lookatstudy-mobile 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/package.json +1 -1
  2. package/web/assets/{abnfDiagram-N423BO3Z-wFTVk74C.js → abnfDiagram-N423BO3Z-DgtY7GDo.js} +1 -1
  3. package/web/assets/{arc-DrtveQeQ.js → arc-BFja7Mgl.js} +1 -1
  4. package/web/assets/{architectureDiagram-T3A2C74G-iSGM_chc.js → architectureDiagram-T3A2C74G-DldSQeNu.js} +1 -1
  5. package/web/assets/{blockDiagram-VBNYF7ZC-Cormy30B.js → blockDiagram-VBNYF7ZC-COFgyocp.js} +1 -1
  6. package/web/assets/{c4Diagram-5PPSVZJV-D1Y3B0gV.js → c4Diagram-5PPSVZJV-GmE0XgdV.js} +1 -1
  7. package/web/assets/channel-iM9iC2OH.js +1 -0
  8. package/web/assets/{chunk-2GRJ4B5K-J_o-lKOF.js → chunk-2GRJ4B5K-C-faEZaU.js} +1 -1
  9. package/web/assets/{chunk-2Q5K7J3B-gPWW6y-A.js → chunk-2Q5K7J3B-BWgLp_F9.js} +1 -1
  10. package/web/assets/{chunk-5RXB4S5H-yigaUOuY.js → chunk-5RXB4S5H-vHcAw0te.js} +1 -1
  11. package/web/assets/{chunk-5VM5RSS4-DEnbC3cS.js → chunk-5VM5RSS4-BCDOzlTk.js} +1 -1
  12. package/web/assets/{chunk-6Q2QTUOP-ComVOTYh.js → chunk-6Q2QTUOP-Dursv_dJ.js} +1 -1
  13. package/web/assets/{chunk-GF5L2VYU-DIOiMyrX.js → chunk-GF5L2VYU-D4V-7P-V.js} +1 -1
  14. package/web/assets/{chunk-JWPE2WC7-m78qF4H_.js → chunk-JWPE2WC7-TwBqtNYu.js} +1 -1
  15. package/web/assets/{chunk-KBJHAD2P-Clh4Yr08.js → chunk-KBJHAD2P-CBdoagw5.js} +1 -1
  16. package/web/assets/{chunk-RYQCIY6F-BMETLjTZ.js → chunk-RYQCIY6F-CvxRMinP.js} +1 -1
  17. package/web/assets/{chunk-XXDRQBXY-DyGYyX9Z.js → chunk-XXDRQBXY-BpesQiqp.js} +1 -1
  18. package/web/assets/classDiagram-JCYQIIEL-Cm2EHo2w.js +1 -0
  19. package/web/assets/classDiagram-v2-OCEON4UE-Cm2EHo2w.js +1 -0
  20. package/web/assets/{cose-bilkent-JH36ORCC-BO1RXGb2.js → cose-bilkent-JH36ORCC-gCstzBiF.js} +1 -1
  21. package/web/assets/{cynefin-VYW2F7L2-DGYmCJ7v.js → cynefin-VYW2F7L2-eq0Le49d.js} +1 -1
  22. package/web/assets/{cynefinDiagram-MW4NZA55-iSEBLol5.js → cynefinDiagram-MW4NZA55-xxlmYE_G.js} +1 -1
  23. package/web/assets/{dagre-VZM6K2ZE-ByPA0378.js → dagre-VZM6K2ZE-CWyDRsXC.js} +1 -1
  24. package/web/assets/{diagram-7IWD3JNH-CUCAodFK.js → diagram-7IWD3JNH-BD4KOl1t.js} +1 -1
  25. package/web/assets/{diagram-B4RE2ZJO-DIFgvaCt.js → diagram-B4RE2ZJO-CXijC7V1.js} +1 -1
  26. package/web/assets/{diagram-LBJQPF4R-XBahy00D.js → diagram-LBJQPF4R-DjfmPFKV.js} +1 -1
  27. package/web/assets/{diagram-Q27KOJAE-DwqZKJhm.js → diagram-Q27KOJAE-DbvF3QXB.js} +1 -1
  28. package/web/assets/{diagram-UB23O5K3-BXMt7Op8.js → diagram-UB23O5K3-Ctcq65GD.js} +1 -1
  29. package/web/assets/{ebnfDiagram-BXEA7PRR-Cpz6ljuD.js → ebnfDiagram-BXEA7PRR-DCYFsDbf.js} +1 -1
  30. package/web/assets/{erDiagram-JOGREHBK-BLsnp8Sa.js → erDiagram-JOGREHBK-CQewgYqy.js} +1 -1
  31. package/web/assets/{flowDiagram-UKHOOZJN-DdGtlHt6.js → flowDiagram-UKHOOZJN-lB12og4l.js} +1 -1
  32. package/web/assets/{ganttDiagram-PKOTCBZU-BA83m21H.js → ganttDiagram-PKOTCBZU-D7qHLjvT.js} +1 -1
  33. package/web/assets/{gitGraphDiagram-DS77QQ5N-PHvv3GCK.js → gitGraphDiagram-DS77QQ5N-DawhnSu7.js} +1 -1
  34. package/web/assets/index-CPlDOqRv.js +563 -0
  35. package/web/assets/index-CUlT9__2.css +1 -0
  36. package/web/assets/{infoDiagram-6WML65LV-KHrgwc8I.js → infoDiagram-6WML65LV-C4YDlp9J.js} +1 -1
  37. package/web/assets/{ishikawaDiagram-WSZJBQD7-DX5VKU6v.js → ishikawaDiagram-WSZJBQD7-qHmIFIFS.js} +1 -1
  38. package/web/assets/{journeyDiagram-NVQOT4AX-DYR1w7M7.js → journeyDiagram-NVQOT4AX-BgXFOkh4.js} +1 -1
  39. package/web/assets/{kanban-definition-27J2QSJJ-YdTG5_IH.js → kanban-definition-27J2QSJJ-Cb_2GmBW.js} +1 -1
  40. package/web/assets/{linear-BG8Ya1Ih.js → linear-C6JxbU0K.js} +1 -1
  41. package/web/assets/{mermaid.core-DtRZ8QZA.js → mermaid.core-BD6oeZlV.js} +4 -4
  42. package/web/assets/{mindmap-definition-FAOFIHXS-fo77Y4vS.js → mindmap-definition-FAOFIHXS-BxBTsWEo.js} +1 -1
  43. package/web/assets/{pegDiagram-VL7TDLO6-DNcbtY8y.js → pegDiagram-VL7TDLO6-BBAVQiSc.js} +1 -1
  44. package/web/assets/{pieDiagram-7S7Q4E2Y-DwCsKwsz.js → pieDiagram-7S7Q4E2Y-CAPgb23U.js} +1 -1
  45. package/web/assets/{quadrantDiagram-CIZ2JOQS-DBsVlNC3.js → quadrantDiagram-CIZ2JOQS-j1RV2NlH.js} +1 -1
  46. package/web/assets/{railroadDiagram-AXF67PYL-DF2bC_5D.js → railroadDiagram-AXF67PYL-BDs1LoGd.js} +1 -1
  47. package/web/assets/{requirementDiagram-LRYGKXZP-BP7teWQ3.js → requirementDiagram-LRYGKXZP-DDwz3C7i.js} +1 -1
  48. package/web/assets/{sankeyDiagram-W5VNT64P-DNoGqQqk.js → sankeyDiagram-W5VNT64P-CT4bV-jV.js} +1 -1
  49. package/web/assets/{sequenceDiagram-SI44F4Z6-DJtGHgQX.js → sequenceDiagram-SI44F4Z6-yQc563EG.js} +1 -1
  50. package/web/assets/{sizeCapture-X5ZJPWSS-CR8vipze.js → sizeCapture-X5ZJPWSS-BY_Fo4Vk.js} +1 -1
  51. package/web/assets/{stateDiagram-OKZ733FA-Bk1VizvY.js → stateDiagram-OKZ733FA-BprQJdqp.js} +1 -1
  52. package/web/assets/stateDiagram-v2-UEYNNEHI-AF2jxans.js +1 -0
  53. package/web/assets/{swimlanes-SLNWSIFB-6eb6Yq1y.js → swimlanes-SLNWSIFB-Cw1Bh8uO.js} +2 -2
  54. package/web/assets/swimlanesDiagram-ULZ7WXOC-DtBbpGaG.js +8 -0
  55. package/web/assets/{timeline-definition-Z64GVDOM-CNhXrkJs.js → timeline-definition-Z64GVDOM-D-3MRDsn.js} +1 -1
  56. package/web/assets/{vennDiagram-T6HMQDX7-NX3AZCBh.js → vennDiagram-T6HMQDX7-D6GEH7ZD.js} +1 -1
  57. package/web/assets/{wardleyDiagram-T6FBY63Y-swaO6e6e.js → wardleyDiagram-T6FBY63Y-C-6u22Ga.js} +1 -1
  58. package/web/assets/{xychartDiagram-ELKLHX3M-CL4seKwn.js → xychartDiagram-ELKLHX3M-DhJCg-k0.js} +1 -1
  59. package/web/index.html +2 -2
  60. package/web/assets/channel-CO81t0iZ.js +0 -1
  61. package/web/assets/classDiagram-JCYQIIEL--cirGlAO.js +0 -1
  62. package/web/assets/classDiagram-v2-OCEON4UE--cirGlAO.js +0 -1
  63. package/web/assets/index-BvQFXLZ2.js +0 -553
  64. package/web/assets/index-C6xbHOXP.css +0 -1
  65. package/web/assets/stateDiagram-v2-UEYNNEHI-BuuaxVSs.js +0 -1
  66. package/web/assets/swimlanesDiagram-ULZ7WXOC-DEN6Tg7V.js +0 -8
@@ -0,0 +1,563 @@
1
+ var qA=Object.defineProperty;var YA=(e,t,n)=>t in e?qA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Yh=(e,t,n)=>YA(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 GA="modulepreload",XA=function(e,t){return new URL(e,t).href},$b={},Hc=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(x=>Promise.resolve(x).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=l(n.map(p=>{if(p=XA(p,i),p in $b)return;$b[p]=!0;const x=p.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(!!i)for(let E=c.length-1;E>=0;E--){const T=c[E];if(T.href===p&&(!x||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${b}`))return;const y=document.createElement("link");if(y.rel=x?"stylesheet":GA,x||(y.as="script"),y.crossOrigin="",y.href=p,f&&y.setAttribute("nonce",f),document.head.appendChild(y),x)return new Promise((E,T)=>{y.addEventListener("load",E),y.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}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 Wb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gh={exports:{}},Vo={};/**
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 Zb;function KA(){if(Zb)return Vo;Zb=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 Vo.Fragment=t,Vo.jsx=n,Vo.jsxs=n,Vo}var Jb;function QA(){return Jb||(Jb=1,Gh.exports=KA()),Gh.exports}var m=QA(),Xh={exports:{}},Xe={};/**
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 ey;function $A(){if(ey)return Xe;ey=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"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function g(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 w(Y,J,U){this.props=Y,this.context=J,this.refs=T,this.updater=U||y}w.prototype.isReactComponent={},w.prototype.setState=function(Y,J){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,J,"setState")},w.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function M(){}M.prototype=w.prototype;function N(Y,J,U){this.props=Y,this.context=J,this.refs=T,this.updater=U||y}var L=N.prototype=new M;L.constructor=N,E(L,w.prototype),L.isPureReactComponent=!0;var A=Array.isArray;function C(){}var I={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function j(Y,J,U){var ne=U.ref;return{$$typeof:e,type:Y,key:J,ref:ne!==void 0?ne:null,props:U}}function D(Y,J){return j(Y.type,J,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function B(Y){var J={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(U){return J[U]})}var Q=/\/+/g;function q(Y,J){return typeof Y=="object"&&Y!==null&&Y.key!=null?B(""+Y.key):J.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(J){Y.status==="pending"&&(Y.status="fulfilled",Y.value=J)},function(J){Y.status==="pending"&&(Y.status="rejected",Y.reason=J)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function H(Y,J,U,ne,K){var $=typeof Y;($==="undefined"||$==="boolean")&&(Y=null);var oe=!1;if(Y===null)oe=!0;else switch($){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(Y.$$typeof){case e:case t:oe=!0;break;case p:return oe=Y._init,H(oe(Y._payload),J,U,ne,K)}}if(oe)return K=K(Y),oe=ne===""?"."+q(Y,0):ne,A(K)?(U="",oe!=null&&(U=oe.replace(Q,"$&/")+"/"),H(K,J,U,"",function(Ke){return Ke})):K!=null&&(P(K)&&(K=D(K,U+(K.key==null||Y&&Y.key===K.key?"":(""+K.key).replace(Q,"$&/")+"/")+oe)),J.push(K)),1;oe=0;var ce=ne===""?".":ne+":";if(A(Y))for(var _e=0;_e<Y.length;_e++)ne=Y[_e],$=ce+q(ne,_e),oe+=H(ne,J,U,$,K);else if(_e=g(Y),typeof _e=="function")for(Y=_e.call(Y),_e=0;!(ne=Y.next()).done;)ne=ne.value,$=ce+q(ne,_e++),oe+=H(ne,J,U,$,K);else if($==="object"){if(typeof Y.then=="function")return H(z(Y),J,U,ne,K);throw J=String(Y),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return oe}function G(Y,J,U){if(Y==null)return Y;var ne=[],K=0;return H(Y,ne,"","",function($){return J.call(U,$,K++)}),ne}function Z(Y){if(Y._status===-1){var J=Y._result;J=J(),J.then(function(U){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=U)},function(U){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=U)}),Y._status===-1&&(Y._status=0,Y._result=J)}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 J=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(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},F={map:G,forEach:function(Y,J,U){G(Y,function(){J.apply(this,arguments)},U)},count:function(Y){var J=0;return G(Y,function(){J++}),J},toArray:function(Y){return G(Y,function(J){return J})||[]},only:function(Y){if(!P(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};return Xe.Activity=x,Xe.Children=F,Xe.Component=w,Xe.Fragment=n,Xe.Profiler=o,Xe.PureComponent=N,Xe.StrictMode=i,Xe.Suspense=d,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return I.H.useMemoCache(Y)}},Xe.cache=function(Y){return function(){return Y.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(Y,J,U){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(J!=null)for($ in J.key!==void 0&&(K=""+J.key),J)!R.call(J,$)||$==="key"||$==="__self"||$==="__source"||$==="ref"&&J.ref===void 0||(ne[$]=J[$]);var $=arguments.length-2;if($===1)ne.children=U;else if(1<$){for(var oe=Array($),ce=0;ce<$;ce++)oe[ce]=arguments[ce+2];ne.children=oe}return j(Y.type,K,ne)},Xe.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},Xe.createElement=function(Y,J,U){var ne,K={},$=null;if(J!=null)for(ne in J.key!==void 0&&($=""+J.key),J)R.call(J,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(K[ne]=J[ne]);var oe=arguments.length-2;if(oe===1)K.children=U;else if(1<oe){for(var ce=Array(oe),_e=0;_e<oe;_e++)ce[_e]=arguments[_e+2];K.children=ce}if(Y&&Y.defaultProps)for(ne in oe=Y.defaultProps,oe)K[ne]===void 0&&(K[ne]=oe[ne]);return j(Y,$,K)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(Y){return{$$typeof:c,render:Y}},Xe.isValidElement=P,Xe.lazy=function(Y){return{$$typeof:p,_payload:{_status:-1,_result:Y},_init:Z}},Xe.memo=function(Y,J){return{$$typeof:f,type:Y,compare:J===void 0?null:J}},Xe.startTransition=function(Y){var J=I.T,U={};I.T=U;try{var ne=Y(),K=I.S;K!==null&&K(U,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(C,ie)}catch($){ie($)}finally{J!==null&&U.types!==null&&(J.types=U.types),I.T=J}},Xe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Xe.use=function(Y){return I.H.use(Y)},Xe.useActionState=function(Y,J,U){return I.H.useActionState(Y,J,U)},Xe.useCallback=function(Y,J){return I.H.useCallback(Y,J)},Xe.useContext=function(Y){return I.H.useContext(Y)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(Y,J){return I.H.useDeferredValue(Y,J)},Xe.useEffect=function(Y,J){return I.H.useEffect(Y,J)},Xe.useEffectEvent=function(Y){return I.H.useEffectEvent(Y)},Xe.useId=function(){return I.H.useId()},Xe.useImperativeHandle=function(Y,J,U){return I.H.useImperativeHandle(Y,J,U)},Xe.useInsertionEffect=function(Y,J){return I.H.useInsertionEffect(Y,J)},Xe.useLayoutEffect=function(Y,J){return I.H.useLayoutEffect(Y,J)},Xe.useMemo=function(Y,J){return I.H.useMemo(Y,J)},Xe.useOptimistic=function(Y,J){return I.H.useOptimistic(Y,J)},Xe.useReducer=function(Y,J,U){return I.H.useReducer(Y,J,U)},Xe.useRef=function(Y){return I.H.useRef(Y)},Xe.useState=function(Y){return I.H.useState(Y)},Xe.useSyncExternalStore=function(Y,J,U){return I.H.useSyncExternalStore(Y,J,U)},Xe.useTransition=function(){return I.H.useTransition()},Xe.version="19.2.8",Xe}var ty;function np(){return ty||(ty=1,Xh.exports=$A()),Xh.exports}var _=np();const ap=Rl(_);var Kh={exports:{}},qo={},Qh={exports:{}},$h={};/**
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 ny;function WA(){return ny||(ny=1,(function(e){function t(H,G){var Z=H.length;H.push(G);e:for(;0<Z;){var ie=Z-1>>>1,F=H[ie];if(0<o(F,G))H[ie]=G,H[Z]=F,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 G=H[0],Z=H.pop();if(Z!==G){H[0]=Z;e:for(var ie=0,F=H.length,Y=F>>>1;ie<Y;){var J=2*(ie+1)-1,U=H[J],ne=J+1,K=H[ne];if(0>o(U,Z))ne<F&&0>o(K,U)?(H[ie]=K,H[ne]=Z,ie=ne):(H[ie]=U,H[J]=Z,ie=J);else if(ne<F&&0>o(K,Z))H[ie]=K,H[ne]=Z,ie=ne;else break e}}return G}function o(H,G){var Z=H.sortIndex-G.sortIndex;return Z!==0?Z:H.id-G.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=[],f=[],p=1,x=null,b=3,g=!1,y=!1,E=!1,T=!1,w=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var G=n(f);G!==null;){if(G.callback===null)i(f);else if(G.startTime<=H)i(f),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(f)}}function A(H){if(E=!1,L(H),!y)if(n(d)!==null)y=!0,C||(C=!0,B());else{var G=n(f);G!==null&&z(A,G.startTime-H)}}var C=!1,I=-1,R=5,j=-1;function D(){return T?!0:!(e.unstable_now()-j<R)}function P(){if(T=!1,C){var H=e.unstable_now();j=H;var G=!0;try{e:{y=!1,E&&(E=!1,M(I),I=-1),g=!0;var Z=b;try{t:{for(L(H),x=n(d);x!==null&&!(x.expirationTime>H&&D());){var ie=x.callback;if(typeof ie=="function"){x.callback=null,b=x.priorityLevel;var F=ie(x.expirationTime<=H);if(H=e.unstable_now(),typeof F=="function"){x.callback=F,L(H),G=!0;break t}x===n(d)&&i(d),L(H)}else i(d);x=n(d)}if(x!==null)G=!0;else{var Y=n(f);Y!==null&&z(A,Y.startTime-H),G=!1}}break e}finally{x=null,b=Z,g=!1}G=void 0}}finally{G?B():C=!1}}}var B;if(typeof N=="function")B=function(){N(P)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,q=Q.port2;Q.port1.onmessage=P,B=function(){q.postMessage(null)}}else B=function(){w(P,0)};function z(H,G){I=w(function(){H(e.unstable_now())},G)}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"):R=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 G=3;break;default:G=b}var Z=b;b=G;try{return H()}finally{b=Z}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(H,G){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Z=b;b=H;try{return G()}finally{b=Z}},e.unstable_scheduleCallback=function(H,G,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 F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Z+F,H={id:p++,callback:G,priorityLevel:H,startTime:Z,expirationTime:F,sortIndex:-1},Z>ie?(H.sortIndex=Z,t(f,H),n(d)===null&&H===n(f)&&(E?(M(I),I=-1):E=!0,z(A,Z-ie))):(H.sortIndex=F,t(d,H),y||g||(y=!0,C||(C=!0,B()))),H},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(H){var G=b;return function(){var Z=b;b=G;try{return H.apply(this,arguments)}finally{b=Z}}}})($h)),$h}var ay;function ZA(){return ay||(ay=1,Qh.exports=WA()),Qh.exports}var Wh={exports:{}},pn={};/**
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 iy;function JA(){if(iy)return pn;iy=1;var e=np();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" 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,f,p){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,pn.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,p)},pn.flushSync=function(d){var f=l.T,p=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=f,i.p=p,i.d.f()}},pn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(d,f))},pn.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},pn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,x=c(p,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,g=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?i.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:g}):p==="script"&&i.d.X(d,{crossOrigin:x,integrity:b,fetchPriority:g,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},pn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);i.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(d)},pn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,x=c(p,f.crossOrigin);i.d.L(d,p,{crossOrigin:x,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},pn.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);i.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(d)},pn.requestFormReset=function(d){i.d.r(d)},pn.unstable_batchedUpdates=function(d,f){return d(f)},pn.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},pn.useFormStatus=function(){return l.H.useHostTransitionStatus()},pn.version="19.2.8",pn}var ry;function mE(){if(ry)return Wh.exports;ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wh.exports=JA(),Wh.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 sy;function eC(){if(sy)return qo;sy=1;var e=ZA(),t=np(),n=mE();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 f(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,h=r;;){var v=u.return;if(v===null)break;var S=v.alternate;if(S===null){if(h=v.return,h!==null){u=h;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===u)return d(v),a;if(S===h)return d(v),r;S=S.sibling}throw Error(i(188))}if(u.return!==h.return)u=v,h=S;else{for(var O=!1,V=v.child;V;){if(V===u){O=!0,u=v,h=S;break}if(V===h){O=!0,h=v,u=S;break}V=V.sibling}if(!O){for(V=S.child;V;){if(V===u){O=!0,u=S,h=v;break}if(V===h){O=!0,h=S,u=v;break}V=V.sibling}if(!O)throw Error(i(189))}}if(u.alternate!==h)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?a:r}function p(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=p(a),r!==null)return r;a=a.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function B(a){return a===null||typeof a!="object"?null:(a=P&&a[P]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Symbol.for("react.client.reference");function q(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Q?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case E:return"Fragment";case w: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 L:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case I:return r=a.displayName||null,r!==null?r:q(a.type)||"Memo";case R: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,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ie=[],F=-1;function Y(a){return{current:a}}function J(a){0>F||(a.current=ie[F],ie[F]=null,F--)}function U(a,r){F++,ie[F]=a.current,a.current=r}var ne=Y(null),K=Y(null),$=Y(null),oe=Y(null);function ce(a,r){switch(U($,r),U(K,a),U(ne,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?yb(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=yb(r),a=vb(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}J(ne),U(ne,a)}function _e(){J(ne),J(K),J($)}function Ke(a){a.memoizedState!==null&&U(oe,a);var r=ne.current,u=vb(r,a.type);r!==u&&(U(K,a),U(ne,u))}function Je(a){K.current===a&&(J(ne),J(K)),oe.current===a&&(J(oe),zo._currentValue=Z)}var it,Ee;function Ye(a){if(it===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);it=r&&r[1]||"",Ee=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+it+a+Ee}var yt=!1;function Ot(a,r){if(!a||yt)return"";yt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(r){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ge){var he=ge}Reflect.construct(a,[],Te)}else{try{Te.call()}catch(ge){he=ge}a.call(Te.prototype)}}else{try{throw Error()}catch(ge){he=ge}(Te=a())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ge){if(ge&&he&&typeof ge.stack=="string")return[ge.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),O=S[0],V=S[1];if(O&&V){var te=O.split(`
44
+ `),de=V.split(`
45
+ `);for(v=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;v<de.length&&!de[v].includes("DetermineComponentFrameRoot");)v++;if(h===te.length||v===de.length)for(h=te.length-1,v=de.length-1;1<=h&&0<=v&&te[h]!==de[v];)v--;for(;1<=h&&0<=v;h--,v--)if(te[h]!==de[v]){if(h!==1||v!==1)do if(h--,v--,0>v||te[h]!==de[v]){var be=`
46
+ `+te[h].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=h&&0<=v);break}}}finally{yt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Ye(u):""}function Xt(a,r){switch(a.tag){case 26:case 27:case 5:return Ye(a.type);case 16:return Ye("Lazy");case 13:return a.child!==r&&r!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return Ot(a.type,!1);case 11:return Ot(a.type.render,!1);case 1:return Ot(a.type,!0);case 31:return Ye("Activity");default:return""}}function Se(a){try{var r="",u=null;do r+=Xt(a,u),u=a,a=a.return;while(a);return r}catch(h){return`
47
+ Error generating stack: `+h.message+`
48
+ `+h.stack}}var Qe=Object.prototype.hasOwnProperty,qe=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,rt=e.unstable_shouldYield,fe=e.unstable_requestPaint,Be=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Me=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Ne=e.log,nt=e.unstable_setDisableYieldValue,tt=null,We=null;function rn(a){if(typeof Ne=="function"&&nt(a),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(tt,a)}catch{}}var vt=Math.clz32?Math.clz32:Od,Yn=Math.log,dt=Math.LN2;function Od(a){return a>>>=0,a===0?32:31-(Yn(a)/dt|0)|0}var Gn=256,Pr=262144,Ln=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 h=a.pendingLanes;if(h===0)return 0;var v=0,S=a.suspendedLanes,O=a.pingedLanes;a=a.warmLanes;var V=h&134217727;return V!==0?(h=V&~S,h!==0?v=ua(h):(O&=V,O!==0?v=ua(O):u||(u=V&~a,u!==0&&(v=ua(u))))):(V=h&~S,V!==0?v=ua(V):O!==0?v=ua(O):u||(u=h&~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 Br(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 zr(){var a=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=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 Id(a,r,u,h,v,S){var O=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 V=a.entanglements,te=a.expirationTimes,de=a.hiddenUpdates;for(u=O&~u;0<u;){var be=31-vt(u),Te=1<<be;V[be]=0,te[be]=-1;var he=de[be];if(he!==null)for(de[be]=null,be=0;be<he.length;be++){var ge=he[be];ge!==null&&(ge.lane&=-536870913)}u&=~Te}h!==0&&Gl(a,h,0),S!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=S&~(O&~r))}function Gl(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var h=31-vt(r);a.entangledLanes|=r,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function Xl(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var h=31-vt(u),v=1<<h;v&r|a[h]&r&&(a[h]|=r),u&=~v}}function Kl(a,r){var u=r&-r;return u=(u&42)!==0?1:Qs(u),(u&(a.suspendedLanes|r))!==0?0:u}function Qs(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 $s(){var a=G.p;return a!==0?a:(a=window.event,a===void 0?32:Vb(a.type))}function Ki(a,r){var u=G.p;try{return G.p=a,r()}finally{G.p=u}}var va=Math.random().toString(36).slice(2),en="__reactFiber$"+va,St="__reactProps$"+va,Oa="__reactContainer$"+va,Pt="__reactEvents$"+va,jd="__reactListeners$"+va,Ws="__reactHandles$"+va,Zs="__reactResources$"+va,Qi="__reactMarker$"+va;function Ur(a){delete a[en],delete a[St],delete a[Pt],delete a[jd],delete a[Ws]}function Xn(a){var r=a[en];if(r)return r;for(var u=a.parentNode;u;){if(r=u[Oa]||u[en]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Cb(a);a!==null;){if(u=a[en])return u;a=Cb(a)}return r}a=u,u=a.parentNode}return null}function Ia(a){if(a=a[en]||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[Zs];return r||(r=a[Zs]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Vt(a){a[Qi]=!0}var Js=new Set,Ql={};function ca(a,r){li(a,r),li(a+"Capture",r)}function li(a,r){for(Ql[a]=r,a=0;a<r.length;a++)Js.add(r[a])}var eo=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]*$"),se={},ye={};function Re(a){return Qe.call(ye,a)?!0:Qe.call(se,a)?!1:eo.test(a)?ye[a]=!0:(se[a]=!0,!1)}function ze(a,r,u){if(Re(r))if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var h=r.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+u)}}function mt(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 Bt(a,r,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(r,u,""+h)}}function Sn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dg(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Pw(a,r,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,S=h.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return v.call(this)},set:function(O){u=""+O,S.call(this,O)}}),Object.defineProperty(a,r,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Pd(a){if(!a._valueTracker){var r=dg(a)?"checked":"value";a._valueTracker=Pw(a,r,""+a[r])}}function fg(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),h="";return a&&(h=dg(a)?a.checked?"true":"false":a.value),a=h,a!==u?(r.setValue(a),!0):!1}function $l(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 Bw=/[\n"\\]/g;function Kn(a){return a.replace(Bw,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Bd(a,r,u,h,v,S,O,V){a.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?a.type=O:a.removeAttribute("type"),r!=null?O==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Sn(r)):a.value!==""+Sn(r)&&(a.value=""+Sn(r)):O!=="submit"&&O!=="reset"||a.removeAttribute("value"),r!=null?zd(a,O,Sn(r)):u!=null?zd(a,O,Sn(u)):h!=null&&a.removeAttribute("value"),v==null&&S!=null&&(a.defaultChecked=!!S),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?a.name=""+Sn(V):a.removeAttribute("name")}function hg(a,r,u,h,v,S,O,V){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)){Pd(a);return}u=u!=null?""+Sn(u):"",r=r!=null?""+Sn(r):u,V||r===a.value||(a.value=r),a.defaultValue=r}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=V?a.checked:!!h,a.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.name=O),Pd(a)}function zd(a,r,u){r==="number"&&$l(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Hr(a,r,u,h){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&&h&&(a[u].defaultSelected=!0)}else{for(u=""+Sn(u),r=null,v=0;v<a.length;v++){if(a[v].value===u){a[v].selected=!0,h&&(a[v].defaultSelected=!0);return}r!==null||a[v].disabled||(r=a[v])}r!==null&&(r.selected=!0)}}function mg(a,r,u){if(r!=null&&(r=""+Sn(r),r!==a.value&&(a.value=r),u==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=u!=null?""+Sn(u):""}function pg(a,r,u,h){if(r==null){if(h!=null){if(u!=null)throw Error(i(92));if(z(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),r=u}u=Sn(r),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),Pd(a)}function Fr(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var zw=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 gg(a,r,u){var h=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":h?a.setProperty(r,u):typeof u!="number"||u===0||zw.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function xg(a,r,u){if(r!=null&&typeof r!="object")throw Error(i(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||r!=null&&r.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var v in r)h=r[v],r.hasOwnProperty(v)&&u[v]!==h&&gg(a,v,h)}else for(var S in r)r.hasOwnProperty(S)&&gg(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 Uw=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"]]),Hw=/^[\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 Wl(a){return Hw.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Pa(){}var Hd=null;function Fd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Vr=null,qr=null;function bg(a){var r=Ia(a);if(r&&(a=r.stateNode)){var u=a[St]||null;e:switch(a=r.stateNode,r.type){case"input":if(Bd(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 h=u[r];if(h!==a&&h.form===a.form){var v=h[St]||null;if(!v)throw Error(i(90));Bd(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(r=0;r<u.length;r++)h=u[r],h.form===a.form&&fg(h)}break e;case"textarea":mg(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&Hr(a,!!u.multiple,r,!1)}}}var Vd=!1;function yg(a,r,u){if(Vd)return a(r,u);Vd=!0;try{var h=a(r);return h}finally{if(Vd=!1,(Vr!==null||qr!==null)&&(Bu(),Vr&&(r=Vr,a=qr,qr=Vr=null,bg(r),a)))for(r=0;r<a.length;r++)bg(a[r])}}function to(a,r){var u=a.stateNode;if(u===null)return null;var h=u[St]||null;if(h===null)return null;u=h[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":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;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"),qd=!1;if(Ba)try{var no={};Object.defineProperty(no,"passive",{get:function(){qd=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{qd=!1}var ui=null,Yd=null,Zl=null;function vg(){if(Zl)return Zl;var a,r=Yd,u=r.length,h,v="value"in ui?ui.value:ui.textContent,S=v.length;for(a=0;a<u&&r[a]===v[a];a++);var O=u-a;for(h=1;h<=O&&r[u-h]===v[S-h];h++);return Zl=v.slice(a,1<h?1-h:void 0)}function Jl(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 eu(){return!0}function Eg(){return!1}function kn(a){function r(u,h,v,S,O){this._reactName=u,this._targetInst=v,this.type=h,this.nativeEvent=S,this.target=O,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(u=a[V],this[V]=u?u(S):S[V]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?eu:Eg,this.isPropagationStopped=Eg,this}return x(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=eu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=eu)},persist:function(){},isPersistent:eu}),r}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tu=kn(Wi),ao=x({},Wi,{view:0,detail:0}),Fw=kn(ao),Gd,Xd,io,nu=x({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qd,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!==io&&(io&&a.type==="mousemove"?(Gd=a.screenX-io.screenX,Xd=a.screenY-io.screenY):Xd=Gd=0,io=a),Gd)},movementY:function(a){return"movementY"in a?a.movementY:Xd}}),Tg=kn(nu),Vw=x({},nu,{dataTransfer:0}),qw=kn(Vw),Yw=x({},ao,{relatedTarget:0}),Kd=kn(Yw),Gw=x({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),Xw=kn(Gw),Kw=x({},Wi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Qw=kn(Kw),$w=x({},Wi,{data:0}),Sg=kn($w),Ww={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zw={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"},Jw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e3(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=Jw[a])?!!r[a]:!1}function Qd(){return e3}var t3=x({},ao,{key:function(a){if(a.key){var r=Ww[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Jl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Zw[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qd,charCode:function(a){return a.type==="keypress"?Jl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Jl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),n3=kn(t3),a3=x({},nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kg=kn(a3),i3=x({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qd}),r3=kn(i3),s3=x({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),o3=kn(s3),l3=x({},nu,{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}),u3=kn(l3),c3=x({},Wi,{newState:0,oldState:0}),d3=kn(c3),f3=[9,13,27,32],$d=Ba&&"CompositionEvent"in window,ro=null;Ba&&"documentMode"in document&&(ro=document.documentMode);var h3=Ba&&"TextEvent"in window&&!ro,wg=Ba&&(!$d||ro&&8<ro&&11>=ro),Ag=" ",Cg=!1;function Ng(a,r){switch(a){case"keyup":return f3.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _g(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Yr=!1;function m3(a,r){switch(a){case"compositionend":return _g(r);case"keypress":return r.which!==32?null:(Cg=!0,Ag);case"textInput":return a=r.data,a===Ag&&Cg?null:a;default:return null}}function p3(a,r){if(Yr)return a==="compositionend"||!$d&&Ng(a,r)?(a=vg(),Zl=Yd=ui=null,Yr=!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 wg&&r.locale!=="ko"?null:r.data;default:return null}}var g3={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 Mg(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!g3[a.type]:r==="textarea"}function Rg(a,r,u,h){Vr?qr?qr.push(h):qr=[h]:Vr=h,r=Yu(r,"onChange"),0<r.length&&(u=new tu("onChange","change",null,u,h),a.push({event:u,listeners:r}))}var so=null,oo=null;function x3(a){hb(a,0)}function au(a){var r=$i(a);if(fg(r))return a}function Dg(a,r){if(a==="change")return r}var Lg=!1;if(Ba){var Wd;if(Ba){var Zd="oninput"in document;if(!Zd){var Og=document.createElement("div");Og.setAttribute("oninput","return;"),Zd=typeof Og.oninput=="function"}Wd=Zd}else Wd=!1;Lg=Wd&&(!document.documentMode||9<document.documentMode)}function Ig(){so&&(so.detachEvent("onpropertychange",jg),oo=so=null)}function jg(a){if(a.propertyName==="value"&&au(oo)){var r=[];Rg(r,oo,a,Fd(a)),yg(x3,r)}}function b3(a,r,u){a==="focusin"?(Ig(),so=r,oo=u,so.attachEvent("onpropertychange",jg)):a==="focusout"&&Ig()}function y3(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return au(oo)}function v3(a,r){if(a==="click")return au(r)}function E3(a,r){if(a==="input"||a==="change")return au(r)}function T3(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var On=typeof Object.is=="function"?Object.is:T3;function lo(a,r){if(On(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var u=Object.keys(a),h=Object.keys(r);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var v=u[h];if(!Qe.call(r,v)||!On(a[v],r[v]))return!1}return!0}function Pg(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Bg(a,r){var u=Pg(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=r&&h>=r)return{node:u,offset:r-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Pg(u)}}function zg(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?zg(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Ug(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=$l(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=$l(a.document)}return r}function Jd(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 S3=Ba&&"documentMode"in document&&11>=document.documentMode,Gr=null,ef=null,uo=null,tf=!1;function Hg(a,r,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;tf||Gr==null||Gr!==$l(h)||(h=Gr,"selectionStart"in h&&Jd(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),uo&&lo(uo,h)||(uo=h,h=Yu(ef,"onSelect"),0<h.length&&(r=new tu("onSelect","select",null,r,u),a.push({event:r,listeners:h}),r.target=Gr)))}function Zi(a,r){var u={};return u[a.toLowerCase()]=r.toLowerCase(),u["Webkit"+a]="webkit"+r,u["Moz"+a]="moz"+r,u}var Xr={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")},nf={},Fg={};Ba&&(Fg=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);function Ji(a){if(nf[a])return nf[a];if(!Xr[a])return a;var r=Xr[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Fg)return nf[a]=r[u];return a}var Vg=Ji("animationend"),qg=Ji("animationiteration"),Yg=Ji("animationstart"),k3=Ji("transitionrun"),w3=Ji("transitionstart"),A3=Ji("transitioncancel"),Gg=Ji("transitionend"),Xg=new Map,af="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(" ");af.push("scrollEnd");function da(a,r){Xg.set(a,r),ca(r,[a])}var iu=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=[],Kr=0,rf=0;function ru(){for(var a=Kr,r=rf=Kr=0;r<a;){var u=Qn[r];Qn[r++]=null;var h=Qn[r];Qn[r++]=null;var v=Qn[r];Qn[r++]=null;var S=Qn[r];if(Qn[r++]=null,h!==null&&v!==null){var O=h.pending;O===null?v.next=v:(v.next=O.next,O.next=v),h.pending=v}S!==0&&Kg(u,v,S)}}function su(a,r,u,h){Qn[Kr++]=a,Qn[Kr++]=r,Qn[Kr++]=u,Qn[Kr++]=h,rf|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function sf(a,r,u,h){return su(a,r,u,h),ou(a)}function er(a,r){return su(a,null,null,r),ou(a)}function Kg(a,r,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var v=!1,S=a.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.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-vt(u),a=S.hiddenUpdates,h=a[v],h===null?a[v]=[r]:h.push(r),r.lane=u|536870912),S):null}function ou(a){if(50<Do)throw Do=0,ph=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Qr={};function C3(a,r,u,h){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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(a,r,u,h){return new C3(a,r,u,h)}function of(a){return a=a.prototype,!(!a||!a.isReactComponent)}function za(a,r){var u=a.alternate;return u===null?(u=In(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 Qg(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 lu(a,r,u,h,v,S){var O=0;if(h=a,typeof a=="function")of(a)&&(O=1);else if(typeof a=="string")O=DA(a,u,ne.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case j:return a=In(31,u,r,v),a.elementType=j,a.lanes=S,a;case E:return tr(u.children,v,S,r);case T:O=8,v|=24;break;case w:return a=In(12,u,r,v|2),a.elementType=w,a.lanes=S,a;case A:return a=In(13,u,r,v),a.elementType=A,a.lanes=S,a;case C:return a=In(19,u,r,v),a.elementType=C,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:O=10;break e;case M:O=9;break e;case L:O=11;break e;case I:O=14;break e;case R:O=16,h=null;break e}O=29,u=Error(i(130,a===null?"null":typeof a,"")),h=null}return r=In(O,u,r,v),r.elementType=a,r.type=h,r.lanes=S,r}function tr(a,r,u,h){return a=In(7,a,h,r),a.lanes=u,a}function lf(a,r,u){return a=In(6,a,null,r),a.lanes=u,a}function $g(a){var r=In(18,null,null,0);return r.stateNode=a,r}function uf(a,r,u){return r=In(4,a.children!==null?a.children:[],a.key,r),r.lanes=u,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Wg=new WeakMap;function $n(a,r){if(typeof a=="object"&&a!==null){var u=Wg.get(a);return u!==void 0?u:(r={value:a,source:r,stack:Se(r)},Wg.set(a,r),r)}return{value:a,source:r,stack:Se(r)}}var $r=[],Wr=0,uu=null,co=0,Wn=[],Zn=0,ci=null,Ea=1,Ta="";function Ua(a,r){$r[Wr++]=co,$r[Wr++]=uu,uu=a,co=r}function Zg(a,r,u){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,ci=a;var h=Ea;a=Ta;var v=32-vt(h)-1;h&=~(1<<v),u+=1;var S=32-vt(r)+v;if(30<S){var O=v-v%5;S=(h&(1<<O)-1).toString(32),h>>=O,v-=O,Ea=1<<32-vt(r)+v|u<<v|h,Ta=S+a}else Ea=1<<S|u<<v|h,Ta=a}function cf(a){a.return!==null&&(Ua(a,1),Zg(a,1,0))}function df(a){for(;a===uu;)uu=$r[--Wr],$r[Wr]=null,co=$r[--Wr],$r[Wr]=null;for(;a===ci;)ci=Wn[--Zn],Wn[Zn]=null,Ta=Wn[--Zn],Wn[Zn]=null,Ea=Wn[--Zn],Wn[Zn]=null}function Jg(a,r){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,Ea=r.id,Ta=r.overflow,ci=a}var un=null,Dt=null,ft=!1,di=null,Jn=!1,ff=Error(i(519));function fi(a){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo($n(r,a)),ff}function e1(a){var r=a.stateNode,u=a.type,h=a.memoizedProps;switch(r[en]=a,r[St]=h,u){case"dialog":ot("cancel",r),ot("close",r);break;case"iframe":case"object":case"embed":ot("load",r);break;case"video":case"audio":for(u=0;u<Oo.length;u++)ot(Oo[u],r);break;case"source":ot("error",r);break;case"img":case"image":case"link":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"input":ot("invalid",r),hg(r,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ot("invalid",r);break;case"textarea":ot("invalid",r),pg(r,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||h.suppressHydrationWarning===!0||xb(r.textContent,u)?(h.popover!=null&&(ot("beforetoggle",r),ot("toggle",r)),h.onScroll!=null&&ot("scroll",r),h.onScrollEnd!=null&&ot("scrollend",r),h.onClick!=null&&(r.onclick=Pa),r=!0):r=!1,r||fi(a,!0)}function t1(a){for(un=a.return;un;)switch(un.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:un=un.return}}function Zr(a){if(a!==un)return!1;if(!ft)return t1(a),ft=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Mh(a.type,a.memoizedProps)),u=!u),u&&Dt&&fi(a),t1(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Dt=Ab(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Dt=Ab(a)}else r===27?(r=Dt,Ai(a.type)?(a=Ih,Ih=null,Dt=a):Dt=r):Dt=un?ta(a.stateNode.nextSibling):null;return!0}function nr(){Dt=un=null,ft=!1}function hf(){var a=di;return a!==null&&(Nn===null?Nn=a:Nn.push.apply(Nn,a),di=null),a}function fo(a){di===null?di=[a]:di.push(a)}var mf=Y(null),ar=null,Ha=null;function hi(a,r,u){U(mf,r._currentValue),r._currentValue=u}function Fa(a){a._currentValue=mf.current,J(mf)}function pf(a,r,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,h!==null&&(h.childLanes|=r)):h!==null&&(h.childLanes&r)!==r&&(h.childLanes|=r),a===u)break;a=a.return}}function gf(a,r,u,h){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var S=v.dependencies;if(S!==null){var O=v.child;S=S.firstContext;e:for(;S!==null;){var V=S;S=v;for(var te=0;te<r.length;te++)if(V.context===r[te]){S.lanes|=u,V=S.alternate,V!==null&&(V.lanes|=u),pf(S.return,u,a),h||(O=null);break e}S=V.next}}else if(v.tag===18){if(O=v.return,O===null)throw Error(i(341));O.lanes|=u,S=O.alternate,S!==null&&(S.lanes|=u),pf(O,u,a),O=null}else O=v.child;if(O!==null)O.return=v;else for(O=v;O!==null;){if(O===a){O=null;break}if(v=O.sibling,v!==null){v.return=O.return,O=v;break}O=O.return}v=O}}function Jr(a,r,u,h){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 O=v.alternate;if(O===null)throw Error(i(387));if(O=O.memoizedProps,O!==null){var V=v.type;On(v.pendingProps.value,O.value)||(a!==null?a.push(V):a=[V])}}else if(v===oe.current){if(O=v.alternate,O===null)throw Error(i(387));O.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(zo):a=[zo])}v=v.return}a!==null&&gf(r,a,u,h),r.flags|=262144}function cu(a){for(a=a.firstContext;a!==null;){if(!On(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 cn(a){return n1(ar,a)}function du(a,r){return ar===null&&ir(a),n1(a,r)}function n1(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 N3=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){r.aborted=!0,a.forEach(function(u){return u()})}},_3=e.unstable_scheduleCallback,M3=e.unstable_NormalPriority,Kt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xf(){return{controller:new N3,data:new Map,refCount:0}}function ho(a){a.refCount--,a.refCount===0&&_3(M3,function(){a.controller.abort()})}var mo=null,bf=0,es=0,ts=null;function R3(a,r){if(mo===null){var u=mo=[];bf=0,es=Eh(),ts={status:"pending",value:void 0,then:function(h){u.push(h)}}}return bf++,r.then(a1,a1),r}function a1(){if(--bf===0&&mo!==null){ts!==null&&(ts.status="fulfilled");var a=mo;mo=null,es=0,ts=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function D3(a,r){var u=[],h={status:"pending",value:null,reason:null,then:function(v){u.push(v)}};return a.then(function(){h.status="fulfilled",h.value=r;for(var v=0;v<u.length;v++)(0,u[v])(r)},function(v){for(h.status="rejected",h.reason=v,v=0;v<u.length;v++)(0,u[v])(void 0)}),h}var i1=H.S;H.S=function(a,r){Hx=Be(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&R3(a,r),i1!==null&&i1(a,r)};var rr=Y(null);function yf(){var a=rr.current;return a!==null?a:Ct.pooledCache}function fu(a,r){r===null?U(rr,rr.current):U(rr,r.pool)}function r1(){var a=yf();return a===null?null:{parent:Kt._currentValue,pool:a}}var ns=Error(i(460)),vf=Error(i(474)),hu=Error(i(542)),mu={then:function(){}};function s1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function o1(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,u1(a),a;default:if(typeof r.status=="string")r.then(Pa,Pa);else{if(a=Ct,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=r,a.status="pending",a.then(function(h){if(r.status==="pending"){var v=r;v.status="fulfilled",v.value=h}},function(h){if(r.status==="pending"){var v=r;v.status="rejected",v.reason=h}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,u1(a),a}throw or=r,ns}}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,ns):u}}var or=null;function l1(){if(or===null)throw Error(i(459));var a=or;return or=null,a}function u1(a){if(a===ns||a===hu)throw Error(i(483))}var as=null,po=0;function pu(a){var r=po;return po+=1,as===null&&(as=[]),o1(as,a,r)}function go(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function gu(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 c1(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 h(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=za(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 O(re){return a&&re.alternate===null&&(re.flags|=67108866),re}function V(re,ae,ue,ve){return ae===null||ae.tag!==6?(ae=lf(ue,re.mode,ve),ae.return=re,ae):(ae=v(ae,ue),ae.return=re,ae)}function te(re,ae,ue,ve){var Ue=ue.type;return Ue===E?be(re,ae,ue.props.children,ve,ue.key):ae!==null&&(ae.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===R&&sr(Ue)===ae.type)?(ae=v(ae,ue.props),go(ae,ue),ae.return=re,ae):(ae=lu(ue.type,ue.key,ue.props,null,re.mode,ve),go(ae,ue),ae.return=re,ae)}function de(re,ae,ue,ve){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==ue.containerInfo||ae.stateNode.implementation!==ue.implementation?(ae=uf(ue,re.mode,ve),ae.return=re,ae):(ae=v(ae,ue.children||[]),ae.return=re,ae)}function be(re,ae,ue,ve,Ue){return ae===null||ae.tag!==7?(ae=tr(ue,re.mode,ve,Ue),ae.return=re,ae):(ae=v(ae,ue),ae.return=re,ae)}function Te(re,ae,ue){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=lf(""+ae,re.mode,ue),ae.return=re,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case g:return ue=lu(ae.type,ae.key,ae.props,null,re.mode,ue),go(ue,ae),ue.return=re,ue;case y:return ae=uf(ae,re.mode,ue),ae.return=re,ae;case R:return ae=sr(ae),Te(re,ae,ue)}if(z(ae)||B(ae))return ae=tr(ae,re.mode,ue,null),ae.return=re,ae;if(typeof ae.then=="function")return Te(re,pu(ae),ue);if(ae.$$typeof===N)return Te(re,du(re,ae),ue);gu(re,ae)}return null}function he(re,ae,ue,ve){var Ue=ae!==null?ae.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ue!==null?null:V(re,ae,""+ue,ve);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case g:return ue.key===Ue?te(re,ae,ue,ve):null;case y:return ue.key===Ue?de(re,ae,ue,ve):null;case R:return ue=sr(ue),he(re,ae,ue,ve)}if(z(ue)||B(ue))return Ue!==null?null:be(re,ae,ue,ve,null);if(typeof ue.then=="function")return he(re,ae,pu(ue),ve);if(ue.$$typeof===N)return he(re,ae,du(re,ue),ve);gu(re,ue)}return null}function ge(re,ae,ue,ve,Ue){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return re=re.get(ue)||null,V(ae,re,""+ve,Ue);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case g:return re=re.get(ve.key===null?ue:ve.key)||null,te(ae,re,ve,Ue);case y:return re=re.get(ve.key===null?ue:ve.key)||null,de(ae,re,ve,Ue);case R:return ve=sr(ve),ge(re,ae,ue,ve,Ue)}if(z(ve)||B(ve))return re=re.get(ue)||null,be(ae,re,ve,Ue,null);if(typeof ve.then=="function")return ge(re,ae,ue,pu(ve),Ue);if(ve.$$typeof===N)return ge(re,ae,ue,du(ae,ve),Ue);gu(ae,ve)}return null}function Oe(re,ae,ue,ve){for(var Ue=null,gt=null,Pe=ae,et=ae=0,ct=null;Pe!==null&&et<ue.length;et++){Pe.index>et?(ct=Pe,Pe=null):ct=Pe.sibling;var xt=he(re,Pe,ue[et],ve);if(xt===null){Pe===null&&(Pe=ct);break}a&&Pe&&xt.alternate===null&&r(re,Pe),ae=S(xt,ae,et),gt===null?Ue=xt:gt.sibling=xt,gt=xt,Pe=ct}if(et===ue.length)return u(re,Pe),ft&&Ua(re,et),Ue;if(Pe===null){for(;et<ue.length;et++)Pe=Te(re,ue[et],ve),Pe!==null&&(ae=S(Pe,ae,et),gt===null?Ue=Pe:gt.sibling=Pe,gt=Pe);return ft&&Ua(re,et),Ue}for(Pe=h(Pe);et<ue.length;et++)ct=ge(Pe,re,et,ue[et],ve),ct!==null&&(a&&ct.alternate!==null&&Pe.delete(ct.key===null?et:ct.key),ae=S(ct,ae,et),gt===null?Ue=ct:gt.sibling=ct,gt=ct);return a&&Pe.forEach(function(Ri){return r(re,Ri)}),ft&&Ua(re,et),Ue}function Fe(re,ae,ue,ve){if(ue==null)throw Error(i(151));for(var Ue=null,gt=null,Pe=ae,et=ae=0,ct=null,xt=ue.next();Pe!==null&&!xt.done;et++,xt=ue.next()){Pe.index>et?(ct=Pe,Pe=null):ct=Pe.sibling;var Ri=he(re,Pe,xt.value,ve);if(Ri===null){Pe===null&&(Pe=ct);break}a&&Pe&&Ri.alternate===null&&r(re,Pe),ae=S(Ri,ae,et),gt===null?Ue=Ri:gt.sibling=Ri,gt=Ri,Pe=ct}if(xt.done)return u(re,Pe),ft&&Ua(re,et),Ue;if(Pe===null){for(;!xt.done;et++,xt=ue.next())xt=Te(re,xt.value,ve),xt!==null&&(ae=S(xt,ae,et),gt===null?Ue=xt:gt.sibling=xt,gt=xt);return ft&&Ua(re,et),Ue}for(Pe=h(Pe);!xt.done;et++,xt=ue.next())xt=ge(Pe,re,et,xt.value,ve),xt!==null&&(a&&xt.alternate!==null&&Pe.delete(xt.key===null?et:xt.key),ae=S(xt,ae,et),gt===null?Ue=xt:gt.sibling=xt,gt=xt);return a&&Pe.forEach(function(VA){return r(re,VA)}),ft&&Ua(re,et),Ue}function At(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 g:e:{for(var Ue=ue.key;ae!==null;){if(ae.key===Ue){if(Ue=ue.type,Ue===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===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===R&&sr(Ue)===ae.type){u(re,ae.sibling),ve=v(ae,ue.props),go(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=lu(ue.type,ue.key,ue.props,null,re.mode,ve),go(ve,ue),ve.return=re,re=ve)}return O(re);case y:e:{for(Ue=ue.key;ae!==null;){if(ae.key===Ue)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=uf(ue,re.mode,ve),ve.return=re,re=ve}return O(re);case R:return ue=sr(ue),At(re,ae,ue,ve)}if(z(ue))return Oe(re,ae,ue,ve);if(B(ue)){if(Ue=B(ue),typeof Ue!="function")throw Error(i(150));return ue=Ue.call(ue),Fe(re,ae,ue,ve)}if(typeof ue.then=="function")return At(re,ae,pu(ue),ve);if(ue.$$typeof===N)return At(re,ae,du(re,ue),ve);gu(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=lf(ue,re.mode,ve),ve.return=re,re=ve),O(re)):u(re,ae)}return function(re,ae,ue,ve){try{po=0;var Ue=At(re,ae,ue,ve);return as=null,Ue}catch(Pe){if(Pe===ns||Pe===hu)throw Pe;var gt=In(29,Pe,null,re.mode);return gt.lanes=ve,gt.return=re,gt}finally{}}}var lr=c1(!0),d1=c1(!1),mi=!1;function Ef(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tf(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 h=a.updateQueue;if(h===null)return null;if(h=h.shared,(bt&2)!==0){var v=h.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),h.pending=r,r=ou(a),Kg(a,null,u),r}return su(a,h,r,u),ou(a)}function xo(a,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var h=r.lanes;h&=a.pendingLanes,u|=h,r.lanes=u,Xl(a,u)}}function Sf(a,r){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var v=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?v=S=O:S=S.next=O,u=u.next}while(u!==null);S===null?v=S=r:S=S.next=r}else v=S=r;u={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=r:a.next=r,u.lastBaseUpdate=r}var kf=!1;function bo(){if(kf){var a=ts;if(a!==null)throw a}}function yo(a,r,u,h){kf=!1;var v=a.updateQueue;mi=!1;var S=v.firstBaseUpdate,O=v.lastBaseUpdate,V=v.shared.pending;if(V!==null){v.shared.pending=null;var te=V,de=te.next;te.next=null,O===null?S=de:O.next=de,O=te;var be=a.alternate;be!==null&&(be=be.updateQueue,V=be.lastBaseUpdate,V!==O&&(V===null?be.firstBaseUpdate=de:V.next=de,be.lastBaseUpdate=te))}if(S!==null){var Te=v.baseState;O=0,be=de=te=null,V=S;do{var he=V.lane&-536870913,ge=he!==V.lane;if(ge?(ut&he)===he:(h&he)===he){he!==0&&he===es&&(kf=!0),be!==null&&(be=be.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Oe=a,Fe=V;he=r;var At=u;switch(Fe.tag){case 1:if(Oe=Fe.payload,typeof Oe=="function"){Te=Oe.call(At,Te,he);break e}Te=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Fe.payload,he=typeof Oe=="function"?Oe.call(At,Te,he):Oe,he==null)break e;Te=x({},Te,he);break e;case 2:mi=!0}}he=V.callback,he!==null&&(a.flags|=64,ge&&(a.flags|=8192),ge=v.callbacks,ge===null?v.callbacks=[he]:ge.push(he))}else ge={lane:he,tag:V.tag,payload:V.payload,callback:V.callback,next:null},be===null?(de=be=ge,te=Te):be=be.next=ge,O|=he;if(V=V.next,V===null){if(V=v.shared.pending,V===null)break;ge=V,V=ge.next,ge.next=null,v.lastBaseUpdate=ge,v.shared.pending=null}}while(!0);be===null&&(te=Te),v.baseState=te,v.firstBaseUpdate=de,v.lastBaseUpdate=be,S===null&&(v.shared.lanes=0),Ei|=O,a.lanes=O,a.memoizedState=Te}}function f1(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function h1(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)f1(u[a],r)}var is=Y(null),xu=Y(0);function m1(a,r){a=Wa,U(xu,a),U(is,r),Wa=a|r.baseLanes}function wf(){U(xu,Wa),U(is,is.current)}function Af(){Wa=xu.current,J(is),J(xu)}var jn=Y(null),ea=null;function xi(a){var r=a.alternate;U(qt,qt.current&1),U(jn,a),ea===null&&(r===null||is.current!==null||r.memoizedState!==null)&&(ea=a)}function Cf(a){U(qt,qt.current),U(jn,a),ea===null&&(ea=a)}function p1(a){a.tag===22?(U(qt,qt.current),U(jn,a),ea===null&&(ea=a)):bi()}function bi(){U(qt,qt.current),U(jn,jn.current)}function Pn(a){J(jn),ea===a&&(ea=null),J(qt)}var qt=Y(0);function bu(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Lh(u)||Oh(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,Ze=null,kt=null,Qt=null,yu=!1,rs=!1,ur=!1,vu=0,vo=0,ss=null,L3=0;function Ut(){throw Error(i(321))}function Nf(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!On(a[u],r[u]))return!1;return!0}function _f(a,r,u,h,v,S){return Va=S,Ze=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?Z1:qf,ur=!1,S=u(h,v),ur=!1,rs&&(S=x1(r,u,h,v)),g1(a),S}function g1(a){H.H=So;var r=kt!==null&&kt.next!==null;if(Va=0,Qt=kt=Ze=null,yu=!1,vo=0,ss=null,r)throw Error(i(300));a===null||$t||(a=a.dependencies,a!==null&&cu(a)&&($t=!0))}function x1(a,r,u,h){Ze=a;var v=0;do{if(rs&&(ss=null),vo=0,rs=!1,25<=v)throw Error(i(301));if(v+=1,Qt=kt=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=J1,S=r(u,h)}while(rs);return S}function O3(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?Eo(r):r,a=a.useState()[0],(kt!==null?kt.memoizedState:null)!==a&&(Ze.flags|=1024),r}function Mf(){var a=vu!==0;return vu=0,a}function Rf(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function Df(a){if(yu){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}yu=!1}Va=0,Qt=kt=Ze=null,rs=!1,vo=vu=0,ss=null}function yn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Ze.memoizedState=Qt=a:Qt=Qt.next=a,Qt}function Yt(){if(kt===null){var a=Ze.alternate;a=a!==null?a.memoizedState:null}else a=kt.next;var r=Qt===null?Ze.memoizedState:Qt.next;if(r!==null)Qt=r,kt=a;else{if(a===null)throw Ze.alternate===null?Error(i(467)):Error(i(310));kt=a,a={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Qt===null?Ze.memoizedState=Qt=a:Qt=Qt.next=a}return Qt}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(a){var r=vo;return vo+=1,ss===null&&(ss=[]),a=o1(ss,a,r),r=Ze,(Qt===null?r.memoizedState:Qt.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?Z1:qf),a}function Tu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Eo(a);if(a.$$typeof===N)return cn(a)}throw Error(i(438,String(a)))}function Lf(a){var r=null,u=Ze.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var h=Ze.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(r={data:h.data.map(function(v){return v.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=Eu(),Ze.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(a),h=0;h<a;h++)u[h]=D;return r.index++,u}function qa(a,r){return typeof r=="function"?r(a):r}function Su(a){var r=Yt();return Of(r,kt,a)}function Of(a,r,u){var h=a.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var v=a.baseQueue,S=h.pending;if(S!==null){if(v!==null){var O=v.next;v.next=S.next,S.next=O}r.baseQueue=v=S,h.pending=null}if(S=a.baseState,v===null)a.memoizedState=S;else{r=v.next;var V=O=null,te=null,de=r,be=!1;do{var Te=de.lane&-536870913;if(Te!==de.lane?(ut&Te)===Te:(Va&Te)===Te){var he=de.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),Te===es&&(be=!0);else if((Va&he)===he){de=de.next,he===es&&(be=!0);continue}else Te={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},te===null?(V=te=Te,O=S):te=te.next=Te,Ze.lanes|=he,Ei|=he;Te=de.action,ur&&u(S,Te),S=de.hasEagerState?de.eagerState:u(S,Te)}else he={lane:Te,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},te===null?(V=te=he,O=S):te=te.next=he,Ze.lanes|=Te,Ei|=Te;de=de.next}while(de!==null&&de!==r);if(te===null?O=S:te.next=V,!On(S,a.memoizedState)&&($t=!0,be&&(u=ts,u!==null)))throw u;a.memoizedState=S,a.baseState=O,a.baseQueue=te,h.lastRenderedState=S}return v===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function If(a){var r=Yt(),u=r.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var h=u.dispatch,v=u.pending,S=r.memoizedState;if(v!==null){u.pending=null;var O=v=v.next;do S=a(S,O.action),O=O.next;while(O!==v);On(S,r.memoizedState)||($t=!0),r.memoizedState=S,r.baseQueue===null&&(r.baseState=S),u.lastRenderedState=S}return[S,h]}function b1(a,r,u){var h=Ze,v=Yt(),S=ft;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=r();var O=!On((kt||v).memoizedState,u);if(O&&(v.memoizedState=u,$t=!0),v=v.queue,Bf(E1.bind(null,h,v,a),[a]),v.getSnapshot!==r||O||Qt!==null&&Qt.memoizedState.tag&1){if(h.flags|=2048,os(9,{destroy:void 0},v1.bind(null,h,v,u,r),null),Ct===null)throw Error(i(349));S||(Va&127)!==0||y1(h,r,u)}return u}function y1(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=Ze.updateQueue,r===null?(r=Eu(),Ze.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function v1(a,r,u,h){r.value=u,r.getSnapshot=h,T1(r)&&S1(a)}function E1(a,r,u){return u(function(){T1(r)&&S1(a)})}function T1(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!On(a,u)}catch{return!0}}function S1(a){var r=er(a,2);r!==null&&_n(r,a,2)}function jf(a){var r=yn();if(typeof a=="function"){var u=a;if(a=u(),ur){rn(!0);try{u()}finally{rn(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:a},r}function k1(a,r,u,h){return a.baseState=u,Of(a,kt,typeof h=="function"?h:qa)}function I3(a,r,u,h,v){if(Au(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(O){S.listeners.push(O)}};H.T!==null?u(!0):S.isTransition=!1,h(S),u=r.pending,u===null?(S.next=r.pending=S,w1(r,S)):(S.next=u.next,r.pending=u.next=S)}}function w1(a,r){var u=r.action,h=r.payload,v=a.state;if(r.isTransition){var S=H.T,O={};H.T=O;try{var V=u(v,h),te=H.S;te!==null&&te(O,V),A1(a,r,V)}catch(de){Pf(a,r,de)}finally{S!==null&&O.types!==null&&(S.types=O.types),H.T=S}}else try{S=u(v,h),A1(a,r,S)}catch(de){Pf(a,r,de)}}function A1(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){C1(a,r,h)},function(h){return Pf(a,r,h)}):C1(a,r,u)}function C1(a,r,u){r.status="fulfilled",r.value=u,N1(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,w1(a,u)))}function Pf(a,r,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do r.status="rejected",r.reason=u,N1(r),r=r.next;while(r!==h)}a.action=null}function N1(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function _1(a,r){return r}function M1(a,r){if(ft){var u=Ct.formState;if(u!==null){e:{var h=Ze;if(ft){if(Dt){t:{for(var v=Dt,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){Dt=ta(v.nextSibling),h=v.data==="F!";break e}}fi(h)}h=!1}h&&(r=u[0])}}return u=yn(),u.memoizedState=u.baseState=r,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_1,lastRenderedState:r},u.queue=h,u=Q1.bind(null,Ze,h),h.dispatch=u,h=jf(!1),S=Vf.bind(null,Ze,!1,h.queue),h=yn(),v={state:r,dispatch:null,action:a,pending:null},h.queue=v,u=I3.bind(null,Ze,v,S,u),v.dispatch=u,h.memoizedState=a,[r,u,!1]}function R1(a){var r=Yt();return D1(r,kt,a)}function D1(a,r,u){if(r=Of(a,r,_1)[0],a=Su(qa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var h=Eo(r)}catch(O){throw O===ns?hu:O}else h=r;r=Yt();var v=r.queue,S=v.dispatch;return u!==r.memoizedState&&(Ze.flags|=2048,os(9,{destroy:void 0},j3.bind(null,v,u),null)),[h,S,a]}function j3(a,r){a.action=r}function L1(a){var r=Yt(),u=kt;if(u!==null)return D1(r,u,a);Yt(),r=r.memoizedState,u=Yt();var h=u.queue.dispatch;return u.memoizedState=a,[r,h,!1]}function os(a,r,u,h){return a={tag:a,create:u,deps:h,inst:r,next:null},r=Ze.updateQueue,r===null&&(r=Eu(),Ze.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,r.lastEffect=a),a}function O1(){return Yt().memoizedState}function ku(a,r,u,h){var v=yn();Ze.flags|=a,v.memoizedState=os(1|r,{destroy:void 0},u,h===void 0?null:h)}function wu(a,r,u,h){var v=Yt();h=h===void 0?null:h;var S=v.memoizedState.inst;kt!==null&&h!==null&&Nf(h,kt.memoizedState.deps)?v.memoizedState=os(r,S,u,h):(Ze.flags|=a,v.memoizedState=os(1|r,S,u,h))}function I1(a,r){ku(8390656,8,a,r)}function Bf(a,r){wu(2048,8,a,r)}function P3(a){Ze.flags|=4;var r=Ze.updateQueue;if(r===null)r=Eu(),Ze.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function j1(a){var r=Yt().memoizedState;return P3({ref:r,nextImpl:a}),function(){if((bt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function P1(a,r){return wu(4,2,a,r)}function B1(a,r){return wu(4,4,a,r)}function z1(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 U1(a,r,u){u=u!=null?u.concat([a]):null,wu(4,4,z1.bind(null,r,a),u)}function zf(){}function H1(a,r){var u=Yt();r=r===void 0?null:r;var h=u.memoizedState;return r!==null&&Nf(r,h[1])?h[0]:(u.memoizedState=[a,r],a)}function F1(a,r){var u=Yt();r=r===void 0?null:r;var h=u.memoizedState;if(r!==null&&Nf(r,h[1]))return h[0];if(h=a(),ur){rn(!0);try{a()}finally{rn(!1)}}return u.memoizedState=[h,r],h}function Uf(a,r,u){return u===void 0||(Va&1073741824)!==0&&(ut&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=Vx(),Ze.lanes|=a,Ei|=a,u)}function V1(a,r,u,h){return On(u,r)?u:is.current!==null?(a=Uf(a,u,h),On(a,r)||($t=!0),a):(Va&42)===0||(Va&1073741824)!==0&&(ut&261930)===0?($t=!0,a.memoizedState=u):(a=Vx(),Ze.lanes|=a,Ei|=a,r)}function q1(a,r,u,h,v){var S=G.p;G.p=S!==0&&8>S?S:8;var O=H.T,V={};H.T=V,Vf(a,!1,r,u);try{var te=v(),de=H.S;if(de!==null&&de(V,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var be=D3(te,h);To(a,r,be,Un(a))}else To(a,r,h,Un(a))}catch(Te){To(a,r,{then:function(){},status:"rejected",reason:Te},Un())}finally{G.p=S,O!==null&&V.types!==null&&(O.types=V.types),H.T=O}}function B3(){}function Hf(a,r,u,h){if(a.tag!==5)throw Error(i(476));var v=Y1(a).queue;q1(a,v,r,Z,u===null?B3:function(){return G1(a),u(h)})}function Y1(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 G1(a){var r=Y1(a);r.next===null&&(r=a.alternate.memoizedState),To(a,r.next.queue,{},Un())}function Ff(){return cn(zo)}function X1(){return Yt().memoizedState}function K1(){return Yt().memoizedState}function z3(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Un();a=pi(u);var h=gi(r,a,u);h!==null&&(_n(h,r,u),xo(h,r,u)),r={cache:xf()},a.payload=r;return}r=r.return}}function U3(a,r,u){var h=Un();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Au(a)?$1(r,u):(u=sf(a,r,u,h),u!==null&&(_n(u,a,h),W1(u,r,h)))}function Q1(a,r,u){var h=Un();To(a,r,u,h)}function To(a,r,u,h){var v={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Au(a))$1(r,v);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=r.lastRenderedReducer,S!==null))try{var O=r.lastRenderedState,V=S(O,u);if(v.hasEagerState=!0,v.eagerState=V,On(V,O))return su(a,r,v,0),Ct===null&&ru(),!1}catch{}finally{}if(u=sf(a,r,v,h),u!==null)return _n(u,a,h),W1(u,r,h),!0}return!1}function Vf(a,r,u,h){if(h={lane:2,revertLane:Eh(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Au(a)){if(r)throw Error(i(479))}else r=sf(a,u,h,2),r!==null&&_n(r,a,2)}function Au(a){var r=a.alternate;return a===Ze||r!==null&&r===Ze}function $1(a,r){rs=yu=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function W1(a,r,u){if((u&4194048)!==0){var h=r.lanes;h&=a.pendingLanes,u|=h,r.lanes=u,Xl(a,u)}}var So={readContext:cn,use:Tu,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};So.useEffectEvent=Ut;var Z1={readContext:cn,use:Tu,useCallback:function(a,r){return yn().memoizedState=[a,r===void 0?null:r],a},useContext:cn,useEffect:I1,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,ku(4194308,4,z1.bind(null,r,a),u)},useLayoutEffect:function(a,r){return ku(4194308,4,a,r)},useInsertionEffect:function(a,r){ku(4,2,a,r)},useMemo:function(a,r){var u=yn();r=r===void 0?null:r;var h=a();if(ur){rn(!0);try{a()}finally{rn(!1)}}return u.memoizedState=[h,r],h},useReducer:function(a,r,u){var h=yn();if(u!==void 0){var v=u(r);if(ur){rn(!0);try{u(r)}finally{rn(!1)}}}else v=r;return h.memoizedState=h.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},h.queue=a,a=a.dispatch=U3.bind(null,Ze,a),[h.memoizedState,a]},useRef:function(a){var r=yn();return a={current:a},r.memoizedState=a},useState:function(a){a=jf(a);var r=a.queue,u=Q1.bind(null,Ze,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:zf,useDeferredValue:function(a,r){var u=yn();return Uf(u,a,r)},useTransition:function(){var a=jf(!1);return a=q1.bind(null,Ze,a.queue,!0,!1),yn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var h=Ze,v=yn();if(ft){if(u===void 0)throw Error(i(407));u=u()}else{if(u=r(),Ct===null)throw Error(i(349));(ut&127)!==0||y1(h,r,u)}v.memoizedState=u;var S={value:u,getSnapshot:r};return v.queue=S,I1(E1.bind(null,h,S,a),[a]),h.flags|=2048,os(9,{destroy:void 0},v1.bind(null,h,S,u,r),null),u},useId:function(){var a=yn(),r=Ct.identifierPrefix;if(ft){var u=Ta,h=Ea;u=(h&~(1<<32-vt(h)-1)).toString(32)+u,r="_"+r+"R_"+u,u=vu++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=L3++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:Ff,useFormState:M1,useActionState:M1,useOptimistic:function(a){var r=yn();r.memoizedState=r.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=Vf.bind(null,Ze,!0,u),u.dispatch=r,[a,r]},useMemoCache:Lf,useCacheRefresh:function(){return yn().memoizedState=z3.bind(null,Ze)},useEffectEvent:function(a){var r=yn(),u={impl:a};return r.memoizedState=u,function(){if((bt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},qf={readContext:cn,use:Tu,useCallback:H1,useContext:cn,useEffect:Bf,useImperativeHandle:U1,useInsertionEffect:P1,useLayoutEffect:B1,useMemo:F1,useReducer:Su,useRef:O1,useState:function(){return Su(qa)},useDebugValue:zf,useDeferredValue:function(a,r){var u=Yt();return V1(u,kt.memoizedState,a,r)},useTransition:function(){var a=Su(qa)[0],r=Yt().memoizedState;return[typeof a=="boolean"?a:Eo(a),r]},useSyncExternalStore:b1,useId:X1,useHostTransitionStatus:Ff,useFormState:R1,useActionState:R1,useOptimistic:function(a,r){var u=Yt();return k1(u,kt,a,r)},useMemoCache:Lf,useCacheRefresh:K1};qf.useEffectEvent=j1;var J1={readContext:cn,use:Tu,useCallback:H1,useContext:cn,useEffect:Bf,useImperativeHandle:U1,useInsertionEffect:P1,useLayoutEffect:B1,useMemo:F1,useReducer:If,useRef:O1,useState:function(){return If(qa)},useDebugValue:zf,useDeferredValue:function(a,r){var u=Yt();return kt===null?Uf(u,a,r):V1(u,kt.memoizedState,a,r)},useTransition:function(){var a=If(qa)[0],r=Yt().memoizedState;return[typeof a=="boolean"?a:Eo(a),r]},useSyncExternalStore:b1,useId:X1,useHostTransitionStatus:Ff,useFormState:L1,useActionState:L1,useOptimistic:function(a,r){var u=Yt();return kt!==null?k1(u,kt,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Lf,useCacheRefresh:K1};J1.useEffectEvent=j1;function Yf(a,r,u,h){r=a.memoizedState,u=u(h,r),u=u==null?r:x({},r,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Gf={enqueueSetState:function(a,r,u){a=a._reactInternals;var h=Un(),v=pi(h);v.payload=r,u!=null&&(v.callback=u),r=gi(a,v,h),r!==null&&(_n(r,a,h),xo(r,a,h))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var h=Un(),v=pi(h);v.tag=1,v.payload=r,u!=null&&(v.callback=u),r=gi(a,v,h),r!==null&&(_n(r,a,h),xo(r,a,h))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var u=Un(),h=pi(u);h.tag=2,r!=null&&(h.callback=r),r=gi(a,h,u),r!==null&&(_n(r,a,u),xo(r,a,u))}};function ex(a,r,u,h,v,S,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,S,O):r.prototype&&r.prototype.isPureReactComponent?!lo(u,h)||!lo(v,S):!0}function tx(a,r,u,h){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,h),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,h),r.state!==a&&Gf.enqueueReplaceState(r,r.state,null)}function cr(a,r){var u=r;if("ref"in r){u={};for(var h in r)h!=="ref"&&(u[h]=r[h])}if(a=a.defaultProps){u===r&&(u=x({},u));for(var v in a)u[v]===void 0&&(u[v]=a[v])}return u}function nx(a){iu(a)}function ax(a){console.error(a)}function ix(a){iu(a)}function Cu(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(h){setTimeout(function(){throw h})}}function rx(a,r,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Xf(a,r,u){return u=pi(u),u.tag=3,u.payload={element:null},u.callback=function(){Cu(a,r)},u}function sx(a){return a=pi(a),a.tag=3,a}function ox(a,r,u,h){var v=u.type.getDerivedStateFromError;if(typeof v=="function"){var S=h.value;a.payload=function(){return v(S)},a.callback=function(){rx(r,u,h)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(a.callback=function(){rx(r,u,h),typeof v!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var V=h.stack;this.componentDidCatch(h.value,{componentStack:V!==null?V:""})})}function H3(a,r,u,h,v){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(r=u.alternate,r!==null&&Jr(r,u,v,!0),u=jn.current,u!==null){switch(u.tag){case 31:case 13:return ea===null?zu():u.alternate===null&&Ht===0&&(Ht=3),u.flags&=-257,u.flags|=65536,u.lanes=v,h===mu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([h]):r.add(h),bh(a,h,v)),!1;case 22:return u.flags|=65536,h===mu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([h]):u.add(h)),bh(a,h,v)),!1}throw Error(i(435,u.tag))}return bh(a,h,v),zu(),!1}if(ft)return r=jn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,h!==ff&&(a=Error(i(422),{cause:h}),fo($n(a,u)))):(h!==ff&&(r=Error(i(423),{cause:h}),fo($n(r,u))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,h=$n(h,u),v=Xf(a.stateNode,h,v),Sf(a,v),Ht!==4&&(Ht=2)),!1;var S=Error(i(520),{cause:h});if(S=$n(S,u),Ro===null?Ro=[S]:Ro.push(S),Ht!==4&&(Ht=2),r===null)return!0;h=$n(h,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=v&-v,u.lanes|=a,a=Xf(u.stateNode,h,a),Sf(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=sx(v),ox(v,a,u,h),Sf(u,v),!1}u=u.return}while(u!==null);return!1}var Kf=Error(i(461)),$t=!1;function dn(a,r,u,h){r.child=a===null?d1(r,null,u,h):lr(r,a.child,u,h)}function lx(a,r,u,h,v){u=u.render;var S=r.ref;if("ref"in h){var O={};for(var V in h)V!=="ref"&&(O[V]=h[V])}else O=h;return ir(r),h=_f(a,r,u,O,S,v),V=Mf(),a!==null&&!$t?(Rf(a,r,v),Ya(a,r,v)):(ft&&V&&cf(r),r.flags|=1,dn(a,r,h,v),r.child)}function ux(a,r,u,h,v){if(a===null){var S=u.type;return typeof S=="function"&&!of(S)&&S.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=S,cx(a,r,S,h,v)):(a=lu(u.type,null,h,r,r.mode,v),a.ref=r.ref,a.return=r,r.child=a)}if(S=a.child,!nh(a,v)){var O=S.memoizedProps;if(u=u.compare,u=u!==null?u:lo,u(O,h)&&a.ref===r.ref)return Ya(a,r,v)}return r.flags|=1,a=za(S,h),a.ref=r.ref,a.return=r,r.child=a}function cx(a,r,u,h,v){if(a!==null){var S=a.memoizedProps;if(lo(S,h)&&a.ref===r.ref)if($t=!1,r.pendingProps=h=S,nh(a,v))(a.flags&131072)!==0&&($t=!0);else return r.lanes=a.lanes,Ya(a,r,v)}return Qf(a,r,u,h,v)}function dx(a,r,u,h){var v=h.children,S=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((r.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(h=r.child=a.child,v=0;h!==null;)v=v|h.lanes|h.childLanes,h=h.sibling;h=v&~S}else h=0,r.child=null;return fx(a,r,S,u,h)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&fu(r,S!==null?S.cachePool:null),S!==null?m1(r,S):wf(),p1(r);else return h=r.lanes=536870912,fx(a,r,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(fu(r,S.cachePool),m1(r,S),bi(),r.memoizedState=null):(a!==null&&fu(r,null),wf(),bi());return dn(a,r,v,u),r.child}function ko(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function fx(a,r,u,h,v){var S=yf();return S=S===null?null:{parent:Kt._currentValue,pool:S},r.memoizedState={baseLanes:u,cachePool:S},a!==null&&fu(r,null),wf(),p1(r),a!==null&&Jr(a,r,h,!0),r.childLanes=v,null}function Nu(a,r){return r=Mu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function hx(a,r,u){return lr(r,a.child,null,u),a=Nu(r,r.pendingProps),a.flags|=2,Pn(r),r.memoizedState=null,a}function F3(a,r,u){var h=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(ft){if(h.mode==="hidden")return a=Nu(r,h),r.lanes=536870912,ko(null,a);if(Cf(r),(a=Dt)?(a=wb(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=$g(a),u.return=r,r.child=u,un=r,Dt=null)):a=null,a===null)throw fi(r);return r.lanes=536870912,null}return Nu(r,h)}var S=a.memoizedState;if(S!==null){var O=S.dehydrated;if(Cf(r),v)if(r.flags&256)r.flags&=-257,r=hx(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(i(558));else if($t||Jr(a,r,u,!1),v=(u&a.childLanes)!==0,$t||v){if(h=Ct,h!==null&&(O=Kl(h,u),O!==0&&O!==S.retryLane))throw S.retryLane=O,er(a,O),_n(h,a,O),Kf;zu(),r=hx(a,r,u)}else a=S.treeContext,Dt=ta(O.nextSibling),un=r,ft=!0,di=null,Jn=!1,a!==null&&Jg(r,a),r=Nu(r,h),r.flags|=4096;return r}return a=za(a.child,{mode:h.mode,children:h.children}),a.ref=r.ref,r.child=a,a.return=r,a}function _u(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 Qf(a,r,u,h,v){return ir(r),u=_f(a,r,u,h,void 0,v),h=Mf(),a!==null&&!$t?(Rf(a,r,v),Ya(a,r,v)):(ft&&h&&cf(r),r.flags|=1,dn(a,r,u,v),r.child)}function mx(a,r,u,h,v,S){return ir(r),r.updateQueue=null,u=x1(r,h,u,v),g1(a),h=Mf(),a!==null&&!$t?(Rf(a,r,S),Ya(a,r,S)):(ft&&h&&cf(r),r.flags|=1,dn(a,r,u,S),r.child)}function px(a,r,u,h,v){if(ir(r),r.stateNode===null){var S=Qr,O=u.contextType;typeof O=="object"&&O!==null&&(S=cn(O)),S=new u(h,S),r.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Gf,r.stateNode=S,S._reactInternals=r,S=r.stateNode,S.props=h,S.state=r.memoizedState,S.refs={},Ef(r),O=u.contextType,S.context=typeof O=="object"&&O!==null?cn(O):Qr,S.state=r.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(Yf(r,u,O,h),S.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(O=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),O!==S.state&&Gf.enqueueReplaceState(S,S.state,null),yo(r,h,S,v),bo(),S.state=r.memoizedState),typeof S.componentDidMount=="function"&&(r.flags|=4194308),h=!0}else if(a===null){S=r.stateNode;var V=r.memoizedProps,te=cr(u,V);S.props=te;var de=S.context,be=u.contextType;O=Qr,typeof be=="object"&&be!==null&&(O=cn(be));var Te=u.getDerivedStateFromProps;be=typeof Te=="function"||typeof S.getSnapshotBeforeUpdate=="function",V=r.pendingProps!==V,be||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(V||de!==O)&&tx(r,S,h,O),mi=!1;var he=r.memoizedState;S.state=he,yo(r,h,S,v),bo(),de=r.memoizedState,V||he!==de||mi?(typeof Te=="function"&&(Yf(r,u,Te,h),de=r.memoizedState),(te=mi||ex(r,u,te,h,he,de,O))?(be||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=h,r.memoizedState=de),S.props=h,S.state=de,S.context=O,h=te):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{S=r.stateNode,Tf(a,r),O=r.memoizedProps,be=cr(u,O),S.props=be,Te=r.pendingProps,he=S.context,de=u.contextType,te=Qr,typeof de=="object"&&de!==null&&(te=cn(de)),V=u.getDerivedStateFromProps,(de=typeof V=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(O!==Te||he!==te)&&tx(r,S,h,te),mi=!1,he=r.memoizedState,S.state=he,yo(r,h,S,v),bo();var ge=r.memoizedState;O!==Te||he!==ge||mi||a!==null&&a.dependencies!==null&&cu(a.dependencies)?(typeof V=="function"&&(Yf(r,u,V,h),ge=r.memoizedState),(be=mi||ex(r,u,be,h,he,ge,te)||a!==null&&a.dependencies!==null&&cu(a.dependencies))?(de||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,ge,te),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,ge,te)),typeof S.componentDidUpdate=="function"&&(r.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof S.componentDidUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=1024),r.memoizedProps=h,r.memoizedState=ge),S.props=h,S.state=ge,S.context=te,h=be):(typeof S.componentDidUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=1024),h=!1)}return S=h,_u(a,r),h=(r.flags&128)!==0,S||h?(S=r.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),r.flags|=1,a!==null&&h?(r.child=lr(r,a.child,null,v),r.child=lr(r,null,u,v)):dn(a,r,u,v),r.memoizedState=S.state,a=r.child):a=Ya(a,r,v),a}function gx(a,r,u,h){return nr(),r.flags|=256,dn(a,r,u,h),r.child}var $f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wf(a){return{baseLanes:a,cachePool:r1()}}function Zf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=zn),a}function xx(a,r,u){var h=r.pendingProps,v=!1,S=(r.flags&128)!==0,O;if((O=S)||(O=a!==null&&a.memoizedState===null?!1:(qt.current&2)!==0),O&&(v=!0,r.flags&=-129),O=(r.flags&32)!==0,r.flags&=-33,a===null){if(ft){if(v?xi(r):bi(),(a=Dt)?(a=wb(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=$g(a),u.return=r,r.child=u,un=r,Dt=null)):a=null,a===null)throw fi(r);return Oh(a)?r.lanes=32:r.lanes=536870912,null}var V=h.children;return h=h.fallback,v?(bi(),v=r.mode,V=Mu({mode:"hidden",children:V},v),h=tr(h,v,u,null),V.return=r,h.return=r,V.sibling=h,r.child=V,h=r.child,h.memoizedState=Wf(u),h.childLanes=Zf(a,O,u),r.memoizedState=$f,ko(null,h)):(xi(r),Jf(r,V))}var te=a.memoizedState;if(te!==null&&(V=te.dehydrated,V!==null)){if(S)r.flags&256?(xi(r),r.flags&=-257,r=eh(a,r,u)):r.memoizedState!==null?(bi(),r.child=a.child,r.flags|=128,r=null):(bi(),V=h.fallback,v=r.mode,h=Mu({mode:"visible",children:h.children},v),V=tr(V,v,u,null),V.flags|=2,h.return=r,V.return=r,h.sibling=V,r.child=h,lr(r,a.child,null,u),h=r.child,h.memoizedState=Wf(u),h.childLanes=Zf(a,O,u),r.memoizedState=$f,r=ko(null,h));else if(xi(r),Oh(V)){if(O=V.nextSibling&&V.nextSibling.dataset,O)var de=O.dgst;O=de,h=Error(i(419)),h.stack="",h.digest=O,fo({value:h,source:null,stack:null}),r=eh(a,r,u)}else if($t||Jr(a,r,u,!1),O=(u&a.childLanes)!==0,$t||O){if(O=Ct,O!==null&&(h=Kl(O,u),h!==0&&h!==te.retryLane))throw te.retryLane=h,er(a,h),_n(O,a,h),Kf;Lh(V)||zu(),r=eh(a,r,u)}else Lh(V)?(r.flags|=192,r.child=a.child,r=null):(a=te.treeContext,Dt=ta(V.nextSibling),un=r,ft=!0,di=null,Jn=!1,a!==null&&Jg(r,a),r=Jf(r,h.children),r.flags|=4096);return r}return v?(bi(),V=h.fallback,v=r.mode,te=a.child,de=te.sibling,h=za(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,de!==null?V=za(de,V):(V=tr(V,v,u,null),V.flags|=2),V.return=r,h.return=r,h.sibling=V,r.child=h,ko(null,h),h=r.child,V=a.child.memoizedState,V===null?V=Wf(u):(v=V.cachePool,v!==null?(te=Kt._currentValue,v=v.parent!==te?{parent:te,pool:te}:v):v=r1(),V={baseLanes:V.baseLanes|u,cachePool:v}),h.memoizedState=V,h.childLanes=Zf(a,O,u),r.memoizedState=$f,ko(a.child,h)):(xi(r),u=a.child,a=u.sibling,u=za(u,{mode:"visible",children:h.children}),u.return=r,u.sibling=null,a!==null&&(O=r.deletions,O===null?(r.deletions=[a],r.flags|=16):O.push(a)),r.child=u,r.memoizedState=null,u)}function Jf(a,r){return r=Mu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function Mu(a,r){return a=In(22,a,null,r),a.lanes=0,a}function eh(a,r,u){return lr(r,a.child,null,u),a=Jf(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function bx(a,r,u){a.lanes|=r;var h=a.alternate;h!==null&&(h.lanes|=r),pf(a.return,r,u)}function th(a,r,u,h,v,S){var O=a.memoizedState;O===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:v,treeForkCount:S}:(O.isBackwards=r,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=u,O.tailMode=v,O.treeForkCount=S)}function yx(a,r,u){var h=r.pendingProps,v=h.revealOrder,S=h.tail;h=h.children;var O=qt.current,V=(O&2)!==0;if(V?(O=O&1|2,r.flags|=128):O&=1,U(qt,O),dn(a,r,h,u),h=ft?co:0,!V&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&bx(a,u,r);else if(a.tag===19)bx(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&&bu(a)===null&&(v=u),u=u.sibling;u=v,u===null?(v=r.child,r.child=null):(v=u.sibling,u.sibling=null),th(r,!1,v,u,S,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,v=r.child,r.child=null;v!==null;){if(a=v.alternate,a!==null&&bu(a)===null){r.child=v;break}a=v.sibling,v.sibling=u,u=v,v=a}th(r,!0,u,null,S,h);break;case"together":th(r,!1,null,null,void 0,h);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(Jr(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=za(a,a.pendingProps),r.child=u,u.return=r;a.sibling!==null;)a=a.sibling,u=u.sibling=za(a,a.pendingProps),u.return=r;u.sibling=null}return r.child}function nh(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&cu(a)))}function V3(a,r,u){switch(r.tag){case 3:ce(r,r.stateNode.containerInfo),hi(r,Kt,a.memoizedState.cache),nr();break;case 27:case 5:Ke(r);break;case 4:ce(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,Cf(r),null;break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(xi(r),r.flags|=128,null):(u&r.child.childLanes)!==0?xx(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(h=(u&r.childLanes)!==0,h||(Jr(a,r,u,!1),h=(u&r.childLanes)!==0),v){if(h)return yx(a,r,u);r.flags|=128}if(v=r.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),U(qt,qt.current),h)break;return null;case 22:return r.lanes=0,dx(a,r,u,r.pendingProps);case 24:hi(r,Kt,a.memoizedState.cache)}return Ya(a,r,u)}function vx(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)$t=!0;else{if(!nh(a,u)&&(r.flags&128)===0)return $t=!1,V3(a,r,u);$t=(a.flags&131072)!==0}else $t=!1,ft&&(r.flags&1048576)!==0&&Zg(r,co,r.index);switch(r.lanes=0,r.tag){case 16:e:{var h=r.pendingProps;if(a=sr(r.elementType),r.type=a,typeof a=="function")of(a)?(h=cr(a,h),r.tag=1,r=px(null,r,a,h,u)):(r.tag=0,r=Qf(null,r,a,h,u));else{if(a!=null){var v=a.$$typeof;if(v===L){r.tag=11,r=lx(null,r,a,h,u);break e}else if(v===I){r.tag=14,r=ux(null,r,a,h,u);break e}}throw r=q(a)||a,Error(i(306,r,""))}}return r;case 0:return Qf(a,r,r.type,r.pendingProps,u);case 1:return h=r.type,v=cr(h,r.pendingProps),px(a,r,h,v,u);case 3:e:{if(ce(r,r.stateNode.containerInfo),a===null)throw Error(i(387));h=r.pendingProps;var S=r.memoizedState;v=S.element,Tf(a,r),yo(r,h,null,u);var O=r.memoizedState;if(h=O.cache,hi(r,Kt,h),h!==S.cache&&gf(r,[Kt],u,!0),bo(),h=O.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:O.cache},r.updateQueue.baseState=S,r.memoizedState=S,r.flags&256){r=gx(a,r,h,u);break e}else if(h!==v){v=$n(Error(i(424)),r),fo(v),r=gx(a,r,h,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(Dt=ta(a.firstChild),un=r,ft=!0,di=null,Jn=!0,u=d1(r,null,h,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(nr(),h===v){r=Ya(a,r,u);break e}dn(a,r,h,u)}r=r.child}return r;case 26:return _u(a,r),a===null?(u=Rb(r.type,null,r.pendingProps,null))?r.memoizedState=u:ft||(u=r.type,a=r.pendingProps,h=Gu($.current).createElement(u),h[en]=r,h[St]=a,fn(h,u,a),Vt(h),r.stateNode=h):r.memoizedState=Rb(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Ke(r),a===null&&ft&&(h=r.stateNode=Nb(r.type,r.pendingProps,$.current),un=r,Jn=!0,v=Dt,Ai(r.type)?(Ih=v,Dt=ta(h.firstChild)):Dt=v),dn(a,r,r.pendingProps.children,u),_u(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&ft&&((v=h=Dt)&&(h=yA(h,r.type,r.pendingProps,Jn),h!==null?(r.stateNode=h,un=r,Dt=ta(h.firstChild),Jn=!1,v=!0):v=!1),v||fi(r)),Ke(r),v=r.type,S=r.pendingProps,O=a!==null?a.memoizedProps:null,h=S.children,Mh(v,S)?h=null:O!==null&&Mh(v,O)&&(r.flags|=32),r.memoizedState!==null&&(v=_f(a,r,O3,null,null,u),zo._currentValue=v),_u(a,r),dn(a,r,h,u),r.child;case 6:return a===null&&ft&&((a=u=Dt)&&(u=vA(u,r.pendingProps,Jn),u!==null?(r.stateNode=u,un=r,Dt=null,a=!0):a=!1),a||fi(r)),null;case 13:return xx(a,r,u);case 4:return ce(r,r.stateNode.containerInfo),h=r.pendingProps,a===null?r.child=lr(r,null,h,u):dn(a,r,h,u),r.child;case 11:return lx(a,r,r.type,r.pendingProps,u);case 7:return dn(a,r,r.pendingProps,u),r.child;case 8:return dn(a,r,r.pendingProps.children,u),r.child;case 12:return dn(a,r,r.pendingProps.children,u),r.child;case 10:return h=r.pendingProps,hi(r,r.type,h.value),dn(a,r,h.children,u),r.child;case 9:return v=r.type._context,h=r.pendingProps.children,ir(r),v=cn(v),h=h(v),r.flags|=1,dn(a,r,h,u),r.child;case 14:return ux(a,r,r.type,r.pendingProps,u);case 15:return cx(a,r,r.type,r.pendingProps,u);case 19:return yx(a,r,u);case 31:return F3(a,r,u);case 22:return dx(a,r,u,r.pendingProps);case 24:return ir(r),h=cn(Kt),a===null?(v=yf(),v===null&&(v=Ct,S=xf(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=u),v=S),r.memoizedState={parent:h,cache:v},Ef(r),hi(r,Kt,v)):((a.lanes&u)!==0&&(Tf(a,r),yo(r,null,null,u),bo()),v=a.memoizedState,S=r.memoizedState,v.parent!==h?(v={parent:h,cache:h},r.memoizedState=v,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=v),hi(r,Kt,h)):(h=S.cache,hi(r,Kt,h),h!==v.cache&&gf(r,[Kt],u,!0))),dn(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 ah(a,r,u,h,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(Xx())a.flags|=8192;else throw or=mu,vf}else a.flags&=-16777217}function Ex(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!jb(r))if(Xx())a.flags|=8192;else throw or=mu,vf}function Ru(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?zr():536870912,a.lanes|=r,ds|=r)}function wo(a,r){if(!ft)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 h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function Lt(a){var r=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(r)for(var v=a.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=h,a.childLanes=u,r}function q3(a,r,u){var h=r.pendingProps;switch(df(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(r),null;case 1:return Lt(r),null;case 3:return u=r.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),Fa(Kt),_e(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Zr(r)?Ga(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,hf())),Lt(r),null;case 26:var v=r.type,S=r.memoizedState;return a===null?(Ga(r),S!==null?(Lt(r),Ex(r,S)):(Lt(r),ah(r,v,null,h,u))):S?S!==a.memoizedState?(Ga(r),Lt(r),Ex(r,S)):(Lt(r),r.flags&=-16777217):(a=a.memoizedProps,a!==h&&Ga(r),Lt(r),ah(r,v,a,h,u)),null;case 27:if(Je(r),u=$.current,v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==h&&Ga(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return Lt(r),null}a=ne.current,Zr(r)?e1(r):(a=Nb(v,h,u),r.stateNode=a,Ga(r))}return Lt(r),null;case 5:if(Je(r),v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==h&&Ga(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return Lt(r),null}if(S=ne.current,Zr(r))e1(r);else{var O=Gu($.current);switch(S){case 1:S=O.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=O.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=O.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?S.multiple=!0:h.size&&(S.size=h.size);break;default:S=typeof h.is=="string"?O.createElement(v,{is:h.is}):O.createElement(v)}}S[en]=r,S[St]=h;e:for(O=r.child;O!==null;){if(O.tag===5||O.tag===6)S.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===r)break e;for(;O.sibling===null;){if(O.return===null||O.return===r)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}r.stateNode=S;e:switch(fn(S,v,h),v){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Ga(r)}}return Lt(r),ah(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,u),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==h&&Ga(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(i(166));if(a=$.current,Zr(r)){if(a=r.stateNode,u=r.memoizedProps,h=null,v=un,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}a[en]=r,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||xb(a.nodeValue,u)),a||fi(r,!0)}else a=Gu(a).createTextNode(h),a[en]=r,r.stateNode=a}return Lt(r),null;case 31:if(u=r.memoizedState,a===null||a.memoizedState!==null){if(h=Zr(r),u!==null){if(a===null){if(!h)throw Error(i(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[en]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),a=!1}else u=hf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return r.flags&256?(Pn(r),r):(Pn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Lt(r),null;case 13:if(h=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=Zr(r),h!==null&&h.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[en]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),v=!1}else v=hf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return r.flags&256?(Pn(r),r):(Pn(r),null)}return Pn(r),(r.flags&128)!==0?(r.lanes=u,r):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=r.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool),S=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==v&&(h.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),Ru(r,r.updateQueue),Lt(r),null);case 4:return _e(),a===null&&wh(r.stateNode.containerInfo),Lt(r),null;case 10:return Fa(r.type),Lt(r),null;case 19:if(J(qt),h=r.memoizedState,h===null)return Lt(r),null;if(v=(r.flags&128)!==0,S=h.rendering,S===null)if(v)wo(h,!1);else{if(Ht!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(S=bu(a),S!==null){for(r.flags|=128,wo(h,!1),a=S.updateQueue,r.updateQueue=a,Ru(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Qg(u,a),u=u.sibling;return U(qt,qt.current&1|2),ft&&Ua(r,h.treeForkCount),r.child}a=a.sibling}h.tail!==null&&Be()>ju&&(r.flags|=128,v=!0,wo(h,!1),r.lanes=4194304)}else{if(!v)if(a=bu(S),a!==null){if(r.flags|=128,v=!0,a=a.updateQueue,r.updateQueue=a,Ru(r,a),wo(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!ft)return Lt(r),null}else 2*Be()-h.renderingStartTime>ju&&u!==536870912&&(r.flags|=128,v=!0,wo(h,!1),r.lanes=4194304);h.isBackwards?(S.sibling=r.child,r.child=S):(a=h.last,a!==null?a.sibling=S:r.child=S,h.last=S)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=Be(),a.sibling=null,u=qt.current,U(qt,v?u&1|2:u&1),ft&&Ua(r,h.treeForkCount),a):(Lt(r),null);case 22:case 23:return Pn(r),Af(),h=r.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(u&536870912)!==0&&(r.flags&128)===0&&(Lt(r),r.subtreeFlags&6&&(r.flags|=8192)):Lt(r),u=r.updateQueue,u!==null&&Ru(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048),a!==null&&J(rr),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Fa(Kt),Lt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function Y3(a,r){switch(df(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Fa(Kt),_e(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return Je(r),null;case 31:if(r.memoizedState!==null){if(Pn(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(Pn(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 J(qt),null;case 4:return _e(),null;case 10:return Fa(r.type),null;case 22:case 23:return Pn(r),Af(),a!==null&&J(rr),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Fa(Kt),null;case 25:return null;default:return null}}function Tx(a,r){switch(df(r),r.tag){case 3:Fa(Kt),_e();break;case 26:case 27:case 5:Je(r);break;case 4:_e();break;case 31:r.memoizedState!==null&&Pn(r);break;case 13:Pn(r);break;case 19:J(qt);break;case 10:Fa(r.type);break;case 22:case 23:Pn(r),Af(),a!==null&&J(rr);break;case 24:Fa(Kt)}}function Ao(a,r){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next;u=v;do{if((u.tag&a)===a){h=void 0;var S=u.create,O=u.inst;h=S(),O.destroy=h}u=u.next}while(u!==v)}}catch(V){Tt(r,r.return,V)}}function yi(a,r,u){try{var h=r.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&a)===a){var O=h.inst,V=O.destroy;if(V!==void 0){O.destroy=void 0,v=r;var te=u,de=V;try{de()}catch(be){Tt(v,te,be)}}}h=h.next}while(h!==S)}}catch(be){Tt(r,r.return,be)}}function Sx(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{h1(r,u)}catch(h){Tt(a,a.return,h)}}}function kx(a,r,u){u.props=cr(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){Tt(a,r,h)}}function Co(a,r){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(v){Tt(a,r,v)}}function Sa(a,r){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(v){Tt(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){Tt(a,r,v)}else u.current=null}function wx(a){var r=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(v){Tt(a,a.return,v)}}function ih(a,r,u){try{var h=a.stateNode;hA(h,a.type,u,r),h[St]=r}catch(v){Tt(a,a.return,v)}}function Ax(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ai(a.type)||a.tag===4}function rh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Ax(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 sh(a,r,u){var h=a.tag;if(h===5||h===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(h!==4&&(h===27&&Ai(a.type)&&(u=a.stateNode,r=null),a=a.child,a!==null))for(sh(a,r,u),a=a.sibling;a!==null;)sh(a,r,u),a=a.sibling}function Du(a,r,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,r?u.insertBefore(a,r):u.appendChild(a);else if(h!==4&&(h===27&&Ai(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Du(a,r,u),a=a.sibling;a!==null;)Du(a,r,u),a=a.sibling}function Cx(a){var r=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,v=r.attributes;v.length;)r.removeAttributeNode(v[0]);fn(r,h,u),r[en]=a,r[St]=u}catch(S){Tt(a,a.return,S)}}var Xa=!1,Wt=!1,oh=!1,Nx=typeof WeakSet=="function"?WeakSet:Set,sn=null;function G3(a,r){if(a=a.containerInfo,Nh=Ju,a=Ug(a),Jd(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var v=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var O=0,V=-1,te=-1,de=0,be=0,Te=a,he=null;t:for(;;){for(var ge;Te!==u||v!==0&&Te.nodeType!==3||(V=O+v),Te!==S||h!==0&&Te.nodeType!==3||(te=O+h),Te.nodeType===3&&(O+=Te.nodeValue.length),(ge=Te.firstChild)!==null;)he=Te,Te=ge;for(;;){if(Te===a)break t;if(he===u&&++de===v&&(V=O),he===S&&++be===h&&(te=O),(ge=Te.nextSibling)!==null)break;Te=he,he=Te.parentNode}Te=ge}u=V===-1||te===-1?null:{start:V,end:te}}else u=null}u=u||{start:0,end:0}}else u=null;for(_h={focusedElem:a,selectionRange:u},Ju=!1,sn=r;sn!==null;)if(r=sn,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,sn=a;else for(;sn!==null;){switch(r=sn,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,h=u.stateNode;try{var Oe=cr(u.type,v);a=h.getSnapshotBeforeUpdate(Oe,S),h.__reactInternalSnapshotBeforeUpdate=a}catch(Fe){Tt(u,u.return,Fe)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Dh(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Dh(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,sn=a;break}sn=r.return}}function _x(a,r,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Qa(a,u),h&4&&Ao(5,u);break;case 1:if(Qa(a,u),h&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(O){Tt(u,u.return,O)}else{var v=cr(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(v,r,a.__reactInternalSnapshotBeforeUpdate)}catch(O){Tt(u,u.return,O)}}h&64&&Sx(u),h&512&&Co(u,u.return);break;case 3:if(Qa(a,u),h&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{h1(a,r)}catch(O){Tt(u,u.return,O)}}break;case 27:r===null&&h&4&&Cx(u);case 26:case 5:Qa(a,u),r===null&&h&4&&wx(u),h&512&&Co(u,u.return);break;case 12:Qa(a,u);break;case 31:Qa(a,u),h&4&&Dx(a,u);break;case 13:Qa(a,u),h&4&&Lx(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=tA.bind(null,u),EA(a,u))));break;case 22:if(h=u.memoizedState!==null||Xa,!h){r=r!==null&&r.memoizedState!==null||Wt,v=Xa;var S=Wt;Xa=h,(Wt=r)&&!S?$a(a,u,(u.subtreeFlags&8772)!==0):Qa(a,u),Xa=v,Wt=S}break;case 30:break;default:Qa(a,u)}}function Mx(a){var r=a.alternate;r!==null&&(a.alternate=null,Mx(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Ur(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 It=null,wn=!1;function Ka(a,r,u){for(u=u.child;u!==null;)Rx(a,r,u),u=u.sibling}function Rx(a,r,u){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(tt,u)}catch{}switch(u.tag){case 26:Wt||Sa(u,r),Ka(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Wt||Sa(u,r);var h=It,v=wn;Ai(u.type)&&(It=u.stateNode,wn=!1),Ka(a,r,u),jo(u.stateNode),It=h,wn=v;break;case 5:Wt||Sa(u,r);case 6:if(h=It,v=wn,It=null,Ka(a,r,u),It=h,wn=v,It!==null)if(wn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(u.stateNode)}catch(S){Tt(u,r,S)}else try{It.removeChild(u.stateNode)}catch(S){Tt(u,r,S)}break;case 18:It!==null&&(wn?(a=It,Sb(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),ys(a)):Sb(It,u.stateNode));break;case 4:h=It,v=wn,It=u.stateNode.containerInfo,wn=!0,Ka(a,r,u),It=h,wn=v;break;case 0:case 11:case 14:case 15:yi(2,u,r),Wt||yi(4,u,r),Ka(a,r,u);break;case 1:Wt||(Sa(u,r),h=u.stateNode,typeof h.componentWillUnmount=="function"&&kx(u,r,h)),Ka(a,r,u);break;case 21:Ka(a,r,u);break;case 22:Wt=(h=Wt)||u.memoizedState!==null,Ka(a,r,u),Wt=h;break;default:Ka(a,r,u)}}function Dx(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ys(a)}catch(u){Tt(r,r.return,u)}}}function Lx(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ys(a)}catch(u){Tt(r,r.return,u)}}function X3(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Nx),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Nx),r;default:throw Error(i(435,a.tag))}}function Lu(a,r){var u=X3(a);r.forEach(function(h){if(!u.has(h)){u.add(h);var v=nA.bind(null,a,h);h.then(v,v)}})}function An(a,r){var u=r.deletions;if(u!==null)for(var h=0;h<u.length;h++){var v=u[h],S=a,O=r,V=O;e:for(;V!==null;){switch(V.tag){case 27:if(Ai(V.type)){It=V.stateNode,wn=!1;break e}break;case 5:It=V.stateNode,wn=!1;break e;case 3:case 4:It=V.stateNode.containerInfo,wn=!0;break e}V=V.return}if(It===null)throw Error(i(160));Rx(S,O,v),It=null,wn=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Ox(r,a),r=r.sibling}var fa=null;function Ox(a,r){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:An(r,a),Cn(a),h&4&&(yi(3,a,a.return),Ao(3,a),yi(5,a,a.return));break;case 1:An(r,a),Cn(a),h&512&&(Wt||u===null||Sa(u,u.return)),h&64&&Xa&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var v=fa;if(An(r,a),Cn(a),h&512&&(Wt||u===null||Sa(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":S=v.getElementsByTagName("title")[0],(!S||S[Qi]||S[en]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=v.createElement(h),v.head.insertBefore(S,v.querySelector("head > title"))),fn(S,h,u),S[en]=a,Vt(S),h=S;break e;case"link":var O=Ob("link","href",v).get(h+(u.href||""));if(O){for(var V=0;V<O.length;V++)if(S=O[V],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)){O.splice(V,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;case"meta":if(O=Ob("meta","content",v).get(h+(u.content||""))){for(V=0;V<O.length;V++)if(S=O[V],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)){O.splice(V,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;default:throw Error(i(468,h))}S[en]=a,Vt(S),h=S}a.stateNode=h}else Ib(v,a.type,a.stateNode);else a.stateNode=Lb(v,h,a.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Ib(v,a.type,a.stateNode):Lb(v,h,a.memoizedProps)):h===null&&a.stateNode!==null&&ih(a,a.memoizedProps,u.memoizedProps)}break;case 27:An(r,a),Cn(a),h&512&&(Wt||u===null||Sa(u,u.return)),u!==null&&h&4&&ih(a,a.memoizedProps,u.memoizedProps);break;case 5:if(An(r,a),Cn(a),h&512&&(Wt||u===null||Sa(u,u.return)),a.flags&32){v=a.stateNode;try{Fr(v,"")}catch(Oe){Tt(a,a.return,Oe)}}h&4&&a.stateNode!=null&&(v=a.memoizedProps,ih(a,v,u!==null?u.memoizedProps:v)),h&1024&&(oh=!0);break;case 6:if(An(r,a),Cn(a),h&4){if(a.stateNode===null)throw Error(i(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(Oe){Tt(a,a.return,Oe)}}break;case 3:if(Qu=null,v=fa,fa=Xu(r.containerInfo),An(r,a),fa=v,Cn(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{ys(r.containerInfo)}catch(Oe){Tt(a,a.return,Oe)}oh&&(oh=!1,Ix(a));break;case 4:h=fa,fa=Xu(a.stateNode.containerInfo),An(r,a),Cn(a),fa=h;break;case 12:An(r,a),Cn(a);break;case 31:An(r,a),Cn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Lu(a,h)));break;case 13:An(r,a),Cn(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Iu=Be()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Lu(a,h)));break;case 22:v=a.memoizedState!==null;var te=u!==null&&u.memoizedState!==null,de=Xa,be=Wt;if(Xa=de||v,Wt=be||te,An(r,a),Wt=be,Xa=de,Cn(a),h&8192)e:for(r=a.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(u===null||te||Xa||Wt||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)O=S.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{V=te.stateNode;var Te=te.memoizedProps.style,he=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;V.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Oe){Tt(te,te.return,Oe)}}}else if(r.tag===6){if(u===null){te=r;try{te.stateNode.nodeValue=v?"":te.memoizedProps}catch(Oe){Tt(te,te.return,Oe)}}}else if(r.tag===18){if(u===null){te=r;try{var ge=te.stateNode;v?kb(ge,!0):kb(te.stateNode,!1)}catch(Oe){Tt(te,te.return,Oe)}}}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}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Lu(a,u))));break;case 19:An(r,a),Cn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Lu(a,h)));break;case 30:break;case 21:break;default:An(r,a),Cn(a)}}function Cn(a){var r=a.flags;if(r&2){try{for(var u,h=a.return;h!==null;){if(Ax(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var v=u.stateNode,S=rh(a);Du(a,S,v);break;case 5:var O=u.stateNode;u.flags&32&&(Fr(O,""),u.flags&=-33);var V=rh(a);Du(a,V,O);break;case 3:case 4:var te=u.stateNode.containerInfo,de=rh(a);sh(a,de,te);break;default:throw Error(i(161))}}catch(be){Tt(a,a.return,be)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function Ix(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;Ix(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;)_x(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"&&kx(r,r.return,u),dr(r);break;case 27:jo(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 h=r.alternate,v=a,S=r,O=S.flags;switch(S.tag){case 0:case 11:case 15:$a(v,S,u),Ao(4,S);break;case 1:if($a(v,S,u),h=S,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(de){Tt(h,h.return,de)}if(h=S,v=h.updateQueue,v!==null){var V=h.stateNode;try{var te=v.shared.hiddenCallbacks;if(te!==null)for(v.shared.hiddenCallbacks=null,v=0;v<te.length;v++)f1(te[v],V)}catch(de){Tt(h,h.return,de)}}u&&O&64&&Sx(S),Co(S,S.return);break;case 27:Cx(S);case 26:case 5:$a(v,S,u),u&&h===null&&O&4&&wx(S),Co(S,S.return);break;case 12:$a(v,S,u);break;case 31:$a(v,S,u),u&&O&4&&Dx(v,S);break;case 13:$a(v,S,u),u&&O&4&&Lx(v,S);break;case 22:S.memoizedState===null&&$a(v,S,u),Co(S,S.return);break;case 30:break;default:$a(v,S,u)}r=r.sibling}}function lh(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&&ho(u))}function uh(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&ho(a))}function ha(a,r,u,h){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)jx(a,r,u,h),r=r.sibling}function jx(a,r,u,h){var v=r.flags;switch(r.tag){case 0:case 11:case 15:ha(a,r,u,h),v&2048&&Ao(9,r);break;case 1:ha(a,r,u,h);break;case 3:ha(a,r,u,h),v&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&ho(a)));break;case 12:if(v&2048){ha(a,r,u,h),a=r.stateNode;try{var S=r.memoizedProps,O=S.id,V=S.onPostCommit;typeof V=="function"&&V(O,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(te){Tt(r,r.return,te)}}else ha(a,r,u,h);break;case 31:ha(a,r,u,h);break;case 13:ha(a,r,u,h);break;case 23:break;case 22:S=r.stateNode,O=r.alternate,r.memoizedState!==null?S._visibility&2?ha(a,r,u,h):No(a,r):S._visibility&2?ha(a,r,u,h):(S._visibility|=2,ls(a,r,u,h,(r.subtreeFlags&10256)!==0||!1)),v&2048&&lh(O,r);break;case 24:ha(a,r,u,h),v&2048&&uh(r.alternate,r);break;default:ha(a,r,u,h)}}function ls(a,r,u,h,v){for(v=v&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var S=a,O=r,V=u,te=h,de=O.flags;switch(O.tag){case 0:case 11:case 15:ls(S,O,V,te,v),Ao(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?ls(S,O,V,te,v):No(S,O):(be._visibility|=2,ls(S,O,V,te,v)),v&&de&2048&&lh(O.alternate,O);break;case 24:ls(S,O,V,te,v),v&&de&2048&&uh(O.alternate,O);break;default:ls(S,O,V,te,v)}r=r.sibling}}function No(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,h=r,v=h.flags;switch(h.tag){case 22:No(u,h),v&2048&&lh(h.alternate,h);break;case 24:No(u,h),v&2048&&uh(h.alternate,h);break;default:No(u,h)}r=r.sibling}}var _o=8192;function us(a,r,u){if(a.subtreeFlags&_o)for(a=a.child;a!==null;)Px(a,r,u),a=a.sibling}function Px(a,r,u){switch(a.tag){case 26:us(a,r,u),a.flags&_o&&a.memoizedState!==null&&LA(u,fa,a.memoizedState,a.memoizedProps);break;case 5:us(a,r,u);break;case 3:case 4:var h=fa;fa=Xu(a.stateNode.containerInfo),us(a,r,u),fa=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=_o,_o=16777216,us(a,r,u),_o=h):us(a,r,u));break;default:us(a,r,u)}}function Bx(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 Mo(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var h=r[u];sn=h,Ux(h,a)}Bx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)zx(a),a=a.sibling}function zx(a){switch(a.tag){case 0:case 11:case 15:Mo(a),a.flags&2048&&yi(9,a,a.return);break;case 3:Mo(a);break;case 12:Mo(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Ou(a)):Mo(a);break;default:Mo(a)}}function Ou(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var h=r[u];sn=h,Ux(h,a)}Bx(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:yi(8,r,r.return),Ou(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,Ou(r));break;default:Ou(r)}a=a.sibling}}function Ux(a,r){for(;sn!==null;){var u=sn;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 h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:ho(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,sn=h;else e:for(u=a;sn!==null;){h=sn;var v=h.sibling,S=h.return;if(Mx(h),h===u){sn=null;break e}if(v!==null){v.return=S,sn=v;break e}sn=S}}}var K3={getCacheForType:function(a){var r=cn(Kt),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return cn(Kt).controller.signal}},Q3=typeof WeakMap=="function"?WeakMap:Map,bt=0,Ct=null,st=null,ut=0,Et=0,Bn=null,vi=!1,cs=!1,ch=!1,Wa=0,Ht=0,Ei=0,fr=0,dh=0,zn=0,ds=0,Ro=null,Nn=null,fh=!1,Iu=0,Hx=0,ju=1/0,Pu=null,Ti=null,tn=0,Si=null,fs=null,Za=0,hh=0,mh=null,Fx=null,Do=0,ph=null;function Un(){return(bt&2)!==0&&ut!==0?ut&-ut:H.T!==null?Eh():$s()}function Vx(){if(zn===0)if((ut&536870912)===0||ft){var a=Pr;Pr<<=1,(Pr&3932160)===0&&(Pr=262144),zn=a}else zn=536870912;return a=jn.current,a!==null&&(a.flags|=32),zn}function _n(a,r,u){(a===Ct&&(Et===2||Et===9)||a.cancelPendingCommit!==null)&&(hs(a,0),ki(a,ut,zn,!1)),Gi(a,u),((bt&2)===0||a!==Ct)&&(a===Ct&&((bt&2)===0&&(fr|=u),Ht===4&&ki(a,ut,zn,!1)),ka(a))}function qx(a,r,u){if((bt&6)!==0)throw Error(i(327));var h=!u&&(r&127)===0&&(r&a.expiredLanes)===0||oi(a,r),v=h?Z3(a,r):xh(a,r,!0),S=h;do{if(v===0){cs&&!h&&ki(a,r,0,!1);break}else{if(u=a.current.alternate,S&&!$3(u)){v=xh(a,r,!1),S=!1;continue}if(v===2){if(S=r,a.errorRecoveryDisabledLanes&S)var O=0;else O=a.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){r=O;e:{var V=a;v=Ro;var te=V.current.memoizedState.isDehydrated;if(te&&(hs(V,O).flags|=256),O=xh(V,O,!1),O!==2){if(ch&&!te){V.errorRecoveryDisabledLanes|=S,fr|=S,v=4;break e}S=Nn,Nn=v,S!==null&&(Nn===null?Nn=S:Nn.push.apply(Nn,S))}v=O}if(S=!1,v!==2)continue}}if(v===1){hs(a,0),ki(a,r,0,!0);break}e:{switch(h=a,S=v,S){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:ki(h,r,zn,!vi);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(v=Iu+300-Be(),10<v)){if(ki(h,r,zn,!vi),qi(h,0,!0)!==0)break e;Za=r,h.timeoutHandle=Eb(Yx.bind(null,h,u,Nn,Pu,fh,r,zn,fr,ds,vi,S,"Throttled",-0,0),v);break e}Yx(h,u,Nn,Pu,fh,r,zn,fr,ds,vi,S,null,-0,0)}}break}while(!0);ka(a)}function Yx(a,r,u,h,v,S,O,V,te,de,be,Te,he,ge){if(a.timeoutHandle=-1,Te=r.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pa},Px(r,S,Te);var Oe=(S&62914560)===S?Iu-Be():(S&4194048)===S?Hx-Be():0;if(Oe=OA(Te,Oe),Oe!==null){Za=S,a.cancelPendingCommit=Oe(Jx.bind(null,a,r,S,u,h,v,O,V,te,be,Te,null,he,ge)),ki(a,S,O,!de);return}}Jx(a,r,S,u,h,v,O,V,te)}function $3(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 h=0;h<u.length;h++){var v=u[h],S=v.getSnapshot;v=v.value;try{if(!On(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 ki(a,r,u,h){r&=~dh,r&=~fr,a.suspendedLanes|=r,a.pingedLanes&=~r,h&&(a.warmLanes|=r),h=a.expirationTimes;for(var v=r;0<v;){var S=31-vt(v),O=1<<S;h[S]=-1,v&=~O}u!==0&&Gl(a,u,r)}function Bu(){return(bt&6)===0?(Lo(0),!1):!0}function gh(){if(st!==null){if(Et===0)var a=st.return;else a=st,Ha=ar=null,Df(a),as=null,po=0,a=st;for(;a!==null;)Tx(a.alternate,a),a=a.return;st=null}}function hs(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,gA(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Za=0,gh(),Ct=a,st=u=za(a.current,null),ut=r,Et=0,Bn=null,vi=!1,cs=oi(a,r),ch=!1,ds=zn=dh=fr=Ei=Ht=0,Nn=Ro=null,fh=!1,(r&8)!==0&&(r|=r&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=r;0<h;){var v=31-vt(h),S=1<<v;r|=a[v],h&=~S}return Wa=r,ru(),u}function Gx(a,r){Ze=null,H.H=So,r===ns||r===hu?(r=l1(),Et=3):r===vf?(r=l1(),Et=4):Et=r===Kf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Bn=r,st===null&&(Ht=1,Cu(a,$n(r,a.current)))}function Xx(){var a=jn.current;return a===null?!0:(ut&4194048)===ut?ea===null:(ut&62914560)===ut||(ut&536870912)!==0?a===ea:!1}function Kx(){var a=H.H;return H.H=So,a===null?So:a}function Qx(){var a=H.A;return H.A=K3,a}function zu(){Ht=4,vi||(ut&4194048)!==ut&&jn.current!==null||(cs=!0),(Ei&134217727)===0&&(fr&134217727)===0||Ct===null||ki(Ct,ut,zn,!1)}function xh(a,r,u){var h=bt;bt|=2;var v=Kx(),S=Qx();(Ct!==a||ut!==r)&&(Pu=null,hs(a,r)),r=!1;var O=Ht;e:do try{if(Et!==0&&st!==null){var V=st,te=Bn;switch(Et){case 8:gh(),O=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(r=!0);var de=Et;if(Et=0,Bn=null,ms(a,V,te,de),u&&cs){O=0;break e}break;default:de=Et,Et=0,Bn=null,ms(a,V,te,de)}}W3(),O=Ht;break}catch(be){Gx(a,be)}while(!0);return r&&a.shellSuspendCounter++,Ha=ar=null,bt=h,H.H=v,H.A=S,st===null&&(Ct=null,ut=0,ru()),O}function W3(){for(;st!==null;)$x(st)}function Z3(a,r){var u=bt;bt|=2;var h=Kx(),v=Qx();Ct!==a||ut!==r?(Pu=null,ju=Be()+500,hs(a,r)):cs=oi(a,r);e:do try{if(Et!==0&&st!==null){r=st;var S=Bn;t:switch(Et){case 1:Et=0,Bn=null,ms(a,r,S,1);break;case 2:case 9:if(s1(S)){Et=0,Bn=null,Wx(r);break}r=function(){Et!==2&&Et!==9||Ct!==a||(Et=7),ka(a)},S.then(r,r);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:s1(S)?(Et=0,Bn=null,Wx(r)):(Et=0,Bn=null,ms(a,r,S,7));break;case 5:var O=null;switch(st.tag){case 26:O=st.memoizedState;case 5:case 27:var V=st;if(O?jb(O):V.stateNode.complete){Et=0,Bn=null;var te=V.sibling;if(te!==null)st=te;else{var de=V.return;de!==null?(st=de,Uu(de)):st=null}break t}}Et=0,Bn=null,ms(a,r,S,5);break;case 6:Et=0,Bn=null,ms(a,r,S,6);break;case 8:gh(),Ht=6;break e;default:throw Error(i(462))}}J3();break}catch(be){Gx(a,be)}while(!0);return Ha=ar=null,H.H=h,H.A=v,bt=u,st!==null?0:(Ct=null,ut=0,ru(),Ht)}function J3(){for(;st!==null&&!rt();)$x(st)}function $x(a){var r=vx(a.alternate,a,Wa);a.memoizedProps=a.pendingProps,r===null?Uu(a):st=r}function Wx(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=mx(u,r,r.pendingProps,r.type,void 0,ut);break;case 11:r=mx(u,r,r.pendingProps,r.type.render,r.ref,ut);break;case 5:Df(r);default:Tx(u,r),r=st=Qg(r,Wa),r=vx(u,r,Wa)}a.memoizedProps=a.pendingProps,r===null?Uu(a):st=r}function ms(a,r,u,h){Ha=ar=null,Df(r),as=null,po=0;var v=r.return;try{if(H3(a,v,r,u,ut)){Ht=1,Cu(a,$n(u,a.current)),st=null;return}}catch(S){if(v!==null)throw st=v,S;Ht=1,Cu(a,$n(u,a.current)),st=null;return}r.flags&32768?(ft||h===1?a=!0:cs||(ut&536870912)!==0?a=!1:(vi=a=!0,(h===2||h===9||h===3||h===6)&&(h=jn.current,h!==null&&h.tag===13&&(h.flags|=16384))),Zx(r,a)):Uu(r)}function Uu(a){var r=a;do{if((r.flags&32768)!==0){Zx(r,vi);return}a=r.return;var u=q3(r.alternate,r,Wa);if(u!==null){st=u;return}if(r=r.sibling,r!==null){st=r;return}st=r=a}while(r!==null);Ht===0&&(Ht=5)}function Zx(a,r){do{var u=Y3(a.alternate,a);if(u!==null){u.flags&=32767,st=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){st=a;return}st=a=u}while(a!==null);Ht=6,st=null}function Jx(a,r,u,h,v,S,O,V,te){a.cancelPendingCommit=null;do Hu();while(tn!==0);if((bt&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(S=r.lanes|r.childLanes,S|=rf,Id(a,u,S,O,V,te),a===Ct&&(st=Ct=null,ut=0),fs=r,Si=a,Za=u,hh=S,mh=v,Fx=h,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,aA(De,function(){return ib(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,v=G.p,G.p=2,O=bt,bt|=4;try{G3(a,r,u)}finally{bt=O,G.p=v,H.T=h}}tn=1,eb(),tb(),nb()}}function eb(){if(tn===1){tn=0;var a=Si,r=fs,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=G.p;G.p=2;var v=bt;bt|=4;try{Ox(r,a);var S=_h,O=Ug(a.containerInfo),V=S.focusedElem,te=S.selectionRange;if(O!==V&&V&&V.ownerDocument&&zg(V.ownerDocument.documentElement,V)){if(te!==null&&Jd(V)){var de=te.start,be=te.end;if(be===void 0&&(be=de),"selectionStart"in V)V.selectionStart=de,V.selectionEnd=Math.min(be,V.value.length);else{var Te=V.ownerDocument||document,he=Te&&Te.defaultView||window;if(he.getSelection){var ge=he.getSelection(),Oe=V.textContent.length,Fe=Math.min(te.start,Oe),At=te.end===void 0?Fe:Math.min(te.end,Oe);!ge.extend&&Fe>At&&(O=At,At=Fe,Fe=O);var re=Bg(V,Fe),ae=Bg(V,At);if(re&&ae&&(ge.rangeCount!==1||ge.anchorNode!==re.node||ge.anchorOffset!==re.offset||ge.focusNode!==ae.node||ge.focusOffset!==ae.offset)){var ue=Te.createRange();ue.setStart(re.node,re.offset),ge.removeAllRanges(),Fe>At?(ge.addRange(ue),ge.extend(ae.node,ae.offset)):(ue.setEnd(ae.node,ae.offset),ge.addRange(ue))}}}}for(Te=[],ge=V;ge=ge.parentNode;)ge.nodeType===1&&Te.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Te.length;V++){var ve=Te[V];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Ju=!!Nh,_h=Nh=null}finally{bt=v,G.p=h,H.T=u}}a.current=r,tn=2}}function tb(){if(tn===2){tn=0;var a=Si,r=fs,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=G.p;G.p=2;var v=bt;bt|=4;try{_x(a,r.alternate,r)}finally{bt=v,G.p=h,H.T=u}}tn=3}}function nb(){if(tn===4||tn===3){tn=0,fe();var a=Si,r=fs,u=Za,h=Fx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?tn=5:(tn=0,fs=Si=null,ab(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Ti=null),Xi(u),r=r.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(tt,r,void 0,(r.current.flags&128)===128)}catch{}if(h!==null){r=H.T,v=G.p,G.p=2,H.T=null;try{for(var S=a.onRecoverableError,O=0;O<h.length;O++){var V=h[O];S(V.value,{componentStack:V.stack})}}finally{H.T=r,G.p=v}}(Za&3)!==0&&Hu(),ka(a),v=a.pendingLanes,(u&261930)!==0&&(v&42)!==0?a===ph?Do++:(Do=0,ph=a):Do=0,Lo(0)}}function ab(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,ho(r)))}function Hu(){return eb(),tb(),nb(),ib()}function ib(){if(tn!==5)return!1;var a=Si,r=hh;hh=0;var u=Xi(Za),h=H.T,v=G.p;try{G.p=32>u?32:u,H.T=null,u=mh,mh=null;var S=Si,O=Za;if(tn=0,fs=Si=null,Za=0,(bt&6)!==0)throw Error(i(331));var V=bt;if(bt|=4,zx(S.current),jx(S,S.current,O,u),bt=V,Lo(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(tt,S)}catch{}return!0}finally{G.p=v,H.T=h,ab(a,r)}}function rb(a,r,u){r=$n(u,r),r=Xf(a.stateNode,r,2),a=gi(a,r,2),a!==null&&(Gi(a,2),ka(a))}function Tt(a,r,u){if(a.tag===3)rb(a,a,u);else for(;r!==null;){if(r.tag===3){rb(r,a,u);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ti===null||!Ti.has(h))){a=$n(u,a),u=sx(2),h=gi(r,u,2),h!==null&&(ox(u,h,r,a),Gi(h,2),ka(h));break}}r=r.return}}function bh(a,r,u){var h=a.pingCache;if(h===null){h=a.pingCache=new Q3;var v=new Set;h.set(r,v)}else v=h.get(r),v===void 0&&(v=new Set,h.set(r,v));v.has(u)||(ch=!0,v.add(u),a=eA.bind(null,a,r,u),r.then(a,a))}function eA(a,r,u){var h=a.pingCache;h!==null&&h.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Ct===a&&(ut&u)===u&&(Ht===4||Ht===3&&(ut&62914560)===ut&&300>Be()-Iu?(bt&2)===0&&hs(a,0):dh|=u,ds===ut&&(ds=0)),ka(a)}function sb(a,r){r===0&&(r=zr()),a=er(a,r),a!==null&&(Gi(a,r),ka(a))}function tA(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),sb(a,u)}function nA(a,r){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,v=a.memoizedState;v!==null&&(u=v.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(r),sb(a,u)}function aA(a,r){return qe(a,r)}var Fu=null,ps=null,yh=!1,Vu=!1,vh=!1,wi=0;function ka(a){a!==ps&&a.next===null&&(ps===null?Fu=ps=a:ps=ps.next=a),Vu=!0,yh||(yh=!0,rA())}function Lo(a,r){if(!vh&&Vu){vh=!0;do for(var u=!1,h=Fu;h!==null;){if(a!==0){var v=h.pendingLanes;if(v===0)var S=0;else{var O=h.suspendedLanes,V=h.pingedLanes;S=(1<<31-vt(42|a)+1)-1,S&=v&~(O&~V),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,cb(h,S))}else S=ut,S=qi(h,h===Ct?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||oi(h,S)||(u=!0,cb(h,S));h=h.next}while(u);vh=!1}}function iA(){ob()}function ob(){Vu=yh=!1;var a=0;wi!==0&&pA()&&(a=wi);for(var r=Be(),u=null,h=Fu;h!==null;){var v=h.next,S=lb(h,r);S===0?(h.next=null,u===null?Fu=v:u.next=v,v===null&&(ps=u)):(u=h,(a!==0||(S&3)!==0)&&(Vu=!0)),h=v}tn!==0&&tn!==5||Lo(a),wi!==0&&(wi=0)}function lb(a,r){for(var u=a.suspendedLanes,h=a.pingedLanes,v=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var O=31-vt(S),V=1<<O,te=v[O];te===-1?((V&u)===0||(V&h)!==0)&&(v[O]=Br(V,r)):te<=r&&(a.expiredLanes|=V),S&=~V}if(r=Ct,u=ut,u=qi(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===r&&(Et===2||Et===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&pt(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||oi(a,u)){if(r=u&-u,r===a.callbackPriority)return r;switch(h!==null&&pt(h),Xi(u)){case 2:case 8:u=ke;break;case 32:u=De;break;case 268435456:u=$e;break;default:u=De}return h=ub.bind(null,a),u=qe(u,h),a.callbackPriority=r,a.callbackNode=u,r}return h!==null&&h!==null&&pt(h),a.callbackPriority=2,a.callbackNode=null,2}function ub(a,r){if(tn!==0&&tn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Hu()&&a.callbackNode!==u)return null;var h=ut;return h=qi(a,a===Ct?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(qx(a,h,r),lb(a,Be()),a.callbackNode!=null&&a.callbackNode===u?ub.bind(null,a):null)}function cb(a,r){if(Hu())return null;qx(a,r,!0)}function rA(){xA(function(){(bt&6)!==0?qe(pe,iA):ob()})}function Eh(){if(wi===0){var a=es;a===0&&(a=Gn,Gn<<=1,(Gn&261888)===0&&(Gn=256)),wi=a}return wi}function db(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Wl(""+a)}function fb(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 sA(a,r,u,h,v){if(r==="submit"&&u&&u.stateNode===v){var S=db((v[St]||null).action),O=h.submitter;O&&(r=(r=O[St]||null)?db(r.formAction):O.getAttribute("formAction"),r!==null&&(S=r,O=null));var V=new tu("action","action",null,h,v);a.push({event:V,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(wi!==0){var te=O?fb(v,O):new FormData(v);Hf(u,{pending:!0,data:te,method:v.method,action:S},null,te)}}else typeof S=="function"&&(V.preventDefault(),te=O?fb(v,O):new FormData(v),Hf(u,{pending:!0,data:te,method:v.method,action:S},S,te))},currentTarget:v}]})}}for(var Th=0;Th<af.length;Th++){var Sh=af[Th],oA=Sh.toLowerCase(),lA=Sh[0].toUpperCase()+Sh.slice(1);da(oA,"on"+lA)}da(Vg,"onAnimationEnd"),da(qg,"onAnimationIteration"),da(Yg,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(k3,"onTransitionRun"),da(w3,"onTransitionStart"),da(A3,"onTransitionCancel"),da(Gg,"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 Oo="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(" "),uA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oo));function hb(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],v=h.event;h=h.listeners;e:{var S=void 0;if(r)for(var O=h.length-1;0<=O;O--){var V=h[O],te=V.instance,de=V.currentTarget;if(V=V.listener,te!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=de;try{S(v)}catch(be){iu(be)}v.currentTarget=null,S=te}else for(O=0;O<h.length;O++){if(V=h[O],te=V.instance,de=V.currentTarget,V=V.listener,te!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=de;try{S(v)}catch(be){iu(be)}v.currentTarget=null,S=te}}}}function ot(a,r){var u=r[Pt];u===void 0&&(u=r[Pt]=new Set);var h=a+"__bubble";u.has(h)||(mb(r,a,2,!1),u.add(h))}function kh(a,r,u){var h=0;r&&(h|=4),mb(u,a,h,r)}var qu="_reactListening"+Math.random().toString(36).slice(2);function wh(a){if(!a[qu]){a[qu]=!0,Js.forEach(function(u){u!=="selectionchange"&&(uA.has(u)||kh(u,!1,a),kh(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[qu]||(r[qu]=!0,kh("selectionchange",!1,r))}}function mb(a,r,u,h){switch(Vb(r)){case 2:var v=PA;break;case 8:v=BA;break;default:v=Uh}u=v.bind(null,r,u,a),v=void 0,!qd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(v=!0),h?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 Ah(a,r,u,h,v){var S=h;if((r&1)===0&&(r&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var V=h.stateNode.containerInfo;if(V===v)break;if(O===4)for(O=h.return;O!==null;){var te=O.tag;if((te===3||te===4)&&O.stateNode.containerInfo===v)return;O=O.return}for(;V!==null;){if(O=Xn(V),O===null)return;if(te=O.tag,te===5||te===6||te===26||te===27){h=S=O;continue e}V=V.parentNode}}h=h.return}yg(function(){var de=S,be=Fd(u),Te=[];e:{var he=Xg.get(a);if(he!==void 0){var ge=tu,Oe=a;switch(a){case"keypress":if(Jl(u)===0)break e;case"keydown":case"keyup":ge=n3;break;case"focusin":Oe="focus",ge=Kd;break;case"focusout":Oe="blur",ge=Kd;break;case"beforeblur":case"afterblur":ge=Kd;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":ge=Tg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=r3;break;case Vg:case qg:case Yg:ge=Xw;break;case Gg:ge=o3;break;case"scroll":case"scrollend":ge=Fw;break;case"wheel":ge=u3;break;case"copy":case"cut":case"paste":ge=Qw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=kg;break;case"toggle":case"beforetoggle":ge=d3}var Fe=(r&4)!==0,At=!Fe&&(a==="scroll"||a==="scrollend"),re=Fe?he!==null?he+"Capture":null:he;Fe=[];for(var ae=de,ue;ae!==null;){var ve=ae;if(ue=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ue===null||re===null||(ve=to(ae,re),ve!=null&&Fe.push(Io(ae,ve,ue))),At)break;ae=ae.return}0<Fe.length&&(he=new ge(he,Oe,null,u,be),Te.push({event:he,listeners:Fe}))}}if((r&7)===0){e:{if(he=a==="mouseover"||a==="pointerover",ge=a==="mouseout"||a==="pointerout",he&&u!==Hd&&(Oe=u.relatedTarget||u.fromElement)&&(Xn(Oe)||Oe[Oa]))break e;if((ge||he)&&(he=be.window===be?be:(he=be.ownerDocument)?he.defaultView||he.parentWindow:window,ge?(Oe=u.relatedTarget||u.toElement,ge=de,Oe=Oe?Xn(Oe):null,Oe!==null&&(At=s(Oe),Fe=Oe.tag,Oe!==At||Fe!==5&&Fe!==27&&Fe!==6)&&(Oe=null)):(ge=null,Oe=de),ge!==Oe)){if(Fe=Tg,ve="onMouseLeave",re="onMouseEnter",ae="mouse",(a==="pointerout"||a==="pointerover")&&(Fe=kg,ve="onPointerLeave",re="onPointerEnter",ae="pointer"),At=ge==null?he:$i(ge),ue=Oe==null?he:$i(Oe),he=new Fe(ve,ae+"leave",ge,u,be),he.target=At,he.relatedTarget=ue,ve=null,Xn(be)===de&&(Fe=new Fe(re,ae+"enter",Oe,u,be),Fe.target=ue,Fe.relatedTarget=At,ve=Fe),At=ve,ge&&Oe)t:{for(Fe=cA,re=ge,ae=Oe,ue=0,ve=re;ve;ve=Fe(ve))ue++;ve=0;for(var Ue=ae;Ue;Ue=Fe(Ue))ve++;for(;0<ue-ve;)re=Fe(re),ue--;for(;0<ve-ue;)ae=Fe(ae),ve--;for(;ue--;){if(re===ae||ae!==null&&re===ae.alternate){Fe=re;break t}re=Fe(re),ae=Fe(ae)}Fe=null}else Fe=null;ge!==null&&pb(Te,he,ge,Fe,!1),Oe!==null&&At!==null&&pb(Te,At,Oe,Fe,!0)}}e:{if(he=de?$i(de):window,ge=he.nodeName&&he.nodeName.toLowerCase(),ge==="select"||ge==="input"&&he.type==="file")var gt=Dg;else if(Mg(he))if(Lg)gt=E3;else{gt=y3;var Pe=b3}else ge=he.nodeName,!ge||ge.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&Ud(de.elementType)&&(gt=Dg):gt=v3;if(gt&&(gt=gt(a,de))){Rg(Te,gt,u,be);break e}Pe&&Pe(a,he,de),a==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&zd(he,"number",he.value)}switch(Pe=de?$i(de):window,a){case"focusin":(Mg(Pe)||Pe.contentEditable==="true")&&(Gr=Pe,ef=de,uo=null);break;case"focusout":uo=ef=Gr=null;break;case"mousedown":tf=!0;break;case"contextmenu":case"mouseup":case"dragend":tf=!1,Hg(Te,u,be);break;case"selectionchange":if(S3)break;case"keydown":case"keyup":Hg(Te,u,be)}var et;if($d)e:{switch(a){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Yr?Ng(a,u)&&(ct="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(ct="onCompositionStart");ct&&(wg&&u.locale!=="ko"&&(Yr||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Yr&&(et=vg()):(ui=be,Yd="value"in ui?ui.value:ui.textContent,Yr=!0)),Pe=Yu(de,ct),0<Pe.length&&(ct=new Sg(ct,a,null,u,be),Te.push({event:ct,listeners:Pe}),et?ct.data=et:(et=_g(u),et!==null&&(ct.data=et)))),(et=h3?m3(a,u):p3(a,u))&&(ct=Yu(de,"onBeforeInput"),0<ct.length&&(Pe=new Sg("onBeforeInput","beforeinput",null,u,be),Te.push({event:Pe,listeners:ct}),Pe.data=et)),sA(Te,a,de,u,be)}hb(Te,r)})}function Io(a,r,u){return{instance:a,listener:r,currentTarget:u}}function Yu(a,r){for(var u=r+"Capture",h=[];a!==null;){var v=a,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=to(a,u),v!=null&&h.unshift(Io(a,v,S)),v=to(a,r),v!=null&&h.push(Io(a,v,S))),a.tag===3)return h;a=a.return}return[]}function cA(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function pb(a,r,u,h,v){for(var S=r._reactName,O=[];u!==null&&u!==h;){var V=u,te=V.alternate,de=V.stateNode;if(V=V.tag,te!==null&&te===h)break;V!==5&&V!==26&&V!==27||de===null||(te=de,v?(de=to(u,S),de!=null&&O.unshift(Io(u,de,te))):v||(de=to(u,S),de!=null&&O.push(Io(u,de,te)))),u=u.return}O.length!==0&&a.push({event:r,listeners:O})}var dA=/\r\n?/g,fA=/\u0000|\uFFFD/g;function gb(a){return(typeof a=="string"?a:""+a).replace(dA,`
49
+ `).replace(fA,"")}function xb(a,r){return r=gb(r),gb(a)===r}function wt(a,r,u,h,v,S){switch(u){case"children":typeof h=="string"?r==="body"||r==="textarea"&&h===""||Fr(a,h):(typeof h=="number"||typeof h=="bigint")&&r!=="body"&&Fr(a,""+h);break;case"className":mt(a,"class",h);break;case"tabIndex":mt(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":mt(a,u,h);break;case"style":xg(a,h,S);break;case"data":if(r!=="object"){mt(a,"data",h);break}case"src":case"href":if(h===""&&(r!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Wl(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="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"&&wt(a,r,"name",v.name,v,null),wt(a,r,"formEncType",v.formEncType,v,null),wt(a,r,"formMethod",v.formMethod,v,null),wt(a,r,"formTarget",v.formTarget,v,null)):(wt(a,r,"encType",v.encType,v,null),wt(a,r,"method",v.method,v,null),wt(a,r,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Wl(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Pa);break;case"onScroll":h!=null&&ot("scroll",a);break;case"onScrollEnd":h!=null&&ot("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=Wl(""+h),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":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":ot("beforetoggle",a),ot("toggle",a),ze(a,"popover",h);break;case"xlinkActuate":Bt(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Bt(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Bt(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Bt(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Bt(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Bt(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Bt(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Bt(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Bt(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ze(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Uw.get(u)||u,ze(a,u,h))}}function Ch(a,r,u,h,v,S){switch(u){case"style":xg(a,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"children":typeof h=="string"?Fr(a,h):(typeof h=="number"||typeof h=="bigint")&&Fr(a,""+h);break;case"onScroll":h!=null&&ot("scroll",a);break;case"onScrollEnd":h!=null&&ot("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ql.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[St]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(r,S,v),typeof h=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,h,v);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):ze(a,u,h)}}}function fn(a,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",a),ot("load",a);var h=!1,v=!1,S;for(S in u)if(u.hasOwnProperty(S)){var O=u[S];if(O!=null)switch(S){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:wt(a,r,S,O,u,null)}}v&&wt(a,r,"srcSet",u.srcSet,u,null),h&&wt(a,r,"src",u.src,u,null);return;case"input":ot("invalid",a);var V=S=O=v=null,te=null,de=null;for(h in u)if(u.hasOwnProperty(h)){var be=u[h];if(be!=null)switch(h){case"name":v=be;break;case"type":O=be;break;case"checked":te=be;break;case"defaultChecked":de=be;break;case"value":S=be;break;case"defaultValue":V=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(i(137,r));break;default:wt(a,r,h,be,u,null)}}hg(a,S,V,te,de,O,v,!1);return;case"select":ot("invalid",a),h=O=S=null;for(v in u)if(u.hasOwnProperty(v)&&(V=u[v],V!=null))switch(v){case"value":S=V;break;case"defaultValue":O=V;break;case"multiple":h=V;default:wt(a,r,v,V,u,null)}r=S,u=O,a.multiple=!!h,r!=null?Hr(a,!!h,r,!1):u!=null&&Hr(a,!!h,u,!0);return;case"textarea":ot("invalid",a),S=v=h=null;for(O in u)if(u.hasOwnProperty(O)&&(V=u[O],V!=null))switch(O){case"value":h=V;break;case"defaultValue":v=V;break;case"children":S=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(91));break;default:wt(a,r,O,V,u,null)}pg(a,h,v,S);return;case"option":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:wt(a,r,te,h,u,null)}return;case"dialog":ot("beforetoggle",a),ot("toggle",a),ot("cancel",a),ot("close",a);break;case"iframe":case"object":ot("load",a);break;case"video":case"audio":for(h=0;h<Oo.length;h++)ot(Oo[h],a);break;case"image":ot("error",a),ot("load",a);break;case"details":ot("toggle",a);break;case"embed":case"source":case"link":ot("error",a),ot("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(de in u)if(u.hasOwnProperty(de)&&(h=u[de],h!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:wt(a,r,de,h,u,null)}return;default:if(Ud(r)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Ch(a,r,be,h,u,void 0));return}}for(V in u)u.hasOwnProperty(V)&&(h=u[V],h!=null&&wt(a,r,V,h,u,null))}function hA(a,r,u,h){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,O=null,V=null,te=null,de=null,be=null;for(ge in u){var Te=u[ge];if(u.hasOwnProperty(ge)&&Te!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":te=Te;default:h.hasOwnProperty(ge)||wt(a,r,ge,null,h,Te)}}for(var he in h){var ge=h[he];if(Te=u[he],h.hasOwnProperty(he)&&(ge!=null||Te!=null))switch(he){case"type":S=ge;break;case"name":v=ge;break;case"checked":de=ge;break;case"defaultChecked":be=ge;break;case"value":O=ge;break;case"defaultValue":V=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,r));break;default:ge!==Te&&wt(a,r,he,ge,h,Te)}}Bd(a,O,V,te,de,be,S,v);return;case"select":ge=O=V=he=null;for(S in u)if(te=u[S],u.hasOwnProperty(S)&&te!=null)switch(S){case"value":break;case"multiple":ge=te;default:h.hasOwnProperty(S)||wt(a,r,S,null,h,te)}for(v in h)if(S=h[v],te=u[v],h.hasOwnProperty(v)&&(S!=null||te!=null))switch(v){case"value":he=S;break;case"defaultValue":V=S;break;case"multiple":O=S;default:S!==te&&wt(a,r,v,S,h,te)}r=V,u=O,h=ge,he!=null?Hr(a,!!u,he,!1):!!h!=!!u&&(r!=null?Hr(a,!!u,r,!0):Hr(a,!!u,u?[]:"",!1));return;case"textarea":ge=he=null;for(V in u)if(v=u[V],u.hasOwnProperty(V)&&v!=null&&!h.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:wt(a,r,V,null,h,v)}for(O in h)if(v=h[O],S=u[O],h.hasOwnProperty(O)&&(v!=null||S!=null))switch(O){case"value":he=v;break;case"defaultValue":ge=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==S&&wt(a,r,O,v,h,S)}mg(a,he,ge);return;case"option":for(var Oe in u)if(he=u[Oe],u.hasOwnProperty(Oe)&&he!=null&&!h.hasOwnProperty(Oe))switch(Oe){case"selected":a.selected=!1;break;default:wt(a,r,Oe,null,h,he)}for(te in h)if(he=h[te],ge=u[te],h.hasOwnProperty(te)&&he!==ge&&(he!=null||ge!=null))switch(te){case"selected":a.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:wt(a,r,te,he,h,ge)}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 Fe in u)he=u[Fe],u.hasOwnProperty(Fe)&&he!=null&&!h.hasOwnProperty(Fe)&&wt(a,r,Fe,null,h,he);for(de in h)if(he=h[de],ge=u[de],h.hasOwnProperty(de)&&he!==ge&&(he!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,r));break;default:wt(a,r,de,he,h,ge)}return;default:if(Ud(r)){for(var At in u)he=u[At],u.hasOwnProperty(At)&&he!==void 0&&!h.hasOwnProperty(At)&&Ch(a,r,At,void 0,h,he);for(be in h)he=h[be],ge=u[be],!h.hasOwnProperty(be)||he===ge||he===void 0&&ge===void 0||Ch(a,r,be,he,h,ge);return}}for(var re in u)he=u[re],u.hasOwnProperty(re)&&he!=null&&!h.hasOwnProperty(re)&&wt(a,r,re,null,h,he);for(Te in h)he=h[Te],ge=u[Te],!h.hasOwnProperty(Te)||he===ge||he==null&&ge==null||wt(a,r,Te,he,h,ge)}function bb(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mA(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var v=u[h],S=v.transferSize,O=v.initiatorType,V=v.duration;if(S&&V&&bb(O)){for(O=0,V=v.responseEnd,h+=1;h<u.length;h++){var te=u[h],de=te.startTime;if(de>V)break;var be=te.transferSize,Te=te.initiatorType;be&&bb(Te)&&(te=te.responseEnd,O+=be*(te<V?1:(V-de)/(te-de)))}if(--h,r+=8*(S+O)/(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 Nh=null,_h=null;function Gu(a){return a.nodeType===9?a:a.ownerDocument}function yb(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 vb(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 Mh(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 Rh=null;function pA(){var a=window.event;return a&&a.type==="popstate"?a===Rh?!1:(Rh=a,!0):(Rh=null,!1)}var Eb=typeof setTimeout=="function"?setTimeout:void 0,gA=typeof clearTimeout=="function"?clearTimeout:void 0,Tb=typeof Promise=="function"?Promise:void 0,xA=typeof queueMicrotask=="function"?queueMicrotask:typeof Tb<"u"?function(a){return Tb.resolve(null).then(a).catch(bA)}:Eb;function bA(a){setTimeout(function(){throw a})}function Ai(a){return a==="head"}function Sb(a,r){var u=r,h=0;do{var v=u.nextSibling;if(a.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(v),ys(r);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")jo(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,jo(u);for(var S=u.firstChild;S;){var O=S.nextSibling,V=S.nodeName;S[Qi]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=O}}else u==="body"&&jo(a.ownerDocument.body);u=v}while(u);ys(r)}function kb(a,r){var u=a;a=0;do{var h=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||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function Dh(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":Dh(u),Ur(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function yA(a,r,u,h){for(;a.nodeType===1;){var v=u;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){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 vA(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 wb(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 Lh(a){return a.data==="$?"||a.data==="$~"}function Oh(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function EA(a,r){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||u.readyState!=="loading")r();else{var h=function(){r(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}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 Ih=null;function Ab(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 Cb(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 Nb(a,r,u){switch(r=Gu(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 jo(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Ur(a)}var na=new Map,_b=new Set;function Xu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ja=G.d;G.d={f:TA,r:SA,D:kA,C:wA,L:AA,m:CA,X:_A,S:NA,M:MA};function TA(){var a=Ja.f(),r=Bu();return a||r}function SA(a){var r=Ia(a);r!==null&&r.tag===5&&r.type==="form"?G1(r):Ja.r(a)}var gs=typeof document>"u"?null:document;function Mb(a,r,u){var h=gs;if(h&&typeof r=="string"&&r){var v=Kn(r);v='link[rel="'+a+'"][href="'+v+'"]',typeof u=="string"&&(v+='[crossorigin="'+u+'"]'),_b.has(v)||(_b.add(v),a={rel:a,crossOrigin:u,href:r},h.querySelector(v)===null&&(r=h.createElement("link"),fn(r,"link",a),Vt(r),h.head.appendChild(r)))}}function kA(a){Ja.D(a),Mb("dns-prefetch",a,null)}function wA(a,r){Ja.C(a,r),Mb("preconnect",a,r)}function AA(a,r,u){Ja.L(a,r,u);var h=gs;if(h&&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=xs(a);break;case"script":S=bs(a)}na.has(S)||(a=x({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:a,as:r},u),na.set(S,a),h.querySelector(v)!==null||r==="style"&&h.querySelector(Po(S))||r==="script"&&h.querySelector(Bo(S))||(r=h.createElement("link"),fn(r,"link",a),Vt(r),h.head.appendChild(r)))}}function CA(a,r){Ja.m(a,r);var u=gs;if(u&&a){var h=r&&typeof r.as=="string"?r.as:"script",v='link[rel="modulepreload"][as="'+Kn(h)+'"][href="'+Kn(a)+'"]',S=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=bs(a)}if(!na.has(S)&&(a=x({rel:"modulepreload",href:a},r),na.set(S,a),u.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Bo(S)))return}h=u.createElement("link"),fn(h,"link",a),Vt(h),u.head.appendChild(h)}}}function NA(a,r,u){Ja.S(a,r,u);var h=gs;if(h&&a){var v=ja(h).hoistableStyles,S=xs(a);r=r||"default";var O=v.get(S);if(!O){var V={loading:0,preload:null};if(O=h.querySelector(Po(S)))V.loading=5;else{a=x({rel:"stylesheet",href:a,"data-precedence":r},u),(u=na.get(S))&&jh(a,u);var te=O=h.createElement("link");Vt(te),fn(te,"link",a),te._p=new Promise(function(de,be){te.onload=de,te.onerror=be}),te.addEventListener("load",function(){V.loading|=1}),te.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Ku(O,r,h)}O={type:"stylesheet",instance:O,count:1,state:V},v.set(S,O)}}}function _A(a,r){Ja.X(a,r);var u=gs;if(u&&a){var h=ja(u).hoistableScripts,v=bs(a),S=h.get(v);S||(S=u.querySelector(Bo(v)),S||(a=x({src:a,async:!0},r),(r=na.get(v))&&Ph(a,r),S=u.createElement("script"),Vt(S),fn(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(v,S))}}function MA(a,r){Ja.M(a,r);var u=gs;if(u&&a){var h=ja(u).hoistableScripts,v=bs(a),S=h.get(v);S||(S=u.querySelector(Bo(v)),S||(a=x({src:a,async:!0,type:"module"},r),(r=na.get(v))&&Ph(a,r),S=u.createElement("script"),Vt(S),fn(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(v,S))}}function Rb(a,r,u,h){var v=(v=$.current)?Xu(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=xs(u.href),u=ja(v).hoistableStyles,h=u.get(r),h||(h={type:"style",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=xs(u.href);var S=ja(v).hoistableStyles,O=S.get(a);if(O||(v=v.ownerDocument||v,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,O),(S=v.querySelector(Po(a)))&&!S._p&&(O.instance=S,O.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||RA(v,a,u,O.state))),r&&h===null)throw Error(i(528,""));return O}if(r&&h!==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=bs(u),u=ja(v).hoistableScripts,h=u.get(r),h||(h={type:"script",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function xs(a){return'href="'+Kn(a)+'"'}function Po(a){return'link[rel="stylesheet"]['+a+"]"}function Db(a){return x({},a,{"data-precedence":a.precedence,precedence:null})}function RA(a,r,u,h){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=a.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),fn(r,"link",u),Vt(r),a.head.appendChild(r))}function bs(a){return'[src="'+Kn(a)+'"]'}function Bo(a){return"script[async]"+a}function Lb(a,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var h=a.querySelector('style[data-href~="'+Kn(u.href)+'"]');if(h)return r.instance=h,Vt(h),h;var v=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Vt(h),fn(h,"style",v),Ku(h,u.precedence,a),r.instance=h;case"stylesheet":v=xs(u.href);var S=a.querySelector(Po(v));if(S)return r.state.loading|=4,r.instance=S,Vt(S),S;h=Db(u),(v=na.get(v))&&jh(h,v),S=(a.ownerDocument||a).createElement("link"),Vt(S);var O=S;return O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),fn(S,"link",h),r.state.loading|=4,Ku(S,u.precedence,a),r.instance=S;case"script":return S=bs(u.src),(v=a.querySelector(Bo(S)))?(r.instance=v,Vt(v),v):(h=u,(v=na.get(S))&&(h=x({},u),Ph(h,v)),a=a.ownerDocument||a,v=a.createElement("script"),Vt(v),fn(v,"link",h),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&&(h=r.instance,r.state.loading|=4,Ku(h,u.precedence,a));return r.instance}function Ku(a,r,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,S=v,O=0;O<h.length;O++){var V=h[O];if(V.dataset.precedence===r)S=V;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 jh(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Ph(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Qu=null;function Ob(a,r,u){if(Qu===null){var h=new Map,v=Qu=new Map;v.set(u,h)}else v=Qu,h=v.get(u),h||(h=new Map,v.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),v=0;v<u.length;v++){var S=u[v];if(!(S[Qi]||S[en]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var O=S.getAttribute(r)||"";O=a+O;var V=h.get(O);V?V.push(S):h.set(O,[S])}}return h}function Ib(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function DA(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 jb(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function LA(a,r,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var v=xs(h.href),S=r.querySelector(Po(v));if(S){r=S._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=$u.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=S,Vt(S);return}S=r.ownerDocument||r,h=Db(h),(v=na.get(v))&&jh(h,v),S=S.createElement("link"),Vt(S);var O=S;O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),fn(S,"link",h),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=$u.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var Bh=0;function OA(a,r){return a.stylesheets&&a.count===0&&Zu(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&Zu(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+r);0<a.imgBytes&&Bh===0&&(Bh=62500*mA());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Zu(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Bh?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function $u(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Wu=null;function Zu(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Wu=new Map,r.forEach(IA,a),Wu=null,$u.call(a))}function IA(a,r){if(!(r.state.loading&4)){var u=Wu.get(a);if(u)var h=u.get(null);else{u=new Map,Wu.set(a,u);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var O=v[S];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),h=O)}h&&u.set(null,h)}v=r.instance,O=v.getAttribute("data-precedence"),S=u.get(O)||h,S===h&&u.set(null,v),u.set(O,v),this.count++,h=$u.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),S?S.parentNode.insertBefore(v,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),r.state.loading|=4}}var zo={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function jA(a,r,u,h,v,S,O,V,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=h,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function Pb(a,r,u,h,v,S,O,V,te,de,be,Te){return a=new jA(a,r,u,O,te,de,be,Te,V),r=1,S===!0&&(r|=24),S=In(3,null,null,r),a.current=S,S.stateNode=a,r=xf(),r.refCount++,a.pooledCache=r,r.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:r},Ef(S),a}function Bb(a){return a?(a=Qr,a):Qr}function zb(a,r,u,h,v,S){v=Bb(v),h.context===null?h.context=v:h.pendingContext=v,h=pi(r),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=gi(a,h,r),u!==null&&(_n(u,a,r),xo(u,a,r))}function Ub(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function zh(a,r){Ub(a,r),(a=a.alternate)&&Ub(a,r)}function Hb(a){if(a.tag===13||a.tag===31){var r=er(a,67108864);r!==null&&_n(r,a,67108864),zh(a,67108864)}}function Fb(a){if(a.tag===13||a.tag===31){var r=Un();r=Qs(r);var u=er(a,r);u!==null&&_n(u,a,r),zh(a,r)}}var Ju=!0;function PA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=2,Uh(a,r,u,h)}finally{G.p=S,H.T=v}}function BA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=8,Uh(a,r,u,h)}finally{G.p=S,H.T=v}}function Uh(a,r,u,h){if(Ju){var v=Hh(h);if(v===null)Ah(a,r,h,ec,u),qb(a,h);else if(UA(v,a,r,u,h))h.stopPropagation();else if(qb(a,h),r&4&&-1<zA.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 O=ua(S.pendingLanes);if(O!==0){var V=S;for(V.pendingLanes|=2,V.entangledLanes|=2;O;){var te=1<<31-vt(O);V.entanglements[1]|=te,O&=~te}ka(S),(bt&6)===0&&(ju=Be()+500,Lo(0))}}break;case 31:case 13:V=er(S,2),V!==null&&_n(V,S,2),Bu(),zh(S,2)}if(S=Hh(h),S===null&&Ah(a,r,h,ec,u),S===v)break;v=S}v!==null&&h.stopPropagation()}else Ah(a,r,h,null,u)}}function Hh(a){return a=Fd(a),Fh(a)}var ec=null;function Fh(a){if(ec=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 ec=a,null}function Vb(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(je()){case pe:return 2;case ke:return 8;case De:case Me:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Vh=!1,Ci=null,Ni=null,_i=null,Uo=new Map,Ho=new Map,Mi=[],zA="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 qb(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":Uo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(r.pointerId)}}function Fo(a,r,u,h,v,S){return a===null||a.nativeEvent!==S?(a={blockedOn:r,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[v]},r!==null&&(r=Ia(r),r!==null&&Hb(r)),a):(a.eventSystemFlags|=h,r=a.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),a)}function UA(a,r,u,h,v){switch(r){case"focusin":return Ci=Fo(Ci,a,r,u,h,v),!0;case"dragenter":return Ni=Fo(Ni,a,r,u,h,v),!0;case"mouseover":return _i=Fo(_i,a,r,u,h,v),!0;case"pointerover":var S=v.pointerId;return Uo.set(S,Fo(Uo.get(S)||null,a,r,u,h,v)),!0;case"gotpointercapture":return S=v.pointerId,Ho.set(S,Fo(Ho.get(S)||null,a,r,u,h,v)),!0}return!1}function Yb(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(){Fb(u)});return}}else if(r===31){if(r=c(u),r!==null){a.blockedOn=r,Ki(a.priority,function(){Fb(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 tc(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=Hh(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);Hd=h,u.target.dispatchEvent(h),Hd=null}else return r=Ia(u),r!==null&&Hb(r),a.blockedOn=u,!1;r.shift()}return!0}function Gb(a,r,u){tc(a)&&u.delete(r)}function HA(){Vh=!1,Ci!==null&&tc(Ci)&&(Ci=null),Ni!==null&&tc(Ni)&&(Ni=null),_i!==null&&tc(_i)&&(_i=null),Uo.forEach(Gb),Ho.forEach(Gb)}function nc(a,r){a.blockedOn===r&&(a.blockedOn=null,Vh||(Vh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,HA)))}var ac=null;function Xb(a){ac!==a&&(ac=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ac===a&&(ac=null);for(var r=0;r<a.length;r+=3){var u=a[r],h=a[r+1],v=a[r+2];if(typeof h!="function"){if(Fh(h||u)===null)continue;break}var S=Ia(u);S!==null&&(a.splice(r,3),r-=3,Hf(S,{pending:!0,data:v,method:u.method,action:h},h,v))}}))}function ys(a){function r(te){return nc(te,a)}Ci!==null&&nc(Ci,a),Ni!==null&&nc(Ni,a),_i!==null&&nc(_i,a),Uo.forEach(r),Ho.forEach(r);for(var u=0;u<Mi.length;u++){var h=Mi[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Mi.length&&(u=Mi[0],u.blockedOn===null);)Yb(u),u.blockedOn===null&&Mi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var v=u[h],S=u[h+1],O=v[St]||null;if(typeof S=="function")O||Xb(u);else if(O){var V=null;if(S&&S.hasAttribute("formAction")){if(v=S,O=S[St]||null)V=O.formAction;else if(Fh(v)!==null)continue}else V=O.action;typeof V=="function"?u[h+1]=V:(u.splice(h,3),h-=3),Xb(u)}}}function Kb(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(O){return v=O})},focusReset:"manual",scroll:"manual"})}function r(){v!==null&&(v(),v=null),h||setTimeout(u,20)}function u(){if(!h&&!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 h=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),v!==null&&(v(),v=null)}}}function qh(a){this._internalRoot=a}ic.prototype.render=qh.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var u=r.current,h=Un();zb(u,h,a,r,null,null)},ic.prototype.unmount=qh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;zb(a.current,2,null,a,null,null),Bu(),r[Oa]=null}};function ic(a){this._internalRoot=a}ic.prototype.unstable_scheduleHydration=function(a){if(a){var r=$s();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&&Yb(a)}};var Qb=t.version;if(Qb!=="19.2.8")throw Error(i(527,Qb,"19.2.8"));G.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=f(r),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var FA={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{tt=rc.inject(FA),We=rc}catch{}}return qo.createRoot=function(a,r){if(!o(a))throw Error(i(299));var u=!1,h="",v=nx,S=ax,O=ix;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),r=Pb(a,1,!1,null,null,u,h,null,v,S,O,Kb),a[Oa]=r.current,wh(a),new qh(r)},qo.hydrateRoot=function(a,r,u){if(!o(a))throw Error(i(299));var h=!1,v="",S=nx,O=ax,V=ix,te=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(V=u.onRecoverableError),u.formState!==void 0&&(te=u.formState)),r=Pb(a,1,!0,r,u??null,h,v,te,S,O,V,Kb),r.context=Bb(null),u=r.current,h=Un(),h=Qs(h),v=pi(h),v.callback=null,gi(u,v,h),u=h,r.current.lanes=u,Gi(r,u),ka(r),a[Oa]=r.current,wh(a),new ic(r)},qo.version="19.2.8",qo}var oy;function tC(){if(oy)return Kh.exports;oy=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(),Kh.exports=eC(),Kh.exports}var nC=tC();const aC=Rl(nC);/**
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 iC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pE=(...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 rC={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 sC=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:l,...c},d)=>_.createElement("svg",{ref:d,...rC,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:pE("lucide",o),...c},[...l.map(([f,p])=>_.createElement(f,p)),...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 Le=(e,t)=>{const n=_.forwardRef(({className:i,...o},s)=>_.createElement(sC,{ref:s,iconNode:t,className:pE(`lucide-${iC(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 oC=Le("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 i0=Le("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 lC=Le("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 uC=Le("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=Le("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 cC=Le("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 dC=Le("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=Le("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 ip=Le("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 fC=Le("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 gE=Le("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 r0=Le("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=Le("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 hC=Le("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 mC=Le("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 Ds=Le("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 xE=Le("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 bE=Le("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 pC=Le("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 yE=Le("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 gC=Le("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 xC=Le("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 Dl=Le("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 vE=Le("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 bC=Le("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 yC=Le("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 vC=Le("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 EE=Le("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 EC=Le("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 TC=Le("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 SC=Le("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 kC=Le("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
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 Fc=Le("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"}]]);/**
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 wC=Le("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"}]]);/**
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 rp=Le("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"}]]);/**
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 AC=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 CC=Le("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"}]]);/**
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 sp=Le("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"}]]);/**
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 Ll=Le("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"}]]);/**
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 TE=Le("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
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 NC=Le("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"}]]);/**
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 Cc=Le("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"}]]);/**
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 _C=Le("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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 MC=Le("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"}]]);/**
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 ly=Le("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"}]]);/**
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 RC=Le("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 DC=Le("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
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 LC=Le("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"}]]);/**
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 OC=Le("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"}]]);/**
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 El=Le("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"}]]);/**
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 uy=Le("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"}]]);/**
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 cd=Le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Zh=Le("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"}]]);/**
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 SE=Le("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"}]]);/**
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 IC=Le("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"}]]);/**
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 jC=Le("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"}]]);/**
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 sl=Le("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"}]]);/**
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 PC=Le("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"}]]);/**
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 BC=Le("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"}]]);/**
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 op=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 zC=Le("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
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 UC=Le("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"}]]);/**
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 Vc=Le("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"}]]);/**
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 lp=Le("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"}]]);/**
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 HC=Le("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"}]]);/**
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 FC=Le("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"}]]);/**
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 s0=Le("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"}]]);/**
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 VC=Le("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"}]]);/**
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 up=Le("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 qC=Le("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"}]]);/**
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 kE=Le("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"}]]);/**
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 Ls=Le("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"}]]);/**
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 YC=Le("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"}]]);/**
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 wE=Le("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"}]]);/**
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 o0=Le("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"}]]);/**
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 ri=Le("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"}]]);/**
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 GC=Le("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"}]]);/**
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 AE=Le("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"}]]);/**
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 XC=Le("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"}]]);/**
465
+ * @license lucide-react v0.468.0 - ISC
466
+ *
467
+ * This source code is licensed under the ISC license.
468
+ * See the LICENSE file in the root directory of this source tree.
469
+ */const cp=Le("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"}]]);/**
470
+ * @license lucide-react v0.468.0 - ISC
471
+ *
472
+ * This source code is licensed under the ISC license.
473
+ * See the LICENSE file in the root directory of this source tree.
474
+ */const la=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
475
+ * @license lucide-react v0.468.0 - ISC
476
+ *
477
+ * This source code is licensed under the ISC license.
478
+ * See the LICENSE file in the root directory of this source tree.
479
+ */const l0=Le("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"}]]),me=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}}),Yo=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),KC=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function CE(e){if(!e)return 0;const t=(e.match(KC)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function QC(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function $C(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 vs(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const NE=.5,WC=.9,ZC=.85;var dp=mE();const _E="lookatstudy-lang";let qc=typeof localStorage>"u"?"zh-CN":localStorage.getItem(_E)||"zh-CN";const u0=new Set;function ME(e){return u0.add(e),()=>{u0.delete(e)}}const cy={"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}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
480
+ 1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
481
+ 2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
482
+ 3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
483
+ 铁律:起手不要讲座、不要用 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":`
484
+
485
+ 网络受限或私有仓库请改用「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.hold_to_talk":"按住说话","chat.speech.release_to_stop":"松开,结束录音","chat.speech.recording_hint":"正在录音,松开结束","chat.speech.rerecord":"取消重录","chat.speech.retry":"重试","chat.speech.back_to_keyboard":"切回键盘输入","chat.speech.keyboard":"键盘","chat.speech.no_speech":"没听到声音,请检查麦克风后重试。","chat.speech.transcribing":"转录中…","chat.speech.asr_failed":"转录失败,请重试。","chat.speech.groq_key_missing":"Groq 密钥未配置。到 设置 → 模型服务 配置 Groq,或改用本地引擎。","chat.speech.azure_stt_key_missing":"Azure 听写缺少密钥。到 设置 → 语音能力 填写。","chat.speech.azure_stt_region_missing":"Azure 听写缺少区域。到 设置 → 语音能力 填写。","chat.speech.asr_model_missing":"听写模型还没下载。到 设置 → 语音能力 下载 Whisper(本地离线),或改用 Groq/Azure 云端。","chat.speech.asr_start_fail":"麦克风启动失败,请检查系统权限。","chat.speech.read_aloud_node":"朗读本课","chat.speech.azure_key_missing":"Azure 朗读缺少密钥。到 设置 → 语音能力 填写后使用。","chat.speech.azure_region_missing":"Azure 朗读缺少区域。到 设置 → 语音能力 填写后使用。","chat.speech.edge_failed":"在线朗读失败,且本地模型未就绪无法降级。稍后重试或改用本地引擎。","chat.speech.edge_disclosed":"朗读将文本发送至微软在线服务(Edge 免费通道)。想完全离线:设置 → 语音能力 → 本地离线。","settings.speech.title":"语音能力","settings.speech.desc":"朗读默认走 Edge 在线通道(免费、无需密钥);本地档下载模型后离线可用。","settings.speech.tts_engine":"朗读引擎","settings.speech.engine.edge":"Edge 在线","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"本地离线","settings.speech.engine.edge_note":"微软 Edge 朗读通道:免费、无需密钥、音色为产品级;文本经在线服务合成。","settings.speech.engine.azure_note":"Azure 官方语音通道,自带密钥,F0 层每月 50 万字符免费。","settings.speech.engine.local_note":"Kokoro 本地模型(约 430MB),完全离线;下载后自动作为在线通道故障的兜底。","settings.speech.voice":"音色","settings.speech.speed":"语速","settings.speech.azure_key":"密钥","settings.speech.azure_region":"区域","settings.speech.asr_engine":"听写引擎","settings.speech.asr_engine.local":"本地离线","settings.speech.asr_engine.groq":"Groq","settings.speech.asr_engine.azure":"Azure","settings.speech.asr_engine.local_note":"Whisper 离线转写(自带标点,中文质量好);下载模型后完全离线,Turbo 约 1GB / Small 约 360MB。","settings.speech.asr_engine.groq_note":"whisper-large-v3-turbo 云端转写(最快最准);复用模型服务里的 Groq 密钥,还没配。","settings.speech.asr_engine.groq_ready":"whisper-large-v3-turbo 云端转写(最快最准);已复用模型服务的 Groq 密钥,零额外配置。","settings.speech.asr_engine.azure_note":"Azure 听写,自带密钥,F0 层每月 5 小时免费。","settings.speech.asr_auto_stop":"静音后自动停止录音","settings.speech.asr_ux_note":"点输入框旁的麦克风进入语音模式:按住说话,松开后可修改识别文字再发送。","settings.speech.model.asr_turbo":"听写引擎 Whisper Turbo(约 1GB,推荐桌面)","settings.speech.model.asr_small":"听写引擎 Whisper Small(约 360MB,轻量)","settings.speech.license_mit":"MIT · 本地推理","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}}。下面是逐题情况:
486
+ 请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"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:
487
+ 1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
488
+ 2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
489
+ 3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
490
+ 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":`
491
+
492
+ 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.hold_to_talk":"Hold to talk","chat.speech.release_to_stop":"Release to finish","chat.speech.recording_hint":"Recording — release to finish","chat.speech.rerecord":"Discard & retry","chat.speech.retry":"Retry","chat.speech.back_to_keyboard":"Back to keyboard input","chat.speech.keyboard":"Keyboard","chat.speech.no_speech":"No speech detected. Check your microphone and retry.","chat.speech.transcribing":"Transcribing…","chat.speech.asr_failed":"Transcription failed. Please retry.","chat.speech.groq_key_missing":"Groq key not configured. Set it in Settings → Model providers, or switch to the local engine.","chat.speech.azure_stt_key_missing":"Azure dictation key missing. Fill it in Settings → Speech.","chat.speech.azure_stt_region_missing":"Azure dictation region missing. Fill it in Settings → Speech.","chat.speech.asr_model_missing":"Dictation model not downloaded. Get Whisper in Settings → Speech (local offline), or use Groq/Azure cloud.","chat.speech.asr_start_fail":"Microphone failed to start. Check system permissions.","chat.speech.read_aloud_node":"Read this lesson","chat.speech.azure_key_missing":"Azure TTS key missing. Fill it in Settings → Speech.","chat.speech.azure_region_missing":"Azure TTS region missing. Fill it in Settings → Speech.","chat.speech.edge_failed":"Online synthesis failed and no local fallback model is ready. Retry later or switch to the local engine.","chat.speech.edge_disclosed":"Read-aloud sends text to Microsoft's online service (free Edge channel). For fully offline: Settings → Speech → Local.","settings.speech.title":"Speech","settings.speech.desc":"Read-aloud defaults to the free Edge online channel (no key needed); the local tier runs offline once its model is downloaded.","settings.speech.tts_engine":"TTS engine","settings.speech.engine.edge":"Edge online","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"Local offline","settings.speech.engine.edge_note":"Microsoft Edge read-aloud channel: free, no key, product-grade voices; text is synthesized online.","settings.speech.engine.azure_note":"Official Azure Speech channel, bring your own key; the F0 tier includes 0.5M characters per month.","settings.speech.engine.local_note":"Kokoro local model (~430MB), fully offline; also acts as automatic fallback when online channels fail.","settings.speech.voice":"Voice","settings.speech.speed":"Speed","settings.speech.azure_key":"Key","settings.speech.azure_region":"Region","settings.speech.asr_engine":"Dictation engine","settings.speech.asr_engine.local":"Local offline","settings.speech.asr_engine.groq":"Groq","settings.speech.asr_engine.azure":"Azure","settings.speech.asr_engine.local_note":"Whisper offline transcription (native punctuation, strong Chinese); fully offline once the model is downloaded — Turbo ~1GB / Small ~360MB.","settings.speech.asr_engine.groq_note":"whisper-large-v3-turbo cloud transcription (fastest, most accurate); reuses the Groq key from model providers — not configured yet.","settings.speech.asr_engine.groq_ready":"whisper-large-v3-turbo cloud transcription (fastest, most accurate); reuses your configured Groq key, zero extra setup.","settings.speech.asr_engine.azure_note":"Azure dictation, bring your own key; the F0 tier includes 5 hours per month.","settings.speech.asr_auto_stop":"Auto-stop recording after silence","settings.speech.asr_ux_note":"Click the mic beside the input box to enter voice mode: hold to talk, then edit the recognized text before sending.","settings.speech.model.asr_turbo":"Dictation engine Whisper Turbo (~1GB, recommended on desktop)","settings.speech.model.asr_small":"Dictation engine Whisper Small (~360MB, lightweight)","settings.speech.license_mit":"MIT · local inference","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:
493
+ 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 Os(){return qc}function JC(e){e!==qc&&(qc=e,typeof localStorage<"u"&&localStorage.setItem(_E,e),u0.forEach(t=>t()))}function fp(e,t=qc,n){var o,s;let i=((o=cy[t])==null?void 0:o[e])??((s=cy["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 Ve(){const e=_.useSyncExternalStore(ME,Os,Os);return _.useCallback((t,n)=>fp(t,e,n),[e])}function RE(){return _.useSyncExternalStore(ME,Os,Os)}const eN=["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 dy(e){return Array.from(e.querySelectorAll(eN)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function Us(e,t){_.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const i=document.activeElement,s=dy(n)[0]??n,l=window.setTimeout(()=>s.focus(),0),c=d=>{if(d.key!=="Tab")return;const f=dy(n);if(f.length===0){d.preventDefault(),n.focus();return}const p=f[0],x=f[f.length-1];d.shiftKey?(document.activeElement===p||!n.contains(document.activeElement))&&(d.preventDefault(),x.focus()):document.activeElement===x&&(d.preventDefault(),p.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 sc=220;function dd({anchorRect:e,message:t,onConfirm:n,onCancel:i,confirmLabel:o,cancelLabel:s,danger:l=!1,testid:c="confirm-card"}){const d=Ve(),f=_.useRef(null);Us(f,!0);const p=o??d("action.confirm"),x=s??d("action.cancel");_.useEffect(()=>{const w=N=>{f.current&&!f.current.contains(N.target)&&i()},M=N=>{N.key==="Escape"&&i(),N.key==="Enter"&&(N.preventDefault(),n())};return document.addEventListener("mousedown",w),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",M)}},[i,n]);const b=window.innerWidth,g=window.innerHeight,y=e.right-sc,E=Math.max(8,Math.min(y,b-sc-8)),T=e.bottom+4+sc>g?Math.max(8,e.top-4-sc):e.bottom+4;return dp.createPortal(m.jsxs("div",{ref:f,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:w=>w.stopPropagation(),children:[m.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),m.jsxs("div",{className:"flex gap-2 justify-end",children:[m.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:x}),m.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:p})]})]}),document.body)}function tN(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)>=NE});return{section:i,lessons:o,chapterLessonsMastered:l}})}function c0(e,t,n){var i;return e.type==="exam"?!n:(((i=t[e.id])==null?void 0:i.status)??"locked")==="locked"}function nN(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 aN(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 iN(e){const t=Ve(),[n,i]=_.useState(""),[o,s]=_.useState([]),l=_.useRef(null);_.useEffect(()=>{var E;(E=l.current)==null||E.focus()},[]);const c=_.useMemo(()=>tN(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),d=_.useMemo(()=>nN(c,n),[c,n]),f=_.useMemo(()=>new Set(e.tree.map(E=>E.id)),[e.tree]),p=_.useMemo(()=>new Set(d.flatMap(E=>E.lessons.map(T=>T.id))),[d]),x=_.useMemo(()=>new Map(e.tree.map(E=>[E.id,E])),[e.tree]),b=_.useMemo(()=>new Map(c.map(E=>[E.section.id,E.chapterLessonsMastered])),[c]);_.useEffect(()=>{const E=n.trim();if(E.length<2){s([]);return}const T=setTimeout(()=>{me.searchContent(E).then(w=>{s(w.filter(M=>f.has(M.nodeId)&&!p.has(M.nodeId)).slice(0,8))}).catch(()=>s([]))},250);return()=>clearTimeout(T)},[n,f,p]);const g=_.useMemo(()=>{for(const E of d){const T=E.lessons.find(w=>!c0(w,e.progressMap,E.chapterLessonsMastered));if(T)return T}return null},[d,e.progressMap]),y=d.length>0||o.length>0;return m.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:[m.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:[m.jsx(op,{className:"w-4 h-4 text-white/50 shrink-0"}),m.jsx("input",{ref:l,value:n,onChange:E=>i(E.target.value),onKeyDown:E=>{E.key==="Enter"&&g&&e.onJump(g)},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&&m.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:m.jsx(la,{className:"w-3.5 h-3.5"})}),m.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:m.jsx(la,{className:"w-3.5 h-3.5"})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!y&&m.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)=>m.jsx(rN,{row:E,sectionIndex:T,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},E.section.id)),o.length>0&&m.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[m.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=x.get(E.nodeId);if(!T)return null;const w=c0(T,e.progressMap,b.get(T.parentId??"")??!1);return m.jsxs("button",{disabled:w,"data-testid":`search-content-row-${T.id.slice(0,8)}`,onClick:()=>!w&&e.onJump(T),className:`w-full text-left px-2 py-1.5 rounded-lg transition-colors ${w?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${T.id===e.selectedNodeId?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),m.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:m.jsx(d0,{text:E.title,query:n})})]}),m.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:E.snippet})]},E.nodeId)})]})]})]})}function rN({row:e,sectionIndex:t,query:n,progressMap:i,selectedNodeId:o,onPick:s}){const l=Ve(),c=(e.section.world??"study")==="practice";return m.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[m.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[m.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}),m.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:m.jsx(d0,{text:e.section.title,query:n})}),c&&m.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 f=c0(d,i,e.chapterLessonsMastered),p=((b=i[d.id])==null?void 0:b.status)??"locked",x=d.type==="exam";return m.jsxs("button",{disabled:f,"data-testid":`search-row-${d.id.slice(0,8)}`,onClick:()=>!f&&s(d),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors ${f?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${d.id===o?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[f?m.jsx(CC,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):x?m.jsx(Ls,{className:"w-3.5 h-3.5 text-accent shrink-0"}):p==="mastered"?m.jsx(yE,{className:"w-3.5 h-3.5 text-gold shrink-0"}):m.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),m.jsx("span",{className:"flex-1 text-label text-white truncate",children:m.jsx(d0,{text:d.title,query:n})})]},d.id)})]})}function d0({text:e,query:t}){const n=aN(e,t);return n?m.jsxs(m.Fragment,{children:[e.slice(0,n[0]),m.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):m.jsx(m.Fragment,{children:e})}const sN=268,hp=28,oN=20,DE=hp*2+oN,lN=DE+8,uN=104,cN=18,Jh=hp+6,dN=26,fN=22;function f0(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 hN(e,t=sN,n=""){const i=[],o=t/2,s=t/2-cN-hp;for(let d=0;d<e;d++){const f=Jh+d*uN,x=f0(`${n}:${d}`)/4294967295*2-1,b=o+x*s,y=f0(`${n}:${d}:y`)/4294967295*2-1,E=f+y*dN;i.push({x:b,y:E,index:d})}if(i.length>0){i[0].y<Jh&&(i[0].y=Jh);for(let d=1;d<i.length;d++){const f=i[d-1].y+lN;i[d].y<f&&(i[d].y=f)}}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+DE/2+10;return{nodes:i,segments:l,height:c}}function mN(e){const{from:t,to:n}=e,i=(t.y+n.y)/2+fN;return`M ${t.x} ${t.y} C ${t.x} ${i}, ${n.x} ${i}, ${n.x} ${n.y}`}var Nc={exports:{}};/*!
494
+ * matter-js 0.19.0 by @liabru
495
+ * http://brm.io/matter-js/
496
+ * License MIT
497
+ *
498
+ * The MIT License (MIT)
499
+ *
500
+ * Copyright (c) Liam Brummitt and contributors.
501
+ *
502
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
503
+ * of this software and associated documentation files (the "Software"), to deal
504
+ * in the Software without restriction, including without limitation the rights
505
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
506
+ * copies of the Software, and to permit persons to whom the Software is
507
+ * furnished to do so, subject to the following conditions:
508
+ *
509
+ * The above copyright notice and this permission notice shall be included in
510
+ * all copies or substantial portions of the Software.
511
+ *
512
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
513
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
514
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
515
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
516
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
517
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
518
+ * THE SOFTWARE.
519
+ */var pN=Nc.exports,fy;function gN(){return fy||(fy=1,(function(e,t){(function(i,o){e.exports=o()})(pN,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(f){return s[f]}).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,f;typeof c=="boolean"?(d=2,f=c):(d=1,f=!0);for(var p=d;p<arguments.length;p++){var x=arguments[p];if(x)for(var b in x)f&&x[b]&&x[b].constructor===Object&&(!l[b]||l[b].constructor===Object)?(l[b]=l[b]||{},o.extend(l[b],f,x[b])):l[b]=x[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),f=0;f<d.length;f++)c.push(l[d[f]]);return c}for(var p in l)c.push(l[p]);return c},o.get=function(l,c,d,f){c=c.split(".").slice(d,f);for(var p=0;p<c.length;p+=1)l=l[c[p]];return l},o.set=function(l,c,d,f,p){var x=c.split(".").slice(f,p);return o.get(l,c,0,-1)[x[x.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)),f=l[c];l[c]=l[d],l[d]=f}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=[],f=0;f<l.length;f+=1)d.push(c(l[f]));return d},o.topologicalSort=function(l){var c=[],d=[],f=[];for(var p in l)!d[p]&&!f[p]&&o._topologicalSort(p,d,f,l,c);return c},o._topologicalSort=function(l,c,d,f,p){var x=f[l]||[];d[l]=!0;for(var b=0;b<x.length;b+=1){var g=x[b];d[g]||c[g]||o._topologicalSort(g,c,d,f,p)}d[l]=!1,c[l]=!0,p.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 f=function(){for(var p,x=new Array(arguments.length),b=0,g=arguments.length;b<g;b++)x[b]=arguments[b];for(b=0;b<l.length;b+=1){var y=l[b].apply(p,x);typeof y<"u"&&(p=y)}return p};return f._chained=l,f},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 Wb<"u"&&(l=Wb.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 f=l[d];f.x>s.max.x&&(s.max.x=f.x),f.x<s.min.x&&(s.min.x=f.x),f.y>s.max.y&&(s.max.y=f.y),f.y<s.min.y&&(s.min.y=f.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),f=Math.sin(l);c||(c={});var p=s.x*d-s.y*f;return c.y=s.x*f+s.y*d,c.x=p,c},o.rotateAbout=function(s,l,c,d){var f=Math.cos(l),p=Math.sin(l);d||(d={});var x=c.x+((s.x-c.x)*f-(s.y-c.y)*p);return d.y=c.y+((s.x-c.x)*p+(s.y-c.y)*f),d.x=x,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,f){for(var p=[],x=0;x<d.length;x++){var b=d[x],g={x:b.x,y:b.y,index:x,body:f,isInternal:!1};p.push(g)}return p},s.fromPath=function(d,f){var p=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,x=[];return d.replace(p,function(b,g,y){x.push({x:parseFloat(g),y:parseFloat(y)})}),s.create(x,f)},s.centre=function(d){for(var f=s.area(d,!0),p={x:0,y:0},x,b,g,y=0;y<d.length;y++)g=(y+1)%d.length,x=l.cross(d[y],d[g]),b=l.mult(l.add(d[y],d[g]),x),p=l.add(p,b);return l.div(p,6*f)},s.mean=function(d){for(var f={x:0,y:0},p=0;p<d.length;p++)f.x+=d[p].x,f.y+=d[p].y;return l.div(f,d.length)},s.area=function(d,f){for(var p=0,x=d.length-1,b=0;b<d.length;b++)p+=(d[x].x-d[b].x)*(d[x].y+d[b].y),x=b;return f?p/2:Math.abs(p)/2},s.inertia=function(d,f){for(var p=0,x=0,b=d,g,y,E=0;E<b.length;E++)y=(E+1)%b.length,g=Math.abs(l.cross(b[y],b[E])),p+=g*(l.dot(b[y],b[y])+l.dot(b[y],b[E])+l.dot(b[E],b[E])),x+=g;return f/6*(p/x)},s.translate=function(d,f,p){p=typeof p<"u"?p:1;var x=d.length,b=f.x*p,g=f.y*p,y;for(y=0;y<x;y++)d[y].x+=b,d[y].y+=g;return d},s.rotate=function(d,f,p){if(f!==0){var x=Math.cos(f),b=Math.sin(f),g=p.x,y=p.y,E=d.length,T,w,M,N;for(N=0;N<E;N++)T=d[N],w=T.x-g,M=T.y-y,T.x=g+(w*x-M*b),T.y=y+(w*b+M*x);return d}},s.contains=function(d,f){for(var p=f.x,x=f.y,b=d.length,g=d[b-1],y,E=0;E<b;E++){if(y=d[E],(p-g.x)*(y.y-g.y)+(x-g.y)*(g.x-y.x)>0)return!1;g=y}return!0},s.scale=function(d,f,p,x){if(f===1&&p===1)return d;x=x||s.centre(d);for(var b,g,y=0;y<d.length;y++)b=d[y],g=l.sub(b,x),d[y].x=x.x+g.x*f,d[y].y=x.y+g.y*p;return d},s.chamfer=function(d,f,p,x,b){typeof f=="number"?f=[f]:f=f||[8],p=typeof p<"u"?p:-1,x=x||2,b=b||14;for(var g=[],y=0;y<d.length;y++){var E=d[y-1>=0?y-1:d.length-1],T=d[y],w=d[(y+1)%d.length],M=f[y<f.length?y:f.length-1];if(M===0){g.push(T);continue}var N=l.normalise({x:T.y-E.y,y:E.x-T.x}),L=l.normalise({x:w.y-T.y,y:T.x-w.x}),A=Math.sqrt(2*Math.pow(M,2)),C=l.mult(c.clone(N),M),I=l.normalise(l.mult(l.add(N,L),.5)),R=l.sub(T,l.mult(I,A)),j=p;p===-1&&(j=Math.pow(M,.32)*1.75),j=c.clamp(j,x,b),j%2===1&&(j+=1);for(var D=Math.acos(l.dot(N,L)),P=D/j,B=0;B<j;B++)g.push(l.add(l.rotate(C,P*B),R))}return g},s.clockwiseSort=function(d){var f=s.mean(d);return d.sort(function(p,x){return l.angle(f,p)-l.angle(f,x)}),d},s.isConvex=function(d){var f=0,p=d.length,x,b,g,y;if(p<3)return null;for(x=0;x<p;x++)if(b=(x+1)%p,g=(x+2)%p,y=(d[b].x-d[x].x)*(d[g].y-d[b].y),y-=(d[b].y-d[x].y)*(d[g].x-d[b].x),y<0?f|=1:y>0&&(f|=2),f===3)return!1;return f!==0?!0:null},s.hull=function(d){var f=[],p=[],x,b;for(d=d.slice(0),d.sort(function(g,y){var E=g.x-y.x;return E!==0?E:g.y-y.y}),b=0;b<d.length;b+=1){for(x=d[b];p.length>=2&&l.cross3(p[p.length-2],p[p.length-1],x)<=0;)p.pop();p.push(x)}for(b=d.length-1;b>=0;b-=1){for(x=d[b];f.length>=2&&l.cross3(f[f.length-2],f[f.length-1],x)<=0;)f.pop();f.push(x)}return f.pop(),p.pop(),f.concat(p)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),f=o(0),p=o(1),x=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(g){var y={id:f.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=f.extend(y,g);return b(E,g),E},s.nextGroup=function(g){return g?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var b=function(g,y){y=y||{},s.set(g,{bounds:g.bounds||p.create(g.vertices),positionPrev:g.positionPrev||c.clone(g.position),anglePrev:g.anglePrev||g.angle,vertices:g.vertices,parts:g.parts||[g],isStatic:g.isStatic,isSleeping:g.isSleeping,parent:g.parent||g}),l.rotate(g.vertices,g.angle,g.position),x.rotate(g.axes,g.angle),p.update(g.bounds,g.vertices,g.velocity),s.set(g,{axes:y.axes||g.axes,area:y.area||g.area,mass:y.mass||g.mass,inertia:y.inertia||g.inertia});var E=g.isStatic?"#14151f":f.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),T=g.isStatic?"#555":"#ccc",w=g.isStatic&&g.render.fillStyle===null?1:0;g.render.fillStyle=g.render.fillStyle||E,g.render.strokeStyle=g.render.strokeStyle||T,g.render.lineWidth=g.render.lineWidth||w,g.render.sprite.xOffset+=-(g.bounds.min.x-g.position.x)/(g.bounds.max.x-g.bounds.min.x),g.render.sprite.yOffset+=-(g.bounds.min.y-g.position.y)/(g.bounds.max.y-g.bounds.min.y)};s.set=function(g,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(g,E);break;case"isSleeping":d.set(g,E);break;case"mass":s.setMass(g,E);break;case"density":s.setDensity(g,E);break;case"inertia":s.setInertia(g,E);break;case"vertices":s.setVertices(g,E);break;case"position":s.setPosition(g,E);break;case"angle":s.setAngle(g,E);break;case"velocity":s.setVelocity(g,E);break;case"angularVelocity":s.setAngularVelocity(g,E);break;case"speed":s.setSpeed(g,E);break;case"angularSpeed":s.setAngularSpeed(g,E);break;case"parts":s.setParts(g,E);break;case"centre":s.setCentre(g,E);break;default:g[T]=E}},s.setStatic=function(g,y){for(var E=0;E<g.parts.length;E++){var T=g.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(g,y){var E=g.inertia/(g.mass/6);g.inertia=E*(y/6),g.inverseInertia=1/g.inertia,g.mass=y,g.inverseMass=1/g.mass,g.density=g.mass/g.area},s.setDensity=function(g,y){s.setMass(g,y*g.area),g.density=y},s.setInertia=function(g,y){g.inertia=y,g.inverseInertia=1/g.inertia},s.setVertices=function(g,y){y[0].body===g?g.vertices=y:g.vertices=l.create(y,g),g.axes=x.fromVertices(g.vertices),g.area=l.area(g.vertices),s.setMass(g,g.density*g.area);var E=l.centre(g.vertices);l.translate(g.vertices,E,-1),s.setInertia(g,s._inertiaScale*l.inertia(g.vertices,g.mass)),l.translate(g.vertices,g.position),p.update(g.bounds,g.vertices,g.velocity)},s.setParts=function(g,y,E){var T;for(y=y.slice(0),g.parts.length=0,g.parts.push(g),g.parent=g,T=0;T<y.length;T++){var w=y[T];w!==g&&(w.parent=g,g.parts.push(w))}if(g.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),L=l.centre(N);s.setVertices(g,N),l.translate(g.vertices,L)}var A=s._totalProperties(g);g.area=A.area,g.parent=g,g.position.x=A.centre.x,g.position.y=A.centre.y,g.positionPrev.x=A.centre.x,g.positionPrev.y=A.centre.y,s.setMass(g,A.mass),s.setInertia(g,A.inertia),s.setPosition(g,A.centre)}},s.setCentre=function(g,y,E){E?(g.positionPrev.x+=y.x,g.positionPrev.y+=y.y,g.position.x+=y.x,g.position.y+=y.y):(g.positionPrev.x=y.x-(g.position.x-g.positionPrev.x),g.positionPrev.y=y.y-(g.position.y-g.positionPrev.y),g.position.x=y.x,g.position.y=y.y)},s.setPosition=function(g,y,E){var T=c.sub(y,g.position);E?(g.positionPrev.x=g.position.x,g.positionPrev.y=g.position.y,g.velocity.x=T.x,g.velocity.y=T.y,g.speed=c.magnitude(T)):(g.positionPrev.x+=T.x,g.positionPrev.y+=T.y);for(var w=0;w<g.parts.length;w++){var M=g.parts[w];M.position.x+=T.x,M.position.y+=T.y,l.translate(M.vertices,T),p.update(M.bounds,M.vertices,g.velocity)}},s.setAngle=function(g,y,E){var T=y-g.angle;E?(g.anglePrev=g.angle,g.angularVelocity=T,g.angularSpeed=Math.abs(T)):g.anglePrev+=T;for(var w=0;w<g.parts.length;w++){var M=g.parts[w];M.angle+=T,l.rotate(M.vertices,T,g.position),x.rotate(M.axes,T),p.update(M.bounds,M.vertices,g.velocity),w>0&&c.rotateAbout(M.position,T,g.position,M.position)}},s.setVelocity=function(g,y){var E=g.deltaTime/s._baseDelta;g.positionPrev.x=g.position.x-y.x*E,g.positionPrev.y=g.position.y-y.y*E,g.velocity.x=(g.position.x-g.positionPrev.x)/E,g.velocity.y=(g.position.y-g.positionPrev.y)/E,g.speed=c.magnitude(g.velocity)},s.getVelocity=function(g){var y=s._baseDelta/g.deltaTime;return{x:(g.position.x-g.positionPrev.x)*y,y:(g.position.y-g.positionPrev.y)*y}},s.getSpeed=function(g){return c.magnitude(s.getVelocity(g))},s.setSpeed=function(g,y){s.setVelocity(g,c.mult(c.normalise(s.getVelocity(g)),y))},s.setAngularVelocity=function(g,y){var E=g.deltaTime/s._baseDelta;g.anglePrev=g.angle-y*E,g.angularVelocity=(g.angle-g.anglePrev)/E,g.angularSpeed=Math.abs(g.angularVelocity)},s.getAngularVelocity=function(g){return(g.angle-g.anglePrev)*s._baseDelta/g.deltaTime},s.getAngularSpeed=function(g){return Math.abs(s.getAngularVelocity(g))},s.setAngularSpeed=function(g,y){s.setAngularVelocity(g,f.sign(s.getAngularVelocity(g))*y)},s.translate=function(g,y,E){s.setPosition(g,c.add(g.position,y),E)},s.rotate=function(g,y,E,T){if(!E)s.setAngle(g,g.angle+y,T);else{var w=Math.cos(y),M=Math.sin(y),N=g.position.x-E.x,L=g.position.y-E.y;s.setPosition(g,{x:E.x+(N*w-L*M),y:E.y+(N*M+L*w)},T),s.setAngle(g,g.angle+y,T)}},s.scale=function(g,y,E,T){var w=0,M=0;T=T||g.position;for(var N=0;N<g.parts.length;N++){var L=g.parts[N];l.scale(L.vertices,y,E,T),L.axes=x.fromVertices(L.vertices),L.area=l.area(L.vertices),s.setMass(L,g.density*L.area),l.translate(L.vertices,{x:-L.position.x,y:-L.position.y}),s.setInertia(L,s._inertiaScale*l.inertia(L.vertices,L.mass)),l.translate(L.vertices,{x:L.position.x,y:L.position.y}),N>0&&(w+=L.area,M+=L.inertia),L.position.x=T.x+(L.position.x-T.x)*y,L.position.y=T.y+(L.position.y-T.y)*E,p.update(L.bounds,L.vertices,g.velocity)}g.parts.length>1&&(g.area=w,g.isStatic||(s.setMass(g,g.density*w),s.setInertia(g,M))),g.circleRadius&&(y===E?g.circleRadius*=y:g.circleRadius=null)},s.update=function(g,y){y=(typeof y<"u"?y:1e3/60)*g.timeScale;var E=y*y,T=s._timeCorrection?y/(g.deltaTime||y):1,w=1-g.frictionAir*(y/f._baseDelta),M=(g.position.x-g.positionPrev.x)*T,N=(g.position.y-g.positionPrev.y)*T;g.velocity.x=M*w+g.force.x/g.mass*E,g.velocity.y=N*w+g.force.y/g.mass*E,g.positionPrev.x=g.position.x,g.positionPrev.y=g.position.y,g.position.x+=g.velocity.x,g.position.y+=g.velocity.y,g.deltaTime=y,g.angularVelocity=(g.angle-g.anglePrev)*w*T+g.torque/g.inertia*E,g.anglePrev=g.angle,g.angle+=g.angularVelocity;for(var L=0;L<g.parts.length;L++){var A=g.parts[L];l.translate(A.vertices,g.velocity),L>0&&(A.position.x+=g.velocity.x,A.position.y+=g.velocity.y),g.angularVelocity!==0&&(l.rotate(A.vertices,g.angularVelocity,g.position),x.rotate(A.axes,g.angularVelocity),L>0&&c.rotateAbout(A.position,g.angularVelocity,g.position,A.position)),p.update(A.bounds,A.vertices,g.velocity)}},s.updateVelocities=function(g){var y=s._baseDelta/g.deltaTime,E=g.velocity;E.x=(g.position.x-g.positionPrev.x)*y,E.y=(g.position.y-g.positionPrev.y)*y,g.speed=Math.sqrt(E.x*E.x+E.y*E.y),g.angularVelocity=(g.angle-g.anglePrev)*y,g.angularSpeed=Math.abs(g.angularVelocity)},s.applyForce=function(g,y,E){var T={x:y.x-g.position.x,y:y.y-g.position.y};g.force.x+=E.x,g.force.y+=E.y,g.torque+=T.x*E.y-T.y*E.x},s._totalProperties=function(g){for(var y={mass:0,area:0,inertia:0,centre:{x:0,y:0}},E=g.parts.length===1?0:1;E<g.parts.length;E++){var T=g.parts[E],w=T.mass!==1/0?T.mass:1;y.mass+=w,y.area+=T.area,y.inertia+=T.inertia,y.centre=c.add(y.centre,c.mult(T.position,w))}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,f){for(var p=d.split(" "),x,b=0;b<p.length;b++)x=p[b],c.events=c.events||{},c.events[x]=c.events[x]||[],c.events[x].push(f);return f},s.off=function(c,d,f){if(!d){c.events={};return}typeof d=="function"&&(f=d,d=l.keys(c.events).join(" "));for(var p=d.split(" "),x=0;x<p.length;x++){var b=c.events[p[x]],g=[];if(f&&b)for(var y=0;y<b.length;y++)b[y]!==f&&g.push(b[y]);c.events[p[x]]=g}},s.trigger=function(c,d,f){var p,x,b,g,y=c.events;if(y&&l.keys(y).length>0){f||(f={}),p=d.split(" ");for(var E=0;E<p.length;E++)if(x=p[E],b=y[x],b){g=l.clone(f,!1),g.name=x,g.source=c;for(var T=0;T<b.length;T++)b[T].apply(c,[g])}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(0),d=o(1),f=o(4);(function(){s.create=function(p){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}},p)},s.setModified=function(p,x,b,g){if(p.isModified=x,x&&p.cache&&(p.cache.allBodies=null,p.cache.allConstraints=null,p.cache.allComposites=null),b&&p.parent&&s.setModified(p.parent,x,b,g),g)for(var y=0;y<p.composites.length;y++){var E=p.composites[y];s.setModified(E,x,b,g)}},s.add=function(p,x){var b=[].concat(x);l.trigger(p,"beforeAdd",{object:x});for(var g=0;g<b.length;g++){var y=b[g];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(p,y);break;case"constraint":s.addConstraint(p,y);break;case"composite":s.addComposite(p,y);break;case"mouseConstraint":s.addConstraint(p,y.constraint);break}}return l.trigger(p,"afterAdd",{object:x}),p},s.remove=function(p,x,b){var g=[].concat(x);l.trigger(p,"beforeRemove",{object:x});for(var y=0;y<g.length;y++){var E=g[y];switch(E.type){case"body":s.removeBody(p,E,b);break;case"constraint":s.removeConstraint(p,E,b);break;case"composite":s.removeComposite(p,E,b);break;case"mouseConstraint":s.removeConstraint(p,E.constraint);break}}return l.trigger(p,"afterRemove",{object:x}),p},s.addComposite=function(p,x){return p.composites.push(x),x.parent=p,s.setModified(p,!0,!0,!1),p},s.removeComposite=function(p,x,b){var g=c.indexOf(p.composites,x);if(g!==-1&&s.removeCompositeAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeComposite(p.composites[y],x,!0);return p},s.removeCompositeAt=function(p,x){return p.composites.splice(x,1),s.setModified(p,!0,!0,!1),p},s.addBody=function(p,x){return p.bodies.push(x),s.setModified(p,!0,!0,!1),p},s.removeBody=function(p,x,b){var g=c.indexOf(p.bodies,x);if(g!==-1&&s.removeBodyAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeBody(p.composites[y],x,!0);return p},s.removeBodyAt=function(p,x){return p.bodies.splice(x,1),s.setModified(p,!0,!0,!1),p},s.addConstraint=function(p,x){return p.constraints.push(x),s.setModified(p,!0,!0,!1),p},s.removeConstraint=function(p,x,b){var g=c.indexOf(p.constraints,x);if(g!==-1&&s.removeConstraintAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeConstraint(p.composites[y],x,!0);return p},s.removeConstraintAt=function(p,x){return p.constraints.splice(x,1),s.setModified(p,!0,!0,!1),p},s.clear=function(p,x,b){if(b)for(var g=0;g<p.composites.length;g++)s.clear(p.composites[g],x,!0);return x?p.bodies=p.bodies.filter(function(y){return y.isStatic}):p.bodies.length=0,p.constraints.length=0,p.composites.length=0,s.setModified(p,!0,!0,!1),p},s.allBodies=function(p){if(p.cache&&p.cache.allBodies)return p.cache.allBodies;for(var x=[].concat(p.bodies),b=0;b<p.composites.length;b++)x=x.concat(s.allBodies(p.composites[b]));return p.cache&&(p.cache.allBodies=x),x},s.allConstraints=function(p){if(p.cache&&p.cache.allConstraints)return p.cache.allConstraints;for(var x=[].concat(p.constraints),b=0;b<p.composites.length;b++)x=x.concat(s.allConstraints(p.composites[b]));return p.cache&&(p.cache.allConstraints=x),x},s.allComposites=function(p){if(p.cache&&p.cache.allComposites)return p.cache.allComposites;for(var x=[].concat(p.composites),b=0;b<p.composites.length;b++)x=x.concat(s.allComposites(p.composites[b]));return p.cache&&(p.cache.allComposites=x),x},s.get=function(p,x,b){var g,y;switch(b){case"body":g=s.allBodies(p);break;case"constraint":g=s.allConstraints(p);break;case"composite":g=s.allComposites(p).concat(p);break}return g?(y=g.filter(function(E){return E.id.toString()===x.toString()}),y.length===0?null:y[0]):null},s.move=function(p,x,b){return s.remove(p,x),s.add(b,x),p},s.rebase=function(p){for(var x=s.allBodies(p).concat(s.allConstraints(p)).concat(s.allComposites(p)),b=0;b<x.length;b++)x[b].id=c.nextId();return p},s.translate=function(p,x,b){for(var g=b?s.allBodies(p):p.bodies,y=0;y<g.length;y++)f.translate(g[y],x);return p},s.rotate=function(p,x,b,g){for(var y=Math.cos(x),E=Math.sin(x),T=g?s.allBodies(p):p.bodies,w=0;w<T.length;w++){var M=T[w],N=M.position.x-b.x,L=M.position.y-b.y;f.setPosition(M,{x:b.x+(N*y-L*E),y:b.y+(N*E+L*y)}),f.rotate(M,x)}return p},s.scale=function(p,x,b,g,y){for(var E=y?s.allBodies(p):p.bodies,T=0;T<E.length;T++){var w=E[T],M=w.position.x-g.x,N=w.position.y-g.y;f.setPosition(w,{x:g.x+M*x,y:g.y+N*b}),f.scale(w,x,b)}return p},s.bounds=function(p){for(var x=s.allBodies(p),b=[],g=0;g<x.length;g+=1){var y=x[g];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(f,p){for(var x=p/d._baseDelta,b=s._motionSleepThreshold,g=0;g<f.length;g++){var y=f[g],E=l.getSpeed(y),T=l.getAngularSpeed(y),w=E*E+T*T;if(y.force.x!==0||y.force.y!==0){s.set(y,!1);continue}var M=Math.min(y.motion,w),N=Math.max(y.motion,w);y.motion=s._minBias*M+(1-s._minBias)*N,y.sleepThreshold>0&&y.motion<b?(y.sleepCounter+=1,y.sleepCounter>=y.sleepThreshold/x&&s.set(y,!0)):y.sleepCounter>0&&(y.sleepCounter-=1)}},s.afterCollisions=function(f){for(var p=s._motionSleepThreshold,x=0;x<f.length;x++){var b=f[x];if(b.isActive){var g=b.collision,y=g.bodyA.parent,E=g.bodyB.parent;if(!(y.isSleeping&&E.isSleeping||y.isStatic||E.isStatic)&&(y.isSleeping||E.isSleeping)){var T=y.isSleeping&&!y.isStatic?y:E,w=T===y?E:y;!T.isStatic&&w.motion>p&&s.set(T,!1)}}}},s.set=function(f,p){var x=f.isSleeping;p?(f.isSleeping=!0,f.sleepCounter=f.sleepThreshold,f.positionImpulse.x=0,f.positionImpulse.y=0,f.positionPrev.x=f.position.x,f.positionPrev.y=f.position.y,f.anglePrev=f.angle,f.speed=0,f.angularSpeed=0,f.motion=0,x||c.trigger(f,"sleepStart")):(f.isSleeping=!1,f.sleepCounter=0,x&&c.trigger(f,"sleepEnd"))}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(9);(function(){var d=[],f={overlap:0,axis:null},p={overlap:0,axis:null};s.create=function(x,b){return{pair:null,collided:!1,bodyA:x,bodyB:b,parentA:x.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(x,b,g){if(s._overlapAxes(f,x.vertices,b.vertices,x.axes),f.overlap<=0||(s._overlapAxes(p,b.vertices,x.vertices,b.axes),p.overlap<=0))return null;var y=g&&g.table[c.id(x,b)],E;y?E=y.collision:(E=s.create(x,b),E.collided=!0,E.bodyA=x.id<b.id?x:b,E.bodyB=x.id<b.id?b:x,E.parentA=E.bodyA.parent,E.parentB=E.bodyB.parent),x=E.bodyA,b=E.bodyB;var T;f.overlap<p.overlap?T=f:T=p;var w=E.normal,M=E.supports,N=T.axis,L=N.x,A=N.y;L*(b.position.x-x.position.x)+A*(b.position.y-x.position.y)<0?(w.x=L,w.y=A):(w.x=-L,w.y=-A),E.tangent.x=-w.y,E.tangent.y=w.x,E.depth=T.overlap,E.penetration.x=w.x*E.depth,E.penetration.y=w.y*E.depth;var C=s._findSupports(x,b,w,1),I=0;if(l.contains(x.vertices,C[0])&&(M[I++]=C[0]),l.contains(x.vertices,C[1])&&(M[I++]=C[1]),I<2){var R=s._findSupports(b,x,w,-1);l.contains(b.vertices,R[0])&&(M[I++]=R[0]),I<2&&l.contains(b.vertices,R[1])&&(M[I++]=R[1])}return I===0&&(M[I++]=C[0]),M.length=I,E},s._overlapAxes=function(x,b,g,y){var E=b.length,T=g.length,w=b[0].x,M=b[0].y,N=g[0].x,L=g[0].y,A=y.length,C=Number.MAX_VALUE,I=0,R,j,D,P,B,Q;for(B=0;B<A;B++){var q=y[B],z=q.x,H=q.y,G=w*z+M*H,Z=N*z+L*H,ie=G,F=Z;for(Q=1;Q<E;Q+=1)P=b[Q].x*z+b[Q].y*H,P>ie?ie=P:P<G&&(G=P);for(Q=1;Q<T;Q+=1)P=g[Q].x*z+g[Q].y*H,P>F?F=P:P<Z&&(Z=P);if(j=ie-Z,D=F-G,R=j<D?j:D,R<C&&(C=R,I=B,R<=0))break}x.axis=y[I],x.overlap=C},s._projectToAxis=function(x,b,g){for(var y=b[0].x*g.x+b[0].y*g.y,E=y,T=1;T<b.length;T+=1){var w=b[T].x*g.x+b[T].y*g.y;w>E?E=w:w<y&&(y=w)}x.min=y,x.max=E},s._findSupports=function(x,b,g,y){var E=b.vertices,T=E.length,w=x.position.x,M=x.position.y,N=g.x*y,L=g.y*y,A=Number.MAX_VALUE,C,I,R,j,D;for(D=0;D<T;D+=1)I=E[D],j=N*(w-I.x)+L*(M-I.y),j<A&&(A=j,C=I);return R=E[(T+C.index-1)%T],A=N*(w-R.x)+L*(M-R.y),I=E[(C.index+1)%T],N*(w-I.x)+L*(M-I.y)<A?(d[0]=C,d[1]=I,d):(d[0]=C,d[1]=R,d)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(16);(function(){s.create=function(c,d){var f=c.bodyA,p=c.bodyB,x={id:s.id(f,p),bodyA:f,bodyB:p,collision:c,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:f.isSensor||p.isSensor,timeCreated:d,timeUpdated:d,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(x,c,d),x},s.update=function(c,d,f){var p=c.contacts,x=d.supports,b=c.activeContacts,g=d.parentA,y=d.parentB,E=g.vertices.length;c.isActive=!0,c.timeUpdated=f,c.collision=d,c.separation=d.depth,c.inverseMass=g.inverseMass+y.inverseMass,c.friction=g.friction<y.friction?g.friction:y.friction,c.frictionStatic=g.frictionStatic>y.frictionStatic?g.frictionStatic:y.frictionStatic,c.restitution=g.restitution>y.restitution?g.restitution:y.restitution,c.slop=g.slop>y.slop?g.slop:y.slop,d.pair=c,b.length=0;for(var T=0;T<x.length;T++){var w=x[T],M=w.body===g?w.index:E+w.index,N=p[M];N?b.push(N):b.push(p[M]=l.create(w))}},s.setActive=function(c,d,f){d?(c.isActive=!0,c.timeUpdated=f):(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),f=o(1),p=o(11),x=o(0);(function(){s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(b){var g=b;g.bodyA&&!g.pointA&&(g.pointA={x:0,y:0}),g.bodyB&&!g.pointB&&(g.pointB={x:0,y:0});var y=g.bodyA?c.add(g.bodyA.position,g.pointA):g.pointA,E=g.bodyB?c.add(g.bodyB.position,g.pointB):g.pointB,T=c.magnitude(c.sub(y,E));g.length=typeof g.length<"u"?g.length:T,g.id=g.id||x.nextId(),g.label=g.label||"Constraint",g.type="constraint",g.stiffness=g.stiffness||(g.length>0?1:.7),g.damping=g.damping||0,g.angularStiffness=g.angularStiffness||0,g.angleA=g.bodyA?g.bodyA.angle:g.angleA,g.angleB=g.bodyB?g.bodyB.angle:g.angleB,g.plugin={};var w={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return g.length===0&&g.stiffness>.1?(w.type="pin",w.anchors=!1):g.stiffness<.9&&(w.type="spring"),g.render=x.extend(w,g.render),g},s.preSolveAll=function(b){for(var g=0;g<b.length;g+=1){var y=b[g],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,g){for(var y=x.clamp(g/x._baseDelta,0,1),E=0;E<b.length;E+=1){var T=b[E],w=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic;(w||M)&&s.solve(b[E],y)}for(E=0;E<b.length;E+=1)T=b[E],w=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic,!w&&!M&&s.solve(b[E],y)},s.solve=function(b,g){var y=b.bodyA,E=b.bodyB,T=b.pointA,w=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(w,E.angle-b.angleB,w),b.angleB=E.angle);var M=T,N=w;if(y&&(M=c.add(y.position,T)),E&&(N=c.add(E.position,w)),!(!M||!N)){var L=c.sub(M,N),A=c.magnitude(L);A<s._minLength&&(A=s._minLength);var C=(A-b.length)/A,I=b.stiffness>=1||b.length===0,R=I?b.stiffness*g:b.stiffness*g*g,j=b.damping*g,D=c.mult(L,C*R),P=(y?y.inverseMass:0)+(E?E.inverseMass:0),B=(y?y.inverseInertia:0)+(E?E.inverseInertia:0),Q=P+B,q,z,H,G,Z;if(j>0){var ie=c.create();H=c.div(L,A),Z=c.sub(E&&c.sub(E.position,E.positionPrev)||ie,y&&c.sub(y.position,y.positionPrev)||ie),G=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*G*z,y.positionPrev.y-=j*H.y*G*z),q=c.cross(T,D)/Q*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*G*z,E.positionPrev.y+=j*H.y*G*z),q=c.cross(w,D)/Q*s._torqueDampen*E.inverseInertia*(1-b.angularStiffness),E.constraintImpulse.angle+=q,E.angle+=q)}}},s.postSolveAll=function(b){for(var g=0;g<b.length;g++){var y=b[g],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 w=y.parts[T];l.translate(w.vertices,E),T>0&&(w.position.x+=E.x,w.position.y+=E.y),E.angle!==0&&(l.rotate(w.vertices,E.angle,y.position),p.rotate(w.axes,E.angle),T>0&&c.rotateAbout(w.position,E.angle,y.position,w.position)),f.update(w.bounds,w.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 f={},p=0;p<d.length;p++){var x=(p+1)%d.length,b=l.normalise({x:d[x].y-d[p].y,y:d[p].x-d[x].x}),g=b.y===0?1/0:b.x/b.y;g=g.toFixed(3).toString(),f[g]=b}return c.values(f)},s.rotate=function(d,f){if(f!==0)for(var p=Math.cos(f),x=Math.sin(f),b=0;b<d.length;b++){var g=d[b],y;y=g.x*p-g.y*x,g.y=g.x*x+g.y*p,g.x=y}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(4),f=o(1),p=o(2);(function(){s.rectangle=function(x,b,g,y,E){E=E||{};var T={label:"Rectangle Body",position:{x,y:b},vertices:l.fromPath("L 0 0 L "+g+" 0 L "+g+" "+y+" L 0 "+y)};if(E.chamfer){var w=E.chamfer;T.vertices=l.chamfer(T.vertices,w.radius,w.quality,w.qualityMin,w.qualityMax),delete E.chamfer}return d.create(c.extend({},T,E))},s.trapezoid=function(x,b,g,y,E,T){T=T||{},E*=.5;var w=(1-E*2)*g,M=g*E,N=M+w,L=N+M,A;E<.5?A="L 0 0 L "+M+" "+-y+" L "+N+" "+-y+" L "+L+" 0":A="L 0 0 L "+N+" "+-y+" L "+L+" 0";var C={label:"Trapezoid Body",position:{x,y:b},vertices:l.fromPath(A)};if(T.chamfer){var I=T.chamfer;C.vertices=l.chamfer(C.vertices,I.radius,I.quality,I.qualityMin,I.qualityMax),delete T.chamfer}return d.create(c.extend({},C,T))},s.circle=function(x,b,g,y,E){y=y||{};var T={label:"Circle Body",circleRadius:g};E=E||25;var w=Math.ceil(Math.max(10,Math.min(E,g)));return w%2===1&&(w+=1),s.polygon(x,b,w,g,c.extend({},T,y))},s.polygon=function(x,b,g,y,E){if(E=E||{},g<3)return s.circle(x,b,y,E);for(var T=2*Math.PI/g,w="",M=T*.5,N=0;N<g;N+=1){var L=M+N*T,A=Math.cos(L)*y,C=Math.sin(L)*y;w+="L "+A.toFixed(3)+" "+C.toFixed(3)+" "}var I={label:"Polygon Body",position:{x,y:b},vertices:l.fromPath(w)};if(E.chamfer){var R=E.chamfer;I.vertices=l.chamfer(I.vertices,R.radius,R.quality,R.qualityMin,R.qualityMax),delete E.chamfer}return d.create(c.extend({},I,E))},s.fromVertices=function(x,b,g,y,E,T,w,M){var N=c.getDecomp(),L,A,C,I,R,j,D,P,B,Q,q;for(L=!!(N&&N.quickDecomp),y=y||{},C=[],E=typeof E<"u"?E:!1,T=typeof T<"u"?T:.01,w=typeof w<"u"?w:10,M=typeof M<"u"?M:.01,c.isArray(g[0])||(g=[g]),Q=0;Q<g.length;Q+=1)if(j=g[Q],I=l.isConvex(j),R=!I,R&&!L&&c.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),I||!L)I?j=l.clockwiseSort(j):j=l.hull(j),C.push({position:{x,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 G=H[D],Z=G.map(function($){return{x:$[0],y:$[1]}});w>0&&l.area(Z)<w||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 F=C[D];for(P=D+1;P<C.length;P++){var Y=C[P];if(f.overlaps(F.bounds,Y.bounds)){var J=F.vertices,U=Y.vertices;for(B=0;B<F.vertices.length;B++)for(q=0;q<Y.vertices.length;q++){var ne=p.magnitudeSquared(p.sub(J[(B+1)%J.length],U[q])),K=p.magnitudeSquared(p.sub(J[B],U[(q+1)%U.length]));ne<ie&&K<ie&&(J[B].isInternal=!0,U[q].isInternal=!0)}}}}}return C.length>1?(A=d.create(c.extend({parts:C.slice(0)},y)),d.setPosition(A,{x,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 f={bodies:[],pairs:null};return l.extend(f,d)},s.setBodies=function(d,f){d.bodies=f.slice(0)},s.clear=function(d){d.bodies=[]},s.collisions=function(d){var f=[],p=d.pairs,x=d.bodies,b=x.length,g=s.canCollide,y=c.collides,E,T;for(x.sort(s._compareBoundsX),E=0;E<b;E++){var w=x[E],M=w.bounds,N=w.bounds.max.x,L=w.bounds.max.y,A=w.bounds.min.y,C=w.isStatic||w.isSleeping,I=w.parts.length,R=I===1;for(T=E+1;T<b;T++){var j=x[T],D=j.bounds;if(D.min.x>N)break;if(!(L<D.min.y||A>D.max.y)&&!(C&&(j.isStatic||j.isSleeping))&&g(w.collisionFilter,j.collisionFilter)){var P=j.parts.length;if(R&&P===1){var B=y(w,j,p);B&&f.push(B)}else for(var Q=I>1?1:0,q=P>1?1:0,z=Q;z<I;z++)for(var H=w.parts[z],M=H.bounds,G=q;G<P;G++){var Z=j.parts[G],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 B=y(H,Z,p);B&&f.push(B)}}}}}return f},s.canCollide=function(d,f){return d.group===f.group&&d.group!==0?d.group>0:(d.mask&f.category)!==0&&(f.mask&d.category)!==0},s._compareBoundsX=function(d,f){return d.bounds.min.x-f.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(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&(d.button=0,f.preventDefault()),d.absolute.x=p.x,d.absolute.y=p.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=f},d.mousedown=function(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x?(d.button=0,f.preventDefault()):d.button=f.button,d.absolute.x=p.x,d.absolute.y=p.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=f},d.mouseup=function(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&f.preventDefault(),d.button=-1,d.absolute.x=p.x,d.absolute.y=p.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=f},d.mousewheel=function(f){d.wheelDelta=Math.max(-1,Math.min(1,f.wheelDelta||-f.detail)),f.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,f){var p=d.getBoundingClientRect(),x=document.documentElement||document.body.parentNode||document.body,b=window.pageXOffset!==void 0?window.pageXOffset:x.scrollLeft,g=window.pageYOffset!==void 0?window.pageYOffset:x.scrollTop,y=c.changedTouches,E,T;return y?(E=y[0].pageX-p.left-b,T=y[0].pageY-p.top-g):(E=c.pageX-p.left-b,T=c.pageY-p.top-g),{x:E/(d.clientWidth/(d.width||d.clientWidth)*f),y:T/(d.clientHeight/(d.height||d.clientHeight)*f)}}})()}),(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],f=s.versionParse(c.version).number,p=s.versionParse(d.version).number;f>p?(l.warn("Plugin.register:",s.toString(d),"was upgraded to",s.toString(c)),s._registry[c.name]=c):f<p?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 f=c.for&&s.dependencyParse(c.for);return!c.for||d.name===f.name&&s.versionSatisfies(d.version,f.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 f=s.dependencies(c),p=l.topologicalSort(f),x=[],b=0;b<p.length;b+=1)if(p[b]!==c.name){var g=s.resolve(p[b]);if(!g){x.push("❌ "+p[b]);continue}s.isUsed(c,g.name)||(s.isFor(g,c)||(l.warn("Plugin.use:",s.toString(g),"is for",g.for,"but installed on",s.toString(c)+"."),g._warned=!0),g.install?g.install(c):(l.warn("Plugin.use:",s.toString(g),"does not specify an install function."),g._warned=!0),g._warned?(x.push("🔶 "+s.toString(g)),delete g._warned):x.push("✅ "+s.toString(g)),c.used.push(g.name))}x.length>0&&l.info(x.join(" "))},s.dependencies=function(c,d){var f=s.dependencyParse(c),p=f.name;if(d=d||{},!(p in d)){c=s.resolve(c)||c,d[p]=l.map(c.uses||[],function(b){s.isPlugin(b)&&s.register(b);var g=s.dependencyParse(b),y=s.resolve(b);return y&&!s.versionSatisfies(y.version,g.range)?(l.warn("Plugin.dependencies:",s.toString(y),"does not satisfy",s.toString(g),"used by",s.toString(f)+"."),y._warned=!0,c._warned=!0):y||(l.warn("Plugin.dependencies:",s.toString(b),"used by",s.toString(f),"could not be resolved."),c._warned=!0),g.name});for(var x=0;x<d[p].length;x+=1)s.dependencies(d[p][x],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 f=d.exec(c),p=Number(f[4]),x=Number(f[5]),b=Number(f[6]);return{isRange:!!(f[1]||f[2]),version:f[3],range:c,operator:f[1]||f[2]||"",major:p,minor:x,patch:b,parts:[p,x,b],prerelease:f[7],number:p*1e8+x*1e4+b}},s.versionSatisfies=function(c,d){d=d||"*";var f=s.versionParse(d),p=s.versionParse(c);if(f.isRange){if(f.operator==="*"||c==="*")return!0;if(f.operator===">")return p.number>f.number;if(f.operator===">=")return p.number>=f.number;if(f.operator==="~")return p.major===f.major&&p.minor===f.minor&&p.patch>=f.patch;if(f.operator==="^")return f.major>0?p.major===f.major&&p.number>=f.number:f.minor>0?p.minor===f.minor&&p.patch>=f.patch:p.patch===f.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),f=o(19),p=o(5),x=o(6),b=o(10),g=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}},w=g.extend(T,E);return w.world=E.world||x.create({label:"World"}),w.pairs=E.pairs||f.create(),w.detector=E.detector||d.create(),w.grid={buckets:[]},w.world.gravity=w.gravity,w.broadphase=w.grid,w.metrics={},w},s.update=function(E,T){var w=g.now(),M=E.world,N=E.detector,L=E.pairs,A=E.timing,C=A.timestamp,I;T=typeof T<"u"?T:g._baseDelta,T*=A.timeScale,A.timestamp+=T,A.lastDelta=T;var R={timestamp:A.timestamp,delta:T};p.trigger(E,"beforeUpdate",R);var j=x.allBodies(M),D=x.allConstraints(M);for(M.isModified&&(d.setBodies(N,j),x.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),I=0;I<E.constraintIterations;I++)b.solveAll(D,T);b.postSolveAll(j),N.pairs=E.pairs;var P=d.collisions(N);f.update(L,P,C),E.enableSleeping&&l.afterCollisions(L.list),L.collisionStart.length>0&&p.trigger(E,"collisionStart",{pairs:L.collisionStart});var B=g.clamp(20/E.positionIterations,0,1);for(c.preSolvePosition(L.list),I=0;I<E.positionIterations;I++)c.solvePosition(L.list,T,B);for(c.postSolvePosition(j),b.preSolveAll(j),I=0;I<E.constraintIterations;I++)b.solveAll(D,T);for(b.postSolveAll(j),c.preSolveVelocity(L.list),I=0;I<E.velocityIterations;I++)c.solveVelocity(L.list,T);return s._bodiesUpdateVelocities(j),L.collisionActive.length>0&&p.trigger(E,"collisionActive",{pairs:L.collisionActive}),L.collisionEnd.length>0&&p.trigger(E,"collisionEnd",{pairs:L.collisionEnd}),s._bodiesClearForces(j),p.trigger(E,"afterUpdate",R),E.timing.lastElapsed=g.now()-w,E},s.merge=function(E,T){if(g.extend(E,T),T.world){E.world=T.world,s.clear(E);for(var w=x.allBodies(E.world),M=0;M<w.length;M++){var N=w[M];l.set(N,!1),N.id=g.nextId()}}},s.clear=function(E){f.clear(E.pairs),d.clear(E.detector)},s._bodiesClearForces=function(E){for(var T=E.length,w=0;w<T;w++){var M=E[w];M.force.x=0,M.force.y=0,M.torque=0}},s._bodiesApplyGravity=function(E,T){var w=typeof T.scale<"u"?T.scale:.001,M=E.length;if(!(T.x===0&&T.y===0||w===0))for(var N=0;N<M;N++){var L=E[N];L.isStatic||L.isSleeping||(L.force.y+=L.mass*T.y*w,L.force.x+=L.mass*T.x*w)}},s._bodiesUpdate=function(E,T){for(var w=E.length,M=0;M<w;M++){var N=E[M];N.isStatic||N.isSleeping||y.update(N,T)}},s._bodiesUpdateVelocities=function(E){for(var T=E.length,w=0;w<T;w++)y.updateVelocities(E[w])}})()}),(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(f){var p,x,b,g=f.length;for(p=0;p<g;p++)x=f[p],x.isActive&&(b=x.activeContacts.length,x.collision.parentA.totalContacts+=b,x.collision.parentB.totalContacts+=b)},s.solvePosition=function(f,p,x){var b,g,y,E,T,w,M,N,L=s._positionDampen*(x||1),A=c.clamp(p/c._baseDelta,0,1),C=f.length;for(b=0;b<C;b++)g=f[b],!(!g.isActive||g.isSensor)&&(y=g.collision,E=y.parentA,T=y.parentB,w=y.normal,g.separation=w.x*(T.positionImpulse.x+y.penetration.x-E.positionImpulse.x)+w.y*(T.positionImpulse.y+y.penetration.y-E.positionImpulse.y));for(b=0;b<C;b++)g=f[b],!(!g.isActive||g.isSensor)&&(y=g.collision,E=y.parentA,T=y.parentB,w=y.normal,N=g.separation-g.slop*A,(E.isStatic||T.isStatic)&&(N*=2),E.isStatic||E.isSleeping||(M=L/E.totalContacts,E.positionImpulse.x+=w.x*N*M,E.positionImpulse.y+=w.y*N*M),T.isStatic||T.isSleeping||(M=L/T.totalContacts,T.positionImpulse.x-=w.x*N*M,T.positionImpulse.y-=w.y*N*M))},s.postSolvePosition=function(f){for(var p=s._positionWarming,x=f.length,b=l.translate,g=d.update,y=0;y<x;y++){var E=f[y],T=E.positionImpulse,w=T.x,M=T.y,N=E.velocity;if(E.totalContacts=0,w!==0||M!==0){for(var L=0;L<E.parts.length;L++){var A=E.parts[L];b(A.vertices,T),g(A.bounds,A.vertices,N),A.position.x+=w,A.position.y+=M}E.positionPrev.x+=w,E.positionPrev.y+=M,w*N.x+M*N.y<0?(T.x=0,T.y=0):(T.x*=p,T.y*=p)}}},s.preSolveVelocity=function(f){var p=f.length,x,b;for(x=0;x<p;x++){var g=f[x];if(!(!g.isActive||g.isSensor)){var y=g.activeContacts,E=y.length,T=g.collision,w=T.parentA,M=T.parentB,N=T.normal,L=T.tangent;for(b=0;b<E;b++){var A=y[b],C=A.vertex,I=A.normalImpulse,R=A.tangentImpulse;if(I!==0||R!==0){var j=N.x*I+L.x*R,D=N.y*I+L.y*R;w.isStatic||w.isSleeping||(w.positionPrev.x+=j*w.inverseMass,w.positionPrev.y+=D*w.inverseMass,w.anglePrev+=w.inverseInertia*((C.x-w.position.x)*D-(C.y-w.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(f,p){var x=p/c._baseDelta,b=x*x,g=b*x,y=-s._restingThresh*x,E=s._restingThreshTangent,T=s._frictionNormalMultiplier*x,w=s._frictionMaxStatic,M=f.length,N,L,A,C;for(A=0;A<M;A++){var I=f[A];if(!(!I.isActive||I.isSensor)){var R=I.collision,j=R.parentA,D=R.parentB,P=j.velocity,B=D.velocity,Q=R.normal.x,q=R.normal.y,z=R.tangent.x,H=R.tangent.y,G=I.activeContacts,Z=G.length,ie=1/Z,F=j.inverseMass+D.inverseMass,Y=I.friction*I.frictionStatic*T;for(P.x=j.position.x-j.positionPrev.x,P.y=j.position.y-j.positionPrev.y,B.x=D.position.x-D.positionPrev.x,B.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 J=G[C],U=J.vertex,ne=U.x-j.position.x,K=U.y-j.position.y,$=U.x-D.position.x,oe=U.y-D.position.y,ce=P.x-K*j.angularVelocity,_e=P.y+ne*j.angularVelocity,Ke=B.x-oe*D.angularVelocity,Je=B.y+$*D.angularVelocity,it=ce-Ke,Ee=_e-Je,Ye=Q*it+q*Ee,yt=z*it+H*Ee,Ot=I.separation+Ye,Xt=Math.min(Ot,1);Xt=Ot<0?0:Xt;var Se=Xt*Y;yt<-Se||yt>Se?(L=yt>0?yt:-yt,N=I.friction*(yt>0?1:-1)*g,N<-L?N=-L:N>L&&(N=L)):(N=yt,L=w);var Qe=ne*q-K*Q,qe=$*q-oe*Q,pt=ie/(F+j.inverseInertia*Qe*Qe+D.inverseInertia*qe*qe),rt=(1+I.restitution)*Ye*pt;if(N*=pt,Ye<y)J.normalImpulse=0;else{var fe=J.normalImpulse;J.normalImpulse+=rt,J.normalImpulse>0&&(J.normalImpulse=0),rt=J.normalImpulse-fe}if(yt<-E||yt>E)J.tangentImpulse=0;else{var Be=J.tangentImpulse;J.tangentImpulse+=N,J.tangentImpulse<-L&&(J.tangentImpulse=-L),J.tangentImpulse>L&&(J.tangentImpulse=L),N=J.tangentImpulse-Be}var je=Q*rt+z*N,pe=q*rt+H*N;j.isStatic||j.isSleeping||(j.positionPrev.x+=je*j.inverseMass,j.positionPrev.y+=pe*j.inverseMass,j.anglePrev+=(ne*pe-K*je)*j.inverseInertia),D.isStatic||D.isSleeping||(D.positionPrev.x-=je*D.inverseMass,D.positionPrev.y-=pe*D.inverseMass,D.anglePrev-=($*pe-oe*je)*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,f,p){var x=d.list,b=x.length,g=d.table,y=f.length,E=d.collisionStart,T=d.collisionEnd,w=d.collisionActive,M,N,L,A;for(E.length=0,T.length=0,w.length=0,A=0;A<b;A++)x[A].confirmedActive=!1;for(A=0;A<y;A++)M=f[A],L=M.pair,L?(L.isActive?w.push(L):E.push(L),l.update(L,M,p),L.confirmedActive=!0):(L=l.create(M,p),g[L.id]=L,E.push(L),x.push(L));var C=[];for(b=x.length,A=0;A<b;A++)L=x[A],L.confirmedActive||(l.setActive(L,!1,p),T.push(L),!L.collision.bodyA.isSleeping&&!L.collision.bodyB.isSleeping&&C.push(A));for(A=0;A<C.length;A++)N=C[A]-A,L=x[N],x.splice(N,1),delete g[L.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,f){return d=d.replace(/^Matter./,""),c.chainPathBefore(s,d,f)},s.after=function(d,f){return d=d.replace(/^Matter./,""),c.chainPathAfter(s,d,f)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(6),c=o(10),d=o(0),f=o(4),p=o(12),x=d.deprecated;(function(){s.stack=function(b,g,y,E,T,w,M){for(var N=l.create({label:"Stack"}),L=b,A=g,C,I=0,R=0;R<E;R++){for(var j=0,D=0;D<y;D++){var P=M(L,A,D,R,C,I);if(P){var B=P.bounds.max.y-P.bounds.min.y,Q=P.bounds.max.x-P.bounds.min.x;B>j&&(j=B),f.translate(P,{x:Q*.5,y:B*.5}),L=P.bounds.max.x+T,l.addBody(N,P),C=P,I+=1}else L+=T}A+=j+w,L=b}return N},s.chain=function(b,g,y,E,T,w){for(var M=b.bodies,N=1;N<M.length;N++){var L=M[N-1],A=M[N],C=L.bounds.max.y-L.bounds.min.y,I=L.bounds.max.x-L.bounds.min.x,R=A.bounds.max.y-A.bounds.min.y,j=A.bounds.max.x-A.bounds.min.x,D={bodyA:L,pointA:{x:I*g,y:C*y},bodyB:A,pointB:{x:j*E,y:R*T}},P=d.extend(D,w);l.addConstraint(b,c.create(P))}return b.label+=" Chain",b},s.mesh=function(b,g,y,E,T){var w=b.bodies,M,N,L,A,C;for(M=0;M<y;M++){for(N=1;N<g;N++)L=w[N-1+M*g],A=w[N+M*g],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T)));if(M>0)for(N=0;N<g;N++)L=w[N+(M-1)*g],A=w[N+M*g],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T))),E&&N>0&&(C=w[N-1+(M-1)*g],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T)))),E&&N<g-1&&(C=w[N+1+(M-1)*g],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T))))}return b.label+=" Mesh",b},s.pyramid=function(b,g,y,E,T,w,M){return s.stack(b,g,y,E,T,w,function(N,L,A,C,I,R){var j=Math.min(E,Math.ceil(y/2)),D=I?I.bounds.max.x-I.bounds.min.x:0;if(!(C>j)){C=j-C;var P=C,B=y-1-C;if(!(A<P||A>B)){R===1&&f.translate(I,{x:(A+(y%2===1?1:-1))*D,y:0});var Q=I?A*D:0;return M(b+Q+A*T,L,A,C,I,R)}}})},s.newtonsCradle=function(b,g,y,E,T){for(var w=l.create({label:"Newtons Cradle"}),M=0;M<y;M++){var N=1.9,L=p.circle(b+M*(E*N),g+T,E,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),A=c.create({pointA:{x:b+M*(E*N),y:g},bodyB:L});l.addBody(w,L),l.addConstraint(w,A)}return w},x(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(b,g,y,E,T){var w=f.nextGroup(!0),M=20,N=-y*.5+M,L=y*.5-M,A=0,C=l.create({label:"Car"}),I=p.rectangle(b,g,y,E,{collisionFilter:{group:w},chamfer:{radius:E*.5},density:2e-4}),R=p.circle(b+N,g+A,T,{collisionFilter:{group:w},friction:.8}),j=p.circle(b+L,g+A,T,{collisionFilter:{group:w},friction:.8}),D=c.create({bodyB:I,pointB:{x:N,y:A},bodyA:R,stiffness:1,length:0}),P=c.create({bodyB:I,pointB:{x:L,y:A},bodyA:j,stiffness:1,length:0});return l.addBody(C,I),l.addBody(C,R),l.addBody(C,j),l.addConstraint(C,D),l.addConstraint(C,P),C},x(s,"car","Composites.car ➤ moved to car example"),s.softBody=function(b,g,y,E,T,w,M,N,L,A){L=d.extend({inertia:1/0},L),A=d.extend({stiffness:.2,render:{type:"line",anchors:!1}},A);var C=s.stack(b,g,y,E,T,w,function(I,R){return p.circle(I,R,N,L)});return s.mesh(C,y,E,M,A),C.label="Soft Body",C},x(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(f){var p={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return c.extend(p,f)},s.update=function(f,p,x,b){var g,y,E,T=x.world,w=f.buckets,M,N,L=!1;for(g=0;g<p.length;g++){var A=p[g];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(f,A);if(!A.region||C.id!==A.region.id||b){(!A.region||b)&&(A.region=C);var I=s._regionUnion(C,A.region);for(y=I.startCol;y<=I.endCol;y++)for(E=I.startRow;E<=I.endRow;E++){N=s._getBucketId(y,E),M=w[N];var R=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;!R&&j&&j&&M&&s._bucketRemoveBody(f,M,A),(A.region===C||R&&!j||b)&&(M||(M=s._createBucket(w,N)),s._bucketAddBody(f,M,A))}A.region=C,L=!0}}}L&&(f.pairsList=s._createActivePairsList(f))},d(s,"update","Grid.update ➤ replaced by Matter.Detector"),s.clear=function(f){f.buckets={},f.pairs={},f.pairsList=[]},d(s,"clear","Grid.clear ➤ replaced by Matter.Detector"),s._regionUnion=function(f,p){var x=Math.min(f.startCol,p.startCol),b=Math.max(f.endCol,p.endCol),g=Math.min(f.startRow,p.startRow),y=Math.max(f.endRow,p.endRow);return s._createRegion(x,b,g,y)},s._getRegion=function(f,p){var x=p.bounds,b=Math.floor(x.min.x/f.bucketWidth),g=Math.floor(x.max.x/f.bucketWidth),y=Math.floor(x.min.y/f.bucketHeight),E=Math.floor(x.max.y/f.bucketHeight);return s._createRegion(b,g,y,E)},s._createRegion=function(f,p,x,b){return{id:f+","+p+","+x+","+b,startCol:f,endCol:p,startRow:x,endRow:b}},s._getBucketId=function(f,p){return"C"+f+"R"+p},s._createBucket=function(f,p){var x=f[p]=[];return x},s._bucketAddBody=function(f,p,x){var b=f.pairs,g=l.id,y=p.length,E;for(E=0;E<y;E++){var T=p[E];if(!(x.id===T.id||x.isStatic&&T.isStatic)){var w=g(x,T),M=b[w];M?M[2]+=1:b[w]=[x,T,1]}}p.push(x)},s._bucketRemoveBody=function(f,p,x){var b=f.pairs,g=l.id,y;p.splice(c.indexOf(p,x),1);var E=p.length;for(y=0;y<E;y++){var T=b[g(x,p[y])];T&&(T[2]-=1)}},s._createActivePairsList=function(f){var p,x=f.pairs,b=c.keys(x),g=b.length,y=[],E;for(E=0;E<g;E++)p=x[b[E]],p[2]>0?y.push(p):delete x[b[E]];return y}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(7),d=o(14),f=o(5),p=o(13),x=o(10),b=o(6),g=o(0),y=o(1);(function(){s.create=function(E,T){var w=(E?E.mouse:null)||(T?T.mouse:null);w||(E&&E.render&&E.render.canvas?w=d.create(E.render.canvas):T&&T.element?w=d.create(T.element):(w=d.create(),g.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var M=x.create({label:"Mouse Constraint",pointA:w.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),N={type:"mouseConstraint",mouse:w,element:null,body:null,constraint:M,collisionFilter:{category:1,mask:4294967295,group:0}},L=g.extend(N,T);return f.on(E,"beforeUpdate",function(){var A=b.allBodies(E.world);s.update(L,A),s._triggerEvents(L)}),L},s.update=function(E,T){var w=E.mouse,M=E.constraint,N=E.body;if(w.button===0){if(M.bodyB)c.set(M.bodyB,!1),M.pointA=w.position;else for(var L=0;L<T.length;L++)if(N=T[L],y.contains(N.bounds,w.position)&&p.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,w.position)){M.pointA=w.position,M.bodyB=E.body=N,M.pointB={x:w.position.x-N.position.x,y:w.position.y-N.position.y},M.angleB=N.angle,c.set(N,!1),f.trigger(E,"startdrag",{mouse:w,body:N});break}}}else M.bodyB=E.body=null,M.pointB=null,N&&f.trigger(E,"enddrag",{mouse:w,body:N})},s._triggerEvents=function(E){var T=E.mouse,w=T.sourceEvents;w.mousemove&&f.trigger(E,"mousemove",{mouse:T}),w.mousedown&&f.trigger(E,"mousedown",{mouse:T}),w.mouseup&&f.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),f=o(12),p=o(3);(function(){s.collides=function(x,b){for(var g=[],y=b.length,E=x.bounds,T=c.collides,w=d.overlaps,M=0;M<y;M++){var N=b[M],L=N.parts.length,A=L===1?0:1;if(w(N.bounds,E))for(var C=A;C<L;C++){var I=N.parts[C];if(w(I.bounds,E)){var R=T(I,x);if(R){g.push(R);break}}}}return g},s.ray=function(x,b,g,y){y=y||1e-100;for(var E=l.angle(b,g),T=l.magnitude(l.sub(b,g)),w=(g.x+b.x)*.5,M=(g.y+b.y)*.5,N=f.rectangle(w,M,T,y,{angle:E}),L=s.collides(N,x),A=0;A<L.length;A+=1){var C=L[A];C.body=C.bodyB=C.bodyA}return L},s.region=function(x,b,g){for(var y=[],E=0;E<x.length;E++){var T=x[E],w=d.overlaps(T.bounds,b);(w&&!g||!w&&g)&&y.push(T)}return y},s.point=function(x,b){for(var g=[],y=0;y<x.length;y++){var E=x[y];if(d.contains(E.bounds,b))for(var T=E.parts.length===1?0:1;T<E.parts.length;T++){var w=E.parts[T];if(d.contains(w.bounds,b)&&p.contains(w.vertices,b)){g.push(E);break}}}return g}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(0),d=o(6),f=o(1),p=o(5),x=o(2),b=o(14);(function(){var g,y;typeof window<"u"&&(g=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}},I=c.extend(C,A);return I.canvas&&(I.canvas.width=I.options.width||I.canvas.width,I.canvas.height=I.options.height||I.canvas.height),I.mouse=A.mouse,I.engine=A.engine,I.canvas=I.canvas||w(I.options.width,I.options.height),I.context=I.canvas.getContext("2d"),I.textures={},I.bounds=I.bounds||{min:{x:0,y:0},max:{x:I.canvas.width,y:I.canvas.height}},I.controller=s,I.options.showBroadphase=!1,I.options.pixelRatio!==1&&s.setPixelRatio(I,I.options.pixelRatio),c.isElement(I.element)&&I.element.appendChild(I.canvas),I},s.run=function(A){(function C(I){A.frameRequestId=g(C),E(A,I),s.world(A,I),(A.options.showStats||A.options.showDebug)&&s.stats(A,A.context,I),(A.options.showPerformance||A.options.showDebug)&&s.performance(A,A.context,I)})()},s.stop=function(A){y(A.frameRequestId)},s.setPixelRatio=function(A,C){var I=A.options,R=A.canvas;C==="auto"&&(C=M(R)),I.pixelRatio=C,R.setAttribute("data-pixel-ratio",C),R.width=I.width*C,R.height=I.height*C,R.style.width=I.width+"px",R.style.height=I.height+"px"},s.lookAt=function(A,C,I,R){R=typeof R<"u"?R:!0,C=c.isArray(C)?C:[C],I=I||{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],B=P.bounds?P.bounds.min:P.min||P.position||P,Q=P.bounds?P.bounds.max:P.max||P.position||P;B&&Q&&(B.x<j.min.x&&(j.min.x=B.x),Q.x>j.max.x&&(j.max.x=Q.x),B.y<j.min.y&&(j.min.y=B.y),Q.y>j.max.y&&(j.max.y=Q.y))}var q=j.max.x-j.min.x+2*I.x,z=j.max.y-j.min.y+2*I.y,H=A.canvas.height,G=A.canvas.width,Z=G/H,ie=q/z,F=1,Y=1;ie>Z?Y=ie/Z:F=Z/ie,A.options.hasBounds=!0,A.bounds.min.x=j.min.x,A.bounds.max.x=j.min.x+q*F,A.bounds.min.y=j.min.y,A.bounds.max.y=j.min.y+z*Y,R&&(A.bounds.min.x+=q*.5-q*F*.5,A.bounds.max.x+=q*.5-q*F*.5,A.bounds.min.y+=z*.5-z*Y*.5,A.bounds.max.y+=z*.5-z*Y*.5),A.bounds.min.x-=I.x,A.bounds.max.x-=I.x,A.bounds.min.y-=I.y,A.bounds.max.y-=I.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,I=A.bounds.max.y-A.bounds.min.y,R=C/A.options.width,j=I/A.options.height;A.context.setTransform(A.options.pixelRatio/R,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 I=c.now(),R=A.engine,j=R.world,D=A.canvas,P=A.context,B=A.options,Q=A.timing,q=d.allBodies(j),z=d.allConstraints(j),H=B.wireframes?B.wireframeBackground:B.background,G=[],Z=[],ie,F={timestamp:R.timing.timestamp};if(p.trigger(A,"beforeRender",F),A.currentBackground!==H&&L(A,H),P.globalCompositeOperation="source-in",P.fillStyle="transparent",P.fillRect(0,0,D.width,D.height),P.globalCompositeOperation="source-over",B.hasBounds){for(ie=0;ie<q.length;ie++){var Y=q[ie];f.overlaps(Y.bounds,A.bounds)&&G.push(Y)}for(ie=0;ie<z.length;ie++){var J=z[ie],U=J.bodyA,ne=J.bodyB,K=J.pointA,$=J.pointB;U&&(K=x.add(U.position,J.pointA)),ne&&($=x.add(ne.position,J.pointB)),!(!K||!$)&&(f.contains(A.bounds,K)||f.contains(A.bounds,$))&&Z.push(J)}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,G=q,A.options.pixelRatio!==1&&A.context.setTransform(A.options.pixelRatio,0,0,A.options.pixelRatio,0,0);!B.wireframes||R.enableSleeping&&B.showSleeping?s.bodies(A,G,P):(B.showConvexHulls&&s.bodyConvexHulls(A,G,P),s.bodyWireframes(A,G,P)),B.showBounds&&s.bodyBounds(A,G,P),(B.showAxes||B.showAngleIndicator)&&s.bodyAxes(A,G,P),B.showPositions&&s.bodyPositions(A,G,P),B.showVelocity&&s.bodyVelocity(A,G,P),B.showIds&&s.bodyIds(A,G,P),B.showSeparations&&s.separations(A,R.pairs.list,P),B.showCollisions&&s.collisions(A,R.pairs.list,P),B.showVertexNumbers&&s.vertexNumbers(A,G,P),B.showMousePosition&&s.mousePosition(A,A.mouse,P),s.constraints(Z,P),B.hasBounds&&s.endViewTransform(A),p.trigger(A,"afterRender",F),Q.lastElapsed=c.now()-I},s.stats=function(A,C,I){for(var R=A.engine,j=R.world,D=d.allBodies(j),P=0,B=55,Q=44,q=0,z=0,H=0;H<D.length;H+=1)P+=D[H].parts.length;var G={Part:P,Body:D.length,Cons:d.allConstraints(j).length,Comp:d.allComposites(j).length,Pair:R.pairs.list.length};C.fillStyle="#0e0f19",C.fillRect(q,z,B*5.5,Q),C.font="12px Arial",C.textBaseline="top",C.textAlign="right";for(var Z in G){var ie=G[Z];C.fillStyle="#aaa",C.fillText(Z,q+B,z+8),C.fillStyle="#eee",C.fillText(ie,q+B,z+26),q+=B}},s.performance=function(A,C){var I=A.engine,R=A.timing,j=R.deltaHistory,D=R.elapsedHistory,P=R.timestampElapsedHistory,B=R.engineDeltaHistory,Q=R.engineElapsedHistory,q=I.timing.lastDelta,z=T(j),H=T(D),G=T(B),Z=T(Q),ie=T(P),F=ie/z||0,Y=1e3/z||0,J=4,U=12,ne=60,K=34,$=10,oe=69;C.fillStyle="#0e0f19",C.fillRect(0,50,U*4+ne*5+22,K),s.status(C,$,oe,ne,J,j.length,Math.round(Y)+" fps",Y/s._goodFps,function(ce){return j[ce]/z-1}),s.status(C,$+U+ne,oe,ne,J,B.length,q.toFixed(2)+" dt",s._goodDelta/q,function(ce){return B[ce]/G-1}),s.status(C,$+(U+ne)*2,oe,ne,J,Q.length,Z.toFixed(2)+" ut",1-Z/s._goodFps,function(ce){return Q[ce]/Z-1}),s.status(C,$+(U+ne)*3,oe,ne,J,D.length,H.toFixed(2)+" rt",1-H/s._goodFps,function(ce){return D[ce]/H-1}),s.status(C,$+(U+ne)*4,oe,ne,J,P.length,F.toFixed(2)+" x",F*F*F,function(ce){return(P[ce]/j[ce]/F||0)-1})},s.status=function(A,C,I,R,j,D,P,B,Q){A.strokeStyle="#888",A.fillStyle="#444",A.lineWidth=1,A.fillRect(C,I+7,R,1),A.beginPath(),A.moveTo(C,I+7-j*c.clamp(.4*Q(0),-2,2));for(var q=0;q<R;q+=1)A.lineTo(C+q,I+7-(q<D?j*c.clamp(.4*Q(q),-2,2):0));A.stroke(),A.fillStyle="hsl("+c.clamp(25+95*B,0,120)+",100%,60%)",A.fillRect(C,I-7,4,4),A.font="12px Arial",A.textBaseline="middle",A.textAlign="right",A.fillStyle="#eee",A.fillText(P,C+R,I-5)},s.constraints=function(A,C){for(var I=C,R=0;R<A.length;R++){var j=A[R];if(!(!j.render.visible||!j.pointA||!j.pointB)){var D=j.bodyA,P=j.bodyB,B,Q;if(D?B=x.add(D.position,j.pointA):B=j.pointA,j.render.type==="pin")I.beginPath(),I.arc(B.x,B.y,3,0,2*Math.PI),I.closePath();else{if(P?Q=x.add(P.position,j.pointB):Q=j.pointB,I.beginPath(),I.moveTo(B.x,B.y),j.render.type==="spring")for(var q=x.sub(Q,B),z=x.perp(x.normalise(q)),H=Math.ceil(c.clamp(j.length/5,12,20)),G,Z=1;Z<H;Z+=1)G=Z%2===0?1:-1,I.lineTo(B.x+q.x*(Z/H)+z.x*G*4,B.y+q.y*(Z/H)+z.y*G*4);I.lineTo(Q.x,Q.y)}j.render.lineWidth&&(I.lineWidth=j.render.lineWidth,I.strokeStyle=j.render.strokeStyle,I.stroke()),j.render.anchors&&(I.fillStyle=j.render.strokeStyle,I.beginPath(),I.arc(B.x,B.y,3,0,2*Math.PI),I.arc(Q.x,Q.y,3,0,2*Math.PI),I.closePath(),I.fill())}}},s.bodies=function(A,C,I){var R=I;A.engine;var j=A.options,D=j.showInternalEdges||!j.wireframes,P,B,Q,q;for(Q=0;Q<C.length;Q++)if(P=C[Q],!!P.render.visible){for(q=P.parts.length>1?1:0;q<P.parts.length;q++)if(B=P.parts[q],!!B.render.visible){if(j.showSleeping&&P.isSleeping?R.globalAlpha=.5*B.render.opacity:B.render.opacity!==1&&(R.globalAlpha=B.render.opacity),B.render.sprite&&B.render.sprite.texture&&!j.wireframes){var z=B.render.sprite,H=N(A,z.texture);R.translate(B.position.x,B.position.y),R.rotate(B.angle),R.drawImage(H,H.width*-z.xOffset*z.xScale,H.height*-z.yOffset*z.yScale,H.width*z.xScale,H.height*z.yScale),R.rotate(-B.angle),R.translate(-B.position.x,-B.position.y)}else{if(B.circleRadius)R.beginPath(),R.arc(B.position.x,B.position.y,B.circleRadius,0,2*Math.PI);else{R.beginPath(),R.moveTo(B.vertices[0].x,B.vertices[0].y);for(var G=1;G<B.vertices.length;G++)!B.vertices[G-1].isInternal||D?R.lineTo(B.vertices[G].x,B.vertices[G].y):R.moveTo(B.vertices[G].x,B.vertices[G].y),B.vertices[G].isInternal&&!D&&R.moveTo(B.vertices[(G+1)%B.vertices.length].x,B.vertices[(G+1)%B.vertices.length].y);R.lineTo(B.vertices[0].x,B.vertices[0].y),R.closePath()}j.wireframes?(R.lineWidth=1,R.strokeStyle="#bbb",R.stroke()):(R.fillStyle=B.render.fillStyle,B.render.lineWidth&&(R.lineWidth=B.render.lineWidth,R.strokeStyle=B.render.strokeStyle,R.stroke()),R.fill())}R.globalAlpha=1}}},s.bodyWireframes=function(A,C,I){var R=I,j=A.options.showInternalEdges,D,P,B,Q,q;for(R.beginPath(),B=0;B<C.length;B++)if(D=C[B],!!D.render.visible)for(q=D.parts.length>1?1:0;q<D.parts.length;q++){for(P=D.parts[q],R.moveTo(P.vertices[0].x,P.vertices[0].y),Q=1;Q<P.vertices.length;Q++)!P.vertices[Q-1].isInternal||j?R.lineTo(P.vertices[Q].x,P.vertices[Q].y):R.moveTo(P.vertices[Q].x,P.vertices[Q].y),P.vertices[Q].isInternal&&!j&&R.moveTo(P.vertices[(Q+1)%P.vertices.length].x,P.vertices[(Q+1)%P.vertices.length].y);R.lineTo(P.vertices[0].x,P.vertices[0].y)}R.lineWidth=1,R.strokeStyle="#bbb",R.stroke()},s.bodyConvexHulls=function(A,C,I){var R=I,j,D,P;for(R.beginPath(),D=0;D<C.length;D++)if(j=C[D],!(!j.render.visible||j.parts.length===1)){for(R.moveTo(j.vertices[0].x,j.vertices[0].y),P=1;P<j.vertices.length;P++)R.lineTo(j.vertices[P].x,j.vertices[P].y);R.lineTo(j.vertices[0].x,j.vertices[0].y)}R.lineWidth=1,R.strokeStyle="rgba(255,255,255,0.2)",R.stroke()},s.vertexNumbers=function(A,C,I){var R=I,j,D,P;for(j=0;j<C.length;j++){var B=C[j].parts;for(P=B.length>1?1:0;P<B.length;P++){var Q=B[P];for(D=0;D<Q.vertices.length;D++)R.fillStyle="rgba(255,255,255,0.2)",R.fillText(j+"_"+D,Q.position.x+(Q.vertices[D].x-Q.position.x)*.8,Q.position.y+(Q.vertices[D].y-Q.position.y)*.8)}}},s.mousePosition=function(A,C,I){var R=I;R.fillStyle="rgba(255,255,255,0.8)",R.fillText(C.position.x+" "+C.position.y,C.position.x+5,C.position.y-5)},s.bodyBounds=function(A,C,I){var R=I;A.engine;var j=A.options;R.beginPath();for(var D=0;D<C.length;D++){var P=C[D];if(P.render.visible)for(var B=C[D].parts,Q=B.length>1?1:0;Q<B.length;Q++){var q=B[Q];R.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?R.strokeStyle="rgba(255,255,255,0.08)":R.strokeStyle="rgba(0,0,0,0.1)",R.lineWidth=1,R.stroke()},s.bodyAxes=function(A,C,I){var R=I;A.engine;var j=A.options,D,P,B,Q;for(R.beginPath(),P=0;P<C.length;P++){var q=C[P],z=q.parts;if(q.render.visible)if(j.showAxes)for(B=z.length>1?1:0;B<z.length;B++)for(D=z[B],Q=0;Q<D.axes.length;Q++){var H=D.axes[Q];R.moveTo(D.position.x,D.position.y),R.lineTo(D.position.x+H.x*20,D.position.y+H.y*20)}else for(B=z.length>1?1:0;B<z.length;B++)for(D=z[B],Q=0;Q<D.axes.length;Q++)R.moveTo(D.position.x,D.position.y),R.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?(R.strokeStyle="indianred",R.lineWidth=1):(R.strokeStyle="rgba(255, 255, 255, 0.4)",R.globalCompositeOperation="overlay",R.lineWidth=2),R.stroke(),R.globalCompositeOperation="source-over"},s.bodyPositions=function(A,C,I){var R=I;A.engine;var j=A.options,D,P,B,Q;for(R.beginPath(),B=0;B<C.length;B++)if(D=C[B],!!D.render.visible)for(Q=0;Q<D.parts.length;Q++)P=D.parts[Q],R.arc(P.position.x,P.position.y,3,0,2*Math.PI,!1),R.closePath();for(j.wireframes?R.fillStyle="indianred":R.fillStyle="rgba(0,0,0,0.5)",R.fill(),R.beginPath(),B=0;B<C.length;B++)D=C[B],D.render.visible&&(R.arc(D.positionPrev.x,D.positionPrev.y,2,0,2*Math.PI,!1),R.closePath());R.fillStyle="rgba(255,165,0,0.8)",R.fill()},s.bodyVelocity=function(A,C,I){var R=I;R.beginPath();for(var j=0;j<C.length;j++){var D=C[j];if(D.render.visible){var P=l.getVelocity(D);R.moveTo(D.position.x,D.position.y),R.lineTo(D.position.x+P.x,D.position.y+P.y)}}R.lineWidth=3,R.strokeStyle="cornflowerblue",R.stroke()},s.bodyIds=function(A,C,I){var R=I,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 B=P[D];R.font="12px Arial",R.fillStyle="rgba(255,255,255,0.5)",R.fillText(B.id,B.position.x+10,B.position.y-10)}}},s.collisions=function(A,C,I){var R=I,j=A.options,D,P,B,Q;for(R.beginPath(),B=0;B<C.length;B++)if(D=C[B],!!D.isActive)for(P=D.collision,Q=0;Q<D.activeContacts.length;Q++){var q=D.activeContacts[Q],z=q.vertex;R.rect(z.x-1.5,z.y-1.5,3.5,3.5)}for(j.wireframes?R.fillStyle="rgba(255,255,255,0.7)":R.fillStyle="orange",R.fill(),R.beginPath(),B=0;B<C.length;B++)if(D=C[B],!!D.isActive&&(P=D.collision,D.activeContacts.length>0)){var H=D.activeContacts[0].vertex.x,G=D.activeContacts[0].vertex.y;D.activeContacts.length===2&&(H=(D.activeContacts[0].vertex.x+D.activeContacts[1].vertex.x)/2,G=(D.activeContacts[0].vertex.y+D.activeContacts[1].vertex.y)/2),P.bodyB===P.supports[0].body||P.bodyA.isStatic===!0?R.moveTo(H-P.normal.x*8,G-P.normal.y*8):R.moveTo(H+P.normal.x*8,G+P.normal.y*8),R.lineTo(H,G)}j.wireframes?R.strokeStyle="rgba(255,165,0,0.7)":R.strokeStyle="orange",R.lineWidth=1,R.stroke()},s.separations=function(A,C,I){var R=I,j=A.options,D,P,B,Q,q;for(R.beginPath(),q=0;q<C.length;q++)if(D=C[q],!!D.isActive){P=D.collision,B=P.bodyA,Q=P.bodyB;var z=1;!Q.isStatic&&!B.isStatic&&(z=.5),Q.isStatic&&(z=0),R.moveTo(Q.position.x,Q.position.y),R.lineTo(Q.position.x-P.penetration.x*z,Q.position.y-P.penetration.y*z),z=1,!Q.isStatic&&!B.isStatic&&(z=.5),B.isStatic&&(z=0),R.moveTo(B.position.x,B.position.y),R.lineTo(B.position.x+P.penetration.x*z,B.position.y+P.penetration.y*z)}j.wireframes?R.strokeStyle="rgba(255,165,0,0.5)":R.strokeStyle="orange",R.stroke()},s.inspector=function(A,C){A.engine;var I=A.selected,R=A.render,j=R.options,D;if(j.hasBounds){var P=R.bounds.max.x-R.bounds.min.x,B=R.bounds.max.y-R.bounds.min.y,Q=P/R.options.width,q=B/R.options.height;C.scale(1/Q,1/q),C.translate(-R.bounds.min.x,-R.bounds.min.y)}for(var z=0;z<I.length;z++){var H=I[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 G=H.pointA;H.bodyA&&(G=H.pointB),C.beginPath(),C.arc(G.x,G.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 I=A.engine,R=A.timing,j=R.historySize,D=I.timing.timestamp;R.delta=C-R.lastTime||s._goodDelta,R.lastTime=C,R.timestampElapsed=D-R.lastTimestamp||0,R.lastTimestamp=D,R.deltaHistory.unshift(R.delta),R.deltaHistory.length=Math.min(R.deltaHistory.length,j),R.engineDeltaHistory.unshift(I.timing.lastDelta),R.engineDeltaHistory.length=Math.min(R.engineDeltaHistory.length,j),R.timestampElapsedHistory.unshift(R.timestampElapsed),R.timestampElapsedHistory.length=Math.min(R.timestampElapsedHistory.length,j),R.engineElapsedHistory.unshift(I.timing.lastElapsed),R.engineElapsedHistory.length=Math.min(R.engineElapsedHistory.length,j),R.elapsedHistory.unshift(R.lastElapsed),R.elapsedHistory.length=Math.min(R.elapsedHistory.length,j)},T=function(A){for(var C=0,I=0;I<A.length;I+=1)C+=A[I];return C/A.length||0},w=function(A,C){var I=document.createElement("canvas");return I.width=A,I.height=C,I.oncontextmenu=function(){return!1},I.onselectstart=function(){return!1},I},M=function(A){var C=A.getContext("2d"),I=window.devicePixelRatio||1,R=C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1;return I/R},N=function(A,C){var I=A.textures[C];return I||(I=A.textures[C]=new Image,I.src=C,I)},L=function(A,C){var I=C;/(jpg|gif|png)$/.test(C)&&(I="url("+C+")"),A.canvas.style.background=I,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 f,p;if(typeof window<"u"&&(f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,p=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!f){var x;f=function(b){x=setTimeout(function(){b(d.now())},1e3/60)},p=function(){clearTimeout(x)}}s.create=function(b){var g={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},y=d.extend(g,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,g){return typeof b.positionIterations<"u"&&(g=b,b=s.create()),(function y(E){b.frameRequestId=f(y),E&&b.enabled&&s.tick(b,g,E)})(),b},s.tick=function(b,g,y){var E=g.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 w={timestamp:E.timestamp};l.trigger(b,"beforeTick",w),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",w),l.trigger(b,"beforeUpdate",w),c.update(g,T),l.trigger(b,"afterUpdate",w),l.trigger(b,"afterTick",w)},s.stop=function(b){p(b.frameRequestId)},s.start=function(b,g){s.run(b,g)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(8),c=o(0),d=c.deprecated;(function(){s.collides=function(f,p){return l.collides(f,p)},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 f,p,x,b,g,y,E,T,w,M,N=[],L,A,C=0,I=0,R=0;d=d||15;var j=function(P,B,Q){var q=Q%2===1&&Q>1;if(!w||P!=w.x||B!=w.y){w&&q?(L=w.x,A=w.y):(L=0,A=0);var z={x:L+P,y:A+B};(q||!w)&&(w=z),N.push(z),I=L+P,R=A+B}},D=function(P){var B=P.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":I=P.x,R=P.y;break;case"H":I=P.x;break;case"V":R=P.y;break}j(I,R,P.pathSegType)}};for(s._svgPathToAbsolute(c),x=c.getTotalLength(),y=[],f=0;f<c.pathSegList.numberOfItems;f+=1)y.push(c.pathSegList.getItem(f));for(E=y.concat();C<x;){if(M=c.getPathSegAtLength(C),g=y[M],g!=T){for(;E.length&&E[0]!=g;)D(E.shift());T=g}switch(g.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(f=0,p=E.length;f<p;++f)D(E[f]);return N},s._svgPathToAbsolute=function(c){for(var d,f,p,x,b,g,y=c.pathSegList,E=0,T=0,w=y.numberOfItems,M=0;M<w;++M){var N=y.getItem(M),L=N.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(L))"x"in N&&(E=N.x),"y"in N&&(T=N.y);else switch("x1"in N&&(p=E+N.x1),"x2"in N&&(b=E+N.x2),"y1"in N&&(x=T+N.y1),"y2"in N&&(g=T+N.y2),"x"in N&&(E+=N.x),"y"in N&&(T+=N.y),L){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,p,x,b,g),M);break;case"s":y.replaceItem(c.createSVGPathSegCurvetoCubicSmoothAbs(E,T,b,g),M);break;case"q":y.replaceItem(c.createSVGPathSegCurvetoQuadraticAbs(E,T,p,x),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=f;break}(L=="M"||L=="m")&&(d=E,f=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})()})])})})(Nc)),Nc.exports}var xN=gN();const LE=Rl(xN);{const e=LE.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const bN=6,Ca=28,ti=.92,em=1.12,yN=34;function hy(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<bN?"click":"drag"}function vN(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 EN(e,t){return e*Math.exp(-t/90)}function TN(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 SN=4e-5,kN=5e-4;function wN(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function AN(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 OE(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 Go=120,CN=.9,my=.7,NN=.09,_N=2.2,MN=2,tm=Ca*2.45,RN=.006,nm=22,am=.06;function DN(e){var Q;const t=e.ballRadius??Ca,n=AN(e.weather??"clear"),{Engine:i,Bodies:o,Body:s,Composite:l,Constraint:c,Events:d}=LE,f=i.create();f.gravity.y=1,f.positionIterations=8,f.velocityIterations=4;const p=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,G=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:G,layoutX:q.x,layoutY:q.y,isExam:!!q.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const q of p){l.add(f.world,q.body);const z=(Q=e.nodes.find(H=>H.id===q.nodeId))==null?void 0:Q.spawn;z&&(z.vx!==void 0||z.vy!==void 0)&&s.setVelocity(q.body,{x:z.vx??0,y:z.vy??0})}const x=Go/2,b={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},g=(q,z)=>({x:Math.min(e.width-t,Math.max(t,q)),y:Math.min(e.height-t,Math.max(t,z))});l.add(f.world,[o.rectangle(e.width/2,-x,e.width*3,Go,b),o.rectangle(e.width/2,e.height+x,e.width*3,Go,b),o.rectangle(-x,e.height/2,Go,e.height*3,b),o.rectangle(e.width+x,e.height/2,Go,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,G,Z){return"body"in q?c.create({bodyA:q.body,pointA:q.offset,bodyB:z,pointB:H,length:G,stiffness:Z,damping:.05}):c.create({pointA:q.point,bodyB:z,pointB:H,length:G,stiffness:Z,damping:.05})}function w(q,z,H,G){const Z={x:H.body.position.x,y:H.body.position.y+t*ti},ie=Z.x-q.x,F=Z.y-q.y,Y=Math.max(60,Math.hypot(ie,F)),J=Math.max(5,Math.min(14,Math.round(Y/yN))),U=Y*em/J,ne=[];let K=z?{body:z,offset:{x:q.x-z.position.x,y:q.y-z.position.y}}:{point:q},$=!0;for(let oe=1;oe<J;oe++){const ce=oe/J,_e=Math.sin(Math.PI*ce)*Y*(em-1)*.85,Ke=o.circle(q.x+ie*ce,q.y+F*ce+_e,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});ne.push(Ke),l.add(f.world,Ke),l.add(f.world,T(K,Ke,void 0,U,$?my:CN)),$=!1,K={body:Ke,offset:{x:0,y:0}}}l.add(f.world,T(K,H.body,{x:0,y:t*ti},U,my)),E.push({from:G,to:H.nodeId,restLen:Y*em,particles:ne})}const M=p[0],N=M?{x:e.anchorKnotX??M.layoutX,y:Yc}:{x:e.width/2,y:Yc};M&&w(N,null,M,"__anchor");for(let q=0;q<p.length-1;q++){const z=p[q],H=p[q+1];w(y(z),z.body,H,z.nodeId)}const L=p[p.length-1],A=e.nextKnot&&(L!=null&&L.isExam)?e.nextKnot:void 0;A&&L&&w(A,null,L,"__next");const C=new Map;for(const q of p){let z=0;for(const G of E)if(G.from===q.nodeId||G.to===q.nodeId)for(const Z of G.particles)z+=Z.mass*.5;const H=Math.min(.25,z/q.body.mass);C.set(q.nodeId,(1+H)*(.96+OE(q.nodeId)*.08))}let I=0,R=1;d.on(f,"beforeUpdate",()=>{const q=f.timing.timestamp;I*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(I=n.gust*(.6+Math.random()*.4),R=Math.random()<.5?-1:1);for(const z of p){const H=z.body.mass,G=f.gravity.y*f.gravity.scale,Z=wN(z.body.position.x,z.body.position.y,q)*n.wind*SN*H+R*I*kN*H;let ie=-H*G*(C.get(z.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(ie+=H*G*.35,s.applyForce(z.body,z.body.position,{x:(Math.random()-.5)*H*G*.3,y:0})),s.applyForce(z.body,z.body.position,{x:Z,y:ie})}});const j=[],D=(q,z,H,G)=>{if(q.snow<=am)return;const Z=Math.max(1,Math.min(G,Math.round(q.snow*G)+1));for(let ie=0;ie<Z;ie++){const F=-(.35+Math.random()*1.9),Y=t*(.55+Math.random()*.45);j.push({x:q.body.position.x+Math.cos(F)*Y,y:q.body.position.y+Math.sin(F)*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(am*.5,q.snow-Z*(.03+Math.min(.07,H*.005))),j.length>96&&j.splice(0,j.length-96)},P=[];d.on(f,"collisionStart",q=>{var z;for(const H of q.pairs){const{bodyA:G,bodyB:Z}=H,ie=p.find($=>$.body===G),F=p.find($=>$.body===Z);if(!ie&&!F)continue;const Y={x:G.velocity.x-Z.velocity.x,y:G.velocity.y-Z.velocity.y},J=Math.hypot(Y.x,Y.y);if(J<_N)continue;const U=H.collision.normal,ne=(z=H.collision.supports)==null?void 0:z[0];P.push(ne?{x:ne.x,y:ne.y,speed:J}:{x:(G.position.x+Z.position.x)/2,y:(G.position.y+Z.position.y)/2,speed:J}),P.length>64&&P.shift();const K=Math.min(.32,J*.028);ie&&K>ie.squash&&(ie.squash=K,ie.squashAngle=Math.atan2(U.y,U.x)),F&&K>F.squash&&(F.squash=K,F.squashAngle=Math.atan2(-U.y,-U.x)),ie&&D(ie,{x:U.x,y:U.y},J,5),F&&D(F,{x:-U.x,y:-U.y},J,5)}}),d.on(f,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const q of p)q.snow=Math.min(1,q.snow+n.snowRate)});let B=null;return{balls:p,links:E,anchor:N,nextKnot:A,ball(q){return p.find(z=>z.nodeId===q)},step(q){i.update(f,Math.min(33,Math.max(8,q)));for(let z=0;z<p.length;z++){const H=p[z];for(let G=z+1;G<p.length;G++){const Z=p[G],ie=Z.body.position.x-H.body.position.x,F=Z.body.position.y-H.body.position.y,Y=ie*ie+F*F;if(Y>=tm*tm||Y<.01)continue;const J=Math.sqrt(Y),U=(J-2*t)/(tm-2*t),ne=U<=0?1:U>=1?0:1-U,$=Math.hypot(H.body.velocity.x-Z.body.velocity.x,H.body.velocity.y-Z.body.velocity.y)<1.2?RN*ne*ne:0,oe=ie/J,ce=F/J;H.body.isStatic||s.applyForce(H.body,H.body.position,{x:-oe*$*H.body.mass,y:-ce*$*H.body.mass}),Z.body.isStatic||s.applyForce(Z.body,Z.body.position,{x:oe*$*Z.body.mass,y:ce*$*Z.body.mass}),H.field=Math.max(H.field,ne),Z.field=Math.max(Z.field,ne)}}for(const z of p)z.field*=.88;for(const z of p){if(z.body.isStatic)continue;const H=z.body.velocity,G=Math.hypot(H.x,H.y);G>nm&&s.setVelocity(z.body,{x:H.x/G*nm,y:H.y/G*nm})}for(let z=0;z<p.length;z++){const H=p[z];for(let G=z+1;G<p.length;G++){const Z=p[G];let ie=Z.body.position.x-H.body.position.x,F=Z.body.position.y-H.body.position.y,Y=Math.hypot(ie,F);if(Y>=t*2)continue;Y<.01&&(ie=1,F=0,Y=1);const J=t*2-Y+.05,U=ie/Y,ne=F/Y;H.body.isStatic&&Z.body.isStatic||(H.body.isStatic?s.setPosition(Z.body,{x:Z.body.position.x+U*J,y:Z.body.position.y+ne*J}):Z.body.isStatic?s.setPosition(H.body,{x:H.body.position.x-U*J,y:H.body.position.y-ne*J}):(s.setPosition(H.body,{x:H.body.position.x-U*J/2,y:H.body.position.y-ne*J/2}),s.setPosition(Z.body,{x:Z.body.position.x+U*J/2,y:Z.body.position.y+ne*J/2})))}}for(const z of p){const H=Math.hypot(z.body.velocity.x,z.body.velocity.y);z.snow>am&&H>MN&&D(z,{x:z.body.velocity.x/H,y:z.body.velocity.y/H},H,2)}for(const z of p){if(z.body.isStatic)continue;const H=z.body.position.x,G=z.body.position.y,Z=Math.min(e.width-t,Math.max(t,H)),ie=Math.min(e.height-t,Math.max(t,G));(Z!==H||ie!==G)&&(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:G<t||G>e.height-t?0:z.body.velocity.y}))}},beginDrag(q,z,H){this.endDrag();const G=this.ball(q);if(!G)return;const Z=c.create({pointA:g(z,H),bodyB:G.body,length:0,stiffness:NN,damping:.12});l.add(f.world,Z),B={constraint:Z,nodeId:q}},moveDrag(q,z){if(!B)return;const H=g(q,z);B.constraint.pointA=H},endDrag(){B&&(l.remove(f.world,B.constraint),B=null)},isDragging(){return B!==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(f,"beforeUpdate"),d.off(f,"afterUpdate"),d.off(f,"collisionStart"),l.clear(f.world,!1),i.clear(f)}}}const Yc=-12;function oc(e,t,n=20){return t<=n*2?t/2:n+OE(e)*(t-n*2)}function LN(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 Ar=(e,t,n)=>e+(t-e)*n,fd=(e,t,n)=>e<t?t:e>n?n:e,Tl=e=>e<0?0:e>1?1:e*e*(3-2*e);function Cr(e,t,n){return[Ar(e[0],t[0],n),Ar(e[1],t[1],n),Ar(e[2],t[2],n)]}const im=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,Is=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function hd(){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 md(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const rm=()=>md(hd(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),lc=()=>md(hd(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),sm=()=>md(hd(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),py=()=>md(hd(),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]}),om={far:[28,50,36],near:[56,110,52],snowy:!1},uc={far:[20,48,30],near:[34,82,40],snowy:!1},lm={far:[54,36,24],near:[128,78,36],snowy:!1},gy={far:[60,66,82],near:[232,236,244],snowy:!0};function aa(e){return t=>{let n=e;return t>.3&&t<.5?n=Ar(n,Math.min(1,n+.2),Tl((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=Ar(n,Math.max(0,n-.3),Tl((t-.74)/.1))),fd(n,0,1)}}const IE={"spring|clear":{season:"spring",weather:"clear",sky:rm(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:om},"spring|cloudy":{season:"spring",weather:"cloudy",sky:rm(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:om},"spring|rain":{season:"spring",weather:"rain",sky:rm(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:om},"summer|clear":{season:"summer",weather:"clear",sky:lc(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:uc},"summer|cloudy":{season:"summer",weather:"cloudy",sky:lc(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:uc},"summer|rain":{season:"summer",weather:"rain",sky:lc(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:uc},"summer|storm":{season:"summer",weather:"storm",sky:lc(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:uc},"autumn|clear":{season:"autumn",weather:"clear",sky:sm(),cloudCover:aa(.15),particles:"none",lightning:!1,fogAlpha:0,ground:lm,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:sm(),cloudCover:aa(.55),particles:"none",lightning:!1,fogAlpha:0,ground:lm},"autumn|storm":{season:"autumn",weather:"storm",sky:sm(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:lm},"winter|clear":{season:"winter",weather:"clear",sky:py(),cloudCover:aa(.2),particles:"none",lightning:!1,fogAlpha:0,ground:gy,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:py(),cloudCover:aa(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:gy}},xy=Object.keys(IE);function ON(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 IN(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return xy[ON(t)%xy.length]}function jN(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=Tl(fd((e-i.t)/(o.t-i.t||1),0,1));return{top:Cr(i.top,o.top,s),mid:Cr(i.mid,o.mid,s),hor:Cr(i.hor,o.hor,s)}}function PN(e,t,n,i,o){if(e<i||e>o)return null;const s=(e-i)/(o-i),l=Ar(.1,.9,s),c=n*.26,d=n*.98,f=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:f,peakness:Math.sin(s*Math.PI)}}function BN(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=Ar(.12,.88,s),c=n*.26,d=n*.98,f=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:f,peakness:Math.sin(s*Math.PI)}}function jE(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 by(e,t){const n=jE(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 zN(){const e=jE(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 UN(e,t,n,i){const o=e.createLinearGradient(0,0,0,i);o.addColorStop(0,im(t.top)),o.addColorStop(.55,im(t.mid)),o.addColorStop(1,im(t.hor)),e.fillStyle=o,e.fillRect(0,0,n,i)}function HN(e,t,n,i,o,s){let l=0;if(t<.22?l=Tl(1-t/.22):t>.8&&(l=Tl((t-.8)/.2)),!(l<=.01))for(const c of n){const d=.55+.45*Math.sin(s*c.sp+c.tw),f=l*d;if(f<.02)continue;e.fillStyle=`rgba(255,248,228,${f})`;const p=c.big?c.r*1.8:c.r;e.beginPath(),e.arc(c.x*i,c.y*o,p,0,Math.PI*2),e.fill(),c.big&&(e.fillStyle=`rgba(255,240,210,${f*.35})`,e.fillRect(c.x*i-p*4,c.y*o-.4,p*8,.8),e.fillRect(c.x*i-.4,c.y*o-p*4,.8,p*8))}}function FN(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),f=n??[255,236,180],p=n?Cr(n,[255,214,150],.5):[255,214,150];d.addColorStop(0,"rgba(255,252,238,1)"),d.addColorStop(.7,Is(f,1)),d.addColorStop(1,Is(p,.9)),e.fillStyle=d,e.beginPath(),e.arc(i,o,l,0,Math.PI*2),e.fill()}function VN(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,f,p]of c)e.beginPath(),e.arc(n+d,i+f,p,0,Math.PI*2),e.fill()}function qN(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=Is([o[0]*.7,o[1]*.7,o[2]*.78],s*.9);for(const[d,f,p]of c)e.beginPath(),e.arc(d*l,f*l*1.1+l*.45,l*p*1.05,0,Math.PI*2),e.fill();e.fillStyle=Is(o,s);for(const[d,f,p]of c)e.beginPath(),e.arc(d*l,f*l,l*p,0,Math.PI*2),e.fill();e.restore()}function YN(e,t,n,i,o,s,l,c,d){const f=l(t);if(f<.02)return;const p=Cr(c.hor,[255,255,255],.35),x=Cr(c.mid,[20,20,30],.45),b=d?x:p;for(let g=0;g<n.length;g++){const y=n[g],E=(y.x+s*y.speed)%1.2-.1,T=y.y+Math.sin(s*1e-4+y.seed)*y.drift;g/n.length<f&&qN(e,E*i,T*o,y.s,b,fd(f*.92,0,.92))}}const ws=[];let xr=[];const tl=[];let br=[];const cc=[],Xo=[];let nl=[];function GN(e,t,n,i,o,s){if(o<.04)return;const l=i*(.02+o*.07),c=.12+o*.73,d=t-i*c,f=t+i*c,p=n-Math.sqrt(Math.max(0,i*i-i*c*(i*c))),x=n-i-l,b=(p+x)/2;e.save(),e.beginPath(),e.moveTo(d,p),e.bezierCurveTo(d,b,t-i*.3,x,t,x),e.bezierCurveTo(t+i*.3,x,f,b,f,p),e.quadraticCurveTo(t,n-i*.78,d,p),e.closePath();const g=e.createLinearGradient(0,x,0,p);g.addColorStop(0,"rgba(255,255,255,0.98)"),g.addColorStop(.65,"rgba(245,250,255,0.95)"),g.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=g,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(d,p),e.quadraticCurveTo(t,n-i*.78,f,p),e.stroke(),e.restore()}function um(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 XN(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 KN(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 PE(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 QN(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 x=0;x<d;x++){const b=c.prog-c.len*(x/d),g=c.prog-c.len*((x+1)/d),y=um(t,n,i,b,c.theta),E=um(t,n,i,g,c.theta),T=(1-x/d)*.42;e.strokeStyle=`rgba(200,228,250,${T})`,e.lineWidth=c.thick*(1-x/d*.7),e.lineCap="round",e.beginPath(),e.moveTo(y.x,y.y),e.lineTo(E.x,E.y),e.stroke()}const f=um(t,n,i,c.prog,c.theta),p=e.createRadialGradient(f.x-1.2,f.y-1.2,0,f.x,f.y,c.thick*1.3);p.addColorStop(0,"rgba(255,255,255,0.85)"),p.addColorStop(.4,"rgba(180,215,240,0.5)"),p.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=p,e.beginPath(),e.arc(f.x,f.y,c.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function $N(e,t,n,i){for(;ws.length<t.length;)ws.push([]);for(;xr.length<t.length;)xr.push(0);for(;nl.length<t.length;)nl.push(.3);for(;tl.length<t.length;)tl.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,(nl[o]??.3)+8e-4);nl[o]=l,GN(e,s.x,s.y,s.r,l)}else if(n.particles==="rain"){if(XN(e,s.x,s.y,s.r),xr[o]=xr[o]-1,xr[o]<=0&&ws[o].length<3){const l=Math.random()<.5?-1:1;ws[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(QN(e,s.x,s.y,s.r,ws[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)),f=4+Math.floor(Math.random()*3);for(let p=0;p<f;p++){const x=c<0?-1:1;tl[o].push({x:l,y:d,vx:x*(.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)}PE(e,tl[o])}}}function WN(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 ZN(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 JN(e,t,n,i,o){const s=e.createLinearGradient(0,n*.4,0,n),l=Cr(o.hor,[255,255,255],.3);s.addColorStop(0,Is(l,0)),s.addColorStop(1,Is(l,i)),e.fillStyle=s,e.fillRect(0,n*.4,t,n*.6)}let Es=0,yy=0;function e5(e,t,n,i,o){if(o>yy&&(Es=1,yy=o+1400+Math.random()*2600),Es*=.86,Es<.02){Es=0;return}if(e.fillStyle=`rgba(255,255,255,${Es*.5})`,e.fillRect(0,0,t,n),Es>.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 t5(e,t,n,i){const o=e.getContext("2d");if(!o)return()=>{};const s=o,l=n;let c=0,d=0,f=1,p=by(1,1);const x=zN();let b=[],g=[],y=0,E=0,T=!0;const w=performance.now(),M=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function N(){const j=l.getBoundingClientRect();if(f=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,j.width),d=Math.max(1,j.height),e.width=Math.floor(c*f),e.height=Math.floor(d*f),e.style.width=c+"px",e.style.height=d+"px",s.setTransform(f,0,0,f,0,0),p=by(c,d),i.particles==="rain"&&b.length===0){const D=i.weather==="storm",P=D?140:70;for(let B=0;B<P;B++)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"&&g.length===0)for(let D=0;D<120;D++)g.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 L(){const j=t.scrollHeight-t.clientHeight;y=j>0?fd(t.scrollTop/j,0,1):0}function A(j){if(!T)return;const D=y,P=M?0:(j-w)/1e3,B=jN(D,i.sky);UN(s,B,c,d),HN(s,D,p,c,d,P),VN(s,BN(D,c,d,.92,.08)),FN(s,PN(D,c,d,.16,.88),i.sunTint),YN(s,D,x,c,d,j,i.cloudCover,B,i.weather==="storm"),i.particles==="rain"&&WN(s,c,d,b,i.weather==="storm"),i.particles==="snow"&&ZN(s,c,d,g,j),i.fogAlpha>0&&JN(s,c,d,i.fogAlpha,B),i.lightning&&e5(s,c,d,!0,j),M||(E=requestAnimationFrame(A))}const C=()=>L(),I=new ResizeObserver(()=>{N(),L()});I.observe(l),N(),L();let R;if(M){let j=!1;R=()=>{L(),j||(j=!0,requestAnimationFrame(()=>{j=!1,A(performance.now())}))},t.addEventListener("scroll",R,{passive:!0}),A(performance.now())}else R=C,t.addEventListener("scroll",R,{passive:!0}),E=requestAnimationFrame(A);return()=>{T=!1,cancelAnimationFrame(E),I.disconnect(),t.removeEventListener("scroll",R)}}function n5(e,t,n,i,o,s){const l=()=>{ws.length=0,nl.length=0,xr.length=0,tl.length=0,br.length=0,cc.length=0,Xo.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 f=d;let p=0,x=0,b=1,g=0,y=!0;function E(){const M=t.getBoundingClientRect();b=Math.min(window.devicePixelRatio||1,2),p=Math.max(1,M.width),x=Math.max(1,M.height),e.width=Math.floor(p*b),e.height=Math.floor(x*b),e.style.width=p+"px",e.style.height=x+"px",f.setTransform(b,0,0,b,0,0)}function T(M){if(!y)return;f.clearRect(0,0,p,x);const N=i();if($N(f,N,n),o){for(const L of o()){const A=3+Math.min(5,Math.floor(L.speed/3));for(let C=0;C<A;C++)cc.push({x:L.x,y:L.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}cc.length>0&&PE(f,cc)}if(s){for(const L of s()){const A=1+Math.min(2,Math.round(L.amount*40));for(let C=0;C<A;C++){const I=55+Math.floor(Math.random()*40);Xo.push({x:L.x+(Math.random()-.5)*8,y:L.y+(Math.random()-.5)*6,vx:L.vx*.6+(Math.random()-.5)*.8,vy:L.vy*.6-Math.random()*.5,life:I,maxLife:I,r:1.2+Math.random()*2.2})}}for(;Xo.length>240;)Xo.shift();KN(f,Xo)}g=requestAnimationFrame(T)}const w=new ResizeObserver(E);return w.observe(t),E(),g=requestAnimationFrame(T),()=>{y=!1,cancelAnimationFrame(g),w.disconnect(),l()}}const h0=new Set;function Nr(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 h0)i(n)}function vy(e){return h0.add(e),()=>{h0.delete(e)}}function a5(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 BE="(prefers-reduced-motion: reduce)";function i5(e){const t=window.matchMedia(BE);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function r5(){return window.matchMedia(BE).matches}function s5(){return!1}function zE(){return _.useSyncExternalStore(i5,r5,s5)}function o5(e){const t=Ve(),[n,i]=_.useState("import"),[o,s]=_.useState("study"),l=_.useRef(null),c=_.useRef(null),d=Math.round(e.overallMastery*100),p=!zE(),x=_.useRef([]),b=_.useRef(P=>{x.current.push(...P),x.current.length>64&&x.current.splice(0,x.current.length-64)}).current,g=_.useRef([]),y=_.useRef(new Map),E=_.useRef(P=>{g.current.push(...P),g.current.length>96&&g.current.splice(0,g.current.length-96)}).current,T=e.sections.filter(P=>(P.world??"study")===o),w=e.sections.some(P=>P.world==="practice"),[M,N]=_.useState(null);_.useEffect(()=>{N(IN(e.courseId))},[e.courseId]);const L=M?IE[M]??null:null,[A,C]=_.useState(!1);_.useEffect(()=>{if(!e.selectedNodeId)return;const P=c.current;if(!P)return;const B=P.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!B)return;const Q=P.getBoundingClientRect(),q=B.getBoundingClientRect();(q.top<Q.top+60||q.bottom>Q.bottom-60)&&B.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const I=_.useRef(null);_.useEffect(()=>{C(!1),e.courseId&&(I.current===null||I.current!==e.courseId)&&(i("map"),s("study")),!e.courseId&&I.current!==null&&(i("import"),s("study")),I.current=e.courseId},[e.courseId]);const[R,j]=_.useState(null),D=_.useRef({});return _.useEffect(()=>{var q;const P=D.current,B={};let Q=!1;for(const z of e.tree){const H=((q=e.progressMap[z.id])==null?void 0:q.status)??"locked";B[z.id]=H,P[z.id]==="locked"&&H!=="locked"&&(Q=!0)}Q&&Object.keys(P).length>0&&Nr("unlock"),D.current=B},[e.tree,e.progressMap]),m.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:[L&&m.jsxs(m.Fragment,{children:[m.jsx(u5,{scrollRef:c,navRef:l,preset:L}),m.jsx(c5,{scrollRef:c,navRef:l,preset:L,getImpacts:()=>x.current.splice(0),getFlakes:()=>g.current.splice(0),orbSnowRef:y})]}),m.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:[m.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:[m.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:[m.jsx(sp,{className:"w-3 h-3"})," ",t("map.tab.map")]}),m.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:[m.jsx(Dl,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&m.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:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.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&&m.jsx(g5,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&m.jsx("button",{onClick:P=>{const B=P.currentTarget.getBoundingClientRect();j({id:e.courseId,title:e.courseTitle??"",rect:B})},"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:m.jsx(wE,{className:"w-3 h-3"})})]}),m.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[m.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:m.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,d)}%`}})}),m.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[d,"%"]})]}),m.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[m.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:[m.jsx(op,{className:"w-3 h-3 text-white/50"}),m.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),m.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:[m.jsx(ii,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),m.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&m.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),w&&m.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[m.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:[m.jsx(ii,{className:"w-3 h-3"})," ",t("map.world.study")]}),m.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:[m.jsx(cp,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),m.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:m.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[m.jsx("div",{className:"w-1/2 h-full relative",children:m.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:m.jsxs("div",{className:`map-sky-content ${L?`env-${L.season} env-${L.weather}`:""}`,children:[e.streaming&&m.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:[m.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?m.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):m.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:[m.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),m.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),m.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),m.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):T.length===0?m.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(o==="practice"?"map.empty.practice":"map.generating")}):m.jsx("div",{className:"space-y-6 pt-2",children:T.map((P,B)=>m.jsx(d5,{section:P,sectionIndex:B,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:p,physicsWeather:(L==null?void 0:L.weather)??"clear",scrollRef:c,navRef:l,onImpacts:b,onFlakes:E,orbSnowRef:y},P.id))})]})})}),m.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:m.jsx(l5,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:P=>{e.onSelectCourse(P),i("map")},onDeleteCourse:(P,B,Q)=>j({id:P,title:B,rect:Q}),onCoursesChanged:e.onCoursesChanged})})]})}),A&&e.courseId&&m.jsx(iN,{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)}),R&&m.jsx(dd,{anchorRect:R.rect,message:`${R.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(R.id),j(null)},onCancel:()=>j(null)})]})}function l5({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:i,onCoursesChanged:o}){const s=Ve(),[l,c]=_.useState("url"),[d,f]=_.useState(!1),[p,x]=_.useState(""),[b,g]=_.useState(""),y=_.useRef(null),[E,T]=_.useState(""),[w,M]=_.useState(""),[N,L]=_.useState(!1),[A,C]=_.useState(null),[I,R]=_.useState(null),[j,D]=_.useState(null),[P,B]=_.useState(null),[Q,q]=_.useState([]),[,z]=_.useState(0),H=_.useRef(null);_.useEffect(()=>{const K=me.on("import:progress",oe=>{q(ce=>{const _e=/\d+\/\d+/.test(oe),Ke=ce[ce.length-1];if(_e&&Ke&&Ke.status==="working"){const it=[...ce];return it[it.length-1]={...Ke,msg:oe},it}const Je=ce.map(it=>it.status==="working"?{...it,status:"done"}:it);return Je.push({msg:oe,status:"working",ts:Date.now()}),Je})}),$=setInterval(()=>z(oe=>oe+1),1e3);return()=>{K(),clearInterval($)}},[]),_.useEffect(()=>me.on("import:done",$=>{L(!1),D($.ok?null:$.planId??null),$.ok?(R(`${s("import.success.folder")}: ${$.title??""}${$.reused?`(${s("import.success.reused")})`:""}`),B($.courseId?{courseId:$.courseId,packable:$.packable??!1}:null),o()):$.cancelled?(q([]),C(null),R(s("import.cancelled"))):C($.error??"导入失败")}),[o,s]),_.useEffect(()=>{const K=H.current;K&&(K.scrollTop=K.scrollHeight)},[Q]);const G=async()=>{if(!(!p.trim()||N)){C(null),R(null),q([]);try{await me.importGithub(p.trim()),L(!0)}catch(K){C(K instanceof Error?`${K.message}${s("import.error.network")}`:String(K))}}},Z=async()=>{if(!(!E.trim()||!w.trim()||N)){L(!0),C(null),R(null);try{const K=await me.generateCourseFromMarkdown(E.trim(),w.trim());R(`${s("import.success.md")}: ${K.title}`),setTimeout(()=>{o(),n(K.id)},800)}catch(K){C(K instanceof Error?K.message:String(K))}finally{L(!1)}}},ie=async()=>{if(N)return;if(C(null),R(null),q([]),!Yo){const $=b.trim();if(!$){C(s("import.folder.pathRequired"));return}try{await me.importLocalFolder($)&&L(!0)}catch(oe){C(oe instanceof Error?oe.message:String(oe))}return}await me.importLocalFolder()&&L(!0)},F=async()=>{var $;if(N)return;if(C(null),R(null),q([]),!Yo){($=y.current)==null||$.click();return}await me.importPack().catch(oe=>(C(oe instanceof Error?oe.message:String(oe)),null))&&L(!0)},Y=async K=>{if(!(!K||N)){C(null),R(null),q([]);try{const $=await K.text();await me.importPack({fileName:K.name,content:$})&&L(!0)}catch($){C($ instanceof Error?$.message:String($))}}},J=async K=>{if(!N){C(null),q([]);try{await me.importResume(K),L(!0)}catch($){C($ instanceof Error?$.message:String($))}}},U=async K=>{try{const $=await me.exportPack(K);$!=null&&$.content&&$.fileName?(ne($.fileName,$.content),R(s("import.pack.exported",{path:$.fileName}))):$!=null&&$.path&&R(s("import.pack.exported",{path:$.path}))}catch($){C($ instanceof Error?$.message:String($))}},ne=(K,$)=>{const oe=new Blob([$],{type:"application/json"}),ce=URL.createObjectURL(oe),_e=document.createElement("a");_e.href=ce,_e.download=K,_e.click(),setTimeout(()=>URL.revokeObjectURL(ce),5e3)};return m.jsxs(m.Fragment,{children:[e.length===0?m.jsxs("div",{className:"text-center py-10",children:[m.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),m.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:s("import.empty")})]}):m.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(K=>{const $=K.id===t;return m.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:[m.jsx("button",{onClick:()=>n(K.id),className:"w-full text-left p-3",children:m.jsxs("div",{className:"flex items-start justify-between gap-2",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:`text-body font-bold truncate ${$?"text-brand":"text-white/90"}`,children:K.title}),m.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:K.repoName})]}),$&&m.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:m.jsx(Fn,{className:"w-3 h-3 text-white"})})]})}),m.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:[m.jsxs("button",{onClick:oe=>{oe.stopPropagation(),C(null),R(null),me.exportPack(K.id).then(ce=>{ce!=null&&ce.content&&ce.fileName?(ne(ce.fileName,ce.content),R(s("import.pack.exported",{path:ce.fileName}))):ce!=null&&ce.path&&R(s("import.pack.exported",{path:ce.path}))}).catch(ce=>{C(ce instanceof Error?ce.message:String(ce))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[m.jsx(ly,{className:"w-2.5 h-2.5"})," ",s("import.export")]}),m.jsxs("button",{onClick:oe=>{oe.stopPropagation();const ce=oe.currentTarget.getBoundingClientRect();i(K.id,K.title,ce)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[m.jsx(wE,{className:"w-2.5 h-2.5"})," ",s("import.delete")]})]})]},K.id)})}),m.jsxs("div",{className:e.length>0?"mt-6":"",children:[m.jsxs("button",{onClick:()=>f(!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:[m.jsx(cd,{className:`w-4 h-4 transition-transform ${d?"rotate-45":""}`})," ",s("import.cta")]}),d&&m.jsxs("div",{className:"mt-3 space-y-3",children:[N?m.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[m.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),m.jsx("span",{className:"text-body font-bold text-white/90",children:s("import.progress.title")}),m.jsx("button",{onClick:()=>{me.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:s("import.progress.cancel")})]}),m.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:s("import.progress.note")}),(l==="url"?p.trim():l==="markdown"&&w.trim())?m.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:l==="url"?p.trim():w.trim()}):null,m.jsx("div",{ref:H,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:Q.length===0?m.jsx("div",{className:"text-caption text-white/50 py-1",children:s("import.progress.starting")}):Q.map((K,$)=>m.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[K.status==="done"?m.jsx(Fn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):m.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"}),m.jsxs("span",{className:K.status==="done"?"text-white/40":"text-white/90",children:[K.msg,K.status==="working"&&m.jsxs("span",{className:"text-white/35 ml-1",children:["(",s("import.progress.elapsed",{s:Math.floor((Date.now()-K.ts)/1e3)}),")"]})]})]},$))})]}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"@container flex gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:s("import.tab.url"),icon:wC},{k:"markdown",label:s("import.tab.md"),icon:Dl},{k:"folder",label:s("import.tab.folder"),icon:bC},{k:"pack",label:s("import.tab.pack"),icon:ly}].map(({k:K,label:$,icon:oe})=>m.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:[m.jsx(oe,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4.4cqi, 0.875rem)"},children:$})]},K))}),l==="url"?m.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[m.jsx("input",{type:"text",value:p,onChange:K=>x(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"}),m.jsx("button",{onClick:G,disabled:!p.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"?m.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[m.jsx("input",{type:"text",value:w,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"}),m.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"}),m.jsx("button",{onClick:Z,disabled:!E.trim()||!w.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"?m.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.folder.desc")}),!Yo&&m.jsx("input",{type:"text",value:b,onChange:K=>g(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"}),m.jsx("button",{onClick:ie,disabled:N||!Yo&&!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")})]}):m.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.pack.desc")}),!Yo&&m.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=""}}),m.jsx("button",{onClick:F,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&&m.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&&m.jsx("button",{onClick:()=>void J(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")})]}),I&&m.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[m.jsx(Fn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(P==null?void 0:P.packable)&&m.jsx("button",{onClick:()=>void U(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 u5({scrollRef:e,navRef:t,preset:n}){const i=_.useRef(null);return _.useEffect(()=>{const o=i.current,s=e.current,l=t.current;return!o||!s||!l?void 0:t5(o,s,l,n)},[e,t,n]),m.jsx("canvas",{ref:i,className:"map-sky-canvas","aria-hidden":"true"})}function c5({scrollRef:e,navRef:t,preset:n,getImpacts:i,getFlakes:o,orbSnowRef:s}){const l=_.useRef(null);return _.useEffect(()=>{const c=l.current,d=t.current,f=e.current;if(!c||!d||!f)return;let p=null,x=null;const b=()=>{p=null,x=null},g=new MutationObserver(b);g.observe(f,{childList:!0,subtree:!0}),window.addEventListener("resize",b);const E=n5(c,d,n,()=>{var M,N;p||(p=Array.from(f.querySelectorAll(".lesson-bubble")));const T=x??d.getBoundingClientRect();x=T;const w=[];for(const L of p){const A=L.getBoundingClientRect();if(A.bottom<T.top||A.top>T.bottom)continue;const C=(M=L.closest("[data-node-id]"))==null?void 0:M.getAttribute("data-node-id"),I=C?(N=s==null?void 0:s.current)==null?void 0:N.get(C):void 0;w.push({x:A.left-T.left+A.width/2,y:A.top-T.top+A.height/2,r:A.width/2,...I!==void 0?{snow:I}:{}})}return w},i,o);return()=>{E(),g.disconnect(),window.removeEventListener("resize",b)}},[e,t,n,i,o]),m.jsx("canvas",{ref:l,className:"map-orb-weather-canvas","aria-hidden":"true"})}function d5({section:e,sectionIndex:t,tree:n,progressMap:i,selectedNodeId:o,dueNodeIds:s,onJumpNode:l,physics:c,physicsWeather:d,scrollRef:f,navRef:p,onImpacts:x,onFlakes:b,orbSnowRef:g}){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)>=NE}),w=_.useRef(null),[M,N]=_.useState(268);_.useEffect(()=>{if(!w.current)return;const K=()=>{var ce;const oe=((ce=w.current)==null?void 0:ce.clientWidth)??268;N(oe>0?oe:268)};K();const $=new ResizeObserver(K);return $.observe(w.current),()=>$.disconnect()},[]);const L=hN(y.length,M,e.id),A=L.height,C=110,I=76,R=_.useRef(null),j=_.useRef(new Map),D=_.useRef(0),P=_.useRef(null),B=_.useRef(0),Q=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("");_.useEffect(()=>{var fe,Be;if(!c||y.length===0||M<=0)return;const K=w.current,$=f.current;if(!K||!$)return;let oe;const ce=y[y.length-1];if((ce==null?void 0:ce.type)==="exam"){const je=(Be=(fe=K.closest("section"))==null?void 0:fe.nextElementSibling)==null?void 0:Be.querySelector(".map-signpost");je&&(oe={x:oc(`${e.id}:next`,M),y:je.getBoundingClientRect().top-K.getBoundingClientRect().top})}const _e=DN({nodes:L.nodes.map((je,pe)=>{const ke=y[pe];return{id:ke.id,x:je.x,y:je.y,isExam:ke.type==="exam",locked:z(ke),spawn:(()=>{const De=j.current.get(ke.id);return De?LN(De,D.current,M):void 0})()}}),width:M,height:L.height+40,weather:d,anchorKnotX:oc(`${e.id}:knot`,M),nextKnot:oe});R.current=_e;const Ke=K.querySelector("[data-next-knot]");Ke&&(_e.nextKnot?(Ke.setAttribute("cx",String(_e.nextKnot.x)),Ke.setAttribute("cy",String(_e.nextKnot.y))):Ke.setAttribute("opacity","0"));const Je=K.querySelector("[data-exam-rope]");Je&&!_e.nextKnot&&Je.setAttribute("opacity","0");const it=new Map;for(const je of K.querySelectorAll("[data-node-id]"))je.dataset.nodeId&&it.set(je.dataset.nodeId,je);const Ee=Array.from(K.querySelectorAll("[data-rope]")),Ye=Array.from(K.querySelectorAll("[data-pulse]")),yt=Array.from(K.querySelectorAll("[data-field]"));let Ot=!0;const Xt=new IntersectionObserver(je=>{for(const pe of je)Ot=pe.isIntersecting},{root:$,rootMargin:"200px 0px 200px 0px"});Xt.observe(K);const Se=520,Qe=[];let qe=0,pt=performance.now();const rt=je=>{var $e;qe=requestAnimationFrame(rt);const pe=Math.min(50,je-pt);if(pt=je,!Ot)return;_e.step(pe);for(const Ne of _e.balls){const nt=it.get(Ne.nodeId);nt&&(nt.style.transform=TN(Ne.body.position.x-Ne.layoutX,Ne.body.position.y-Ne.layoutY,Ne.squash,Ne.squashAngle)),Ne.squash=EN(Ne.squash,pe),($e=g.current)==null||$e.set(Ne.nodeId,Ne.snow)}const ke=Ne=>{if(Ne==="__anchor")return _e.anchor;if(Ne==="__next")return _e.nextKnot??_e.anchor;const nt=_e.ball(Ne);if(nt)return{x:nt.body.position.x,y:nt.body.position.y+Ca*ti};const tt=y.findIndex(rn=>rn.id===Ne),We=tt>=0?L.nodes[tt]:void 0;return We?{x:We.x,y:We.y+Ca*ti}:{x:0,y:0}};for(let Ne=0;Ne<_e.links.length&&Ne<Ee.length;Ne++){const nt=_e.links[Ne],tt=[ke(nt.from)];for(const We of nt.particles)tt.push({x:We.position.x,y:We.position.y});tt.push(ke(nt.to)),Ee[Ne].setAttribute("d",vN(tt))}for(let Ne=0;Ne<_e.balls.length&&Ne<yt.length;Ne++){const nt=_e.balls[Ne],tt=yt[Ne];nt.field>.03?(tt.setAttribute("cx",String(nt.body.position.x)),tt.setAttribute("cy",String(nt.body.position.y)),tt.setAttribute("r",String(Ca+4+nt.field*5)),tt.setAttribute("opacity",String((.3*nt.field).toFixed(3)))):tt.setAttribute("opacity","0")}const De=_e.drainImpacts();for(const Ne of De)Qe.push({x:Ne.x,y:Ne.y,t0:je,s:Math.min(1,Ne.speed/14)});for(let Ne=Qe.length-1;Ne>=0;Ne--)je-Qe[Ne].t0>Se&&Qe.splice(Ne,1);for(let Ne=0;Ne<Ye.length;Ne++){const nt=Qe[Ne],tt=Ye[Ne];if(!nt){tt.setAttribute("opacity","0");continue}const We=(je-nt.t0)/Se;tt.setAttribute("cx",String(nt.x)),tt.setAttribute("cy",String(nt.y)),tt.setAttribute("r",String(6+We*(14+nt.s*14))),tt.setAttribute("opacity",String(.55*(1-We))),tt.setAttribute("stroke-width",String(2+nt.s*1.5))}const Me=_e.drainFlakes();if((De.length>0||Me.length>0)&&p.current){const Ne=K.getBoundingClientRect(),nt=p.current.getBoundingClientRect(),tt=We=>({x:We.x+Ne.left-nt.left,y:We.y+Ne.top-nt.top});De.length>0&&x(De.map(We=>({...tt(We),speed:We.speed}))),Me.length>0&&b(Me.map(We=>({...tt(We),vx:We.vx,vy:We.vy,amount:We.amount})))}};return qe=requestAnimationFrame(rt),()=>{cancelAnimationFrame(qe),Xt.disconnect();for(const je of _e.balls)j.current.set(je.nodeId,{x:je.body.position.x,y:je.body.position.y,vx:je.body.velocity.x,vy:je.body.velocity.y});D.current=M,_e.dispose(),R.current=null;for(const je of it.values())je.style.transform=""}},[c,M,Q,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(!(!R.current||K.button!==0||z(y.find(_e=>_e.id===$))||!w.current)){try{K.currentTarget.setPointerCapture(K.pointerId)}catch{}B.current=0,P.current={track:{startX:K.clientX,startY:K.clientY},id:K.pointerId,dragging:!1,nodeId:$}}},G=K=>{const $=P.current,oe=R.current;if(!$||!oe||K.pointerId!==$.id)return;const ce=w.current;if(!ce||(!$.dragging&&hy($.track,K.clientX,K.clientY)==="drag"&&($.dragging=!0,K.currentTarget.style.zIndex="40",oe.beginDrag($.nodeId,K.clientX-ce.getBoundingClientRect().left,K.clientY-ce.getBoundingClientRect().top)),!$.dragging))return;const _e=ce.getBoundingClientRect();oe.moveDrag(K.clientX-_e.left,K.clientY-_e.top)},Z=K=>{var oe;const $=P.current;if(!(!$||K.pointerId!==$.id)){if((oe=R.current)==null||oe.endDrag(),K.currentTarget.style.zIndex="",hy($.track,K.clientX,K.clientY)==="drag")B.current=Date.now()+300;else{const ce=y.find(_e=>_e.id===$.nodeId);ce&&Date.now()>=B.current&&!z(ce)&&l(ce.id)}P.current=null}},ie=K=>{const $=y[K],oe=$?i[$.id]:void 0,ce=(oe==null?void 0:oe.status)==="mastered"||(oe==null?void 0:oe.status)==="in_progress"||(oe==null?void 0:oe.status)==="available";return{stroke:ce?"var(--brand)":"var(--ink-faint)",strokeWidth:ce?4:2.5,strokeOpacity:ce?.6:.5,strokeDasharray:ce?"none":"3 7"}},F=L.nodes[0]?{x:oc(`${e.id}:knot`,M),y:Yc}:{x:M/2,y:Yc},Y=y[y.length-1],J=(Y==null?void 0:Y.type)==="exam",U=L.nodes[L.nodes.length-1],ne=J&&U?{x:oc(`${e.id}:next`,M),y:A+24}:void 0;return m.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[m.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[m.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}),m.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})]}),m.jsxs("div",{ref:w,className:"relative",style:{minHeight:A},children:[m.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:A,overflow:"visible"},children:c?m.jsxs(m.Fragment,{children:[L.nodes[0]&&m.jsx("circle",{cx:F.x,cy:F.y,r:3.5,fill:"#ffc800",opacity:.9}),L.nodes[0]&&m.jsx("path",{"data-rope":0,d:`M ${F.x} ${F.y} L ${L.nodes[0].x} ${L.nodes[0].y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ie(0)}),L.segments.map((K,$)=>m.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&&U&&m.jsxs(m.Fragment,{children:[m.jsx("path",{"data-rope":L.segments.length+1,"data-exam-rope":!0,d:`M ${ne.x} ${ne.y} L ${U.x} ${U.y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ie(y.length-1)}),m.jsx("circle",{"data-next-knot":!0,cx:ne.x,cy:ne.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(K,$)=>m.jsx("circle",{"data-pulse":$,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},$)),y.map((K,$)=>m.jsx("circle",{"data-field":$,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${K.id}`))]}):L.segments.map(K=>{const $=f5(y[K.index],i);return m.jsx("path",{d:mN(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 oe=L.nodes[$];if(!oe)return null;const ce=f0(K.id),_e=`${ce%40/10}s`,Ke=`${5+ce%30/10}s`;return m.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:oe.x-C/2,top:oe.y-I/2+10,width:C,...c?{touchAction:"pan-y"}:{"--bob-delay":_e,"--bob-duration":Ke}},onPointerDown:c?Je=>H(Je,K.id):void 0,onPointerMove:c?G:void 0,onPointerUp:c?Z:void 0,onPointerCancel:c?Z:void 0,children:m.jsx(h5,{lesson:K,progress:i[K.id],isSelected:K.id===o,isDue:s.has(K.id),chapterLessonsMastered:T,onClick:()=>{Date.now()<B.current||l(K.id)}})},K.id)})]})]})}function f5(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 h5({lesson:e,progress:t,isSelected:n,isDue:i,chapterLessonsMastered:o,onClick:s}){const l=Ve(),c=(t==null?void 0:t.status)??"locked",d=(t==null?void 0:t.crownLevel)??0,f=e.type==="exam",p=Math.min(3,d),x=f?!o:c==="locked",b=f&&x,g=!f&&(c==="in_progress"||c==="mastered"),y=c==="mastered"?100:c==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return m.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[m.jsxs("button",{onClick:()=>!x&&s(),disabled:x,"data-testid":`${f?"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 ${f?b?"lesson-bubble exam-bubble-locked":p5(d>0):m5(c)} ${x?"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")}`:f?`🎯 ${e.title}`:x?`🔒 ${e.title}`:i?`📖 ${e.title}${l("node.due.hint")}`:e.title,children:[g&&m.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[m.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),m.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"})]}),f?b?m.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):m.jsx(Ls,{"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}):x?m.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):c==="mastered"?m.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):c==="in_progress"?m.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}):m.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),i&&!x&&!f&&m.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:"!"})]}),f&&m.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(E=>m.jsx("span",{className:`text-caption ${E<p?"text-gold":"text-white/25"}`,children:"★"},E))}),n&&m.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 m5(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 p5(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function g5({available:e,current:t,onChange:n}){const i=Ve(),[o,s]=_.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 m.jsxs("div",{className:"relative shrink-0",children:[m.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:[m.jsx(vC,{className:"w-3 h-3"}),c]}),o&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),m.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:[m.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=>m.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 x5=500,hr=8;function b5(){const[e,t]=_.useState(null),[n,i]=_.useState({mode:"cursor",x:0,y:0}),[o,s]=_.useState({w:0,h:0}),l=_.useRef(null),c=_.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),d=_.useCallback(T=>{c()||i(w=>w.mode==="cursor"?{...w,x:T.clientX,y:T.clientY}:w)},[c]),f=_.useCallback(T=>{var N;if(c())return;const w=(N=T.target)==null?void 0:N.closest("[data-tooltip]"),M=w==null?void 0:w.getAttribute("data-tooltip");if(M){t(M),i({mode:"cursor",x:T.clientX,y:T.clientY});return}t(null)},[c]),p=_.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(_.useEffect(()=>(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("mouseover",f,{passive:!0}),document.addEventListener("mouseout",p,{passive:!0}),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseover",f),document.removeEventListener("mouseout",p)}),[d,f,p]),_.useEffect(()=>{let T=null;const w=()=>{T&&(clearTimeout(T),T=null)},M=C=>{var D;if(!c()||C.touches.length!==1)return w();const I=(D=C.target)==null?void 0:D.closest("[data-tooltip]"),R=I==null?void 0:I.getAttribute("data-tooltip");if(!R||!I)return w();const j=I;w(),T=setTimeout(()=>{j.isConnected&&(t(R),i({mode:"rect",x:0,y:0,rect:j.getBoundingClientRect()}))},x5)},N=()=>{w(),t(C=>C&&null)},L=()=>w(),A=()=>{w(),t(null)};return document.addEventListener("touchstart",M,{passive:!0}),document.addEventListener("touchend",N,{passive:!0}),document.addEventListener("touchmove",L,{passive:!0}),document.addEventListener("touchcancel",A,{passive:!0}),()=>{w(),document.removeEventListener("touchstart",M),document.removeEventListener("touchend",N),document.removeEventListener("touchmove",L),document.removeEventListener("touchcancel",A)}},[c]),_.useLayoutEffect(()=>{l.current&&e&&s({w:l.current.offsetWidth,h:l.current.offsetHeight})},[e]),!e)return null;const x=window.innerWidth,b=window.innerHeight;let g,y,E;if(n.mode==="rect"&&n.rect){const T=n.rect;g=T.left+T.width/2-o.w/2,y=T.top-o.h-6,E="none",y<hr&&(y=T.bottom+6)}else g=n.x,y=n.y-6,E="translate(0, -100%)";return g=Math.min(Math.max(g,hr),Math.max(hr,x-o.w-hr)),y=Math.min(Math.max(y,hr),Math.max(hr,b-o.h-hr)),dp.createPortal(m.jsx("div",{ref:l,style:{position:"fixed",left:g,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 Ey(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 UE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const y5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E5={};function Ty(e,t){return(E5.jsx?v5:y5).test(e)}const T5=/[ \t\n\f\r]/g;function S5(e){return typeof e=="object"?e.type==="text"?Sy(e.value):!1:Sy(e)}function Sy(e){return e.replace(T5,"")===""}class Ol{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ol.prototype.normal={};Ol.prototype.property={};Ol.prototype.space=void 0;function HE(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Ol(n,i,t)}function Sl(e){return e.toLowerCase()}class Dn{constructor(t,n){this.attribute=n,this.property=t}}Dn.prototype.attribute="";Dn.prototype.booleanish=!1;Dn.prototype.boolean=!1;Dn.prototype.commaOrSpaceSeparated=!1;Dn.prototype.commaSeparated=!1;Dn.prototype.defined=!1;Dn.prototype.mustUseProperty=!1;Dn.prototype.number=!1;Dn.prototype.overloadedBoolean=!1;Dn.prototype.property="";Dn.prototype.spaceSeparated=!1;Dn.prototype.space=void 0;let k5=0;const Ge=Ir(),Zt=Ir(),m0=Ir(),Ce=Ir(),Nt=Ir(),_r=Ir(),Hn=Ir();function Ir(){return 2**++k5}const p0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:Zt,commaOrSpaceSeparated:Hn,commaSeparated:_r,number:Ce,overloadedBoolean:m0,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),cm=Object.keys(p0);class mp extends Dn{constructor(t,n,i,o){let s=-1;if(super(t,n),ky(this,"space",o),typeof i=="number")for(;++s<cm.length;){const l=cm[s];ky(this,cm[s],(i&p0[l])===p0[l])}}}mp.prototype.defined=!0;function ky(e,t,n){n&&(e[t]=n)}function Hs(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const s=new mp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Sl(i)]=i,n[Sl(s.attribute)]=i}return new Ol(t,n,e.space)}const FE=Hs({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:Nt,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:Ce,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:Nt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Zt,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function VE(e,t){return t in e?e[t]:t}function qE(e,t){return VE(e,t.toLowerCase())}const w5=Hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_r,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alpha:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:Nt,autoFocus:Ge,autoPlay:Ge,blocking:Nt,capture:null,charSet:null,checked:Ge,cite:null,className:Nt,closedBy:null,colorSpace:null,cols:Ce,colSpan:Ce,command:null,commandFor:null,content:null,contentEditable:Zt,controls:Ge,controlsList:Nt,coords:Ce|_r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:m0,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:Nt,height:Ce,hidden:m0,high:Ce,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:Ge,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,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:Ge,optimum:Ce,pattern:null,ping:Nt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:Nt,required:Ge,reversed:Ge,rows:Ce,rowSpan:Ce,sandbox:Nt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootCustomElementRegistry:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shadowRootSerializable:Ge,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:Zt,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ge,disablePictureInPicture:Ge,disableRemotePlayback:Ge,exportParts:_r,part:Nt,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:qE}),A5=Hs({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:Hn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Nt,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:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,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:_r,g2:_r,glyphName:_r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,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:Ce,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:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,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:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:VE}),YE=Hs({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()}}),GE=Hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qE}),XE=Hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),C5={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"},N5=/[A-Z]/g,wy=/-[a-z]/g,_5=/^data[-\w.:]+$/i;function pd(e,t){const n=Sl(t);let i=t,o=Dn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_5.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(wy,R5);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!wy.test(s)){let l=s.replace(N5,M5);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=mp}return new o(i,t)}function M5(e){return"-"+e.toLowerCase()}function R5(e){return e.charAt(1).toUpperCase()}const Il=HE([FE,w5,YE,GE,XE],"html"),Hi=HE([FE,A5,YE,GE,XE],"svg");function Ay(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function KE(e){return e.join(" ").trim()}var Ts={},dm,Cy;function D5(){if(Cy)return dm;Cy=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=`
520
+ `,f="/",p="*",x="",b="comment",g="declaration";function y(T,w){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];w=w||{};var M=1,N=1;function L(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=w.source}C.prototype.content=T;function I(q){var z=new Error(w.source+":"+M+":"+N+": "+q);if(z.reason=q,z.filename=w.source,z.line=M,z.column=N,z.source=T,!w.silent)throw z}function R(q){var z=q.exec(T);if(z){var H=z[0];return L(H),T=T.slice(H.length),z}}function j(){R(n)}function D(q){var z;for(q=q||[];z=P();)z!==!1&&q.push(z);return q}function P(){var q=A();if(!(f!=T.charAt(0)||p!=T.charAt(1))){for(var z=2;x!=T.charAt(z)&&(p!=T.charAt(z)||f!=T.charAt(z+1));)++z;if(z+=2,x===T.charAt(z-1))return I("End of comment missing");var H=T.slice(2,z-2);return N+=2,L(H),T=T.slice(z),N+=2,q({type:b,comment:H})}}function B(){var q=A(),z=R(i);if(z){if(P(),!R(o))return I("property missing ':'");var H=R(s),G=q({type:g,property:E(z[0].replace(e,x)),value:H?E(H[0].replace(e,x)):x});return R(l),G}}function Q(){var q=[];D(q);for(var z;z=B();)z!==!1&&(q.push(z),D(q));return q}return j(),Q()}function E(T){return T?T.replace(c,x):x}return dm=y,dm}var Ny;function L5(){if(Ny)return Ts;Ny=1;var e=Ts&&Ts.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.default=n;const t=e(D5());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:f,value:p}=d;c?o(f,p,d):p&&(s=s||{},s[f]=p)}),s}return Ts}var Ko={},_y;function O5(){if(_y)return Ko;_y=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),s(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,c):f=f.replace(i,c),f.replace(t,l))};return Ko.camelCase=d,Ko}var Qo,My;function I5(){if(My)return Qo;My=1;var e=Qo&&Qo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(L5()),n=O5();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,Qo=i,Qo}var j5=I5();const P5=Rl(j5),gd=QE("end"),Da=QE("start");function QE(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 $E(e){const t=Da(e),n=gd(e);if(t&&n)return{start:t,end:n}}function ol(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ry(e.position):"start"in e||"end"in e?Ry(e):"line"in e||"column"in e?g0(e):""}function g0(e){return Dy(e&&e.line)+":"+Dy(e&&e.column)}function Ry(e){return g0(e&&e.start)+"-"+g0(e&&e.end)}function Dy(e){return e&&typeof e=="number"?e:1}class xn 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=ol(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}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const pp={}.hasOwnProperty,B5=new Map,z5=/[A-Z]/g,U5=new Set(["table","tbody","thead","tfoot","tr"]),H5=new Set(["td","th"]),WE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function F5(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=$5(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=Q5(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:Il,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ZE(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function ZE(e,t,n){if(t.type==="element")return V5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return q5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return G5(e,t,n);if(t.type==="mdxjsEsm")return Y5(e,t);if(t.type==="root")return X5(e,t,n);if(t.type==="text")return K5(e,t)}function V5(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=eT(e,t.tagName,!1),l=W5(e,t);let c=xp(e,t);return U5.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!S5(d):!0})),JE(e,l,s,t),gp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function q5(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)}kl(e,t.position)}function Y5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kl(e,t.position)}function G5(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:eT(e,t.name,!0),l=Z5(e,t),c=xp(e,t);return JE(e,l,s,t),gp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function X5(e,t,n){const i={};return gp(i,xp(e,t)),e.create(t,e.Fragment,i,n)}function K5(e,t){return t.value}function JE(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function gp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Q5(e,t,n){return i;function i(o,s,l,c){const f=Array.isArray(l.children)?n:t;return c?f(s,l,c):f(s,l)}}function $5(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 W5(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&pp.call(t.properties,o)){const s=J5(e,o,t.properties[o]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&H5.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 Z5(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 kl(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 kl(e,t.position);else s=i.value===null?!0:i.value;n[o]=s}return n}function xp(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:B5;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 f=o.get(d)||0;l=d+"-"+f,o.set(d,f+1)}}const c=ZE(e,s,l);c!==void 0&&n.push(c)}return n}function J5(e,t,n){const i=pd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?UE(n):KE(n)),i.property==="style"){let o=typeof n=="object"?n:e_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=t_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?C5[i.property]||i.property:i.attribute,n]}}function e_(e,t){try{return P5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new xn("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=WE+"#cannot-parse-style-attribute",o}}function eT(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=Ty(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=Ty(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return pp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);kl(e)}function kl(e,t){const n=new xn("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=WE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function t_(e){const t={};let n;for(n in e)pp.call(e,n)&&(t[n_(n)]=e[n]);return t}function n_(e){let t=e.replace(z5,a_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function a_(e){return"-"+e.toLowerCase()}const fm={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"]},i_={};function bp(e,t){const n=i_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tT(e,i,o)}function tT(e,t,n){if(r_(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 Ly(e.children,t,n)}return Array.isArray(e)?Ly(e,t,n):""}function Ly(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=tT(e[o],t,n);return i.join("")}function r_(e){return!!(e&&typeof e=="object")}const Oy=document.createElement("i");function yp(e){const t="&"+e+";";Oy.innerHTML=t;const n=Oy.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 Iy={}.hasOwnProperty;function nT(e){const t={};let n=-1;for(;++n<e.length;)s_(t,e[n]);return t}function s_(e,t){let n;for(n in t){const o=(Iy.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){Iy.call(o,l)||(o[l]=[]);const c=s[l];o_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function o_(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 aT(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 vn=Fi(/[A-Za-z]/),gn=Fi(/[\dA-Za-z]/),l_=Fi(/[#-'*+\--9=?A-Z^-~]/);function Gc(e){return e!==null&&(e<32||e===127)}const x0=Fi(/\d/),u_=Fi(/[\dA-Fa-f]/),c_=Fi(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Rt(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const xd=Fi(new RegExp("\\p{P}|\\p{S}","u")),Lr=Fi(/\s/);function Fi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fs(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&gn(e.charCodeAt(n+1))&&gn(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 ht(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return lt(d)&&s++<o?(e.consume(d),c):(e.exit(n),t(d))}}const d_={tokenize:f_};function f_(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"),ht(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 He(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const h_={tokenize:m_},jy={tokenize:p_};function m_(e){const t=this,n=[];let i=0,o,s,l;return c;function c(N){if(i<n.length){const L=n[i];return t.containerState=L[1],e.attempt(L[0].continuation,d,f)(N)}return f(N)}function d(N){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&M();const L=t.events.length;let A=L,C;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){C=t.events[A][1].end;break}w(i);let I=L;for(;I<t.events.length;)t.events[I][1].end={...C},I++;return Vn(t.events,A+1,0,t.events.slice(L)),t.events.length=I,f(N)}return c(N)}function f(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(jy,p,x)(N)}function p(N){return o&&M(),w(i),b(N)}function x(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(jy,g,y)(N)}function g(N){return i++,n.push([t.currentConstruct,t.containerState]),b(N)}function y(N){if(N===null){o&&M(),w(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),w(0),e.consume(N);return}return He(N)?(e.consume(N),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(N),E)}function T(N,L){const A=t.sliceStream(N);if(L&&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 I=t.events.length;let R=I,j,D;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(j){D=t.events[R][1].end;break}j=!0}for(w(i),C=I;C<t.events.length;)t.events[C][1].end={...D},C++;Vn(t.events,R+1,0,t.events.slice(I)),t.events.length=C}}function w(N){let L=n.length;for(;L-- >N;){const A=n[L];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 p_(e,t,n){return ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function js(e){if(e===null||Rt(e)||Lr(e))return 1;if(xd(e))return 2}function bd(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 b0={name:"attention",resolveAll:g_,tokenize:x_};function g_(e,t){let n=-1,i,o,s,l,c,d,f,p;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 x={...e[i][1].end},b={...e[n][1].start};Py(x,-d),Py(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:x,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},f=[],e[i][1].end.offset-e[i][1].start.offset&&(f=ia(f,[["enter",e[i][1],t],["exit",e[i][1],t]])),f=ia(f,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),f=ia(f,bd(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),f=ia(f,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=ia(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Vn(e,i-1,n-i+3,f),n=i+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function x_(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=js(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 f=e.exit("attentionSequence"),p=js(d),x=!p||p===2&&o||n.includes(d),b=!o||o===2&&p||n.includes(i);return f._open=!!(s===42?x:x&&(o||!b)),f._close=!!(s===42?b:b&&(p||!x)),t(d)}}function Py(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const b_={name:"autolink",tokenize:y_};function y_(e,t,n){let i=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(g){return vn(g)?(e.consume(g),l):g===64?n(g):f(g)}function l(g){return g===43||g===45||g===46||gn(g)?(i=1,c(g)):f(g)}function c(g){return g===58?(e.consume(g),i=0,d):(g===43||g===45||g===46||gn(g))&&i++<32?(e.consume(g),c):(i=0,f(g))}function d(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Gc(g)?n(g):(e.consume(g),d)}function f(g){return g===64?(e.consume(g),p):l_(g)?(e.consume(g),f):n(g)}function p(g){return gn(g)?x(g):n(g)}function x(g){return g===46?(e.consume(g),i=0,p):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):b(g)}function b(g){if((g===45||gn(g))&&i++<63){const y=g===45?b:x;return e.consume(g),y}return n(g)}}const jl={partial:!0,tokenize:v_};function v_(e,t,n){return i;function i(s){return lt(s)?ht(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||He(s)?t(s):n(s)}}const iT={continuation:{tokenize:T_},exit:S_,name:"blockQuote",tokenize:E_};function E_(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 lt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function T_(e,t,n){const i=this;return o;function o(l){return lt(l)?ht(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(iT,t,n)(l)}}function S_(e){e.exit("blockQuote")}const rT={name:"characterEscape",tokenize:k_};function k_(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 c_(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const sT={name:"characterReference",tokenize:w_};function w_(e,t,n){const i=this;let o=0,s,l;return c;function c(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),d}function d(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,l=gn,p(x))}function f(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=u_,p):(e.enter("characterReferenceValue"),s=7,l=x0,p(x))}function p(x){if(x===59&&o){const b=e.exit("characterReferenceValue");return l===gn&&!yp(i.sliceSerialize(b))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(x)&&o++<s?(e.consume(x),p):n(x)}}const By={partial:!0,tokenize:C_},zy={concrete:!0,name:"codeFenced",tokenize:A_};function A_(e,t,n){const i=this,o={partial:!0,tokenize:A};let s=0,l=0,c;return d;function d(C){return f(C)}function f(C){const I=i.events[i.events.length-1];return s=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,c=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(C)}function p(C){return C===c?(l++,e.consume(C),p):l<3?n(C):(e.exit("codeFencedFenceSequence"),lt(C)?ht(e,x,"whitespace")(C):x(C))}function x(C){return C===null||He(C)?(e.exit("codeFencedFence"),i.interrupt?t(C):e.check(By,E,L)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===null||He(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(C)):lt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ht(e,g,"whitespace")(C)):C===96&&C===c?n(C):(e.consume(C),b)}function g(C){return C===null||He(C)?x(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||He(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(C)):C===96&&C===c?n(C):(e.consume(C),y)}function E(C){return e.attempt(o,L,T)(C)}function T(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),w}function w(C){return s>0&&lt(C)?ht(e,M,"linePrefix",s+1)(C):M(C)}function M(C){return C===null||He(C)?e.check(By,E,L)(C):(e.enter("codeFlowValue"),N(C))}function N(C){return C===null||He(C)?(e.exit("codeFlowValue"),M(C)):(e.consume(C),N)}function L(C){return e.exit("codeFenced"),t(C)}function A(C,I,R){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"),lt(z)?ht(C,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):B(z)}function B(z){return z===c?(C.enter("codeFencedFenceSequence"),Q(z)):R(z)}function Q(z){return z===c?(j++,C.consume(z),Q):j>=l?(C.exit("codeFencedFenceSequence"),lt(z)?ht(C,q,"whitespace")(z):q(z)):R(z)}function q(z){return z===null||He(z)?(C.exit("codeFencedFence"),I(z)):R(z)}}}function C_(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 hm={name:"codeIndented",tokenize:__},N_={partial:!0,tokenize:M_};function __(e,t,n){const i=this;return o;function o(f){return e.enter("codeIndented"),ht(e,s,"linePrefix",5)(f)}function s(f){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):He(f)?e.attempt(N_,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||He(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function M_(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):He(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ht(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):He(l)?o(l):n(l)}}const R_={name:"codeText",previous:L_,resolve:D_,tokenize:O_};function D_(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 L_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function O_(e,t,n){let i=0,o,s;return l;function l(x){return e.enter("codeText"),e.enter("codeTextSequence"),c(x)}function c(x){return x===96?(e.consume(x),i++,c):(e.exit("codeTextSequence"),d(x))}function d(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),d):x===96?(s=e.enter("codeTextSequence"),o=0,p(x)):He(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(x))}function f(x){return x===null||x===32||x===96||He(x)?(e.exit("codeTextData"),d(x)):(e.consume(x),f)}function p(x){return x===96?(e.consume(x),o++,p):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(s.type="codeTextData",f(x))}}class I_{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&&$o(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),$o(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$o(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);$o(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$o(this.left,n.reverse())}}}function $o(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 oT(e){const t={};let n=-1,i,o,s,l,c,d,f;const p=new I_(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.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,j_(p,n)),n=t[n],f=!0);else if(i[1]._container){for(s=n,o=void 0;s--;)if(l=p.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.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={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(i),p.splice(o,n-o+1,c))}}return Vn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function j_(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=[],f={};let p,x,b=-1,g=n,y=0,E=0;const T=[E];for(;g;){for(;e.get(++o)[1]!==g;);s.push(o),g._tokenizer||(p=i.sliceStream(g),g.next||p.push(null),x&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=g,g=g.next}for(g=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),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):T.pop(),b=T.length;b--;){const w=c.slice(T[b],T[b+1]),M=s.pop();d.push([M,M+w.length-1]),e.splice(M,2,w)}for(d.reverse(),b=-1;++b<d.length;)f[y+d[b][0]]=y+d[b][1],y+=d[b][1]-d[b][0]-1;return f}const P_={resolve:z_,tokenize:U_},B_={partial:!0,tokenize:H_};function z_(e){return oT(e),e}function U_(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):He(c)?e.check(B_,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 H_(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ht(e,s,"linePrefix")}function s(l){if(l===null||He(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 lT(e,t,n,i,o,s,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return x;function x(w){return w===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(w),e.exit(s),b):w===null||w===32||w===41||Gc(w)?n(w):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(w))}function b(w){return w===62?(e.enter(s),e.consume(w),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===62?(e.exit("chunkString"),e.exit(c),b(w)):w===null||w===60||He(w)?n(w):(e.consume(w),w===92?y:g)}function y(w){return w===60||w===62||w===92?(e.consume(w),g):g(w)}function E(w){return!p&&(w===null||w===41||Rt(w))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(w)):p<f&&w===40?(e.consume(w),p++,E):w===41?(e.consume(w),p--,E):w===null||w===32||w===40||Gc(w)?n(w):(e.consume(w),w===92?T:E)}function T(w){return w===40||w===41||w===92?(e.consume(w),E):E(w)}}function uT(e,t,n,i,o,s){const l=this;let c=0,d;return f;function f(g){return e.enter(i),e.enter(o),e.consume(g),e.exit(o),e.enter(s),p}function p(g){return c>999||g===null||g===91||g===93&&!d||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(s),e.enter(o),e.consume(g),e.exit(o),e.exit(i),t):He(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),x(g))}function x(g){return g===null||g===91||g===93||He(g)||c++>999?(e.exit("chunkString"),p(g)):(e.consume(g),d||(d=!lt(g)),g===92?b:x)}function b(g){return g===91||g===92||g===93?(e.consume(g),c++,x):x(g)}}function cT(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),f(b))}function f(b){return b===l?(e.exit(s),d(l)):b===null?n(b):He(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ht(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||He(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?x:p)}function x(b){return b===l||b===92?(e.consume(b),p):p(b)}}function ll(e,t){let n;return i;function i(o){return He(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):lt(o)?ht(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const F_={name:"definition",tokenize:q_},V_={partial:!0,tokenize:Y_};function q_(e,t,n){const i=this;let o;return s;function s(g){return e.enter("definition"),l(g)}function l(g){return uT.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return o=xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),d):n(g)}function d(g){return Rt(g)?ll(e,f)(g):f(g)}function f(g){return lT(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(V_,x,x)(g)}function x(g){return lt(g)?ht(e,b,"whitespace")(g):b(g)}function b(g){return g===null||He(g)?(e.exit("definition"),i.parser.defined.push(o),t(g)):n(g)}}function Y_(e,t,n){return i;function i(c){return Rt(c)?ll(e,o)(c):n(c)}function o(c){return cT(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return lt(c)?ht(e,l,"whitespace")(c):l(c)}function l(c){return c===null||He(c)?t(c):n(c)}}const G_={name:"hardBreakEscape",tokenize:X_};function X_(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return He(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const K_={name:"headingAtx",resolve:Q_,tokenize:$_};function Q_(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 $_(e,t,n){let i=0;return o;function o(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(e.consume(p),l):p===null||Rt(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||He(p)?(e.exit("atxHeading"),t(p)):lt(p)?ht(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Rt(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const W_=["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"],Uy=["pre","script","style","textarea"],Z_={concrete:!0,name:"htmlFlow",resolveTo:t4,tokenize:n4},J_={partial:!0,tokenize:i4},e4={partial:!0,tokenize:a4};function t4(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 n4(e,t,n){const i=this;let o,s,l,c,d;return f;function f(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),x}function x(U){return U===33?(e.consume(U),b):U===47?(e.consume(U),s=!0,E):U===63?(e.consume(U),o=3,i.interrupt?t:F):vn(U)?(e.consume(U),l=String.fromCharCode(U),T):n(U)}function b(U){return U===45?(e.consume(U),o=2,g):U===91?(e.consume(U),o=5,c=0,y):vn(U)?(e.consume(U),o=4,i.interrupt?t:F):n(U)}function g(U){return U===45?(e.consume(U),i.interrupt?t:F):n(U)}function y(U){const ne="CDATA[";return U===ne.charCodeAt(c++)?(e.consume(U),c===ne.length?i.interrupt?t:B:y):n(U)}function E(U){return vn(U)?(e.consume(U),l=String.fromCharCode(U),T):n(U)}function T(U){if(U===null||U===47||U===62||Rt(U)){const ne=U===47,K=l.toLowerCase();return!ne&&!s&&Uy.includes(K)?(o=1,i.interrupt?t(U):B(U)):W_.includes(l.toLowerCase())?(o=6,ne?(e.consume(U),w):i.interrupt?t(U):B(U)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?M(U):N(U))}return U===45||gn(U)?(e.consume(U),l+=String.fromCharCode(U),T):n(U)}function w(U){return U===62?(e.consume(U),i.interrupt?t:B):n(U)}function M(U){return lt(U)?(e.consume(U),M):D(U)}function N(U){return U===47?(e.consume(U),D):U===58||U===95||vn(U)?(e.consume(U),L):lt(U)?(e.consume(U),N):D(U)}function L(U){return U===45||U===46||U===58||U===95||gn(U)?(e.consume(U),L):A(U)}function A(U){return U===61?(e.consume(U),C):lt(U)?(e.consume(U),A):N(U)}function C(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),d=U,I):lt(U)?(e.consume(U),C):R(U)}function I(U){return U===d?(e.consume(U),d=null,j):U===null||He(U)?n(U):(e.consume(U),I)}function R(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Rt(U)?A(U):(e.consume(U),R)}function j(U){return U===47||U===62||lt(U)?N(U):n(U)}function D(U){return U===62?(e.consume(U),P):n(U)}function P(U){return U===null||He(U)?B(U):lt(U)?(e.consume(U),P):n(U)}function B(U){return U===45&&o===2?(e.consume(U),H):U===60&&o===1?(e.consume(U),G):U===62&&o===4?(e.consume(U),Y):U===63&&o===3?(e.consume(U),F):U===93&&o===5?(e.consume(U),ie):He(U)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(J_,J,Q)(U)):U===null||He(U)?(e.exit("htmlFlowData"),Q(U)):(e.consume(U),B)}function Q(U){return e.check(e4,q,J)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),z}function z(U){return U===null||He(U)?Q(U):(e.enter("htmlFlowData"),B(U))}function H(U){return U===45?(e.consume(U),F):B(U)}function G(U){return U===47?(e.consume(U),l="",Z):B(U)}function Z(U){if(U===62){const ne=l.toLowerCase();return Uy.includes(ne)?(e.consume(U),Y):B(U)}return vn(U)&&l.length<8?(e.consume(U),l+=String.fromCharCode(U),Z):B(U)}function ie(U){return U===93?(e.consume(U),F):B(U)}function F(U){return U===62?(e.consume(U),Y):U===45&&o===2?(e.consume(U),F):B(U)}function Y(U){return U===null||He(U)?(e.exit("htmlFlowData"),J(U)):(e.consume(U),Y)}function J(U){return e.exit("htmlFlow"),t(U)}}function a4(e,t,n){const i=this;return o;function o(l){return He(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 i4(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(jl,t,n)}}const r4={name:"htmlText",tokenize:s4};function s4(e,t,n){const i=this;let o,s,l;return c;function c(F){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(F),d}function d(F){return F===33?(e.consume(F),f):F===47?(e.consume(F),A):F===63?(e.consume(F),N):vn(F)?(e.consume(F),R):n(F)}function f(F){return F===45?(e.consume(F),p):F===91?(e.consume(F),s=0,y):vn(F)?(e.consume(F),M):n(F)}function p(F){return F===45?(e.consume(F),g):n(F)}function x(F){return F===null?n(F):F===45?(e.consume(F),b):He(F)?(l=x,G(F)):(e.consume(F),x)}function b(F){return F===45?(e.consume(F),g):x(F)}function g(F){return F===62?H(F):F===45?b(F):x(F)}function y(F){const Y="CDATA[";return F===Y.charCodeAt(s++)?(e.consume(F),s===Y.length?E:y):n(F)}function E(F){return F===null?n(F):F===93?(e.consume(F),T):He(F)?(l=E,G(F)):(e.consume(F),E)}function T(F){return F===93?(e.consume(F),w):E(F)}function w(F){return F===62?H(F):F===93?(e.consume(F),w):E(F)}function M(F){return F===null||F===62?H(F):He(F)?(l=M,G(F)):(e.consume(F),M)}function N(F){return F===null?n(F):F===63?(e.consume(F),L):He(F)?(l=N,G(F)):(e.consume(F),N)}function L(F){return F===62?H(F):N(F)}function A(F){return vn(F)?(e.consume(F),C):n(F)}function C(F){return F===45||gn(F)?(e.consume(F),C):I(F)}function I(F){return He(F)?(l=I,G(F)):lt(F)?(e.consume(F),I):H(F)}function R(F){return F===45||gn(F)?(e.consume(F),R):F===47||F===62||Rt(F)?j(F):n(F)}function j(F){return F===47?(e.consume(F),H):F===58||F===95||vn(F)?(e.consume(F),D):He(F)?(l=j,G(F)):lt(F)?(e.consume(F),j):H(F)}function D(F){return F===45||F===46||F===58||F===95||gn(F)?(e.consume(F),D):P(F)}function P(F){return F===61?(e.consume(F),B):He(F)?(l=P,G(F)):lt(F)?(e.consume(F),P):j(F)}function B(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),o=F,Q):He(F)?(l=B,G(F)):lt(F)?(e.consume(F),B):(e.consume(F),q)}function Q(F){return F===o?(e.consume(F),o=void 0,z):F===null?n(F):He(F)?(l=Q,G(F)):(e.consume(F),Q)}function q(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||Rt(F)?j(F):(e.consume(F),q)}function z(F){return F===47||F===62||Rt(F)?j(F):n(F)}function H(F){return F===62?(e.consume(F),e.exit("htmlTextData"),e.exit("htmlText"),t):n(F)}function G(F){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),Z}function Z(F){return lt(F)?ht(e,ie,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):ie(F)}function ie(F){return e.enter("htmlTextData"),l(F)}}const vp={name:"labelEnd",resolveAll:c4,resolveTo:d4,tokenize:f4},o4={tokenize:h4},l4={tokenize:m4},u4={tokenize:p4};function c4(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 d4(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}},f={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=ia(c,e.slice(s+1,s+i+3)),c=ia(c,[["enter",p,t]]),c=ia(c,bd(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=ia(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=ia(c,e.slice(l+1)),c=ia(c,[["exit",d,t]]),Vn(e,s,e.length,c),e}function f4(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?x(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(o4,p,l?p:x)(b):b===91?e.attempt(l4,p,l?f:x)(b):l?p(b):x(b)}function f(b){return e.attempt(u4,p,x)(b)}function p(b){return t(b)}function x(b){return s._balanced=!0,n(b)}}function h4(e,t,n){return i;function i(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),o}function o(x){return Rt(x)?ll(e,s)(x):s(x)}function s(x){return x===41?p(x):lT(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Rt(x)?ll(e,d)(x):p(x)}function c(x){return n(x)}function d(x){return x===34||x===39||x===40?cT(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):p(x)}function f(x){return Rt(x)?ll(e,p)(x):p(x)}function p(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function m4(e,t,n){const i=this;return o;function o(c){return uT.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 p4(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 g4={name:"labelStartImage",resolveAll:vp.resolveAll,tokenize:x4};function x4(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 b4={name:"labelStartLink",resolveAll:vp.resolveAll,tokenize:y4};function y4(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 mm={name:"lineEnding",tokenize:v4};function v4(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ht(e,t,"linePrefix")}}const _c={name:"thematicBreak",tokenize:E4};function E4(e,t,n){let i=0,o;return s;function s(f){return e.enter("thematicBreak"),l(f)}function l(f){return o=f,c(f)}function c(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):i>=3&&(f===null||He(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),i++,d):(e.exit("thematicBreakSequence"),lt(f)?ht(e,c,"whitespace")(f):c(f))}}const Rn={continuation:{tokenize:w4},exit:C4,name:"list",tokenize:k4},T4={partial:!0,tokenize:N4},S4={partial:!0,tokenize:A4};function k4(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(g){const y=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:x0(g)){if(i.containerState.type||(i.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(_c,n,f)(g):f(g);if(!i.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(g)}return n(g)}function d(g){return x0(g)&&++l<10?(e.consume(g),d):(!i.interrupt||l<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):n(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,e.check(jl,i.interrupt?n:p,e.attempt(T4,b,x))}function p(g){return i.containerState.initialBlankLine=!0,s++,b(g)}function x(g){return lt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),b):n(g)}function b(g){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function w4(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(jl,o,s);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ht(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!lt(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(S4,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,ht(e,e.attempt(Rn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function A4(e,t,n){const i=this;return ht(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 C4(e){e.exit(this.containerState.type)}function N4(e,t,n){const i=this;return ht(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!lt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Hy={name:"setextUnderline",resolveTo:_4,tokenize:M4};function _4(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 M4(e,t,n){const i=this;let o;return s;function s(f){let p=i.events.length,x;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){x=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||x)?(e.enter("setextHeadingLine"),o=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===o?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),lt(f)?ht(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||He(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const R4={tokenize:D4};function D4(e){const t=this,n=e.attempt(jl,i,e.attempt(this.parser.constructs.flowInitial,o,ht(e,e.attempt(this.parser.constructs.flow,o,e.attempt(P_,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 L4={resolveAll:fT()},O4=dT("string"),I4=dT("text");function dT(e){return{resolveAll:fT(e==="text"?j4: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(p){return f(p)?s(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),s(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const x=o[p];let b=-1;if(x)for(;++b<x.length;){const g=x[b];if(!g.previous||g.previous.call(i,i.previous))return!0}return!1}}}function fT(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 j4(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 f=o[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={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={...f.start},i.start.offset===i.end.offset?Object.assign(i,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const P4={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:iT},B4={91:F_},z4={[-2]:hm,[-1]:hm,32:hm},U4={35:K_,42:_c,45:[Hy,_c],60:Z_,61:Hy,95:_c,96:zy,126:zy},H4={38:sT,92:rT},F4={[-5]:mm,[-4]:mm,[-3]:mm,33:g4,38:sT,42:b0,60:[b_,r4],91:b4,92:[G_,rT],93:vp,95:b0,96:R_},V4={null:[b0,L4]},q4={null:[42,95]},Y4={null:[]},G4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:q4,contentInitial:B4,disable:Y4,document:P4,flow:U4,flowInitial:z4,insideSpan:V4,string:H4,text:F4},Symbol.toStringTag,{value:"Module"}));function X4(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:I(A),check:I(C),consume:M,enter:N,exit:L,interrupt:I(C,{interrupt:!0})},f={code:null,containerState:{},defineSkip:E,events:[],now:y,parser:e,previous:null,sliceSerialize:b,sliceStream:g,write:x};let p=t.tokenize.call(f,d);return t.resolveAll&&s.push(t),f;function x(P){return l=ia(l,P),T(),l[l.length-1]!==null?[]:(R(t,0),f.events=bd(s,f.events,f),f.events)}function b(P,B){return Q4(g(P),B)}function g(P){return K4(l,P)}function y(){const{_bufferIndex:P,_index:B,line:Q,column:q,offset:z}=i;return{_bufferIndex:P,_index:B,line:Q,column:q,offset:z}}function E(P){o[P.line]=P.column,D()}function T(){let P;for(;i._index<l.length;){const B=l[i._index];if(typeof B=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<B.length;)w(B.charCodeAt(i._bufferIndex));else w(B)}}function w(P){p=p(P)}function M(P){He(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++)),f.previous=P}function N(P,B){const Q=B||{};return Q.type=P,Q.start=y(),f.events.push(["enter",Q,f]),c.push(Q),Q}function L(P){const B=c.pop();return B.end=y(),f.events.push(["exit",B,f]),B}function A(P,B){R(P,B.from)}function C(P,B){B.restore()}function I(P,B){return Q;function Q(q,z,H){let G,Z,ie,F;return Array.isArray(q)?J(q):"tokenize"in q?J([q]):Y(q);function Y($){return oe;function oe(ce){const _e=ce!==null&&$[ce],Ke=ce!==null&&$.null,Je=[...Array.isArray(_e)?_e:_e?[_e]:[],...Array.isArray(Ke)?Ke:Ke?[Ke]:[]];return J(Je)(ce)}}function J($){return G=$,Z=0,$.length===0?H:U($[Z])}function U($){return oe;function oe(ce){return F=j(),ie=$,$.partial||(f.currentConstruct=$),$.name&&f.parser.constructs.disable.null.includes($.name)?K():$.tokenize.call(B?Object.assign(Object.create(f),B):f,d,ne,K)(ce)}}function ne($){return P(ie,F),z}function K($){return F.restore(),++Z<G.length?U(G[Z]):H}}}function R(P,B){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&Vn(f.events,B,f.events.length-B,P.resolve(f.events.slice(B),f)),P.resolveTo&&(f.events=P.resolveTo(f.events,f))}function j(){const P=y(),B=f.previous,Q=f.currentConstruct,q=f.events.length,z=Array.from(c);return{from:q,restore:H};function H(){i=P,f.previous=B,f.currentConstruct=Q,f.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 K4(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 Q4(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=`
521
+ `;break}case-3:{l=`\r
522
+ `;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 $4(e){const i={constructs:nT([G4,...(e||{}).extensions||[]]),content:o(d_),defined:[],document:o(h_),flow:o(R4),lazy:{},string:o(O4),text:o(I4)};return i;function o(s){return l;function l(c){return X4(i,s,c)}}}function W4(e){for(;!oT(e););return e}const Fy=/[\0\t\n\r]/g;function Z4(){let e=1,t="",n=!0,i;return o;function o(s,l,c){const d=[];let f,p,x,b,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),x=0,t="",n&&(s.charCodeAt(0)===65279&&x++,n=void 0);x<s.length;){if(Fy.lastIndex=x,f=Fy.exec(s),b=f&&f.index!==void 0?f.index:s.length,g=s.charCodeAt(b),!f){t=s.slice(x);break}if(g===10&&x===b&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),x<b&&(d.push(s.slice(x,b)),e+=b-x),g){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}x=b+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const J4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e6(e){return e.replace(J4,t6)}function t6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return aT(n.slice(s?2:1),s?16:10)}return yp(n)||e}const hT={}.hasOwnProperty;function n6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),a6(n)(W4($4(n).document().write(Z4()(e,t,!0))))}function a6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Qe),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(yt),blockQuote:s(Ke),characterEscape:j,characterReference:j,codeFenced:s(Je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Je,l),codeText:s(it,l),codeTextData:j,data:j,codeFlowValue:j,definition:s(Ee),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Ye),hardBreakEscape:s(Ot),hardBreakTrailing:s(Ot),htmlFlow:s(Xt,l),htmlFlowData:j,htmlText:s(Xt,l),htmlTextData:j,image:s(Se),label:l,link:s(Qe),listItem:s(pt),listItemValue:b,listOrdered:s(qe,x),listUnordered:s(qe),paragraph:s(rt),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(yt),strong:s(fe),thematicBreak:s(je)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:_e,autolinkProtocol:ce,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:$,characterReference:oe,codeFenced:d(T),codeFencedFence:E,codeFencedFenceInfo:g,codeFencedFenceMeta:y,codeFlowValue:D,codeIndented:d(w),codeText:d(z),codeTextData:D,data:D,definition:d(),definitionDestinationString:L,definitionLabelString:M,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(Q),htmlFlowData:D,htmlText:d(q),htmlTextData:D,image:d(G),label:ie,labelText:Z,lineEnding:P,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ne,resourceDestinationString:F,resourceTitleString:Y,resource:J,setextHeading:d(R),setextHeadingLineSequence:I,setextHeadingText:C,strong:d(),thematicBreak:d()}};mT(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(pe){let ke={type:"root",children:[]};const De={stack:[ke],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Me=[];let $e=-1;for(;++$e<pe.length;)if(pe[$e][1].type==="listOrdered"||pe[$e][1].type==="listUnordered")if(pe[$e][0]==="enter")Me.push($e);else{const Ne=Me.pop();$e=o(pe,Ne,$e)}for($e=-1;++$e<pe.length;){const Ne=t[pe[$e][0]];hT.call(Ne,pe[$e][1].type)&&Ne[pe[$e][1].type].call(Object.assign({sliceSerialize:pe[$e][2].sliceSerialize},De),pe[$e][1])}if(De.tokenStack.length>0){const Ne=De.tokenStack[De.tokenStack.length-1];(Ne[1]||Vy).call(De,void 0,Ne[0])}for(ke.position={start:Di(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Di(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)ke=t.transforms[$e](ke)||ke;return ke}function o(pe,ke,De){let Me=ke-1,$e=-1,Ne=!1,nt,tt,We,rn;for(;++Me<=De;){const vt=pe[Me];switch(vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{vt[0]==="enter"?$e++:$e--,rn=void 0;break}case"lineEndingBlank":{vt[0]==="enter"&&(nt&&!rn&&!$e&&!We&&(We=Me),rn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rn=void 0}if(!$e&&vt[0]==="enter"&&vt[1].type==="listItemPrefix"||$e===-1&&vt[0]==="exit"&&(vt[1].type==="listUnordered"||vt[1].type==="listOrdered")){if(nt){let Yn=Me;for(tt=void 0;Yn--;){const dt=pe[Yn];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;tt&&(pe[tt][1].type="lineEndingBlank",Ne=!0),dt[1].type="lineEnding",tt=Yn}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}We&&(!tt||We<tt)&&(nt._spread=!0),nt.end=Object.assign({},tt?pe[tt][1].start:vt[1].end),pe.splice(tt||Me,0,["exit",nt,vt[2]]),Me++,De++}if(vt[1].type==="listItemPrefix"){const Yn={type:"listItem",_spread:!1,start:Object.assign({},vt[1].start),end:void 0};nt=Yn,pe.splice(Me,0,["enter",Yn,vt[2]]),Me++,De++,We=void 0,rn=!0}}}return pe[ke][1]._spread=Ne,De}function s(pe,ke){return De;function De(Me){c.call(this,pe(Me),Me),ke&&ke.call(this,Me)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,ke,De){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([ke,De||void 0]),pe.position={start:Di(ke.start),end:void 0}}function d(pe){return ke;function ke(De){pe&&pe.call(this,De),f.call(this,De)}}function f(pe,ke){const De=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==pe.type&&(ke?ke.call(this,pe,Me[0]):(Me[1]||Vy).call(this,pe,Me[0]));else throw new Error("Cannot close `"+pe.type+"` ("+ol({start:pe.start,end:pe.end})+"): it’s not open");De.position.end=Di(pe.end)}function p(){return bp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(pe){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function g(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=pe}function y(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=pe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe.replace(/(\r?\n|\r)$/g,"")}function M(pe){const ke=this.resume(),De=this.stack[this.stack.length-1];De.label=ke,De.identifier=xa(this.sliceSerialize(pe)).toLowerCase()}function N(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=pe}function L(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=pe}function A(pe){const ke=this.stack[this.stack.length-1];if(!ke.depth){const De=this.sliceSerialize(pe).length;ke.depth=De}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(pe){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function j(pe){const De=this.stack[this.stack.length-1].children;let Me=De[De.length-1];(!Me||Me.type!=="text")&&(Me=Be(),Me.position={start:Di(pe.start),end:void 0},De.push(Me)),this.stack.push(Me)}function D(pe){const ke=this.stack.pop();ke.value+=this.sliceSerialize(pe),ke.position.end=Di(pe.end)}function P(pe){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ke.children[ke.children.length-1];De.position.end=Di(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ke.type)&&(j.call(this,pe),D.call(this,pe))}function B(){this.data.atHardBreak=!0}function Q(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function q(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function z(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function H(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=ke,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=ke,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function Z(pe){const ke=this.sliceSerialize(pe),De=this.stack[this.stack.length-2];De.label=e6(ke),De.identifier=xa(ke).toLowerCase()}function ie(){const pe=this.stack[this.stack.length-1],ke=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Me=pe.children;De.children=Me}else De.alt=ke}function F(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=pe}function Y(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=pe}function J(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function ne(pe){const ke=this.resume(),De=this.stack[this.stack.length-1];De.label=ke,De.identifier=xa(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function K(pe){this.data.characterReferenceType=pe.type}function $(pe){const ke=this.sliceSerialize(pe),De=this.data.characterReferenceType;let Me;De?(Me=aT(ke,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=yp(ke);const $e=this.stack[this.stack.length-1];$e.value+=Me}function oe(pe){const ke=this.stack.pop();ke.position.end=Di(pe.end)}function ce(pe){D.call(this,pe);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(pe)}function _e(pe){D.call(this,pe);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(pe)}function Ke(){return{type:"blockquote",children:[]}}function Je(){return{type:"code",lang:null,meta:null,value:""}}function it(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function yt(){return{type:"heading",depth:0,children:[]}}function Ot(){return{type:"break"}}function Xt(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function qe(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function pt(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function rt(){return{type:"paragraph",children:[]}}function fe(){return{type:"strong",children:[]}}function Be(){return{type:"text",value:""}}function je(){return{type:"thematicBreak"}}}function Di(e){return{line:e.line,column:e.column,offset:e.offset}}function mT(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?mT(e,i):i6(e,i)}}function i6(e,t){let n;for(n in t)if(hT.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 Vy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ol({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ol({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ol({start:t.start,end:t.end})+") is still open")}function r6(e){const t=this;t.parser=n;function n(i){return n6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function s6(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 o6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
523
+ `}]}function l6(e,t){const n=t.value?t.value+`
524
+ `:"",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 u6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Fs(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 f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function f6(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 h6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pT(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 m6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return pT(e,t);const o={src:Fs(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 p6(e,t){const n={src:Fs(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 g6(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 x6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return pT(e,t);const o={href:Fs(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 b6(e,t){const n={href:Fs(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 y6(e,t,n){const i=e.all(t),o=n?v6(n):gT(t),s={},l=[];if(typeof t.checked=="boolean"){const p=i[0];let x;p&&p.type==="element"&&p.tagName==="p"?x=p:(x={type:"element",tagName:"p",properties:{},children:[]},i.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.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 p=i[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
525
+ `}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
526
+ `});const f={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,f),e.applyData(t,f)}function v6(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=gT(n[i])}return t}function gT(e){const t=e.spread;return t??e.children.length>1}function E6(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 T6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function k6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w6(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=gd(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 A6(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 f=[];for(;++d<c;){const x=t.children[d],b={},g=l?l[d]:void 0;g&&(b.align=g);let y={type:"element",tagName:s,properties:b,children:[]};x&&(y.children=e.all(x),e.patch(x,y),y=e.applyData(x,y)),f.push(y)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function C6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const qy=9,Yy=32;function N6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const s=[];for(;i;)s.push(Gy(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return s.push(Gy(t.slice(o),o>0,!1)),s.join("")}function Gy(e,t,n){let i=0,o=e.length;if(t){let s=e.codePointAt(i);for(;s===qy||s===Yy;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(o-1);for(;s===qy||s===Yy;)o--,s=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function _6(e,t){const n={type:"text",value:N6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function M6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const R6={blockquote:s6,break:o6,code:l6,delete:u6,emphasis:c6,footnoteReference:d6,heading:f6,html:h6,imageReference:m6,image:p6,inlineCode:g6,linkReference:x6,link:b6,listItem:y6,list:E6,paragraph:T6,root:S6,strong:k6,table:w6,tableCell:C6,tableRow:A6,text:_6,thematicBreak:M6,toml:dc,yaml:dc,definition:dc,footnoteDefinition:dc};function dc(){}const xT=-1,yd=0,ul=1,Xc=2,Ep=3,Tp=4,Sp=5,kp=6,bT=7,yT=8,vT=typeof self=="object"?self:globalThis,Xy=(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 vT[e](t)},D6=(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 yd:case xT:return n(l,o);case ul:{const c=n([],o);for(const d of l)c.push(i(d));return c}case Xc:{const c=n({},o);for(const[d,f]of l)c[i(d)]=i(f);return c}case Ep:return n(new Date(l),o);case Tp:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Sp:{const c=n(new Map,o);for(const[d,f]of l)c.set(i(d),i(f));return c}case kp:{const c=n(new Set,o);for(const d of l)c.add(i(d));return c}case bT:{const{name:c,message:d}=l;return n(typeof vT[c]=="function"?Xy(c,d):new Error(d),o)}case yT: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(Xy(s,l),o)};return i},Ky=e=>D6(new Map,e)(0),yr="",{toString:L6}={},{keys:O6}=Object,Wo=e=>{const t=typeof e;if(t!=="object"||!e)return[yd,t];const n=L6.call(e).slice(8,-1);switch(n){case"Array":return[ul,yr];case"Object":return[Xc,yr];case"Date":return[Ep,yr];case"RegExp":return[Tp,yr];case"Map":return[Sp,yr];case"Set":return[kp,yr];case"DataView":return[ul,n]}return n.includes("Array")?[ul,n]:e instanceof Error?[bT,e.name||"Error"]:[Xc,n]},fc=([e,t])=>e===yd&&(t==="function"||t==="symbol"),I6=(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]=Wo(l);switch(c){case yd:{let p=l;switch(d){case"bigint":c=yT,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return o([xT],l)}return o([c,p],l)}case ul:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const p=[],x=o([c,p],l);for(const b of l)p.push(s(b));return x}case Xc:{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 p=[],x=o([c,p],l);for(const b of O6(l))(e||!fc(Wo(l[b])))&&p.push([s(b),s(l[b])]);return x}case Ep:return o([c,isNaN(l.getTime())?yr:l.toISOString()],l);case Tp:{const{source:p,flags:x}=l;return o([c,{source:p,flags:x}],l)}case Sp:{const p=[],x=o([c,p],l);for(const[b,g]of l)(e||!(fc(Wo(b))||fc(Wo(g))))&&p.push([s(b),s(g)]);return x}case kp:{const p=[],x=o([c,p],l);for(const b of l)(e||!fc(Wo(b)))&&p.push(s(b));return x}}const{message:f}=l;return o([c,{name:d,message:f}],l)};return s},Qy=(e,{json:t,lossy:n}={})=>{const i=[];return I6(!(t||n),!!t,new Map,i)(e),i},Or=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ky(Qy(e,t)):structuredClone(e):(e,t)=>Ky(Qy(e,t));function j6(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 P6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function B6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||j6,i=e.options.footnoteBackLabel||P6,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 f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),x=String(f.identifier).toUpperCase(),b=Fs(x.toLowerCase());let g=0;const y=[],E=e.footnoteCounts.get(x);for(;E!==void 0&&++g<=E;){y.length>0&&y.push({type:"text",value:" "});let M=typeof n=="string"?n:n(d,g);typeof M=="string"&&(M={type:"text",value:M}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,g),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const T=p[p.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 p.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(f,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Or(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
527
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
528
+ `}]}}const vd=(function(e){if(e==null)return F6;if(typeof e=="function")return Ed(e);if(typeof e=="object")return Array.isArray(e)?z6(e):U6(e);if(typeof e=="string")return H6(e);throw new Error("Expected function, string, or object as test")});function z6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vd(e[n]);return Ed(i);function i(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function U6(e){const t=e;return Ed(n);function n(i){const o=i;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function H6(e){return Ed(t);function t(n){return n&&n.type===e}}function Ed(e){return t;function t(n,i,o){return!!(V6(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function F6(){return!0}function V6(e){return e!==null&&typeof e=="object"&&"type"in e}const ET=[],q6=!0,y0=!1,Y6="skip";function TT(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const s=vd(o),l=i?-1:1;c(e,void 0,[])();function c(d,f,p){const x=d&&typeof d=="object"?d:{};if(typeof x.type=="string"){const g=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(g?"<"+g+">":""))+")"})}return b;function b(){let g=ET,y,E,T;if((!t||s(d,f,p[p.length-1]||void 0))&&(g=G6(n(d,p)),g[0]===y0))return g;if("children"in d&&d.children){const w=d;if(w.children&&g[0]!==Y6)for(E=(i?w.children.length:-1)+l,T=p.concat(w);E>-1&&E<w.children.length;){const M=w.children[E];if(y=c(M,E,T)(),y[0]===y0)return y;E=typeof y[1]=="number"?y[1]:E+l}}return g}}}function G6(e){return Array.isArray(e)?e:typeof e=="number"?[q6,e]:e==null?ET:[e]}function Td(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),TT(e,s,c,o);function c(d,f){const p=f[f.length-1],x=p?p.children.indexOf(d):void 0;return l(d,x,p)}}const v0={}.hasOwnProperty,X6={};function K6(e,t){const n=t||X6,i=new Map,o=new Map,s=new Map,l={...R6,...n.handlers},c={all:f,applyData:$6,definitionById:i,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:Q6,wrap:Z6};return Td(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const x=p.type==="definition"?i:o,b=String(p.identifier).toUpperCase();x.has(b)||x.set(b,p)}}),c;function d(p,x){const b=p.type,g=c.handlers[b];if(v0.call(c.handlers,b)&&g)return g(c,p,x);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in p){const{children:E,...T}=p,w=Or(T);return w.children=c.all(p),w}return Or(p)}return(c.options.unknownHandler||W6)(c,p,x)}function f(p){const x=[];if("children"in p){const b=p.children;let g=-1;for(;++g<b.length;){const y=c.one(b[g],p);if(y){if(g&&b[g-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=$y(y.value)),!Array.isArray(y)&&y.type==="element")){const E=y.children[0];E&&E.type==="text"&&(E.value=$y(E.value))}Array.isArray(y)?x.push(...y):x.push(y)}}}return x}}function Q6(e,t){e.position&&(t.position=$E(e))}function $6(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,Or(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function W6(e,t){const n=t.data||{},i="value"in t&&!(v0.call(n,"hProperties")||v0.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 Z6(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
529
+ `});++i<e.length;)i&&n.push({type:"text",value:`
530
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
531
+ `}),n}function $y(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wy(e,t){const n=K6(e,t),i=n.one(e,void 0),o=B6(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
532
+ `},o),s}function J6(e,t){return e&&"run"in e?async function(n,i){const o=Wy(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Wy(n,{file:i,...e||t})}}function Zy(e){if(e)throw e}var pm,Jy;function eM(){if(Jy)return pm;Jy=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!x)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(i)return i(f,p).value}else return;return f[p]};return pm=function d(){var f,p,x,b,g,y,E=arguments[0],T=1,w=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<w;++T)if(f=arguments[T],f!=null)for(p in f)x=c(E,p),b=c(f,p),E!==b&&(M&&b&&(s(b)||(g=o(b)))?(g?(g=!1,y=x&&o(x)?x:[]):y=x&&s(x)?x:{},l(E,{name:p,newValue:d(M,y,b)})):typeof b<"u"&&l(E,{name:p,newValue:b}));return E},pm}var tM=eM();const gm=Rl(tM);function E0(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 nM(){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,...f){const p=e[++s];let x=-1;if(d){l(d);return}for(;++x<o.length;)(f[x]===null||f[x]===void 0)&&(f[x]=o[x]);o=f,p?aM(p,c)(...f):l(null,...f)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function aM(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(f){const p=f;if(c&&n)throw p;return o(p)}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 wa={basename:iM,dirname:rM,extname:sM,join:oM,sep:"/"};function iM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pl(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 rM(e){if(Pl(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 sM(e){Pl(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 oM(...e){let t=-1,n;for(;++t<e.length;)Pl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lM(n)}function lM(e){Pl(e);const t=e.codePointAt(0)===47;let n=uM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uM(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 Pl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cM={cwd:dM};function dM(){return"/"}function T0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fM(e){if(typeof e=="string")e=new URL(e);else if(!T0(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 hM(e)}function hM(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 xm=["history","path","basename","stem","extname","dirname"];class ST{constructor(t){let n;t?T0(t)?n={path:t}:typeof t=="string"||mM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<xm.length;){const s=xm[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)xm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?wa.basename(this.path):void 0}set basename(t){ym(t,"basename"),bm(t,"basename"),this.path=wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wa.dirname(this.path):void 0}set dirname(t){ev(this.basename,"dirname"),this.path=wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wa.extname(this.path):void 0}set extname(t){if(bm(t,"extname"),ev(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=wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){T0(t)&&(t=fM(t)),ym(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wa.basename(this.path,this.extname):void 0}set stem(t){ym(t,"stem"),bm(t,"stem"),this.path=wa.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 xn(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 bm(e,t){if(e&&e.includes(wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wa.sep+"`")}function ym(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ev(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function mM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pM=(function(e){const i=this.constructor.prototype,o=i[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),gM={}.hasOwnProperty;class wp extends pM{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=nM()}copy(){const t=new wp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(gm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tm("data",this.frozen),this.namespace[t]=n,this):gM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tm("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=hc(t),i=this.parser||this.Parser;return vm("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),vm("process",this.parser||this.Parser),Em("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,l){const c=hc(t),d=i.parse(c);i.run(d,c,function(p,x,b){if(p||!x||!b)return f(p);const g=x,y=i.stringify(g,b);yM(y)?b.value=y:b.result=y,f(p,b)});function f(p,x){p||!x?l(p):s?s(x):n(void 0,x)}}}processSync(t){let n=!1,i;return this.freeze(),vm("processSync",this.parser||this.Parser),Em("processSync",this.compiler||this.Compiler),this.process(t,o),nv("processSync","process",n),i;function o(s,l){n=!0,Zy(s),i=l}}run(t,n,i){tv(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=hc(n);o.run(t,d,f);function f(p,x,b){const g=x||t;p?c(p):l?l(g):i(void 0,g,b)}}}runSync(t,n){let i=!1,o;return this.run(t,n,s),nv("runSync","run",i),o;function s(l,c){Zy(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=hc(n),o=this.compiler||this.Compiler;return Em("stringify",o),tv(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(Tm("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(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...x]=f;d(p,x)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))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(f.plugins),f.settings&&(o.settings=gm(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const x=f[p];s(x)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let x=-1,b=-1;for(;++x<i.length;)if(i[x][0]===f){b=x;break}if(b===-1)i.push([f,...p]);else if(p.length>0){let[g,...y]=p;const E=i[b][1];E0(E)&&E0(g)&&(g=gm(!0,E,g)),i[b]=[f,g,...y]}}}}const xM=new wp().freeze();function vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Em(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tm(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 tv(e){if(!E0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hc(e){return bM(e)?e:new ST(e)}function bM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yM(e){return typeof e=="string"||vM(e)}function vM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",av=[],iv={allowDangerousHtml:!0},TM=/^(https?|ircs?|mailto|xmpp)$/i,SM=[{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 kT(e){const t=kM(e),n=wM(e);return AM(t.runSync(t.parse(n),n),e)}function kM(e){const t=e.rehypePlugins||av,n=e.remarkPlugins||av,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iv}:iv;return xM().use(r6).use(n).use(J6,i).use(t)}function wM(e){const t=e.children||"",n=new ST;return typeof t=="string"&&(n.value=t),n}function AM(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||CM;for(const p of SM)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+EM+p.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Td(e,f),F5(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,x,b){if(p.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let g;for(g in fm)if(Object.hasOwn(fm,g)&&Object.hasOwn(p.properties,g)){const y=p.properties[g],E=fm[g];(E===null||E.includes(p.tagName))&&(p.properties[g]=d(String(y||""),g,p))}}if(p.type==="element"){let g=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!g&&i&&typeof x=="number"&&(g=!i(p,x,b)),g&&b&&typeof x=="number")return c&&p.children?b.children.splice(x,1,...p.children):b.children.splice(x,1),x}}}function CM(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||TM.test(e.slice(0,t))?e:""}function rv(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 NM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _M(e,t,n){const o=vd((n||{}).ignore||[]),s=MM(t);let l=-1;for(;++l<s.length;)TT(e,"text",c);function c(f,p){let x=-1,b;for(;++x<p.length;){const g=p[x],y=b?b.children:void 0;if(o(g,y?y.indexOf(g):void 0,b))return;b=g}if(b)return d(f,p)}function d(f,p){const x=p[p.length-1],b=s[l][0],g=s[l][1];let y=0;const T=x.children.indexOf(f);let w=!1,M=[];b.lastIndex=0;let N=b.exec(f.value);for(;N;){const L=N.index,A={index:N.index,input:N.input,stack:[...p,f]};let C=g(...N,A);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?b.lastIndex=L+1:(y!==L&&M.push({type:"text",value:f.value.slice(y,L)}),Array.isArray(C)?M.push(...C):C&&M.push(C),y=L+N[0].length,w=!0),!b.global)break;N=b.exec(f.value)}return w?(y<f.value.length&&M.push({type:"text",value:f.value.slice(y)}),x.children.splice(T,1,...M)):M=[f],T+M.length}}function MM(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([RM(o[0]),DM(o[1])])}return t}function RM(e){return typeof e=="string"?new RegExp(NM(e),"g"):e}function DM(e){return typeof e=="function"?e:function(){return e}}const Sm="phrasing",km=["autolink","link","image","label"];function LM(){return{transforms:[UM],enter:{literalAutolink:IM,literalAutolinkEmail:wm,literalAutolinkHttp:wm,literalAutolinkWww:wm},exit:{literalAutolink:zM,literalAutolinkEmail:BM,literalAutolinkHttp:jM,literalAutolinkWww:PM}}}function OM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sm,notInConstruct:km},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sm,notInConstruct:km},{character:":",before:"[ps]",after:"\\/",inConstruct:Sm,notInConstruct:km}]}}function IM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wm(e){this.config.enter.autolinkProtocol.call(this,e)}function jM(e){this.config.exit.autolinkProtocol.call(this,e)}function PM(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 BM(e){this.config.exit.autolinkEmail.call(this,e)}function zM(e){this.exit(e)}function UM(e){_M(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,HM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),FM]],{ignore:["link","linkReference"]})}function HM(e,t,n,i,o){let s="";if(!wT(o)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!VM(n)))return!1;const l=qM(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 FM(e,t,n,i){return!wT(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function VM(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 qM(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=rv(e,"(");let s=rv(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 wT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||xd(n))&&(!t||n!==47)}AT.peek=JM;function YM(){this.buffer()}function GM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XM(){this.buffer()}function KM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function QM(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 $M(e){this.exit(e)}function WM(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 ZM(e){this.exit(e)}function JM(){return"["}function AT(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 eR(){return{enter:{gfmFootnoteCallString:YM,gfmFootnoteCall:GM,gfmFootnoteDefinitionLabelString:XM,gfmFootnoteDefinition:KM},exit:{gfmFootnoteCallString:QM,gfmFootnoteCall:$M,gfmFootnoteDefinitionLabelString:WM,gfmFootnoteDefinition:ZM}}}function tR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:AT},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,o,s,l){const c=s.createTracker(l);let d=c.move("[^");const f=s.enter("footnoteDefinition"),p=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),p(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
533
+ `:" ")+s.indentLines(s.containerFlow(i,c.current()),t?CT:nR))),f(),d}}function nR(e,t,n){return t===0?e:CT(e,t,n)}function CT(e,t,n){return(n?"":" ")+e}const aR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];NT.peek=lR;function iR(){return{canContainEols:["delete"],enter:{strikethrough:sR},exit:{strikethrough:oR}}}function rR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aR}],handlers:{delete:NT}}}function sR(e){this.enter({type:"delete",children:[]},e)}function oR(e){this.exit(e)}function NT(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 lR(){return"~"}function uR(e){return e.length}function cR(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||uR,s=[],l=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const E=[],T=[];let w=-1;for(e[p].length>f&&(f=e[p].length);++w<e[p].length;){const M=dR(e[p][w]);if(n.alignDelimiters!==!1){const N=o(M);T[w]=N,(d[w]===void 0||N>d[w])&&(d[w]=N)}E.push(M)}l[p]=E,c[p]=T}let x=-1;if(typeof i=="object"&&"length"in i)for(;++x<f;)s[x]=sv(i[x]);else{const E=sv(i);for(;++x<f;)s[x]=E}x=-1;const b=[],g=[];for(;++x<f;){const E=s[x];let T="",w="";E===99?(T=":",w=":"):E===108?T=":":E===114&&(w=":");let M=n.alignDelimiters===!1?1:Math.max(1,d[x]-T.length-w.length);const N=T+"-".repeat(M)+w;n.alignDelimiters!==!1&&(M=T.length+M+w.length,M>d[x]&&(d[x]=M),g[x]=M),b[x]=N}l.splice(1,0,b),c.splice(1,0,g),p=-1;const y=[];for(;++p<l.length;){const E=l[p],T=c[p];x=-1;const w=[];for(;++x<f;){const M=E[x]||"";let N="",L="";if(n.alignDelimiters!==!1){const A=d[x]-(T[x]||0),C=s[x];C===114?N=" ".repeat(A):C===99?A%2?(N=" ".repeat(A/2+.5),L=" ".repeat(A/2-.5)):(N=" ".repeat(A/2),L=N):L=" ".repeat(A)}n.delimiterStart!==!1&&!x&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||x)&&w.push(" "),n.alignDelimiters!==!1&&w.push(N),w.push(M),n.alignDelimiters!==!1&&w.push(L),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||x!==f-1)&&w.push("|")}y.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return y.join(`
534
+ `)}function dR(e){return e==null?"":String(e)}function sv(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 ov={}.hasOwnProperty;function _T(e,t){const n=t||{};function i(o,...s){let l=i.invalid;const c=i.handlers;if(o&&ov.call(o,e)){const d=String(o[e]);l=ov.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 fR(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()),hR);return o(),l}function hR(e,t,n){return">"+(n?"":" ")+e}function mR(e,t){return lv(e,t.inConstruct,!0)&&!lv(e,t.notInConstruct,!1)}function lv(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 uv(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
535
+ `&&mR(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
536
+ `}function pR(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 gR(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 xR(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 bR(e,t,n,i){const o=xR(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(gR(e,n)){const x=n.enter("codeIndented"),b=n.indentLines(s,yR);return x(),b}const c=n.createTracker(i),d=o.repeat(Math.max(pR(s,o)+1,3)),f=n.enter("codeFenced");let p=c.move(d);if(e.lang){const x=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
537
+ `,encode:["`"],...c.current()})),x()}return p+=c.move(`
538
+ `),s&&(p+=c.move(s+`
539
+ `)),p+=c.move(d),f(),p}function yR(e,t,n){return(n?"":" ")+e}function Ap(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 vR(e,t,n,i){const o=Ap(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
540
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=d.move(" "+o),f+=d.move(n.safe(e.title,{before:f,after:o,...d.current()})),f+=d.move(o),c()),l(),f}function ER(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 Kc(e,t,n){const i=js(e),o=js(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}}MT.peek=TR;function MT(e,t,n,i){const o=ER(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 f=d.charCodeAt(0),p=Kc(i.before.charCodeAt(i.before.length-1),f,o);p.inside&&(d=wl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Kc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+wl(x));const g=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+g}function TR(e,t,n){return n.options.emphasis||"*"}function SR(e,t){let n=!1;return Td(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,y0}),!!((!e.depth||e.depth<3)&&bp(e)&&(t.options.setext||n))}function kR(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(SR(e,n)){const p=n.enter("headingSetext"),x=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
541
+ `,after:`
542
+ `});return x(),p(),b+`
543
+ `+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
544
+ `))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
545
+ `,...s.current()});return/^[\t ]/.test(f)&&(f=wl(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}RT.peek=wR;function RT(e){return e.value||""}function wR(){return"<"}DT.peek=AR;function DT(e,t,n,i){const o=Ap(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=d.move(" "+o),f+=d.move(n.safe(e.title,{before:f,after:o,...d.current()})),f+=d.move(o),c()),f+=d.move(")"),l(),f}function AR(){return"!"}LT.peek=CR;function LT(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 f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function CR(){return"!"}OT.peek=NR;function OT(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 f=d.index;i.charCodeAt(f)===10&&i.charCodeAt(f-1)===13&&f--,i=i.slice(0,f)+" "+i.slice(d.index+1)}}return o+i+o}function NR(){return"`"}function IT(e,t){const n=bp(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))}jT.peek=_R;function jT(e,t,n,i){const o=Ap(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(IT(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let x=l.move("<");return x+=l.move(n.containerPhrasing(e,{before:x,after:">",...l.current()})),x+=l.move(">"),c(),n.stack=p,x}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${s}`),f+=l.move(" "+o),f+=l.move(n.safe(e.title,{before:f,after:o,...l.current()})),f+=l.move(o),d()),f+=l.move(")"),c(),f}function _R(e,t,n){return IT(e,n)?"<":"["}PT.peek=MR;function PT(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 f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function MR(){return"["}function Cp(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 RR(e){const t=Cp(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 DR(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 BT(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 LR(e,t,n,i){const o=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?DR(n):Cp(n);const c=e.ordered?l==="."?")":".":RR(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.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),BT(n)===l&&p){let x=-1;for(;++x<e.children.length;){const b=e.children[x];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 f=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=s,o(),f}function OR(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 IR(e,t,n,i){const o=OR(n);let s=n.bulletCurrent||Cp(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"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(x,b,g){return b?(g?"":" ".repeat(l))+x:(g?s:s+" ".repeat(l-s.length))+x}}function jR(e,t,n,i){const o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}const PR=vd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function BR(e,t,n,i){return(e.children.some(function(l){return PR(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function zR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zT.peek=UR;function zT(e,t,n,i){const o=zR(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 f=d.charCodeAt(0),p=Kc(i.before.charCodeAt(i.before.length-1),f,o);p.inside&&(d=wl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Kc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+wl(x));const g=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+g}function UR(e,t,n){return n.options.strong||"*"}function HR(e,t,n,i){return n.safe(e.value,i)}function FR(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 VR(e,t,n){const i=(BT(n)+(n.options.ruleSpaces?" ":"")).repeat(FR(n));return n.options.ruleSpaces?i.slice(0,-1):i}const UT={blockquote:fR,break:uv,code:bR,definition:vR,emphasis:MT,hardBreak:uv,heading:kR,html:RT,image:DT,imageReference:LT,inlineCode:OT,link:jT,linkReference:PT,list:LR,listItem:IR,paragraph:jR,root:BR,strong:zT,text:HR,thematicBreak:VR};function qR(){return{enter:{table:YR,tableData:cv,tableHeader:cv,tableRow:XR},exit:{codeText:KR,table:GR,tableData:Am,tableHeader:Am,tableRow:Am}}}function YR(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 GR(e){this.exit(e),this.data.inTable=void 0}function XR(e){this.enter({type:"tableRow",children:[]},e)}function Am(e){this.exit(e)}function cv(e){this.enter({type:"tableCell",children:[]},e)}function KR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,QR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function QR(e,t){return t==="|"?t:e}function $R(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
546
+ `,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(g,y,E,T){return f(p(g,E,T),g.align)}function c(g,y,E,T){const w=x(g,E,T),M=f([w]);return M.slice(0,M.indexOf(`
547
+ `))}function d(g,y,E,T){const w=E.enter("tableCell"),M=E.enter("phrasing"),N=E.containerPhrasing(g,{...T,before:s,after:s});return M(),w(),N}function f(g,y){return cR(g,{align:y,alignDelimiters:i,padding:n,stringLength:o})}function p(g,y,E){const T=g.children;let w=-1;const M=[],N=y.enter("table");for(;++w<T.length;)M[w]=x(T[w],y,E);return N(),M}function x(g,y,E){const T=g.children;let w=-1;const M=[],N=y.enter("tableRow");for(;++w<T.length;)M[w]=d(T[w],g,y,E);return N(),M}function b(g,y,E){let T=UT.inlineCode(g,y,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function WR(){return{exit:{taskListCheckValueChecked:dv,taskListCheckValueUnchecked:dv,paragraph:JR}}}function ZR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eD}}}function dv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function JR(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 eD(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=UT.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function tD(){return[LM(),eR(),iR(),qR(),WR()]}function nD(e){return{extensions:[OM(),tR(e),rR(),$R(e),ZR()]}}const aD={tokenize:uD,partial:!0},HT={tokenize:cD,partial:!0},FT={tokenize:dD,partial:!0},VT={tokenize:fD,partial:!0},iD={tokenize:hD,partial:!0},qT={name:"wwwAutolink",tokenize:oD,previous:GT},YT={name:"protocolAutolink",tokenize:lD,previous:XT},si={name:"emailAutolink",tokenize:sD,previous:KT},La={};function rD(){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,YT];La[104]=[si,YT];La[87]=[si,qT];La[119]=[si,qT];function sD(e,t,n){const i=this;let o,s;return l;function l(x){return!S0(x)||!KT.call(i,i.previous)||Np(i.events)?n(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(x))}function c(x){return S0(x)?(e.consume(x),c):x===64?(e.consume(x),d):n(x)}function d(x){return x===46?e.check(iD,p,f)(x):x===45||x===95||gn(x)?(s=!0,e.consume(x),d):p(x)}function f(x){return e.consume(x),o=!0,d}function p(x){return s&&o&&vn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(x)):n(x)}}function oD(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!GT.call(i,i.previous)||Np(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aD,e.attempt(HT,e.attempt(FT,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function lD(e,t,n){const i=this;let o="",s=!1;return l;function l(x){return(x===72||x===104)&&XT.call(i,i.previous)&&!Np(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(x),e.consume(x),c):n(x)}function c(x){if(vn(x)&&o.length<5)return o+=String.fromCodePoint(x),e.consume(x),c;if(x===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(x),d}return n(x)}function d(x){return x===47?(e.consume(x),s?f:(s=!0,d)):n(x)}function f(x){return x===null||Gc(x)||Rt(x)||Lr(x)||xd(x)?n(x):e.attempt(HT,e.attempt(FT,p),n)(x)}function p(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(x)}}function uD(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 cD(e,t,n){let i,o,s;return l;function l(f){return f===46||f===95?e.check(VT,d,c)(f):f===null||Rt(f)||Lr(f)||f!==45&&xd(f)?d(f):(s=!0,e.consume(f),l)}function c(f){return f===95?i=!0:(o=i,i=void 0),e.consume(f),l}function d(f){return o||i||!s?n(f):t(f)}}function dD(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(VT,t,s)(l):l===null||Rt(l)||Lr(l)?t(l):(e.consume(l),o)}function s(l){return l===41&&i++,e.consume(l),o}}function fD(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||Rt(c)||Lr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Rt(c)||Lr(c)?t(c):i(c)}function s(c){return vn(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):vn(c)?(e.consume(c),l):n(c)}}function hD(e,t,n){return i;function i(s){return e.consume(s),o}function o(s){return gn(s)?n(s):t(s)}}function GT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Rt(e)}function XT(e){return!vn(e)}function KT(e){return!(e===47||S0(e))}function S0(e){return e===43||e===45||e===46||e===95||gn(e)}function Np(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 mD={tokenize:TD,partial:!0};function pD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yD,continuation:{tokenize:vD},exit:ED}},text:{91:{name:"gfmFootnoteCall",tokenize:bD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:gD,resolveTo:xD}}}}function gD(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 f=xa(i.sliceSerialize({start:l.end,end:i.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function xD(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 bD(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),d}function d(x){return x!==94?n(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(x){if(s>999||x===93&&!l||x===null||x===91||Rt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(xa(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(x)}return Rt(x)||(l=!0),s++,e.consume(x),x===92?p:f}function p(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}}function yD(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"),f}function f(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(y)}function p(y){if(l>999||y===93&&!c||y===null||y===91||Rt(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 Rt(y)||(c=!0),l++,e.consume(y),y===92?x:p}function x(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}function b(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),o.includes(s)||o.push(s),ht(e,g,"gfmFootnoteDefinitionWhitespace")):n(y)}function g(y){return t(y)}}function vD(e,t,n){return e.check(jl,t,e.attempt(mD,t,n))}function ED(e){e.exit("gfmFootnoteDefinition")}function TD(e,t,n){const i=this;return ht(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 SD(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 f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},x={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",x,c]],g=c.parser.constructs.insideSpan.null;g&&Vn(b,b.length,0,bd(g,l.slice(f+1,d),c)),Vn(b,b.length,0,[["exit",x,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),Vn(l,f-1,d-f+3,b),d=f+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 f=this.previous,p=this.events;let x=0;return b;function b(y){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(y):(l.enter("strikethroughSequenceTemporary"),g(y))}function g(y){const E=js(f);if(y===126)return x>1?d(y):(l.consume(y),x++,g);if(x<2&&!n)return d(y);const T=l.exit("strikethroughSequenceTemporary"),w=js(y);return T._open=!w||w===2&&!!E,T._close=!E||E===2&&!!w,c(y)}}}class kD{constructor(){this.map=[]}add(t,n,i){wD(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 wD(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 AD(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 CD(){return{flow:{null:{name:"table",tokenize:ND,resolveAll:_D}}}}function ND(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 B=P>-1?i.events[P][1].type:null,Q=B==="tableHead"||B==="tableRow"?C:d;return Q===C&&i.parser.lazy[i.now().line]?n(D):Q(D)}function d(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(l=!0,s+=1),p(D)}function p(D){return D===null?n(D):He(D)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),g):n(D):lt(D)?ht(e,p,"whitespace")(D):(s+=1,l&&(l=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),x(D)))}function x(D){return D===null||D===124||Rt(D)?(e.exit("data"),p(D)):(e.consume(D),D===92?b:x)}function b(D){return D===92||D===124?(e.consume(D),x):x(D)}function g(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,lt(D)?ht(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 lt(D)?ht(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"),w):D===45?(s+=1,w(D)):D===null||He(D)?L(D):A(D)}function w(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 lt(D)?ht(e,L,"whitespace")(D):L(D)}function L(D){return D===124?y(D):D===null||He(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"),I(D)}function I(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),I):D===null||He(D)?(e.exit("tableRow"),t(D)):lt(D)?ht(e,I,"whitespace")(D):(e.enter("data"),R(D))}function R(D){return D===null||D===124||Rt(D)?(e.exit("data"),I(D)):(e.consume(D),D===92?j:R)}function j(D){return D===92||D===124?(e.consume(D),R):R(D)}}function _D(e,t){let n=-1,i=!0,o=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,p,x;const b=new kD;for(;++n<e.length;){const g=e[n],y=g[1];g[0]==="enter"?y.type==="tableHead"?(c=!1,d!==0&&(fv(b,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",f,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,x=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",p,t]])),o=y.type==="tableDelimiterRow"?2:p?3:1):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],x=mc(b,t,s,o,void 0,x),s=[0,0,0,0]),l[2]=n)):y.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],x=mc(b,t,s,o,void 0,x)),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],x=mc(b,t,s,o,n,x)):l[1]!==0&&(x=mc(b,t,l,o,n,x)),o=0):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&fv(b,t,d,f,p),b.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=AD(t.events,n))}return e}function mc(e,t,n,i,o,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},As(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=As(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 f=As(t.events,n[2]),p=As(t.events,n[3]),x={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",x,t]]),i!==2){const b=t.events[n[2]],g=t.events[n[3]];if(b[1].end=Object.assign({},g[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",x,t]])}return o!==void 0&&(s.end=Object.assign({},As(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function fv(e,t,n,i,o){const s=[],l=As(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 As(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const MD={name:"tasklistCheck",tokenize:DD};function RD(){return{text:{91:MD}}}function DD(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 Rt(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 He(d)?t(d):lt(d)?e.check({tokenize:LD},t,n)(d):n(d)}}function LD(e,t,n){return ht(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function OD(e){return nT([rD(),pD(),SD(e),CD(),RD()])}const ID={};function QT(e){const t=this,n=e||ID,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(OD(n)),s.push(tD()),l.push(nD(n))}const hv=/[#.]/g;function jD(e,t){const n=e||"",i={};let o=0,s,l;for(;o<n.length;){hv.lastIndex=o;const c=hv.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 $T(e,t,n){const i=n?UD(n):void 0;function o(s,l,...c){let d;if(s==null){d={type:"root",children:[]};const f=l;c.unshift(f)}else{d=jD(s,t);const f=d.tagName.toLowerCase(),p=i?i.get(f):void 0;if(d.tagName=p||f,PD(l))c.unshift(l);else for(const[x,b]of Object.entries(l))BD(e,d.properties,x,b)}for(const f of c)k0(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function PD(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 BD(e,t,n,i){const o=pd(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=Ay(i):o.commaSeparated?s=Ey(i):o.commaOrSpaceSeparated?s=Ay(Ey(i).join(" ")):s=mv(o,o.property,i):Array.isArray(i)?s=[...i]:s=o.property==="style"?zD(i):String(i);if(Array.isArray(s)){const l=[];for(const c of s)l.push(mv(o,o.property,c));s=l}o.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[o.property]=s}}function k0(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)k0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?k0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function mv(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Sl(n)===Sl(t)))return!0}return n}function zD(e){const t=[];for(const[n,i]of Object.entries(e))t.push([n,i].join(": "));return t.join("; ")}function UD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const HD=["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"],FD=$T(Il,"div"),VD=$T(Hi,"g",HD);function qD(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=pv(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=pv(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const l=(s.line>1?n[s.line-2]:0)+s.column-1;if(l<n[s.line-1])return l}}}function pv(e,t){const n=e.indexOf("\r",t),i=e.indexOf(`
548
+ `,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/"},WT={}.hasOwnProperty,YD=Object.prototype;function GD(e,t){const n=t||{};return _p({file:n.file||void 0,location:!1,schema:n.space==="svg"?Hi:Il,verbose:n.verbose||!1},e)}function _p(e,t){let n;switch(t.nodeName){case"#comment":{const i=t;return n={type:"comment",value:i.data},Mc(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:ZT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const s=String(e.file),l=qD(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"},Mc(e,i,n),n}case"#text":{const i=t;return n={type:"text",value:i.value},Mc(e,i,n),n}default:return n=XD(e,t),n}}function ZT(e,t){let n=-1;const i=[];for(;++n<t.length;){const o=_p(e,t[n]);i.push(o)}return i}function XD(e,t){const n=e.schema;e.schema=t.namespaceURI===Er.svg?Hi:Il;let i=-1;const o={};for(;++i<t.attrs.length;){const c=t.attrs[i],d=(c.prefix?c.prefix+":":"")+c.name;WT.call(YD,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?VD:FD)(t.tagName,o,ZT(e,t.childNodes));if(Mc(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Ns(d.startTag),p=d&&d.endTag&&Ns(d.endTag),x=_p(e,c.content);f&&p&&e.file&&(x.position={start:f.end,end:p.start}),l.content=x}return e.schema=n,l}function Mc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const i=KD(e,n,t.sourceCodeLocation);i&&(e.location=!0,n.position=i)}}function KD(e,t,n){const i=Ns(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)WT.call(n.attrs,l)&&(s[pd(e.schema,l).property]=Ns(n.attrs[l]));n.startTag;const c=Ns(n.startTag),d=n.endTag?Ns(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=s,t.data={position:f}}}return i}function Ns(e){const t=gv({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=gv({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function gv(e){return e.line&&e.column?e:void 0}const QD={},$D={}.hasOwnProperty,JT=_T("type",{handlers:{root:ZD,element:a8,text:t8,comment:n8,doctype:e8}});function WD(e,t){const i=(t||QD).space;return JT(e,i==="svg"?Hi:Il)}function ZD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Mp(e.children,n,t),Vs(e,n),n}function JD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Mp(e.children,n,t),Vs(e,n),n}function e8(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Vs(e,t),t}function t8(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Vs(e,t),t}function n8(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Vs(e,t),t}function a8(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"&&$D.call(e.properties,s)){const d=i8(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=Mp(e.children,c,i),Vs(e,c),e.tagName==="template"&&e.content&&(c.content=JD(e.content,i)),c}function i8(e,t,n){const i=pd(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?UE(n):KE(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 Mp(e,t,n){let i=-1;const o=[];if(e)for(;++i<e.length;){const s=JT(e[i],n);s.parentNode=t,o.push(s)}return o}function Vs(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 r8=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],s8=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]),jt="�";var X;(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"})(X||(X={}));const Mn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function eS(e){return e>=55296&&e<=57343}function o8(e){return e>=56320&&e<=57343}function l8(e,t){return(e-55296)*1024+9216+t}function tS(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function nS(e){return e>=64976&&e<=65007||s8.has(e)}var xe;(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"})(xe||(xe={}));const u8=65536;class c8{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=u8,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(o8(n))return this.pos++,this._addGap(),l8(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,X.EOF;return this._err(xe.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,X.EOF;const i=this.html.charCodeAt(n);return i===X.CARRIAGE_RETURN?X.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,X.EOF;let t=this.html.charCodeAt(this.pos);return t===X.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,X.LINE_FEED):t===X.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,eS(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===X.LINE_FEED||t===X.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){tS(t)?this._err(xe.controlCharacterInInputStream):nS(t)&&this._err(xe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function aS(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 d8=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),f8=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 h8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=f8.get(e))!==null&&t!==void 0?t:e}var ln;(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"})(ln||(ln={}));const m8=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>=ln.ZERO&&e<=ln.NINE}function p8(e){return e>=ln.UPPER_A&&e<=ln.UPPER_F||e>=ln.LOWER_A&&e<=ln.LOWER_F}function g8(e){return e>=ln.UPPER_A&&e<=ln.UPPER_Z||e>=ln.LOWER_A&&e<=ln.LOWER_Z||w0(e)}function x8(e){return e===ln.EQUALS||g8(e)}var on;(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"})(on||(on={}));var ni;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ni||(ni={}));class b8{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=on.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ni.Strict}startEntity(t){this.decodeMode=t,this.state=on.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case on.EntityStart:return t.charCodeAt(n)===ln.NUM?(this.state=on.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=on.NamedEntity,this.stateNamedEntity(t,n));case on.NumericStart:return this.stateNumericStart(t,n);case on.NumericDecimal:return this.stateNumericDecimal(t,n);case on.NumericHex:return this.stateNumericHex(t,n);case on.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|m8)===ln.LOWER_X?(this.state=on.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=on.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)||p8(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===ln.SEMI)this.consumed+=1;else if(this.decodeMode===ni.Strict)return 0;return this.emitCodePoint(h8(this.result),this.consumed),this.errors&&(t!==ln.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=y8(i,o,this.treeIndex+Math.max(1,s),l),this.treeIndex<0)return this.result===0||this.decodeMode===ni.Attribute&&(s===0||x8(l))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Pi.VALUE_LENGTH)>>14,s!==0){if(l===ln.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 on.NamedEntity:return this.result!==0&&(this.decodeMode!==ni.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case on.NumericDecimal:return this.emitNumericEntity(0,2);case on.NumericHex:return this.emitNumericEntity(0,3);case on.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case on.EntityStart:return 0}}}function y8(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,f=e[d];if(f<i)l=d+1;else if(f>i)c=d-1;else return e[d+o]}return-1}var we;(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/"})(we||(we={}));var Mr;(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"})(Mr||(Mr={}));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 k;(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"})(k||(k={}));const v8=new Map([[le.A,k.A],[le.ADDRESS,k.ADDRESS],[le.ANNOTATION_XML,k.ANNOTATION_XML],[le.APPLET,k.APPLET],[le.AREA,k.AREA],[le.ARTICLE,k.ARTICLE],[le.ASIDE,k.ASIDE],[le.B,k.B],[le.BASE,k.BASE],[le.BASEFONT,k.BASEFONT],[le.BGSOUND,k.BGSOUND],[le.BIG,k.BIG],[le.BLOCKQUOTE,k.BLOCKQUOTE],[le.BODY,k.BODY],[le.BR,k.BR],[le.BUTTON,k.BUTTON],[le.CAPTION,k.CAPTION],[le.CENTER,k.CENTER],[le.CODE,k.CODE],[le.COL,k.COL],[le.COLGROUP,k.COLGROUP],[le.DD,k.DD],[le.DESC,k.DESC],[le.DETAILS,k.DETAILS],[le.DIALOG,k.DIALOG],[le.DIR,k.DIR],[le.DIV,k.DIV],[le.DL,k.DL],[le.DT,k.DT],[le.EM,k.EM],[le.EMBED,k.EMBED],[le.FIELDSET,k.FIELDSET],[le.FIGCAPTION,k.FIGCAPTION],[le.FIGURE,k.FIGURE],[le.FONT,k.FONT],[le.FOOTER,k.FOOTER],[le.FOREIGN_OBJECT,k.FOREIGN_OBJECT],[le.FORM,k.FORM],[le.FRAME,k.FRAME],[le.FRAMESET,k.FRAMESET],[le.H1,k.H1],[le.H2,k.H2],[le.H3,k.H3],[le.H4,k.H4],[le.H5,k.H5],[le.H6,k.H6],[le.HEAD,k.HEAD],[le.HEADER,k.HEADER],[le.HGROUP,k.HGROUP],[le.HR,k.HR],[le.HTML,k.HTML],[le.I,k.I],[le.IMG,k.IMG],[le.IMAGE,k.IMAGE],[le.INPUT,k.INPUT],[le.IFRAME,k.IFRAME],[le.KEYGEN,k.KEYGEN],[le.LABEL,k.LABEL],[le.LI,k.LI],[le.LINK,k.LINK],[le.LISTING,k.LISTING],[le.MAIN,k.MAIN],[le.MALIGNMARK,k.MALIGNMARK],[le.MARQUEE,k.MARQUEE],[le.MATH,k.MATH],[le.MENU,k.MENU],[le.META,k.META],[le.MGLYPH,k.MGLYPH],[le.MI,k.MI],[le.MO,k.MO],[le.MN,k.MN],[le.MS,k.MS],[le.MTEXT,k.MTEXT],[le.NAV,k.NAV],[le.NOBR,k.NOBR],[le.NOFRAMES,k.NOFRAMES],[le.NOEMBED,k.NOEMBED],[le.NOSCRIPT,k.NOSCRIPT],[le.OBJECT,k.OBJECT],[le.OL,k.OL],[le.OPTGROUP,k.OPTGROUP],[le.OPTION,k.OPTION],[le.P,k.P],[le.PARAM,k.PARAM],[le.PLAINTEXT,k.PLAINTEXT],[le.PRE,k.PRE],[le.RB,k.RB],[le.RP,k.RP],[le.RT,k.RT],[le.RTC,k.RTC],[le.RUBY,k.RUBY],[le.S,k.S],[le.SCRIPT,k.SCRIPT],[le.SEARCH,k.SEARCH],[le.SECTION,k.SECTION],[le.SELECT,k.SELECT],[le.SOURCE,k.SOURCE],[le.SMALL,k.SMALL],[le.SPAN,k.SPAN],[le.STRIKE,k.STRIKE],[le.STRONG,k.STRONG],[le.STYLE,k.STYLE],[le.SUB,k.SUB],[le.SUMMARY,k.SUMMARY],[le.SUP,k.SUP],[le.TABLE,k.TABLE],[le.TBODY,k.TBODY],[le.TEMPLATE,k.TEMPLATE],[le.TEXTAREA,k.TEXTAREA],[le.TFOOT,k.TFOOT],[le.TD,k.TD],[le.TH,k.TH],[le.THEAD,k.THEAD],[le.TITLE,k.TITLE],[le.TR,k.TR],[le.TRACK,k.TRACK],[le.TT,k.TT],[le.U,k.U],[le.UL,k.UL],[le.SVG,k.SVG],[le.VAR,k.VAR],[le.WBR,k.WBR],[le.XMP,k.XMP]]);function qs(e){var t;return(t=v8.get(e))!==null&&t!==void 0?t:k.UNKNOWN}const Ae=k,E8={[we.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[we.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[we.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[we.XLINK]:new Set,[we.XML]:new Set,[we.XMLNS]:new Set},A0=new Set([Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.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 Gt={DATA:W.DATA,RCDATA:W.RCDATA,RAWTEXT:W.RAWTEXT,SCRIPT_DATA:W.SCRIPT_DATA,PLAINTEXT:W.PLAINTEXT,CDATA_SECTION:W.CDATA_SECTION};function T8(e){return e>=X.DIGIT_0&&e<=X.DIGIT_9}function al(e){return e>=X.LATIN_CAPITAL_A&&e<=X.LATIN_CAPITAL_Z}function S8(e){return e>=X.LATIN_SMALL_A&&e<=X.LATIN_SMALL_Z}function Li(e){return S8(e)||al(e)}function xv(e){return Li(e)||T8(e)}function pc(e){return e+32}function iS(e){return e===X.SPACE||e===X.LINE_FEED||e===X.TABULATION||e===X.FORM_FEED}function bv(e){return iS(e)||e===X.SOLIDUS||e===X.GREATER_THAN_SIGN}function k8(e){return e===X.NULL?xe.nullCharacterReference:e>1114111?xe.characterReferenceOutsideUnicodeRange:eS(e)?xe.surrogateCharacterReference:nS(e)?xe.noncharacterCharacterReference:tS(e)||e===X.CARRIAGE_RETURN?xe.controlCharacterReference:null}class w8{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 c8(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new b8(d8,(i,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(xe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(xe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const o=k8(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:at.START_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.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(aS(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(xe.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=qs(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(xe.endTagWithAttributes),t.selfClosing&&this._err(xe.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=iS(t)?at.WHITESPACE_CHARACTER:t===X.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.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 X.LESS_THAN_SIGN:{this.state=W.TAG_OPEN;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitCodePoint(t);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case X.AMPERSAND:{this._startCharacterReference();break}case X.LESS_THAN_SIGN:{this.state=W.RCDATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case X.LESS_THAN_SIGN:{this.state=W.RAWTEXT_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.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 X.EXCLAMATION_MARK:{this.state=W.MARKUP_DECLARATION_OPEN;break}case X.SOLIDUS:{this.state=W.END_TAG_OPEN;break}case X.QUESTION_MARK:{this._err(xe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t);break}case X.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(xe.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 X.GREATER_THAN_SIGN:{this._err(xe.missingEndTagName),this.state=W.DATA;break}case X.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(xe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this.state=W.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.tagName+=jt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(al(t)?pc(t):t)}}_stateRcdataLessThanSign(t){t===X.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=W.BEFORE_ATTRIBUTE_NAME,!1;case X.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=W.SELF_CLOSING_START_TAG,!1;case X.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===X.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 X.SOLIDUS:{this.state=W.SCRIPT_DATA_END_TAG_OPEN;break}case X.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===X.HYPHEN_MINUS?(this.state=W.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===X.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 X.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===X.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(Mn.SCRIPT,!1)&&bv(this.preprocessor.peek(Mn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mn.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 X.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(jt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===X.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(Mn.SCRIPT,!1)&&bv(this.preprocessor.peek(Mn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mn.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this.state=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this._leaveAttrName(),this.state=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._leaveAttrName(),this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:{this._err(xe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.name+=jt;break}default:this.currentAttr.name+=String.fromCodePoint(al(t)?pc(t):t)}}_stateAfterAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:{this.state=W.SELF_CLOSING_START_TAG;break}case X.EQUALS_SIGN:{this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=W.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{this.state=W.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this.state=W.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingAttributeValue),this.state=W.DATA,this.emitCurrentTagToken();break}default:this.state=W.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case X.QUOTATION_MARK:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=jt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case X.APOSTROPHE:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=jt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=W.BEFORE_ATTRIBUTE_NAME;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=jt;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:case X.EQUALS_SIGN:case X.GRAVE_ACCENT:{this._err(xe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=W.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this._leaveAttrValue(),this.state=W.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBetweenAttributes),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case X.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=W.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.unexpectedSolidusInTag),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case X.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=jt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Mn.DASH_DASH,!0)?(this._createCommentToken(Mn.DASH_DASH.length+1),this.state=W.COMMENT_START):this._consumeSequenceIfMatch(Mn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Mn.DOCTYPE.length+1),this.state=W.DOCTYPE):this._consumeSequenceIfMatch(Mn.CDATA_START,!0)?this.inForeignNode?this.state=W.CDATA_SECTION:(this._err(xe.cdataInHtmlContent),this._createCommentToken(Mn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=W.BOGUS_COMMENT):this._ensureHibernation()||(this._err(xe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case X.HYPHEN_MINUS:{this.state=W.COMMENT_START_DASH;break}case X.GREATER_THAN_SIGN:{this._err(xe.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 X.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptClosingOfEmptyComment),this.state=W.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(xe.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 X.HYPHEN_MINUS:{this.state=W.COMMENT_END_DASH;break}case X.LESS_THAN_SIGN:{n.data+="<",this.state=W.COMMENT_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=jt;break}case X.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case X.EXCLAMATION_MARK:{n.data+="!",this.state=W.COMMENT_LESS_THAN_SIGN_BANG;break}case X.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=W.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===X.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=W.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===X.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=W.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==X.GREATER_THAN_SIGN&&t!==X.EOF&&this._err(xe.nestedComment),this.state=W.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case X.EOF:{this._err(xe.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 X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case X.EXCLAMATION_MARK:{this.state=W.COMMENT_END_BANG;break}case X.HYPHEN_MINUS:{n.data+="-";break}case X.EOF:{this._err(xe.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 X.HYPHEN_MINUS:{n.data+="--!",this.state=W.COMMENT_END_DASH;break}case X.GREATER_THAN_SIGN:{this._err(xe.incorrectlyClosedComment),this.state=W.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=W.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case X.EOF:{this._err(xe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBeforeDoctypeName),this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(al(t))this._createDoctypeToken(String.fromCharCode(pc(t))),this.state=W.DOCTYPE_NAME;else switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.NULL:{this._err(xe.unexpectedNullCharacter),this._createDoctypeToken(jt),this.state=W.DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.AFTER_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.name+=jt;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(al(t)?pc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Mn.PUBLIC,!1)?this.state=W.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Mn.SYSTEM,!1)?this.state=W.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(xe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=jt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.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 X.APOSTROPHE:{this.state=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=jt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case X.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.QUOTATION_MARK:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=jt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.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 X.APOSTROPHE:{this.state=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=jt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case X.NULL:{this._err(xe.unexpectedNullCharacter);break}case X.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case X.RIGHT_SQUARE_BRACKET:{this.state=W.CDATA_SECTION_BRACKET;break}case X.EOF:{this._err(xe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===X.RIGHT_SQUARE_BRACKET?this.state=W.CDATA_SECTION_END:(this._emitChars("]"),this.state=W.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case X.GREATER_THAN_SIGN:{this.state=W.DATA;break}case X.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(X.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&xv(this.preprocessor.peek(1))?W.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){xv(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===X.SEMICOLON&&this._err(xe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const rS=new Set([k.DD,k.DT,k.LI,k.OPTGROUP,k.OPTION,k.P,k.RB,k.RP,k.RT,k.RTC]),yv=new Set([...rS,k.CAPTION,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]),Qc=new Set([k.APPLET,k.CAPTION,k.HTML,k.MARQUEE,k.OBJECT,k.TABLE,k.TD,k.TEMPLATE,k.TH]),A8=new Set([...Qc,k.OL,k.UL]),C8=new Set([...Qc,k.BUTTON]),vv=new Set([k.ANNOTATION_XML,k.MI,k.MN,k.MO,k.MS,k.MTEXT]),Ev=new Set([k.DESC,k.FOREIGN_OBJECT,k.TITLE]),N8=new Set([k.TR,k.TEMPLATE,k.HTML]),_8=new Set([k.TBODY,k.TFOOT,k.THEAD,k.TEMPLATE,k.HTML]),M8=new Set([k.TABLE,k.TEMPLATE,k.HTML]),R8=new Set([k.TD,k.TH]);class D8{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=k.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===k.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===we.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])!==we.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(A0,we.HTML)}popUntilTableCellPopped(){this.popUntilPopped(R8,we.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(M8,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(_8,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(N8,we.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]===k.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]===k.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 we.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case we.SVG:{if(Ev.has(o))return!1;break}case we.MATHML:{if(vv.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Qc)}hasInListItemScope(t){return this.hasInDynamicScope(t,A8)}hasInButtonScope(t){return this.hasInDynamicScope(t,C8)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case we.HTML:{if(A0.has(n))return!0;if(Qc.has(n))return!1;break}case we.SVG:{if(Ev.has(n))return!1;break}case we.MATHML:{if(vv.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===we.HTML)switch(this.tagIDs[t]){case k.TBODY:case k.THEAD:case k.TFOOT:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case k.OPTION:case k.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&rS.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&yv.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&yv.has(this.currentTagId);)this.pop()}}const Cm=3;var Na;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Na||(Na={}));const Tv={type:Na.Marker};class L8{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:f}=d;if(this.treeAdapter.getTagName(f)===s&&this.treeAdapter.getNamespaceURI(f)===l){const p=this.treeAdapter.getAttrList(f);p.length===o&&i.push({idx:c,attrs:p})}}return i}_ensureNoahArkCondition(t){if(this.entries.length<Cm)return;const n=this.treeAdapter.getAttrList(t),i=this._getNoahArkConditionCandidates(t,n);if(i.length<Cm)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>=Cm&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Tv)}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(Tv);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}}},sS="html",O8="about:legacy-compat",I8="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",oS=["+//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//"],j8=[...oS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],P8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),lS=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],B8=[...lS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Sv(e,t){return t.some(n=>e.startsWith(n))}function z8(e){return e.name===sS&&e.publicId===null&&(e.systemId===null||e.systemId===O8)}function U8(e){if(e.name!==sS)return ra.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===I8)return ra.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),P8.has(n))return ra.QUIRKS;let i=t===null?j8:oS;if(Sv(n,i))return ra.QUIRKS;if(i=t===null?lS:B8,Sv(n,i))return ra.LIMITED_QUIRKS}return ra.NO_QUIRKS}const kv={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},H8="definitionurl",F8="definitionURL",V8=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])),q8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:we.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:we.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:we.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:we.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:we.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:we.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:we.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:we.XML}],["xml:space",{prefix:"xml",name:"space",namespace:we.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:we.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:we.XMLNS}]]),Y8=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])),G8=new Set([k.B,k.BIG,k.BLOCKQUOTE,k.BODY,k.BR,k.CENTER,k.CODE,k.DD,k.DIV,k.DL,k.DT,k.EM,k.EMBED,k.H1,k.H2,k.H3,k.H4,k.H5,k.H6,k.HEAD,k.HR,k.I,k.IMG,k.LI,k.LISTING,k.MENU,k.META,k.NOBR,k.OL,k.P,k.PRE,k.RUBY,k.S,k.SMALL,k.SPAN,k.STRONG,k.STRIKE,k.SUB,k.SUP,k.TABLE,k.TT,k.U,k.UL,k.VAR]);function X8(e){const t=e.tagID;return t===k.FONT&&e.attrs.some(({name:i})=>i===Mr.COLOR||i===Mr.SIZE||i===Mr.FACE)||G8.has(t)}function uS(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===H8){e.attrs[t].name=F8;break}}function cS(e){for(let t=0;t<e.attrs.length;t++){const n=V8.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Rp(e){for(let t=0;t<e.attrs.length;t++){const n=q8.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 K8(e){const t=Y8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=qs(e.tagName))}function Q8(e,t){return t===we.MATHML&&(e===k.MI||e===k.MO||e===k.MN||e===k.MS||e===k.MTEXT)}function $8(e,t,n){if(t===we.MATHML&&e===k.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===Mr.ENCODING){const o=n[i].value.toLowerCase();return o===kv.TEXT_HTML||o===kv.APPLICATION_XML}}return t===we.SVG&&(e===k.FOREIGN_OBJECT||e===k.DESC||e===k.TITLE)}function W8(e,t,n,i){return(!i||i===we.HTML)&&$8(e,t,n)||(!i||i===we.MATHML)&&Q8(e,t)}const Z8="hidden",J8=8,eL=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 tL={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},dS=new Set([k.TABLE,k.TBODY,k.TFOOT,k.THEAD,k.TR]),wv={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Oi,onParseError:null};class Av{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={...wv,...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 w8(this.options,this),this.activeFormattingElements=new L8(this.treeAdapter),this.fragmentContextID=i?qs(this.treeAdapter.getTagName(i)):k.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new D8(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={...wv,...n};t??(t=i.treeAdapter.createElement(le.TEMPLATE,we.HTML,[]));const o=i.treeAdapter.createElement("documentmock",we.HTML,[]),s=new this(i,o,t);return s.fragmentContextID===k.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:tL,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)===we.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,we.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=Gt.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)!==we.HTML))switch(this.fragmentContextID){case k.TITLE:case k.TEXTAREA:{this.tokenizer.state=Gt.RCDATA;break}case k.STYLE:case k.XMP:case k.IFRAME:case k.NOEMBED:case k.NOFRAMES:case k.NOSCRIPT:{this.tokenizer.state=Gt.RAWTEXT;break}case k.SCRIPT:{this.tokenizer.state=Gt.SCRIPT_DATA;break}case k.PLAINTEXT:{this.tokenizer.state=Gt.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,we.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,we.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,we.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,k.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:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:p})}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===at.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===k.SVG&&this.treeAdapter.getTagName(n)===le.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===we.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===k.MGLYPH||t.tagID===k.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,we.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const o=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return W8(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(k.P),this.openElements.popUntilTagNamePopped(k.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case k.TR:{this.insertionMode=ee.IN_ROW;return}case k.TBODY:case k.THEAD:case k.TFOOT:{this.insertionMode=ee.IN_TABLE_BODY;return}case k.CAPTION:{this.insertionMode=ee.IN_CAPTION;return}case k.COLGROUP:{this.insertionMode=ee.IN_COLUMN_GROUP;return}case k.TABLE:{this.insertionMode=ee.IN_TABLE;return}case k.BODY:{this.insertionMode=ee.IN_BODY;return}case k.FRAMESET:{this.insertionMode=ee.IN_FRAMESET;return}case k.SELECT:{this._resetInsertionModeForSelect(t);return}case k.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case k.HTML:{this.insertionMode=this.headElement?ee.AFTER_HEAD:ee.BEFORE_HEAD;return}case k.TD:case k.TH:{if(t>0){this.insertionMode=ee.IN_CELL;return}break}case k.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===k.TEMPLATE)break;if(i===k.TABLE){this.insertionMode=ee.IN_SELECT_IN_TABLE;return}}this.insertionMode=ee.IN_SELECT}_isElementCausesFosterParenting(t){return dS.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 k.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===we.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case k.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 E8[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){RO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{cl(this,t);break}case ee.BEFORE_HEAD:{dl(this,t);break}case ee.IN_HEAD:{fl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{hl(this,t);break}case ee.AFTER_HEAD:{ml(this,t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:{hS(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:{Nm(this,t);break}case ee.IN_TABLE_TEXT:{yS(this,t);break}case ee.IN_COLUMN_GROUP:{$c(this,t);break}case ee.AFTER_BODY:{Wc(this,t);break}case ee.AFTER_AFTER_BODY:{Rc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{cl(this,t);break}case ee.BEFORE_HEAD:{dl(this,t);break}case ee.IN_HEAD:{fl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{hl(this,t);break}case ee.AFTER_HEAD:{ml(this,t);break}case ee.TEXT:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Nm(this,t);break}case ee.IN_COLUMN_GROUP:{$c(this,t);break}case ee.AFTER_BODY:{Wc(this,t);break}case ee.AFTER_AFTER_BODY:{Rc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){C0(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:{C0(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.AFTER_BODY:{lL(this,t);break}case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{uL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ee.INITIAL:{cL(this,t);break}case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:{this._err(t,xe.misplacedDoctype);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,xe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?DO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{dL(this,t);break}case ee.BEFORE_HEAD:{hL(this,t);break}case ee.IN_HEAD:{ya(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{gL(this,t);break}case ee.AFTER_HEAD:{bL(this,t);break}case ee.IN_BODY:{bn(this,t);break}case ee.IN_TABLE:{Ps(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.IN_CAPTION:{mO(this,t);break}case ee.IN_COLUMN_GROUP:{Op(this,t);break}case ee.IN_TABLE_BODY:{wd(this,t);break}case ee.IN_ROW:{Ad(this,t);break}case ee.IN_CELL:{xO(this,t);break}case ee.IN_SELECT:{TS(this,t);break}case ee.IN_SELECT_IN_TABLE:{yO(this,t);break}case ee.IN_TEMPLATE:{EO(this,t);break}case ee.AFTER_BODY:{SO(this,t);break}case ee.IN_FRAMESET:{kO(this,t);break}case ee.AFTER_FRAMESET:{AO(this,t);break}case ee.AFTER_AFTER_BODY:{NO(this,t);break}case ee.AFTER_AFTER_FRAMESET:{_O(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?LO(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{fL(this,t);break}case ee.BEFORE_HEAD:{mL(this,t);break}case ee.IN_HEAD:{pL(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{xL(this,t);break}case ee.AFTER_HEAD:{yL(this,t);break}case ee.IN_BODY:{kd(this,t);break}case ee.TEXT:{iO(this,t);break}case ee.IN_TABLE:{Al(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.IN_CAPTION:{pO(this,t);break}case ee.IN_COLUMN_GROUP:{gO(this,t);break}case ee.IN_TABLE_BODY:{N0(this,t);break}case ee.IN_ROW:{ES(this,t);break}case ee.IN_CELL:{bO(this,t);break}case ee.IN_SELECT:{SS(this,t);break}case ee.IN_SELECT_IN_TABLE:{vO(this,t);break}case ee.IN_TEMPLATE:{TO(this,t);break}case ee.AFTER_BODY:{wS(this,t);break}case ee.IN_FRAMESET:{wO(this,t);break}case ee.AFTER_FRAMESET:{CO(this,t);break}case ee.AFTER_AFTER_BODY:{Rc(this,t);break}}}onEof(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{cl(this,t);break}case ee.BEFORE_HEAD:{dl(this,t);break}case ee.IN_HEAD:{fl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{hl(this,t);break}case ee.AFTER_HEAD:{ml(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:{xS(this,t);break}case ee.TEXT:{rO(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.IN_TEMPLATE:{kS(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:{Lp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===X.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:{fS(this,t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Nm(this,t);break}case ee.IN_TABLE_TEXT:{bS(this,t);break}}}}function nL(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):gS(e,t),n}function aL(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 iL(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>=eL;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=rL(e,c),i===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(l,i),i=l)}return i}function rL(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 sL(e,t,n){const i=e.treeAdapter.getTagName(t),o=qs(i);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);o===k.TEMPLATE&&s===we.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function oL(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 Dp(e,t){for(let n=0;n<J8;n++){const i=nL(e,t);if(!i)break;const o=aL(e,i);if(!o)break;e.activeFormattingElements.bookmark=i;const s=iL(e,o,i.element),l=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(s),l&&sL(e,l,s),oL(e,o,i)}}function C0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function lL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function uL(e,t){e._appendCommentNode(t,e.document)}function Lp(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 cL(e,t){e._setDocumentType(t);const n=t.forceQuirks?ra.QUIRKS:U8(t);z8(t)||e._err(t,xe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ee.BEFORE_HTML}function Zo(e,t){e._err(t,xe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ra.QUIRKS),e.insertionMode=ee.BEFORE_HTML,e._processToken(t)}function dL(e,t){t.tagID===k.HTML?(e._insertElement(t,we.HTML),e.insertionMode=ee.BEFORE_HEAD):cl(e,t)}function fL(e,t){const n=t.tagID;(n===k.HTML||n===k.HEAD||n===k.BODY||n===k.BR)&&cl(e,t)}function cl(e,t){e._insertFakeRootElement(),e.insertionMode=ee.BEFORE_HEAD,e._processToken(t)}function hL(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.HEAD:{e._insertElement(t,we.HTML),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD;break}default:dl(e,t)}}function mL(e,t){const n=t.tagID;n===k.HEAD||n===k.BODY||n===k.HTML||n===k.BR?dl(e,t):e._err(t,xe.endTagWithoutMatchingOpenElement)}function dl(e,t){e._insertFakeElement(le.HEAD,k.HEAD),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD,e._processToken(t)}function ya(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case k.TITLE:{e._switchToTextParsing(t,Gt.RCDATA);break}case k.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Gt.RAWTEXT):(e._insertElement(t,we.HTML),e.insertionMode=ee.IN_HEAD_NO_SCRIPT);break}case k.NOFRAMES:case k.STYLE:{e._switchToTextParsing(t,Gt.RAWTEXT);break}case k.SCRIPT:{e._switchToTextParsing(t,Gt.SCRIPT_DATA);break}case k.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ee.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ee.IN_TEMPLATE);break}case k.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:fl(e,t)}}function pL(e,t){switch(t.tagID){case k.HEAD:{e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD;break}case k.BODY:case k.BR:case k.HTML:{fl(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function jr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==k.TEMPLATE&&e._err(t,xe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,xe.endTagWithoutMatchingOpenElement)}function fl(e,t){e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD,e._processToken(t)}function gL(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.BASEFONT:case k.BGSOUND:case k.HEAD:case k.LINK:case k.META:case k.NOFRAMES:case k.STYLE:{ya(e,t);break}case k.NOSCRIPT:{e._err(t,xe.nestedNoscriptInHead);break}default:hl(e,t)}}function xL(e,t){switch(t.tagID){case k.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ee.IN_HEAD;break}case k.BR:{hl(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function hl(e,t){const n=t.type===at.EOF?xe.openElementsLeftAfterEof:xe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ee.IN_HEAD,e._processToken(t)}function bL(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.BODY:{e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_BODY;break}case k.FRAMESET:{e._insertElement(t,we.HTML),e.insertionMode=ee.IN_FRAMESET;break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{e._err(t,xe.abandonedHeadElementChild),e.openElements.push(e.headElement,k.HEAD),ya(e,t),e.openElements.remove(e.headElement);break}case k.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:ml(e,t)}}function yL(e,t){switch(t.tagID){case k.BODY:case k.HTML:case k.BR:{ml(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function ml(e,t){e._insertFakeElement(le.BODY,k.BODY),e.insertionMode=ee.IN_BODY,Sd(e,t)}function Sd(e,t){switch(t.type){case at.CHARACTER:{hS(e,t);break}case at.WHITESPACE_CHARACTER:{fS(e,t);break}case at.COMMENT:{C0(e,t);break}case at.START_TAG:{bn(e,t);break}case at.END_TAG:{kd(e,t);break}case at.EOF:{xS(e,t);break}}}function fS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function hS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function vL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function TL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_FRAMESET)}function SL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function kL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&A0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function wL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function AL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),n||(e.formElement=e.openElements.current))}function CL(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===k.LI&&o===k.LI||(n===k.DD||n===k.DT)&&(o===k.DD||o===k.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==k.ADDRESS&&o!==k.DIV&&o!==k.P&&e._isSpecialElement(e.openElements.items[i],o))break}e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function NL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Gt.PLAINTEXT}function _L(e,t){e.openElements.hasInScope(k.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1}function ML(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(le.A);n&&(Dp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function DL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(k.NOBR)&&(Dp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OL(e,t){e.treeAdapter.getDocumentMode(e.document)!==ra.QUIRKS&&e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_TABLE}function mS(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pS(e){const t=aS(e,Mr.TYPE);return t!=null&&t.toLowerCase()===Z8}function IL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),pS(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function jL(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function PL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function BL(e,t){t.tagName=le.IMG,t.tagID=k.IMG,mS(e,t)}function zL(e,t){e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Gt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ee.TEXT}function UL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function HL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function Cv(e,t){e._switchToTextParsing(t,Gt.RAWTEXT)}function FL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.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 VL(e,t){e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function qL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function YL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(k.RTC),e._insertElement(t,we.HTML)}function GL(e,t){e._reconstructActiveFormattingElements(),uS(t),Rp(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function XL(e,t){e._reconstructActiveFormattingElements(),cS(t),Rp(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function Nv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function bn(e,t){switch(t.tagID){case k.I:case k.S:case k.B:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.SMALL:case k.STRIKE:case k.STRONG:{RL(e,t);break}case k.A:{ML(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{kL(e,t);break}case k.P:case k.DL:case k.OL:case k.UL:case k.DIV:case k.DIR:case k.NAV:case k.MAIN:case k.MENU:case k.ASIDE:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.DETAILS:case k.ADDRESS:case k.ARTICLE:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{SL(e,t);break}case k.LI:case k.DD:case k.DT:{CL(e,t);break}case k.BR:case k.IMG:case k.WBR:case k.AREA:case k.EMBED:case k.KEYGEN:{mS(e,t);break}case k.HR:{PL(e,t);break}case k.RB:case k.RTC:{qL(e,t);break}case k.RT:case k.RP:{YL(e,t);break}case k.PRE:case k.LISTING:{wL(e,t);break}case k.XMP:{UL(e,t);break}case k.SVG:{XL(e,t);break}case k.HTML:{vL(e,t);break}case k.BASE:case k.LINK:case k.META:case k.STYLE:case k.TITLE:case k.SCRIPT:case k.BGSOUND:case k.BASEFONT:case k.TEMPLATE:{ya(e,t);break}case k.BODY:{EL(e,t);break}case k.FORM:{AL(e,t);break}case k.NOBR:{DL(e,t);break}case k.MATH:{GL(e,t);break}case k.TABLE:{OL(e,t);break}case k.INPUT:{IL(e,t);break}case k.PARAM:case k.TRACK:case k.SOURCE:{jL(e,t);break}case k.IMAGE:{BL(e,t);break}case k.BUTTON:{_L(e,t);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{LL(e,t);break}case k.IFRAME:{HL(e,t);break}case k.SELECT:{FL(e,t);break}case k.OPTION:case k.OPTGROUP:{VL(e,t);break}case k.NOEMBED:case k.NOFRAMES:{Cv(e,t);break}case k.FRAMESET:{TL(e,t);break}case k.TEXTAREA:{zL(e,t);break}case k.NOSCRIPT:{e.options.scriptingEnabled?Cv(e,t):Nv(e,t);break}case k.PLAINTEXT:{NL(e,t);break}case k.COL:case k.TH:case k.TD:case k.TR:case k.HEAD:case k.FRAME:case k.TBODY:case k.TFOOT:case k.THEAD:case k.CAPTION:case k.COLGROUP:break;default:Nv(e,t)}}function KL(e,t){if(e.openElements.hasInScope(k.BODY)&&(e.insertionMode=ee.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function QL(e,t){e.openElements.hasInScope(k.BODY)&&(e.insertionMode=ee.AFTER_BODY,wS(e,t))}function $L(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function WL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(k.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(k.FORM):n&&e.openElements.remove(n))}function ZL(e){e.openElements.hasInButtonScope(k.P)||e._insertFakeElement(le.P,k.P),e._closePElement()}function JL(e){e.openElements.hasInListItemScope(k.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(k.LI),e.openElements.popUntilTagNamePopped(k.LI))}function eO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function tO(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function nO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function aO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(le.BR,k.BR),e.openElements.pop(),e.framesetOk=!1}function gS(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!==k.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 kd(e,t){switch(t.tagID){case k.A:case k.B:case k.I:case k.S:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.NOBR:case k.SMALL:case k.STRIKE:case k.STRONG:{Dp(e,t);break}case k.P:{ZL(e);break}case k.DL:case k.UL:case k.OL:case k.DIR:case k.DIV:case k.NAV:case k.PRE:case k.MAIN:case k.MENU:case k.ASIDE:case k.BUTTON:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.ADDRESS:case k.ARTICLE:case k.DETAILS:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.LISTING:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{$L(e,t);break}case k.LI:{JL(e);break}case k.DD:case k.DT:{eO(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{tO(e);break}case k.BR:{aO(e);break}case k.BODY:{KL(e,t);break}case k.HTML:{QL(e,t);break}case k.FORM:{WL(e);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{nO(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:gS(e,t)}}function xS(e,t){e.tmplInsertionModeStack.length>0?kS(e,t):Lp(e,t)}function iO(e,t){var n;t.tagID===k.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rO(e,t){e._err(t,xe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Nm(e,t){if(e.openElements.currentTagId!==void 0&&dS.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 at.CHARACTER:{yS(e,t);break}case at.WHITESPACE_CHARACTER:{bS(e,t);break}}else Bl(e,t)}function sO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_CAPTION}function oO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_COLUMN_GROUP}function lO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(le.COLGROUP,k.COLGROUP),e.insertionMode=ee.IN_COLUMN_GROUP,Op(e,t)}function uO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_TABLE_BODY}function cO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(le.TBODY,k.TBODY),e.insertionMode=ee.IN_TABLE_BODY,wd(e,t)}function dO(e,t){e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function fO(e,t){pS(t)?e._appendElement(t,we.HTML):Bl(e,t),t.ackSelfClosing=!0}function hO(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,we.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ps(e,t){switch(t.tagID){case k.TD:case k.TH:case k.TR:{cO(e,t);break}case k.STYLE:case k.SCRIPT:case k.TEMPLATE:{ya(e,t);break}case k.COL:{lO(e,t);break}case k.FORM:{hO(e,t);break}case k.TABLE:{dO(e,t);break}case k.TBODY:case k.TFOOT:case k.THEAD:{uO(e,t);break}case k.INPUT:{fO(e,t);break}case k.CAPTION:{sO(e,t);break}case k.COLGROUP:{oO(e,t);break}default:Bl(e,t)}}function Al(e,t){switch(t.tagID){case k.TABLE:{e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode());break}case k.TEMPLATE:{jr(e,t);break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:Bl(e,t)}}function Bl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Sd(e,t),e.fosterParentingEnabled=n}function bS(e,t){e.pendingCharacterTokens.push(t)}function yS(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Jo(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Bl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const vS=new Set([k.CAPTION,k.COL,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]);function mO(e,t){const n=t.tagID;vS.has(n)?e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,Ps(e,t)):bn(e,t)}function pO(e,t){const n=t.tagID;switch(n){case k.CAPTION:case k.TABLE:{e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,n===k.TABLE&&Al(e,t));break}case k.BODY:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:kd(e,t)}}function Op(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.COL:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case k.TEMPLATE:{ya(e,t);break}default:$c(e,t)}}function gO(e,t){switch(t.tagID){case k.COLGROUP:{e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case k.TEMPLATE:{jr(e,t);break}case k.COL:break;default:$c(e,t)}}function $c(e,t){e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE,e._processToken(t))}function wd(e,t){switch(t.tagID){case k.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_ROW;break}case k.TH:case k.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(le.TR,k.TR),e.insertionMode=ee.IN_ROW,Ad(e,t);break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,Ps(e,t));break}default:Ps(e,t)}}function N0(e,t){const n=t.tagID;switch(t.tagID){case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case k.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,Al(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:case k.TR:break;default:Al(e,t)}}function Ad(e,t){switch(t.tagID){case k.TH:case k.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_CELL,e.activeFormattingElements.insertMarker();break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,wd(e,t));break}default:Ps(e,t)}}function ES(e,t){switch(t.tagID){case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY);break}case k.TABLE:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,N0(e,t));break}case k.TBODY:case k.TFOOT:case k.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(k.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,N0(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:break;default:Al(e,t)}}function xO(e,t){const n=t.tagID;vS.has(n)?(e.openElements.hasInTableScope(k.TD)||e.openElements.hasInTableScope(k.TH))&&(e._closeTableCell(),Ad(e,t)):bn(e,t)}function bO(e,t){const n=t.tagID;switch(n){case k.TD:case k.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_ROW);break}case k.TABLE:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ES(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:break;default:kd(e,t)}}function TS(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._insertElement(t,we.HTML);break}case k.OPTGROUP:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._insertElement(t,we.HTML);break}case k.HR:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case k.INPUT:case k.KEYGEN:case k.TEXTAREA:case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),t.tagID!==k.SELECT&&e._processStartTag(t));break}case k.SCRIPT:case k.TEMPLATE:{ya(e,t);break}}}function SS(e,t){switch(t.tagID){case k.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===k.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===k.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop();break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop();break}case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode());break}case k.TEMPLATE:{jr(e,t);break}}}function yO(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e._processStartTag(t)):TS(e,t)}function vO(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e.onEndTag(t)):SS(e,t)}function EO(e,t){switch(t.tagID){case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{ya(e,t);break}case k.CAPTION:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.tmplInsertionModeStack[0]=ee.IN_TABLE,e.insertionMode=ee.IN_TABLE,Ps(e,t);break}case k.COL:{e.tmplInsertionModeStack[0]=ee.IN_COLUMN_GROUP,e.insertionMode=ee.IN_COLUMN_GROUP,Op(e,t);break}case k.TR:{e.tmplInsertionModeStack[0]=ee.IN_TABLE_BODY,e.insertionMode=ee.IN_TABLE_BODY,wd(e,t);break}case k.TD:case k.TH:{e.tmplInsertionModeStack[0]=ee.IN_ROW,e.insertionMode=ee.IN_ROW,Ad(e,t);break}default:e.tmplInsertionModeStack[0]=ee.IN_BODY,e.insertionMode=ee.IN_BODY,bn(e,t)}}function TO(e,t){t.tagID===k.TEMPLATE&&jr(e,t)}function kS(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Lp(e,t)}function SO(e,t){t.tagID===k.HTML?bn(e,t):Wc(e,t)}function wS(e,t){var n;if(t.tagID===k.HTML){if(e.fragmentContext||(e.insertionMode=ee.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===k.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 Wc(e,t)}function Wc(e,t){e.insertionMode=ee.IN_BODY,Sd(e,t)}function kO(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.FRAMESET:{e._insertElement(t,we.HTML);break}case k.FRAME:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case k.NOFRAMES:{ya(e,t);break}}}function wO(e,t){t.tagID===k.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==k.FRAMESET&&(e.insertionMode=ee.AFTER_FRAMESET))}function AO(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function CO(e,t){t.tagID===k.HTML&&(e.insertionMode=ee.AFTER_AFTER_FRAMESET)}function NO(e,t){t.tagID===k.HTML?bn(e,t):Rc(e,t)}function Rc(e,t){e.insertionMode=ee.IN_BODY,Sd(e,t)}function _O(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function MO(e,t){t.chars=jt,e._insertCharacters(t)}function RO(e,t){e._insertCharacters(t),e.framesetOk=!1}function AS(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==we.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function DO(e,t){if(X8(t))AS(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===we.MATHML?uS(t):i===we.SVG&&(K8(t),cS(t)),Rp(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function LO(e,t){if(t.tagID===k.P||t.tagID===k.BR){AS(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)===we.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 OO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,IO=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),_v={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function CS(e,t){const n=YO(e),i=_T("type",{handlers:{root:jO,element:PO,text:BO,comment:_S,doctype:zO,raw:HO},unknown:FO}),o={parser:n?new Av(_v):Av.getFragmentParser(void 0,_v),handle(c){i(c,o)},stitches:!1,options:t||{}};i(e,o),Ys(o,Da());const s=n?o.parser.document:o.parser.getFragment(),l=GD(s,{file:o.options.file});return o.stitches&&Td(l,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const x=f.children;return x[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function NS(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function jO(e,t){NS(e.children,t)}function PO(e,t){VO(e,t),NS(e.children,t),qO(e,t)}function BO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:at.CHARACTER,chars:e.value,location:zl(e)};Ys(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function zO(e,t){const n={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:zl(e)};Ys(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function UO(e,t){t.stitches=!0;const n=GO(e);if("children"in e&&"children"in n){const i=CS({type:"root",children:e.children},t.options);n.children=i.children}_S({type:"comment",value:{stitch:n}},t)}function _S(e,t){const n=e.value,i={type:at.COMMENT,data:n,location:zl(e)};Ys(t,Da(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function HO(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,MS(t,Da(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OO,"&lt;$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 FO(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))UO(n,t);else{let i="";throw IO.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 Ys(e,t){MS(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=Gt.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 MS(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 VO(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ys(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=WD({...e,children:[]},{space:o===Er.svg?"svg":"html"}),l={type:at.START_TAG,tagName:n,tagID:qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:zl(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function qO(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&r8.includes(n)||t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ys(t,gd(e));const i={type:at.END_TAG,tagName:n,tagID:qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:zl(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Gt.RCDATA||t.parser.tokenizer.state===Gt.RAWTEXT||t.parser.tokenizer.state===Gt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Gt.DATA)}function YO(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function zl(e){const t=Da(e)||{line:void 0,column:void 0,offset:void 0},n=gd(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 GO(e){return"children"in e?Or({...e,children:[]}):Or(e)}function RS(e){return function(t,n){return CS(t,{...e,file:n})}}const pr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],pl={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 XO(e,t){let n={type:"root",children:[]};const i={schema:t?{...pl,...t}:pl,stack:[]},o=DS(i,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function DS(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return KO(e,n);case"doctype":return QO(e,n);case"element":return $O(e,n);case"root":return WO(e,n);case"text":return ZO(e,n)}}}function KO(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 QO(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Ul(n,t),n}}function $O(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const i=LS(e,t.children),o=JO(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 WO(e,t){const i={type:"root",children:LS(e,t.children)};return Ul(i,t),i}function ZO(e,t){const i={type:"text",value:typeof t.value=="string"?t.value:""};return Ul(i,t),i}function LS(e,t){const n=[];if(Array.isArray(t)){const i=t;let o=-1;for(;++o<i.length;){const s=DS(e,i[o]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function JO(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 f;for(f in c)if(ji.call(c,f)){const p=c[f];let x=Mv(e,Rv(s,f),f,p);x==null&&(x=Mv(e,Rv(l,f),f,p)),x!=null&&(d[f]=x)}if(o&&ji.call(o,n)){const p=o[n];for(f in p)ji.call(p,f)&&!ji.call(d,f)&&(d[f]=p[f])}return d}function Mv(e,t,n,i){return t?Array.isArray(i)?eI(e,t,n,i):OS(e,t,n,i):void 0}function eI(e,t,n,i){let o=-1;const s=[];for(;++o<i.length;){const l=OS(e,t,n,i[o]);(typeof l=="number"||typeof l=="string")&&s.push(l)}return s}function OS(e,t,n,i){if(!(typeof i!="boolean"&&typeof i!="number"&&typeof i!="string")&&tI(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 tI(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 f=-1;for(;++f<i.length;){const p=i[f];if(s===p.length&&o.slice(0,p.length)===p)return!0}return!1}function Ul(e,t){const n=$E(t);t.data&&(e.data=Or(t.data)),n&&(e.position=n)}function Rv(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 IS(e){return function(t){return XO(t,e)}}var hE;const jS={...pl,protocols:{...pl.protocols,src:[...((hE=pl.protocols)==null?void 0:hE.src)??["http","https","mailto"],"data"]}};function nI({retry:e}){const t=Ve();return m.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[m.jsx(ri,{className:"w-4 h-4 shrink-0 mt-0.5"}),m.jsxs("span",{children:[t("error.renderFailed")," ",m.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class aI extends _.Component{constructor(){super(...arguments);Yh(this,"state",{error:null});Yh(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):m.jsx(nI,{error:this.state.error,retry:this.retry}):this.props.children}}function iI({nodeId:e,onRated:t}){const n=Ve(),[i,o]=_.useState(!1),[s,l]=_.useState(!1),c=async d=>{if(!(i||s)){o(!0);try{await me.recordReview(e,d),l(!0),t==null||t(),Nr(d>=4?"correct":"wrong")}catch{}finally{o(!1)}}};return s?m.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):m.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[m.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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),m.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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),m.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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function Zc(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 PS(e,t){const n=Dv(e.startContainer,e.startOffset,t,"start"),i=Dv(e.endContainer,e.endOffset,t,"end");return n==null||i==null||i<=n?null:{start:n,end:i}}function Dv(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 f=t;f<c.length;f++){const p=BS(c[f],n);if(p!=null)return p}const d=n.nodes[n.nodes.length-1];return d?d.end:null}else{for(let f=t;f>=0;f--){const p=zS(c[f],n);if(p!=null)return p}const d=n.nodes[0];return d?d.start:null}}return null}function BS(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=BS(n,t);if(i!=null)return i}return null}function zS(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=zS(i,t);o!=null&&(n=o)}return n}return null}function rI(e,t,n){var c,d,f,p;if(n<=t)return null;let i=null,o=0,s=null,l=0;for(const x of e.nodes)if(!i&&t>=x.start&&t<x.end&&(i=x.node,o=t-x.start),!s&&n>x.start&&n<=x.end&&(s=x.node,l=n-x.start),i&&s)break;if(!i&&e.nodes.length>0){const x=e.nodes[e.nodes.length-1];i=x.node,o=((c=x.node.textContent)==null?void 0:c.length)??0}if(!s&&e.nodes.length>0){const x=e.nodes[e.nodes.length-1];s=x.node,l=((d=x.node.textContent)==null?void 0:d.length)??0}if(!i||!s)return null;try{const x=document.createRange();return x.setStart(i,Math.min(o,((f=i.textContent)==null?void 0:f.length)??0)),x.setEnd(s,Math.min(l,((p=s.textContent)==null?void 0:p.length)??0)),x}catch{return null}}function US(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=Zc(e),o=[];for(const s of t){const l=sI(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=rI(i,s.start,s.end);if(!l)continue;const c=oI(l,s.noteId);c&&n.set(s.noteId,c)}return n}function sI(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 f=Math.abs(d-o);f<l&&(s=d,l=f),c=d+1}return s}}return i}function oI(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 f=d;if(d===e.startContainer&&e.startOffset>0&&(f=d.splitText(e.startOffset)),d===e.endContainer||f===e.endContainer){const x=f===e.endContainer?e.endOffset:e.endOffset-(d===e.startContainer?e.startOffset:0);x<f.textContent.length&&f.splitText(x)}if(!f.textContent)continue;const p=document.createElement("mark");p.className="lookatstudy-underline",p.dataset.noteId=t,p.style.cssText=n,(i=f.parentNode)==null||i.insertBefore(p,f),p.appendChild(f),c||(c=p)}return c}catch{return null}}function HS(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 FS(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 Cd({title:e,onClose:t,children:n}){const i=Ve(),o=_.useRef(null);return Us(o,!0),_.useEffect(()=>{const s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t]),dp.createPortal(m.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:[m.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:s=>s.stopPropagation(),children:[m.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),m.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[m.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:i("artifact.viewer.hint")}),m.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:m.jsx(la,{className:"w-5 h-5"})})]})]}),m.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:m.jsx("div",{ref:o,className:"h-full w-full",onClick:s=>s.stopPropagation(),children:n})})]}),document.body)}function lI(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 uI(e,t,n,i,o=24){const s=lI(e,t,n,i,o);return{scale:s,x:(n-e*s)/2,y:(i-t*s)/2}}function cI(e,t,n,i){return{scale:e.scale*t,x:n-(n-e.x)*t,y:i-(i-e.y)*t}}function il(e,t,n,i,o,s=64){const l=t*e.scale,c=n*e.scale;let{x:d,y:f}=e;return l<=i?d=(i-l)/2:d=Math.min(Math.max(d,i-l-s),s),c<=o?f=(o-c)/2:f=Math.min(Math.max(f,o-c-s),s),{x:d,y:f,scale:e.scale}}function dI(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:il(cI(e,l,n,i),o.contentW,o.contentH,o.viewW,o.viewH)}const Lv=.05,Ov=4,gc=1.25;function Hl({children:e,grid:t=!0,testid:n}){const i=Ve(),o=_.useRef(null),s=_.useRef(null),[l,c]=_.useState({x:0,y:0,scale:1}),[d,f]=_.useState(null),[p,x]=_.useState(!1),b=_.useRef("mouse"),g=_.useRef(!0),y=_.useRef({pointers:new Map,pinchBase:null,lastMid:null,panning:!1,moved:!1}),E=_.useRef(null),T=_.useCallback(()=>{const R=o.current,j=s.current;return{min:Lv,max:Ov,contentW:(j==null?void 0:j.offsetWidth)??0,contentH:(j==null?void 0:j.offsetHeight)??0,viewW:(R==null?void 0:R.clientWidth)??0,viewH:(R==null?void 0:R.clientHeight)??0}},[]),w=_.useCallback(()=>{const R=T();!R.contentW||!R.viewW||(c(uI(R.contentW,R.contentH,R.viewW,R.viewH)),g.current=!0)},[T]);_.useEffect(()=>{const R=o.current,j=s.current;if(!R||!j)return;const D=()=>{f({w:j.offsetWidth,h:j.offsetHeight}),w()};D();const P=new ResizeObserver(D);return P.observe(j),P.observe(R),()=>P.disconnect()},[w]);const M=_.useCallback((R,j,D)=>{const P=T(),B=j??P.viewW/2,Q=D??P.viewH/2;c(q=>dI(q,R,B,Q,P)),g.current=!1},[T]),N=_.useCallback(R=>{var P,B;if((B=(P=R.target).closest)!=null&&B.call(P,"[data-testid=canvas-zoom-controls]"))return;const j=R.currentTarget;try{j.setPointerCapture(R.pointerId)}catch{}const D=y.current;if(b.current=R.pointerType,D.pointers.size===0&&x(!0),D.pointers.set(R.pointerId,{x:R.clientX,y:R.clientY}),D.pointers.size===2){const[Q,q]=[...D.pointers.values()];D.pinchBase={dist:Math.hypot(Q.x-q.x,Q.y-q.y),factorAcc:1},D.lastMid={x:(Q.x+q.x)/2,y:(Q.y+q.y)/2},D.panning=!1}else D.pointers.size===1&&(D.panning=!0,D.moved=!1,D.lastMid={x:R.clientX,y:R.clientY})},[]),L=_.useCallback(R=>{const j=y.current;if(!j.pointers.has(R.pointerId))return;j.pointers.set(R.pointerId,{x:R.clientX,y:R.clientY});const D=o.current;if(!D)return;const P=D.getBoundingClientRect();if(j.pointers.size>=2&&j.pinchBase){const[B,Q]=[...j.pointers.values()],q=Math.hypot(B.x-Q.x,B.y-Q.y),z={x:(B.x+Q.x)/2,y:(B.y+Q.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,G=z.y-j.lastMid.y,Z=T();c(ie=>il({...ie,x:ie.x+H,y:ie.y+G},Z.contentW,Z.contentH,Z.viewW,Z.viewH))}j.lastMid=z;return}if(j.panning&&j.lastMid){const B=R.clientX-j.lastMid.x,Q=R.clientY-j.lastMid.y;Math.abs(B)+Math.abs(Q)>2&&(j.moved=!0);const q=T();c(z=>il({...z,x:z.x+B,y:z.y+Q},q.contentW,q.contentH,q.viewW,q.viewH)),j.lastMid={x:R.clientX,y:R.clientY}}},[T,M]),A=_.useCallback(R=>{const j=y.current,D=j.pointers.size===1;if(j.pointers.delete(R.pointerId),j.pointers.size<2&&(j.pinchBase=null),j.pointers.size===0){if(j.panning=!1,j.lastMid=null,x(!1),D&&!j.moved&&R.pointerType!=="mouse"){const P=performance.now(),B=E.current;if(B&&P-B.t<320&&Math.hypot(R.clientX-B.x,R.clientY-B.y)<32){const Q=T();g.current?(c(il({x:(Q.viewW-Q.contentW)/2,y:Math.max(24,(Q.viewH-Q.contentH)/2),scale:1},Q.contentW,Q.contentH,Q.viewW,Q.viewH)),g.current=!1):w(),E.current=null}else E.current={t:P,x:R.clientX,y:R.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,w]),C=_.useCallback(R=>{var D;R.preventDefault();const j=(D=o.current)==null?void 0:D.getBoundingClientRect();j&&M(R.deltaY<0?gc:1/gc,R.clientX-j.left,R.clientY-j.top)},[M]),I=_.useCallback(()=>{if(b.current!=="mouse")return;const R=T();g.current?(c(il({x:(R.viewW-R.contentW)/2,y:Math.max(24,(R.viewH-R.contentH)/2),scale:1},R.contentW,R.contentH,R.viewW,R.viewH)),g.current=!1):w()},[T,w]);return m.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:L,onPointerUp:A,onPointerCancel:A,onWheel:C,onDoubleClick:I,children:[m.jsx("div",{ref:s,className:`absolute top-0 left-0 canvas-stage-gesture ${p?"":"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}),m.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:[m.jsx("button",{onClick:()=>M(1/gc),disabled:l.scale<=Lv+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:m.jsx(_C,{className:"w-4 h-4"})}),m.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),"%"]}),m.jsx("button",{onClick:()=>M(gc),disabled:l.scale>=Ov-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:m.jsx(cd,{className:"w-4 h-4"})}),m.jsx("button",{onClick:w,"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:m.jsx(Ll,{className:"w-4 h-4"})})]}),m.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 Ss=118;function fI(e){if(ga(e)<=Ss)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 f=Math.abs(d+1-n);f<o&&(o=f,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,f=0;for(const p of e)if(d+=ga(p),f++,d>=ga(e)/2)break;s=e.slice(0,f),l=e.slice(f)}if(ga(s)<=Ss&&ga(l)<=Ss)return[s,l];const c=d=>{let f="";for(const p of d){if(ga(f+p+"…")>Ss)break;f+=p}return f+"…"};return[ga(s)>Ss?c(s):s,ga(l)>Ss?c(l):l]}function hI(e,t){const n=fI(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 mI=28,pI=52,Iv=34;function VS(e,t){var B,Q,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=((B=e[0])==null?void 0:B.id)??"";for(const z of e)c(z.id)>c(d)&&(d=z.id);const f=new Map(n.map((z,H)=>[z,H])),p=new Map,x=new Map;for(const z of e)x.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 G of[...o.get(H)??[]].sort((Z,ie)=>(f.get(Z)??0)-(f.get(ie)??0)))b.has(G)||(b.set(G,(b.get(H)??0)+1),p.set(G,H),x.get(H).push(G),z.push(G))}}let g=0;for(const z of b.values())g=Math.max(g,z);const y=e.filter(z=>!b.has(z.id)).map(z=>z.id);for(const z of y)b.set(z,g+1),p.set(z,d),x.get(d).push(z);for(const z of b.values())g=Math.max(g,z);const E=new Map,T=z=>{const H=E.get(z);if(H!=null)return H;const G=x.get(z)??[],Z=G.length===0?1:G.reduce((ie,F)=>ie+T(F),0);return E.set(z,Z),Z};d&&T(d);const w=new Map,M=(z,H,G)=>{const Z=x.get(z)??[];if(Z.length===0)return;const ie=Z.reduce((Y,J)=>Y+(E.get(J)??1),0);let F=H;for(const Y of Z){const J=(E.get(Y)??1)/ie*G;w.set(Y,F+J/2),M(Y,F,J),F+=J}};d&&M(d,-Math.PI/2,Math.PI*2);const N=new Map;for(const z of e)N.set(z.id,hI(z.label,z.id===d||c(z.id)>=4));const L=new Map;for(const z of e){const H=b.get(z.id)??0;L.has(H)||L.set(H,[]),L.get(H).push(z.id)}const A=new Map;A.set(0,0);for(let z=1;z<=g;z++){const H=L.get(z)??[];if(H.length===0){A.set(z,A.get(z-1)??0);continue}const Z=H.reduce((K,$)=>{var oe;return K+(((oe=N.get($))==null?void 0:oe.width)??0)+Iv},0)/(Math.PI*2),ie=H.map(K=>({id:K,a:w.get(K)??0})).sort((K,$)=>K.a-$.a);let F=0;if(ie.length>1)for(let K=0;K<ie.length;K++){const $=ie[K],oe=ie[(K+1)%ie.length];let ce=oe.a-$.a;if(K===ie.length-1&&(ce+=Math.PI*2),ce<=.01)continue;const _e=((((Q=N.get($.id))==null?void 0:Q.width)??0)+(((q=N.get(oe.id))==null?void 0:q.width)??0))/2+Iv;F=Math.max(F,_e/(2*Math.sin(Math.min(Math.PI,ce)/2)))}const Y=A.get(z-1)??0,J=Math.max(...(L.get(z-1)??[]).map(K=>{var $;return((($=N.get(K))==null?void 0:$.height)??0)/2}),0),U=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+J+U+pI,Z,F+ne))}const C=new Map;for(const z of e){const H=b.get(z.id)??0,G=A.get(H)??0,Z=H===0?0:w.get(z.id)??0;C.set(z.id,{id:z.id,center:{x:G*Math.cos(Z),y:G*Math.sin(Z)},box:N.get(z.id),degree:c(z.id),depth:H})}let I=0;for(const z of C.values())I=Math.max(I,Math.abs(z.center.x)+z.box.width/2,Math.abs(z.center.y)+z.box.height/2);const R=Math.ceil(2*(I+mI)),j=R/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),G=C.get(z.to);if(!H||!G)continue;const Z=jv(H,G.center),ie=jv(G,H.center),F={x:(Z.x+ie.x)/2,y:(Z.y+ie.y)/2},Y=ie.x-Z.x,J=ie.y-Z.y,U=Math.hypot(Y,J)||1,ne=Math.min(34,Math.max(10,U*.16)),K={x:F.x+J/U*ne,y:F.y-Y/U*ne};let $={x:(Z.x+2*K.x+ie.x)/4,y:(Z.y+2*K.y+ie.y)/4};if(z.label){const oe=ga(z.label,12)+14;for(const ce of P)if(Math.hypot($.x-ce.pt.x,$.y-ce.pt.y)<(oe+ce.w)/2+6){$={x:$.x+J/U*22,y:$.y-Y/U*22};break}P.push({pt:$,w:oe})}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(R),height:Math.ceil(R)}}function jv(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 gI(e){return{width:ga(e,12)+16,height:19}}const xc=.4,_m=2.5,bc=.2;function Pv({data:e}){const t=_.useMemo(()=>VS(e.nodes,e.edges),[e.nodes,e.edges]);return m.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[m.jsx("defs",{children:m.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:m.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?gI(n.label):null;return m.jsxs("g",{children:[m.jsx("path",{d:i,className:"fill-none stroke-ink-faint/70",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),n.label&&l&&m.jsxs("g",{children:[m.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}),m.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 m.jsxs("g",{children:[m.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)=>m.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 qS({data:e,variant:t="card"}){const n=e,i=Ve(),o=_.useMemo(()=>VS(n.nodes,n.edges),[n.nodes,n.edges]),[s,l]=_.useState(1),[c,d]=_.useState(!1),f=_.useRef(null);_.useEffect(()=>{const y=f.current;if(!y)return;const E=()=>{const w=(y.clientWidth-16)/o.width;w<1&&l(Math.max(xc,+w.toFixed(2)))};E();const T=new ResizeObserver(E);return T.observe(y),()=>T.disconnect()},[o.width]);const p=_.useCallback(()=>l(y=>Math.min(_m,+(y+bc).toFixed(2))),[]),x=_.useCallback(()=>l(y=>Math.max(xc,+(y-bc).toFixed(2))),[]),b=_.useCallback(()=>l(1),[]),g=_.useCallback(y=>{if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const E=y.deltaY>0?-bc:bc;l(T=>Math.min(_m,Math.max(xc,+(T+E).toFixed(2))))},[]);return t==="canvas"?m.jsx("div",{"data-testid":"conceptmap-canvas-content",children:m.jsx(Pv,{data:n})}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[m.jsx(lp,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[m.jsx("button",{onClick:x,disabled:s<=xc,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:"−"}),m.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),"%"]}),m.jsx("button",{onClick:p,disabled:s>=_m,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:"+"})]}),m.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:m.jsx(Ll,{className:"w-3.5 h-3.5"})})]})]}),m.jsx("div",{ref:f,onClick:()=>d(!0),onWheel:g,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:m.jsx("div",{style:{width:o.width*s,height:o.height*s,margin:"0 auto"},children:m.jsx("div",{style:{transform:`scale(${s})`,transformOrigin:"top left",width:o.width,height:o.height},children:m.jsx(Pv,{data:n})})})}),m.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:m.jsx("span",{children:i("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),c&&m.jsx(Cd,{title:n.title,onClose:()=>d(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Hl,{testid:"conceptmap-modal-stage",children:m.jsx(qS,{data:e,variant:"canvas"})})})})]})}function xI(e,t){const{correct:n,total:i}=e,o=i>0&&n===i,s=i>0&&n<i,l=t!=null&&t>=WC,c=t!=null&&t>=ZC;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 bI="ls-quiz-progress:";function yI(e){const t=e.questions.map(i=>`${i.prompt}|${(i.options??[]).join("/")}#${i.answer??""}`).join(`
549
+ `);let n=2166136261;for(let i=0;i<t.length;i++)n^=t.charCodeAt(i),n=Math.imul(n,16777619);return`${bI}${(n>>>0).toString(36)}`}function vI(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 EI(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const TI={"explain-wrong":{icon:hC,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:sl,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:s0,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:ai,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:i0,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function SI({data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o}){const s=e,l=Ve(),c=_.useMemo(()=>yI(s),[s]),d=_.useMemo(()=>vI(c),[c]),[f,p]=_.useState((d==null?void 0:d.current)??0),[x,b]=_.useState(null),[g,y]=_.useState(!1),[E,T]=_.useState((d==null?void 0:d.score)??{correct:0,total:0}),w=_.useRef([]);_.useEffect(()=>{EI(c,{current:f,score:E})},[c,f,E]);const[M,N]=_.useState(!1);if(f>=s.questions.length){const R=!!i&&!o;if(o)return m.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[m.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),m.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),M?m.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:l("quiz.hook.sent")}):m.jsx("button",{onClick:()=>{N(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...w.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=R?xI(E,n??null):[];return m.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[m.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),m.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),m.jsx("div",{className:"text-label text-ink-muted mt-1",children:E.correct===E.total?l("quiz.allCorrectHint"):l("quiz.tryAgainHint")}),j.length>0&&m.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[m.jsx("div",{className:"text-label text-ink-muted",children:l("quiz.action.nextPrompt")}),j.map((D,P)=>{const B=TI[D.id],Q=B.icon;return m.jsxs("button",{onClick:()=>i==null?void 0:i(B.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:[m.jsx(Q,{className:"w-4 h-4"}),l(B.labelKey)]},D.id)})]})]})}const L=s.questions[f],A=g&&x===L.answer,C=()=>{if(x===null)return;y(!0);const R=x===L.answer;T(j=>({correct:j.correct+(R?1:0),total:j.total+1})),t==null||t(L,x,R),w.current.push({prompt:L.prompt,chosen:L.options[x]??"?",answerText:L.options[L.answer]??"?",correct:R}),Nr(R?"correct":"wrong")},I=()=>{f===s.questions.length-1&&o&&!M&&(N(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...w.current]})),p(R=>R+1),b(null),y(!1)};return m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(rp,{className:"w-4 h-4 text-brand"}),m.jsx("span",{className:"text-label font-bold text-brand",children:l("quiz.questionProgress",{cur:f+1,total:s.questions.length})})]}),m.jsx("span",{className:"text-label text-ink-muted",children:l("quiz.answeredCorrect",{n:E.correct})})]}),m.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:L.prompt}),m.jsx("div",{className:"space-y-2 mb-3",children:L.options.map((R,j)=>{const D=x===j,P=g&&j===L.answer,B=g&&D&&!P;return m.jsxs("button",{onClick:()=>!g&&b(j),disabled:g,"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":B?"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)]"} ${g?"cursor-default":"cursor-pointer"}`,children:[m.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+j)}),R,P&&m.jsx("span",{className:"float-right",children:m.jsx(Fn,{className:"w-4 h-4 inline-block"})}),B&&m.jsx("span",{className:"float-right",children:m.jsx(la,{className:"w-4 h-4 inline-block"})})]},j)})}),g&&m.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:[m.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[A?m.jsx(Fn,{className:"w-4 h-4"}):m.jsx(la,{className:"w-4 h-4"}),m.jsx("span",{children:l(A?"quiz.correct":"quiz.wrong")})]}),m.jsx("div",{className:"text-ink-muted",children:L.explanation})]}),g?m.jsx("button",{onClick:I,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:f+1<s.questions.length?l("exercise.next"):l("quiz.finish")}):m.jsx("button",{onClick:C,disabled:x===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&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:s.warnings.join("; ")})]})]})}function YS({data:e,variant:t="card"}){const n=e,i=Ve(),[o,s]=_.useState(!1),l=m.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[m.jsx("thead",{children:m.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((c,d)=>m.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))})}),m.jsx("tbody",{children:n.rows.map((c,d)=>m.jsx("tr",{className:d%2===0?"bg-surface-0/40":"",children:c.map((f,p)=>m.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${p===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:p===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:f},p))},d))})]});return t==="canvas"?m.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:l}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(kE,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),m.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:m.jsx(Ll,{className:"w-3.5 h-3.5"})})]}),m.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&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),o&&m.jsx(Cd,{title:n.title,onClose:()=>s(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Hl,{testid:"comparetable-modal-stage",children:m.jsx("div",{className:"p-2 surface-card",children:m.jsx(YS,{data:e,variant:"canvas"})})})})})]})}let Dc=null;function kI(){return Dc||(Dc=Hc(()=>import("./mermaid.core-BD6oeZlV.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:wI(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),Dc}function wI(){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",()=>{Dc=null});async function AI(e,t){const n=await kI();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 Mm=.3,Rm=3,yc=.2;function GS({data:e,variant:t="card"}){const n=e,i=Ve(),o={flowchart:i("artifact.diagram.flowchart"),sequence:i("artifact.diagram.sequence"),state:i("artifact.diagram.state")},s=_.useId().replace(/[:]/g,"_"),[l,c]=_.useState({status:"loading"}),[d,f]=_.useState(0);_.useEffect(()=>{const C=()=>f(I=>I+1);return window.addEventListener("theme-changed",C),()=>window.removeEventListener("theme-changed",C)},[]);const[p,x]=_.useState(null),[b,g]=_.useState(1),[y,E]=_.useState(!1);_.useEffect(()=>{let C=!1;return c({status:"loading"}),x(null),AI(`mmd-${s}`,n.mermaid).then(I=>{C||c({status:"rendered",svg:I})}).catch(I=>{C||(console.error("[MermaidArtifact] render failed:",I),c({status:"error",message:I instanceof Error?I.message:String(I)}))}),()=>{C=!0}},[n.mermaid,s,d]);const T=`https://mermaid.live/edit#${encodeURIComponent(n.mermaid)}`,w=_.useCallback(()=>g(C=>Math.min(Rm,+(C+yc).toFixed(2))),[]),M=_.useCallback(()=>g(C=>Math.max(Mm,+(C-yc).toFixed(2))),[]),N=_.useCallback(()=>g(1),[]),L=_.useCallback(C=>{if(!C.ctrlKey&&!C.metaKey)return;C.preventDefault();const I=C.deltaY>0?-yc:yc;g(R=>Math.min(Rm,Math.max(Mm,+(R+I).toFixed(2))))},[]),A=l.status==="rendered"?m.jsx("div",{ref:C=>{var I;if(C&&!p){const R=C.querySelector("svg");if(R){const j=R.getBoundingClientRect(),D=(I=R.viewBox)==null?void 0:I.baseVal,P=D&&D.width?D.width:j.width,B=D&&D.height?D.height:j.height;P>0&&B>0&&x({width:P,height:B})}}},style:{width:(p==null?void 0:p.width)??void 0,height:(p==null?void 0:p.height)??void 0},dangerouslySetInnerHTML:{__html:l.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?m.jsx("div",{"data-testid":"mermaid-canvas-content",children:A}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[m.jsx(XC,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),m.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})]}),m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.status==="rendered"&&m.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[m.jsx("button",{onClick:M,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.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),m.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),"%"]}),m.jsx("button",{onClick:w,disabled:b>=Rm,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"&&m.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:m.jsx(Ll,{className:"w-3.5 h-3.5"})})]}),m.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 ↗"})]}),m.jsxs("div",{onClick:()=>{l.status==="rendered"&&E(!0)},onWheel:L,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"&&m.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),m.jsx("span",{children:i("artifact.mermaid.rendering")})]}),l.status==="rendered"&&m.jsx("div",{style:{width:p?p.width*b:"auto",height:p?p.height*b:"auto",margin:"0 auto"},children:m.jsx("div",{style:{transform:`scale(${b})`,transformOrigin:"top left"},children:A})}),l.status==="error"&&m.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[m.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[m.jsx(ri,{className:"w-4 h-4 shrink-0"}),m.jsx("span",{children:i("artifact.mermaid.renderFailed")})]}),m.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}),m.jsx("div",{className:"text-caption text-ink-muted mt-2",children:i("artifact.mermaid.errorPrefix",{msg:l.message})})]})]}),l.status==="rendered"&&m.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:m.jsx("span",{children:i("artifact.mermaid.hint")})}),y&&l.status==="rendered"&&m.jsx(Cd,{title:n.title,onClose:()=>E(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Hl,{testid:"mermaid-modal-stage",children:m.jsx(GS,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]})]})}function XS({data:e,variant:t="card"}){const n=e,i=Ve(),[o,s]=_.useState(null),[l,c]=_.useState(!1),d=_.useRef([]),f=_.useRef([]),p=n.code.split(`
550
+ `),x=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 w=n.annotations[T],M=(l?f:d).current[w.lineStart-1];M==null||M.scrollIntoView({behavior:"smooth",block:"center"})}},g=E=>m.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:m.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:m.jsx("code",{children:p.map((T,w)=>{const M=w+1;return m.jsxs("div",{ref:N=>{E.current[w]=N},className:`flex ${x(M)?"bg-brand/15":""}`,children:[m.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}),m.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:T||" "})]},w)})})})}),y=m.jsxs("div",{className:"space-y-2",children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted",children:i("artifact.codewalk.sectionLabel")}),n.annotations.map((E,T)=>m.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:[m.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})}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:E.note})]},T))]});return t==="canvas"?m.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:g(f)}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(xE,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),m.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})]}),m.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:m.jsx(Ll,{className:"w-3.5 h-3.5"})})]}),m.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[m.jsx("div",{onClick:()=>{l||c(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:g(d)}),y]}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),l&&m.jsx(Cd,{title:n.title,onClose:()=>c(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Hl,{testid:"codewalk-modal-stage",children:m.jsx(XS,{data:e,variant:"canvas"})})})})]})}function CI({data:e,onPickAction:t}){const n=e,i=Ve(),[o,s]=_.useState(null),l=c=>{o||(s(c.id),t==null||t(`${i("guess.pickedPrefix")}${c.label}`))};return m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[m.jsx(gC,{className:"w-4 h-4 text-accent"}),m.jsx("span",{className:"text-label font-bold text-accent",children:i("guess.header")})]}),m.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),m.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,f=o!==null;return m.jsxs("button",{onClick:()=>l(c),disabled:f,"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":f?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[m.jsx("span",{children:c.label}),d&&m.jsx(Fn,{className:"w-4 h-4 shrink-0"})]},c.id)})}),o&&m.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&&m.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Ip({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o,variant:s="card"}){const l=e;if(!l||!l.artifactType)return m.jsx(Bv,{data:e});switch(l.artifactType){case"concept_map":return m.jsx(qS,{data:e,variant:s});case"quiz":return m.jsx(SI,{data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o});case"compare_table":return m.jsx(YS,{data:e,variant:s});case"diagram":return m.jsx(GS,{data:e,variant:s});case"code_walkthrough":return m.jsx(XS,{data:e,variant:s});case"guess":return m.jsx(CI,{data:e,onPickAction:i});default:return m.jsx(Bv,{data:e})}}function Bv({data:e}){var n;const t=Ve();return m.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[m.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[m.jsx(SE,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),m.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)})]})}function KS(){const[e,t]=_.useState(null),[n,i]=_.useState(null),[o,s]=_.useState(null),[l,c]=_.useState(!1),d=_.useRef(null),f=_.useRef([]),p=_.useRef(!1),x=_.useRef([]),b=_.useRef(0),g=_.useRef(0),y=_.useRef(!1),E=_.useRef(null),T=()=>{if(!d.current){const C=window.AudioContext??window.webkitAudioContext;d.current=new C}return d.current.resume(),d.current},w=_.useCallback(()=>{y.current&&g.current>=b.current&&!p.current&&(E.current=null,t(null),i(null))},[]),M=_.useCallback(()=>{const C=d.current,I=f.current.shift();if(!C||!I){p.current=!1,w();return}p.current=!0;const R=C.createBufferSource();R.buffer=I,R.connect(C.destination),R.onended=()=>{g.current+=1,M()},x.current.push(R),R.start()},[w]),N=_.useCallback(()=>{for(const C of x.current)try{C.onended=null,C.stop()}catch{}x.current=[],f.current=[],p.current=!1,b.current=0,g.current=0,y.current=!1,E.current=null,t(null),i(null)},[]),L=_.useCallback(()=>{N(),window.api.ttsStop().catch(()=>{})},[N]),A=_.useCallback((C,I)=>{if(E.current===C){L();return}N(),s(null),E.current=C,b.current=0,g.current=0,y.current=!1,t(C),i({index:0,total:0}),T(),window.api.ttsSpeak(I,C).then(R=>{if(R.ok){R.firstUse&&c(!0);return}N(),R.reason!=="empty-text"&&s(R.reason)}).catch(()=>N())},[L,N]);return _.useEffect(()=>{const C=window.api.on("speech:ttsAudio",j=>{if(j.messageId!==E.current)return;const D=T();b.current+=1,i({index:j.sentenceIndex,total:j.sentenceTotal}),D.decodeAudioData(j.wavBytes).then(P=>{j.messageId===E.current&&(f.current.push(P),p.current||M())})}),I=window.api.on("speech:ttsDone",j=>{j.messageId===E.current&&(y.current=!0,w())}),R=window.api.on("speech:ttsError",()=>N());return()=>{C(),I(),R()}},[w,M,N]),_.useEffect(()=>N,[N]),{speakingMessageId:e,speakingSentence:n,failReason:o,clearFailReason:()=>s(null),onlineNotice:l,clearOnlineNotice:()=>c(!1),speak:A,stop:L}}const QS=_.createContext(null);let NI=0;const _I={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},MI={default:null,success:m.jsx(ai,{className:"w-4 h-4 text-brand shrink-0"}),error:m.jsx(r0,{className:"w-4 h-4 text-warning shrink-0"}),warning:m.jsx(ri,{className:"w-4 h-4 text-review shrink-0"}),info:m.jsx(SC,{className:"w-4 h-4 text-accent shrink-0"})};function RI({children:e}){const[t,n]=_.useState([]),i=_.useCallback(l=>{n(c=>c.filter(d=>d.id!==l))},[]),o=_.useCallback(l=>{n(c=>c.map(d=>d.id===l?{...d,exiting:!0}:d))},[]),s=_.useCallback((l,c)=>{const d=++NI,f=(c==null?void 0:c.severity)??"default",p=(c==null?void 0:c.duration)??_I[f],x={id:d,message:l,action:c==null?void 0:c.action,duration:p,severity:f,exiting:!1};n(b=>[...b,x]),window.setTimeout(()=>o(d),p)},[o]);return m.jsxs(QS.Provider,{value:{show:s},children:[e,m.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=>m.jsx(DI,{item:l,onAction:()=>{l.action.onClick(),o(l.id)},onDismiss:()=>o(l.id),onExitDone:()=>i(l.id)},l.id))})]})}function DI({item:e,onAction:t,onDismiss:n,onExitDone:i}){const o=Ve(),s=MI[e.severity];return m.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,m.jsx("span",{className:"flex-1",children:e.message}),e.action&&m.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}),m.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:m.jsx(la,{className:"w-3.5 h-3.5"})})]})}function jp(){const e=_.useContext(QS);return e||{show:()=>{}}}const LI={concept_map:lp,quiz:rp,compare_table:kE,diagram:yC,code_walkthrough:xE},OI=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function II(e,t){return OI.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function jI({selectedNode:e,items:t,loading:n,forceTab:i,canvasArtifact:o,isReviewing:s,onReviewDone:l,onUserTabChange:c,onRemove:d,onTogglePin:f,onRecordQuizResult:p,onSaveContentNote:x,onUpdateNoteComment:b,onJumpToSource:g,onQuoteToChat:y,locale:E}){var I;const T=Ve(),[w,M]=_.useState("content"),N=i??w,L=R=>{M(R),c==null||c()},A=e?t.filter(R=>R.nodeId===e.id):[],C=_.useRef(null);return _.useEffect(()=>{var R;(R=C.current)==null||R.scrollTo({top:0})},[e==null?void 0:e.id]),m.jsxs("div",{className:"h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[m.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:m.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[m.jsx(Im,{label:T("notebook.tab.explain"),icon:ii,active:N==="content",onClick:()=>L("content"),testid:"tab-content"}),m.jsx(Im,{label:T("notebook.tab.notes"),icon:MC,active:N==="notes",onClick:()=>L("notes"),testid:"tab-notes",badge:A.length>0?String(A.length):void 0}),m.jsx(Im,{label:T("notebook.tab.board"),icon:Zh,active:N==="board",onClick:()=>L("board"),testid:"tab-board"})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:C,role:"tabpanel",children:N==="board"?m.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[m.jsx(Zh,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-label font-bold text-ink truncate",children:((I=o.output)==null?void 0:I.title)??o.toolName})]}),m.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:m.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:m.jsx(Hl,{testid:"board-canvas-stage",children:m.jsx(Ip,{data:o.output,variant:"canvas"})})})})]}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[m.jsx(Zh,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),m.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:T("notebook.board.empty")})]})}):m.jsx(m.Fragment,{children:m.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:N==="content"?m.jsx(PI,{selectedNode:e,contentNotes:A.filter(R=>R.artifactType==="user_note"&&R.sourceAnchor),onQuoteToChat:y,onSaveContentNote:x,locale:E,isReviewing:s,onReviewDone:l}):m.jsx(BI,{items:A,loading:n,selectedNode:e,onRemove:d,onTogglePin:f,onRecordQuizResult:p,onUpdateNoteComment:b,onJumpToSource:g})})})},N)]})}function PI({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:i,locale:o,isReviewing:s,onReviewDone:l}){const c=Ve(),d=jp(),f=KS();_.useEffect(()=>{if(f.failReason){const P=f.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":f.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":f.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":f.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";d.show(c(P),{severity:"warning"}),f.clearFailReason()}else f.onlineNotice&&(d.show(c("chat.speech.edge_disclosed"),{severity:"info"}),f.clearOnlineNotice())},[f.failReason,f.onlineNotice,d,c,f]);const p=_.useRef(f.stop);p.current=f.stop;const x=e?`content-${e.id}`:null;_.useEffect(()=>()=>{p.current()},[x]);const[b,g]=_.useState(null),[y,E]=_.useState(!1),[T,w]=_.useState(!1),[M,N]=_.useState([]),[L,A]=_.useState(null),C=_.useRef(null),I=_.useRef(null);_.useEffect(()=>{if(!e){g(null),w(!1);return}let P=!1;return E(!0),w(!1),me.getNodeContent(e.id,o??void 0).then(B=>{P||g(B)}).catch(()=>{P||(g(null),w(!0))}).finally(()=>{P||E(!1)}),()=>{P=!0}},[e==null?void 0:e.id,o]),_.useEffect(()=>{if(!e){N([]);return}let P=!1;return me.listAssetsByNode(e.id).then(B=>{P||N(B)}).catch(()=>{P||N([])}),()=>{P=!0}},[e==null?void 0:e.id]),_.useEffect(()=>{if(!b||!C.current)return;const P=[];for(const Q of t)try{const q=JSON.parse(Q.sourceAnchor);if(q.type==="content"){const z=JSON.parse(Q.data).text??"";z&&P.push({noteId:Q.id,text:z,surrounding:q.surroundingText})}}catch{}const B=setTimeout(()=>{I.current&&US(I.current,P)},80);return()=>clearTimeout(B)},[b,t]),_.useEffect(()=>{const P=B=>{var z;const Q=B.detail;if(!Q)return;const q=(z=I.current)==null?void 0:z.querySelector(`mark[data-note-id="${Q}"]`);q&&HS(q)};return window.addEventListener("lookatstudy-jump-to-note",P),()=>window.removeEventListener("lookatstudy-jump-to-note",P)},[]);const R=_.useCallback(()=>{var J;if(!n&&!i)return;const P=window.getSelection(),B=(P==null?void 0:P.toString().trim())??"";if(B.length<2||B.length>500){A(null);return}const Q=P==null?void 0:P.getRangeAt(0);if(!Q||!((J=C.current)!=null&&J.contains(Q.commonAncestorContainer))){A(null);return}const q=Q.getBoundingClientRect(),z=C.current.getBoundingClientRect(),H=I.current;let G=null;if(H&&H.contains(Q.commonAncestorContainer)){const U=Zc(H);G=PS(Q,U)}const Z=H?Zc(H).text:B,ie=G?G.start:Z.indexOf(B),F=ie>=0?Z.slice(Math.max(0,ie-30),ie+B.length+30):B,Y=FS({left:q.left-z.left,top:q.top-z.top,right:q.right-z.left,bottom:q.bottom-z.top,width:q.width,height:q.height},z.width,n?150:100);A({x:Y.left,y:Y.top,transform:Y.transform,text:B,surrounding:F,offsets:G??void 0})},[n,i]);_.useEffect(()=>{let P=null,B=null;const Q=()=>{P&&clearTimeout(P),P=setTimeout(()=>{var z;(((z=window.getSelection())==null?void 0:z.toString().trim().length)??0)>=2?(B&&(clearTimeout(B),B=null),R()):B||(B=setTimeout(()=>A(H=>H&&null),250))},250)};return document.addEventListener("selectionchange",Q),()=>{document.removeEventListener("selectionchange",Q),P&&clearTimeout(P),B&&clearTimeout(B)}},[R]);const j=_.useCallback(()=>{var B;if(!L||!n)return;const P=L.text.length>200?L.text.slice(0,200)+"…":L.text;n(c("notebook.quote.template",{text:P})),A(null),(B=window.getSelection())==null||B.removeAllRanges()},[L,n,c]),D=_.useCallback(()=>{var B,Q,q;if(!L||!i||!e)return;const P=L.text.length>200?L.text.slice(0,200)+"…":L.text;i(P,{type:"content",surroundingText:L.surrounding,startOffset:(B=L.offsets)==null?void 0:B.start,endOffset:(Q=L.offsets)==null?void 0:Q.end}),A(null),(q=window.getSelection())==null||q.removeAllRanges()},[L,i,e]);return e?m.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:C,onMouseUp:R,children:[m.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")}),m.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[m.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title}),!y&&!T&&b&&m.jsx("button",{onClick:()=>f.speak(x??"content",b),"data-tooltip":f.speakingMessageId===x?c("chat.speech.stop"):c("chat.speech.read_aloud_node"),"aria-label":f.speakingMessageId===x?c("chat.speech.stop"):c("chat.speech.read_aloud_node"),"data-testid":f.speakingMessageId===x?"node-content-speak-active":"node-content-speak",className:`shrink-0 rounded-full p-2 transition-colors ${f.speakingMessageId===x?"text-brand bg-brand/10 animate-pulse":"text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06]"}`,children:f.speakingMessageId===x?m.jsx(up,{className:"w-4 h-4"}):m.jsx(AE,{className:"w-4 h-4"})})]}),y?m.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),c("notebook.content.loading")]}):T?m.jsxs("div",{className:"text-body text-warning",children:[c("notebook.content.load_failed"),m.jsx("button",{className:"underline ml-1",onClick:()=>{w(!1),E(!0),me.getNodeContent(e.id,o??void 0).then(g).catch(()=>w(!0)).finally(()=>E(!1))},children:c("notebook.content.retry")})]}):b?m.jsx(aI,{fallback:(P,B)=>m.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[m.jsx("div",{className:"text-body text-warning mb-2",children:c("notebook.content.render_failed")}),m.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[b.slice(0,500),b.length>500?`
551
+ `+c("notebook.content.truncated"):""]}),m.jsx("div",{className:"flex gap-2 mt-2",children:m.jsx("button",{className:"text-caption underline text-accent",onClick:B,children:c("notebook.content.retry_render")})})]}),children:m.jsx("div",{ref:I,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:m.jsx(kT,{remarkPlugins:[QT],rehypePlugins:[RS,[IS,jS]],urlTransform:P=>P,components:{a({children:P,...B}){return m.jsx("a",{...B,target:"_blank",rel:"noopener noreferrer",children:P})},img({src:P,alt:B,...Q}){return m.jsx(zI,{src:P,alt:B,assets:M,...Q})},table({children:P}){return m.jsx("div",{className:"overflow-x-auto my-4",children:m.jsx("table",{children:P})})}},children:b})})},`${e.id}-${o??"orig"}`):m.jsx("div",{className:"text-body text-ink-muted",children:c("notebook.content.empty")}),M.length>0&&m.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[m.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[m.jsx(TC,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:c("notebook.images.heading",{n:M.length})})]}),m.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:M.map(P=>m.jsx(UI,{asset:P},P.id))})]}),L&&m.jsxs("div",{style:{left:L.x,top:L.y,transform:L.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter",children:[n&&m.jsxs("button",{onClick:j,"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:[m.jsx(TE,{className:"w-3 h-3"}),c("notebook.quote.ask")]}),m.jsxs("button",{onClick:D,"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:[m.jsx(El,{className:"w-3.5 h-3.5"}),c("notebook.quote.add_note")]})]}),e.sourcePath&&m.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})}),m.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:[m.jsx(Fc,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),m.jsx("span",{children:c("notebook.quote.hint")})]}),s&&e&&m.jsx(iI,{nodeId:e.id,onRated:l})]}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:c("notebook.empty.select_node")})]})}function BI({items:e,loading:t,selectedNode:n,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c}){const d=Ve();if(!n)return m.jsx(zv,{message:d("notebook.empty.notes.title"),icon:"📓"});if(t)return m.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),d("notebook.empty.notes.title")]});const f=e.filter(E=>["concept_map","compare_table","diagram","code_walkthrough"].includes(E.artifactType)),p=e.filter(E=>E.artifactType==="user_note"),x=e.filter(E=>E.artifactType==="quiz"),b=e.length,g=x.filter(E=>E.lastResult==="correct").length,y=x.filter(E=>E.lastResult==="wrong").length;return b===0?m.jsx(zv,{message:d("notebook.empty.no_notes_message"),icon:"🧩"}):m.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[m.jsx(Dm,{title:d("notebook.zone.understand"),icon:m.jsx(lp,{className:"w-4 h-4"}),subtitle:d("notebook.zone.understand.subtitle"),count:f.length,testid:"zone-understand",defaultOpen:!1,children:f.length===0?m.jsx(Lm,{hint:d("notebook.zone.understand.empty_hint")}):f.map(E=>m.jsx(Om,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),m.jsx(Dm,{title:d("notebook.zone.note"),icon:m.jsx(El,{className:"w-4 h-4"}),subtitle:d("notebook.zone.note.subtitle"),count:p.length,testid:"zone-note",defaultOpen:!1,children:p.length===0?m.jsx(Lm,{hint:d("notebook.zone.note.empty_hint")}):p.map(E=>m.jsx(Om,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),m.jsx(Dm,{title:d("notebook.zone.practice"),icon:m.jsx(rp,{className:"w-4 h-4"}),subtitle:x.length>0?d("notebook.zone.practice.subtitle_stats",{total:x.length,correct:g,wrong:y}):d("notebook.zone.practice.subtitle_empty"),count:x.length,testid:"zone-practice",defaultOpen:!1,children:x.length===0?m.jsx(Lm,{hint:d("notebook.zone.practice.empty_hint")}):x.map(E=>m.jsx(Om,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))})]})}function Dm({title:e,icon:t,subtitle:n,count:i,testid:o,defaultOpen:s=!0,children:l}){const[c,d]=_.useState(s),f=_.useRef(!0),p=_.useRef(i);return _.useEffect(()=>{if(f.current){f.current=!1,p.current=i;return}i>p.current&&d(!0),p.current=i},[i]),m.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":o,children:[m.jsxs("button",{onClick:()=>d(x=>!x),"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:[m.jsx(ip,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${c?"":"-rotate-90"}`}),m.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),m.jsx("span",{className:"text-body font-bold text-ink",children:e}),m.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:i}),m.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),m.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:c?"1fr":"0fr"},children:m.jsx("div",{className:"overflow-hidden",children:m.jsx("div",{className:"p-3 space-y-3",children:l})})})]})}function Lm({hint:e}){return m.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Om({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:i,onUpdateNoteComment:o,onJumpToSource:s}){const l=Ve(),[c,d]=_.useState(!1),[f,p]=_.useState(e.notes??""),x=_.useCallback((N,L,A)=>{e.nodeId&&me.recordQuizAnswer(e.nodeId,A).catch(()=>{}),i(e.id,A)},[e.nodeId,e.id,i]),b=e.artifactType==="user_note";let g="",y=null;if(b){try{g=JSON.parse(e.data).text??""}catch{g=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),w=`${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,L=()=>{p(N??""),d(!0)},A=()=>{p(N??""),d(!1)},C=()=>{o==null||o(e.id,f),d(!1)};return m.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:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(IC,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:g}),o&&c?m.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[m.jsx("textarea",{value:f,onChange:I=>p(I.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)}`}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.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:[m.jsx(Fn,{className:"w-3 h-3"})," ",l("notebook.action.save")]}),m.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:[m.jsx(la,{className:"w-3 h-3"})," ",l("notebook.action.cancel")]})]})]}):N?m.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[m.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:N}),o&&m.jsxs("button",{onClick:L,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:[m.jsx(El,{className:"w-2.5 h-2.5"})," ",l("notebook.note.edit_comment")]})]}):o?m.jsxs("button",{onClick:L,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:[m.jsx(El,{className:"w-2.5 h-2.5"})," ",l("notebook.note.add_comment")]}):null,y&&s&&m.jsx("button",{onClick:()=>s(y,g,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"?m.jsxs(m.Fragment,{children:[m.jsx(ii,{className:"w-3 h-3"}),l("notebook.source.jump_content")]}):m.jsxs(m.Fragment,{children:[m.jsx(TE,{className:"w-3 h-3"}),l("notebook.source.jump_chat")]})}),m.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[m.jsx("span",{className:"text-caption text-ink-muted",children:w}),m.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:m.jsx(o0,{className:"w-3 h-3"})})]})]})]})})}const M=LI[e.artifactType]??SE;return m.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:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:m.jsx(M,{className:"w-4 h-4"})}),m.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??II(l,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&m.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?m.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[m.jsx(uy,{className:"w-2.5 h-2.5"}),l("notebook.note.pinned")]}):null,m.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:m.jsx(uy,{className:"w-3 h-3"})}),m.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:m.jsx(o0,{className:"w-3 h-3"})})]}),m.jsx("div",{className:"text-label",children:E?m.jsx(Ip,{data:E,onQuizAnswered:x}):m.jsx("div",{className:"text-ink-muted",children:l("notebook.artifact.broken")})}),m.jsx("div",{className:"text-caption text-ink-muted mt-2",children:w})]})}function zv({message:e,icon:t}){return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Im({label:e,icon:t,active:n,onClick:i,testid:o,badge:s}){return m.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:[m.jsx(t,{className:"w-3 h-3"}),m.jsx("span",{children:e}),s&&m.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 zI({src:e,alt:t,assets:n,...i}){const[o,s]=_.useState(null),l=e??"",c=_.useMemo(()=>{if(!l||l.startsWith("http")||l.startsWith("data:"))return null;const f=l.split("/").pop()??l;return n.find(p=>{var x;return(x=p.sourcePath)==null?void 0:x.endsWith(f)})??n.find(p=>p.filename===f)??null},[l,n]);if(_.useEffect(()=>{if(!c){s(null);return}let f=!1;return me.getAssetDataUrl(c.id).then(p=>{f||s(p)}),()=>{f=!0}},[c]),!l)return null;const d=o??l;return m.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 UI({asset:e}){const t=Ve(),[n,i]=_.useState(null),[o,s]=_.useState(!1);return _.useEffect(()=>{let l=!1;return me.getAssetDataUrl(e.id).then(c=>{l||i(c)}),()=>{l=!0}},[e.id]),m.jsxs(m.Fragment,{children:[m.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?m.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):m.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),o&&n&&m.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>s(!1),children:[m.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"}),m.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:m.jsx(la,{className:"w-6 h-6"})})]})]})}function HI(e){const[t,n]=_.useState([]),[i,o]=_.useState(!0),s=_.useCallback(async()=>{if(!e){n([]),o(!1);return}try{const y=await me.canvasList(e);n(y)}catch{n([])}finally{o(!1)}},[e]);_.useEffect(()=>{s()},[s]);const l=_.useCallback(async y=>{if(!e)return null;try{const E=await me.canvasSave({...y,courseId:e});return n(T=>T.some(w=>w.id===E.id)?T:[E,...T]),E}catch{return null}},[e]),c=_.useCallback(async y=>{if(!e)return null;try{const E=await me.canvasSaveUserNote({...y,courseId:e});return n(T=>[E,...T]),E}catch{return null}},[e]),d=_.useCallback(async(y,E)=>{try{const T=await me.canvasRecordQuizResult(y,E);return T&&n(w=>w.map(M=>M.id===y?T:M)),T}catch{return null}},[]),f=_.useCallback(async(y,E)=>{try{const T=await me.canvasUpdateUserNoteComment(y,E);return T&&n(w=>w.map(M=>M.id===y?T:M)),T}catch{return null}},[]),p=_.useCallback(async y=>{try{await me.canvasDelete(y),n(E=>E.filter(T=>T.id!==y))}catch{}},[]),x=_.useCallback(async y=>{try{const E=await me.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=_.useCallback(y=>y===null?t:t.filter(E=>E.nodeId===y),[t]),g=_.useCallback((y,E)=>{const T=y===null?t:t.filter(w=>w.nodeId===y);return E==="note"?T.filter(w=>w.artifactType==="user_note"):E==="practice"?T.filter(w=>w.artifactType==="quiz"):T.filter(w=>["concept_map","compare_table","diagram","code_walkthrough"].includes(w.artifactType))},[t]);return{items:t,loading:i,reload:s,save:l,saveUserNote:c,recordQuizResult:d,updateUserNoteComment:f,remove:p,togglePin:x,byNode:b,byZone:g}}const Uv={small:16,medium:17,large:18},Hv="lookatstudy-font-size",FI="medium";function VI(){const[e,t]=_.useState(()=>{if(typeof localStorage<"u"){const i=localStorage.getItem(Hv);if(i&&i in Uv)return i}return FI});_.useEffect(()=>{document.documentElement.style.fontSize=`${Uv[e]}px`,localStorage.setItem(Hv,e)},[e]);const n=_.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 jm=new Map;function qI({ref_:e,onOpen:t}){const n=Ve(),[i,o]=_.useState(e.previewUrl??(e.file?jm.get(e.file)??null:null));return _.useEffect(()=>{if(i||!e.file)return;let s=!1;return(async()=>{const l=jm.get(e.file);if(l){s||o(l);return}const c=await me.getAttachmentDataUrl(e.file);c&&!s&&(jm.set(e.file,c),o(c))})(),()=>{s=!0}},[e.file,i]),i?m.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:m.jsx("img",{src:i,alt:e.name,className:"w-full h-full object-cover"})}):m.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 YI({src:e,name:t,onClose:n}){return _.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),m.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:[m.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),m.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:m.jsx(la,{className:"w-4 h-4"})})]})}function GI({parts:e}){const t=Ve(),[n,i]=_.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 m.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[s.length>0&&m.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((c,d)=>m.jsx(qI,{ref_:c,onOpen:f=>i({src:f,name:c.name})},c.file??c.previewUrl??`${c.name}:${d}`))}),l.length>0&&m.jsx("div",{className:"flex gap-1.5 flex-wrap",children:l.map((c,d)=>m.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:[m.jsx(Dl,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"truncate max-w-[12rem]",children:c.name})]},`${c.name}:${d}`))}),n&&m.jsx(YI,{src:n.src,name:n.name,onClose:()=>i(null)})]})}function XI({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:i,summary:o,onStartLearning:s,agentReady:l=!0,onGotoSettings:c,hasNode:d=!0,selectedNodeId:f,threadId:p,onSaveChatNote:x,chatNotes:b,onPickQuizAction:g,onQuizCompleted:y,cardMode:E=!1}){const T=Ve(),w=jp(),M=KS();_.useEffect(()=>{if(M.failReason){const G=M.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":M.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":M.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":M.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";w.show(T(G),{severity:"warning"}),M.clearFailReason()}},[M.failReason,w,T,M]),_.useEffect(()=>{M.onlineNotice&&(w.show(T("chat.speech.edge_disclosed"),{severity:"info"}),M.clearOnlineNotice())},[M.onlineNotice,w,T,M]);const N=_.useCallback((G,Z,ie)=>{f&&me.recordQuizAnswer(f,ie,G.kc).catch(()=>{})},[f]),[L,A]=_.useState(null);_.useEffect(()=>{if(!f){A(null);return}let G=!1;const Z=()=>me.getProgress(f).then(F=>{G||A((F==null?void 0:F.mastery)??null)}).catch(()=>{});Z();const ie=me.on("state:changed",F=>{F==="mastery"&&Z()});return()=>{G=!0,ie()}},[f]);const C=_.useRef(null),I=_.useRef(!0),[R,j]=_.useState(!1);_.useEffect(()=>{const G=Z=>{const ie=Z.detail;if(!(ie!=null&&ie.msgId))return;const F=document.querySelector(`[data-msg-id="${ie.msgId}"]`);F&&(F.scrollIntoView({behavior:"smooth",block:"center"}),F.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>F.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",G),()=>window.removeEventListener("lookatstudy-highlight-message",G)},[]),_.useEffect(()=>{if(t||!C.current||!b||b.length===0)return;const G=setTimeout(()=>{if(!C.current)return;const Z=new Map;for(const ie of b)try{const F=JSON.parse(ie.sourceAnchor);if(F.type==="chat"&&F.msgId){const Y=JSON.parse(ie.data).text??"";if(Y){const J=Z.get(F.msgId)??[];J.push({noteId:ie.id,text:Y}),Z.set(F.msgId,J)}}}catch{}for(const[ie,F]of Z){const Y=C.current.querySelector(`[data-msg-id="${ie}"]`);Y&&US(Y,F)}},150);return()=>clearTimeout(G)},[e,b,t]),_.useEffect(()=>{const G=Z=>{var Y;const ie=Z.detail;if(!ie)return;const F=(Y=C.current)==null?void 0:Y.querySelector(`mark[data-note-id="${ie}"]`);F&&HS(F)};return window.addEventListener("lookatstudy-jump-to-chat-note",G),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",G)},[]);const[D,P]=_.useState(null),B=_.useCallback(()=>{if(!x||!p)return;const G=window.getSelection(),Z=(G==null?void 0:G.toString().trim())??"";if(Z.length<2||Z.length>500){P(null);return}const ie=G==null?void 0:G.getRangeAt(0);if(!ie){P(null);return}const F=C.current;if(!(F!=null&&F.contains(ie.commonAncestorContainer))){P(null);return}let Y=ie.commonAncestorContainer,J=null;for(;Y&&Y!==F;){if(Y instanceof HTMLElement&&Y.dataset.msgId){J=Y;break}Y=Y.parentNode}if(!J){P(null);return}const U=J.dataset.msgId,ne=Zc(J),K=PS(ie,ne),$=ie.getBoundingClientRect(),oe=F.getBoundingClientRect(),ce=FS({left:$.left-oe.left,top:$.top-oe.top,right:$.right-oe.left,bottom:$.bottom-oe.top,width:$.width,height:$.height},oe.width,110);P({x:ce.left,y:ce.top,transform:ce.transform,text:Z,msgId:U,startOffset:K==null?void 0:K.start,endOffset:K==null?void 0:K.end})},[x,p]);_.useEffect(()=>{let G=null,Z=null;const ie=()=>{G&&clearTimeout(G),G=setTimeout(()=>{var Y;(((Y=window.getSelection())==null?void 0:Y.toString().trim().length)??0)>=2?(Z&&(clearTimeout(Z),Z=null),B()):Z||(Z=setTimeout(()=>P(J=>J&&null),250))},250)};return document.addEventListener("selectionchange",ie),()=>{document.removeEventListener("selectionchange",ie),G&&clearTimeout(G),Z&&clearTimeout(Z)}},[B]);const Q=_.useCallback(()=>{var Z;if(!D||!x)return;const G=D.text.length>200?D.text.slice(0,200)+"…":D.text;x(G,D.msgId,D.startOffset,D.endOffset),P(null),(Z=window.getSelection())==null||Z.removeAllRanges()},[D,x]),q=_.useCallback(()=>{const G=C.current;if(!G)return;const Z=G.scrollHeight-G.scrollTop-G.clientHeight<80;I.current=Z,j(ie=>ie===!Z?ie:!Z)},[]);_.useEffect(()=>{if(!I.current)return;const G=C.current;G&&(G.scrollTop=G.scrollHeight)},[e,t]);const z=e.length>0&&e[e.length-1].role==="user";_.useEffect(()=>{if(!z)return;I.current=!0,j(!1);const G=C.current;G&&(G.scrollTop=G.scrollHeight)},[z]);const H=_.useCallback(()=>{const G=C.current;G&&(G.scrollTop=G.scrollHeight,I.current=!0,j(!1))},[]);return m.jsxs("div",{className:"relative flex-1 min-h-0",children:[m.jsxs("div",{ref:C,onScroll:q,onMouseUp:B,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&&m.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:d?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-center mb-4",children:[m.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.greeting")}),m.jsx("div",{className:"text-ink-muted text-label",children:T("chat.empty.overview")})]}),o?m.jsxs("div",{className:"surface-card p-4 mb-4",children:[m.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:T("chat.empty.summary.title")}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:o})]}):m.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:m.jsx("div",{className:"text-body text-ink-muted",children:T("chat.empty.summary.none")})}),l?m.jsx(m.Fragment,{children:s&&m.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:[m.jsx(jC,{className:"w-4 h-4"}),m.jsx("span",{children:T("chat.empty.start")})]})}):m.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.keyless.title")}),m.jsx("div",{className:"text-label text-ink-muted mb-3",children:T("chat.empty.keyless.desc")}),m.jsxs("button",{onClick:c,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[m.jsx(Vc,{className:"w-4 h-4"}),m.jsx("span",{children:T("chat.empty.keyless.btn")})]})]})]}):m.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[m.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.no_node.title")}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:T("chat.empty.no_node.desc")})]})}),e.map(G=>m.jsx("div",{className:E?"":"contents",children:m.jsx("div",{className:E&&G.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:m.jsx(KI,{msg:G,onApplyProposal:n,onRejectProposal:i,onQuizAnswered:N,quizMastery:L,onPickAction:g,onQuizCompleted:y,speakingMessageId:M.speakingMessageId,speakingSentence:M.speakingSentence,onSpeak:M.speak})})},G.id)),t&&m.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),R&&e.length>0&&m.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:[m.jsx(ip,{className:"w-5 h-5"}),t&&m.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&&m.jsxs("button",{onClick:Q,"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:[m.jsx(El,{className:"w-3 h-3"})," ",T("chat.note.add")]})]})}function Fv(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 KI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l,speakingMessageId:c,speakingSentence:d,onSpeak:f}){const p=Ve();if(e.role==="user")return m.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:m.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[m.jsx(GI,{parts:e.parts}),m.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((g,y)=>g.type==="text"?m.jsx("span",{children:g.text},y):null)})]})});const x=e.parts.map(g=>g.type==="text"?g.text:"").join("").trim(),b=c===e.id;return m.jsxs("div",{className:"msg-enter","data-testid":"msg-assistant","data-msg-id":e.id,children:[m.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((g,y)=>m.jsx(QI,{part:g,msgId:e.id,toolCallIdx:y,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l},y))}),f&&x&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[m.jsx("button",{onClick:()=>f(e.id,x),"data-testid":b?"speech-stop-btn":"speech-speak-btn","aria-label":p(b?"chat.speech.stop":"chat.speech.speak"),title:p(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?m.jsx(up,{className:"w-3.5 h-3.5"}):m.jsx(AE,{className:"w-4 h-4"})}),b&&d&&d.total>0&&m.jsx("span",{className:"text-caption text-ink-muted",children:p("chat.speech.progress").replace("{n}",String(d.index+1)).replace("{total}",String(d.total))})]})]})}function QI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d}){if(e.type==="text")return m.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:m.jsx(kT,{remarkPlugins:[QT],rehypePlugins:[RS,[IS,jS]],urlTransform:g=>g,components:ZI,children:e.text})});if(e.type==="reasoning")return m.jsx($I,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:f,state:p,output:x,error:b}=e;return m.jsx(WI,{toolName:f,state:p,output:x,error:b,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d})}function $I({text:e}){const t=Ve(),[n,i]=_.useState(!1);return m.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[m.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:[m.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),m.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&m.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 WI({toolName:e,state:t,output:n,error:i,msgId:o,toolCallIdx:s,onApplyProposal:l,onRejectProposal:c,onQuizAnswered:d,quizMastery:f,onPickAction:p,onQuizCompleted:x}){const b=Ve(),y=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(y!=null&&y.proposalId){const w=y.status;return w==="applied"?m.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:[m.jsx(ai,{className:"w-4 h-4 text-gold shrink-0"}),m.jsx("span",{className:"text-body font-bold text-ink",children:b("chat.proposal.applied")})]}):w==="rejected"?m.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:[m.jsx(mC,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-body text-ink-muted",children:b("chat.proposal.rejected")})]}):m.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),m.jsxs("div",{className:"pl-4 pr-3 py-3",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:m.jsx(EE,{className:"w-4 h-4"})}),m.jsx("span",{className:"text-lead font-bold text-ink",children:b("chat.proposal.mastered.title")})]}),y.message&&m.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:y.message}),m.jsx("div",{className:"text-caption text-ink-muted mb-3",children:b("chat.proposal.mastered.hint")}),m.jsxs("div",{className:"flex gap-2",children:[m.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:[m.jsx(Fn,{className:"w-3.5 h-3.5 inline"}),b("chat.proposal.confirm")]}),m.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 w=n.artifactType;return m.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${w}`,"data-tool":e,children:m.jsx(Ip,{data:n,onQuizAnswered:d,quizMastery:f,onPickAction:p,onQuizCompleted:x})})}const T=ej(e,b);return m.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"?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsxs("span",{className:"text-ink-muted",children:[T,"…"]})]}):t==="output-error"?m.jsxs(m.Fragment,{children:[m.jsx(Ds,{className:"w-3.5 h-3.5 text-warning shrink-0"}),m.jsxs("span",{className:"text-warning",children:[T,": ",i]})]}):m.jsxs(m.Fragment,{children:[m.jsx(cp,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),m.jsx("span",{className:"text-ink-muted",children:T})]})})}const ZI={pre({children:e,...t}){return m.jsx(JI,{...t,children:e})},a({children:e,...t}){return m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return m.jsx("div",{className:"overflow-x-auto my-4",children:m.jsx("table",{children:e})})}};function JI({children:e,...t}){const n=Ve(),[i,o]=_.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])??"",f=()=>{var b;const p=l.children,x=typeof p=="string"?p:Array.isArray(p)?p.join(""):"";(b=navigator.clipboard)==null||b.writeText(x).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})};return m.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[m.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:[m.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:d||"code"}),m.jsx("button",{onClick:f,"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?m.jsxs(m.Fragment,{children:[m.jsx(Fn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):m.jsxs(m.Fragment,{children:[m.jsx(pC,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),m.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function ej(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 gl={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},tj=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 Vv(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function nj(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(Vv(e))?n>gl.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:tj.has(Vv(e))?n>gl.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function aj(e,t){const n=e.length,i=n*2,o=new ArrayBuffer(44+i),s=new DataView(o),l=(d,f)=>{for(let p=0;p<f.length;p++)s.setUint8(d+p,f.charCodeAt(p))};l(0,"RIFF"),s.setUint32(4,36+i,!0),l(8,"WAVE"),l(12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,t,!0),s.setUint32(28,t*2,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0),l(36,"data"),s.setUint32(40,i,!0);let c=44;for(let d=0;d<n;d++){const f=e[d]<=-1?-1:e[d]>=1?1:e[d];s.setInt16(c,Math.round(f*32767),!0),c+=2}return o}function ij(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,f=e[l+1]??d;i[o]=d+(f-d)*c}return i}function rj(e,t,n={}){if(e.length===0||e.length!==t.length)return e;const i=n.threshold??.012;let o=0;for(;o<e.length-1&&t[o]<i;)o+=1;let s=e.length;for(;s>o+1&&t[s-1]<i;)s-=1;return e.slice(o,s)}function sj(e={}){const t=e.rmsThreshold??.015,n=e.minSpeechMs??300,i=e.silenceMs??1200,o=e.maxMs??6e4,s=e.autoStop!==!1;let l=null,c=0,d=null,f=null,p=!1;return{feed(x,b){l==null&&(l=b);const g=f==null?0:Math.max(0,b-f);if(f=b,x>=t)c+=g,c>=n&&(p=!0,d=b);else if(s&&p&&d!=null&&b-d>=i)return"auto-stop";return s&&b-l>=o?"auto-stop":"listening"},hadSpeech(){return p}}}const Pm=16e3;function oj(e,t={}){const[n,i]=_.useState(!1),[o,s]=_.useState(!1),[l,c]=_.useState(0),[d,f]=_.useState(null),[p,x]=_.useState(null),b=_.useRef(null),g=_.useRef(null),y=_.useRef(null),E=_.useRef([]),T=_.useRef([]),w=_.useRef(!1),M=_.useRef(null),N=_.useRef(0),L=_.useRef(e);L.current=e;const A=_.useRef(t);A.current=t;const C=_.useRef(!1),I=_.useRef(!1),R=_.useCallback(()=>{var Q,q,z;w.current=!1,(Q=y.current)==null||Q.disconnect(),y.current=null,(q=g.current)==null||q.getTracks().forEach(H=>H.stop()),g.current=null,(z=b.current)==null||z.close().catch(()=>{}),b.current=null,E.current=[],T.current=[],M.current=null,c(0)},[]),j=_.useCallback(()=>{var J;const Q=E.current,q=T.current,z=((J=M.current)==null?void 0:J.hadSpeech())??!1;E.current=[],T.current=[];let H=0;for(const U of Q)H+=U.length;if(R(),i(!1),H===0)return;if(!z){x("no-speech");return}const G=rj(Q,q);let Z=0;for(const U of G)Z+=U.length;const ie=new Float32Array(Z);let F=0;for(const U of G)ie.set(U,F),F+=U.length;const Y=aj(ie,Pm);s(!0),x(null),window.api.asrTranscribe(Y,A.current.locale).then(U=>{U.ok?L.current(U.text):x(U.reason)}).catch(()=>x("asr-failed")).finally(()=>s(!1))},[R]),D=_.useCallback(()=>{w.current&&j()},[j]),P=_.useCallback(()=>{w.current||C.current||(f(null),C.current=!0,(async()=>{var Q;try{if(((Q=navigator.mediaDevices)==null?void 0:Q.getUserMedia)==null){f("mic-unavailable");return}const q=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),z=window.AudioContext??window.webkitAudioContext;let H;try{H=new z({sampleRate:Pm})}catch{H=new z}b.current=H,g.current=q,w.current=!0,M.current=sj({autoStop:A.current.autoStop!==!1});const G=H.createMediaStreamSource(q),Z=H.createScriptProcessor(4096,1,1);y.current=Z;const ie=H.sampleRate/Pm;Z.onaudioprocess=Y=>{var oe;if(!w.current)return;const J=Y.inputBuffer.getChannelData(0),U=ie===1?new Float32Array(J):ij(J,ie);E.current.push(U);let ne=0;for(let ce=0;ce<U.length;ce++)ne+=U[ce]*U[ce];const K=Math.sqrt(ne/U.length);T.current.push(K),N.current=N.current*.7+K*.3,c(Math.min(1,N.current*8)),((oe=M.current)==null?void 0:oe.feed(K,performance.now()))==="auto-stop"&&w.current&&j()},G.connect(Z);const F=H.createGain();F.gain.value=0,Z.connect(F),F.connect(H.destination),i(!0),I.current&&(I.current=!1,j())}catch(q){R(),i(!1),f(q instanceof Error?q.message:String(q))}finally{C.current=!1}})())},[R,j]),B=_.useCallback(()=>{w.current?D():C.current&&(I.current=!0)},[D]);return _.useEffect(()=>()=>{w.current&&R()},[R]),{listening:n,transcribing:o,level:l,startError:d,transcribeError:p,clearTranscribeError:()=>x(null),beginHold:P,endHold:B}}function lj({onGotoSettings:e}){var E;const t=Ve(),[n,i]=_.useState(!1),[o,s]=_.useState(null),[l,c]=_.useState(""),[d,f]=_.useState(""),p=_.useRef(null),x=_.useCallback(async()=>{var T,w;try{const[M,N,L,A]=await Promise.all([me.getProviderPresets(),me.listCustomProviders(),me.getSetting("active_provider"),me.getSetting("active_model")]),C=L??"glm",I=await Promise.all(M.map(async B=>await me.getSetting(B.apiKeySetting)!=null)),R=new Set;M.forEach((B,Q)=>{(I[Q]||B.id===C)&&R.add(B.id)});const j=[],D=(B,Q,q)=>{for(const z of q)j.push({providerId:B,providerLabel:Q,modelId:z.id,modelLabel:z.label,vision:(z.capabilities??[]).includes("vision"),contextWindow:z.contextWindow})};for(const B of M)R.has(B.id)&&D(B.id,B.label,B.models);for(const B of N)D(B.id,B.label,B.models);const P=A??"";if(P&&!j.some(B=>B.providerId===C&&B.modelId===P)){const B=((T=M.find(Q=>Q.id===C))==null?void 0:T.label)??((w=N.find(Q=>Q.id===C))==null?void 0:w.label)??C;j.unshift({providerId:C,providerLabel:B,modelId:P,modelLabel:P,vision:!0,contextWindow:null})}s(j),c(C),f(P)}catch{s([])}},[]);_.useEffect(()=>{x();const T=()=>void x();return window.addEventListener("llm-config-changed",T),()=>window.removeEventListener("llm-config-changed",T)},[x]),_.useEffect(()=>{if(!n)return;const T=M=>{var N;M.target instanceof Node&&((N=p.current)==null?void 0:N.contains(M.target))!==!0&&i(!1)},w=M=>{M.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",w)}},[n]);const b=async T=>{if(i(!1),!(T.providerId===l&&T.modelId===d))try{await me.setSetting("active_provider",T.providerId),await me.setSetting("active_model",T.modelId),c(T.providerId),f(T.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},g=((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 w=y[y.length-1];w&&w.label===T.providerLabel?w.rows.push(T):y.push({label:T.providerLabel,rows:[T]})}return m.jsxs("div",{ref:p,className:"relative","data-testid":"composer-model",children:[m.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:[m.jsx("span",{className:"truncate",children:g}),m.jsx(gE,{className:`w-3 h-3 shrink-0 transition-transform ${n?"":"rotate-180"}`})]}),n&&m.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&&m.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),y.map(T=>m.jsxs("div",{role:"group","aria-label":T.label,children:[m.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:T.label}),T.rows.map(w=>{const M=w.providerId===l&&w.modelId===d;return m.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M,onClick:()=>void b(w),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:[m.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 ${M?"opacity-100":"opacity-0"}`}),m.jsx("span",{className:"flex-1 truncate text-label",children:w.modelLabel}),w.vision&&m.jsx(xC,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${w.providerId}:${w.modelId}`)})]},T.label)),m.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:m.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:[m.jsx(UC,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const _0=5.5,qv=2*Math.PI*_0,ks=["system","node","learner","history","draft"],Yv={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function uj({info:e,historyTokens:t,draftTokens:n}){const i=Ve(),[o,s]=_.useState(!1),l=_.useRef(null);if(_.useEffect(()=>{!(e!=null&&e.contextWindow)&&o&&s(!1)},[e==null?void 0:e.contextWindow,o]),_.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)},g=y=>{y.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",g)}},[o]),!e)return null;const c={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},d=ks.reduce((b,g)=>b+c[g],0),f=QC(d,e.contextWindow),p=f!==null&&f>=85,x=$C(ks.map(b=>c[b]),f??0);return m.jsxs("span",{ref:l,className:"relative inline-flex items-center","data-testid":"composer-context",children:[m.jsxs("button",{type:"button",onClick:()=>s(!o),disabled:e.contextWindow===null,"aria-label":i("context.aria",{p:f!==null?`${f}%`:vs(d)}),"aria-haspopup":"dialog","aria-expanded":o,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${i("context.label")} ~${vs(d)} · ${i("context.unknownWindow")}`:i("context.aria",{p:`${f}%`}),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${p?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[m.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[m.jsx("circle",{cx:"7",cy:"7",r:_0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),m.jsx("circle",{cx:"7",cy:"7",r:_0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${qv*(f??100)/100} ${qv}`,transform:"rotate(-90 7 7)"})]}),f!==null?m.jsxs("span",{children:[f,"%"]}):m.jsxs("span",{children:["~",vs(d)]})]}),o&&e.contextWindow!==null&&m.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:[m.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[m.jsx("span",{className:"text-label font-bold text-ink-strong",children:i("context.label")}),m.jsxs("span",{className:`text-caption ${p?"text-warning":"text-ink-muted"}`,children:[i("context.approx")," ",vs(d)," / ",vs(e.contextWindow)]})]}),m.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${f}%`,children:ks.map(b=>x[ks.indexOf(b)]>0?m.jsx("div",{className:Yv[b],style:{width:`${x[ks.indexOf(b)]}%`}},b):null)}),m.jsx("dl",{className:"space-y-1",children:ks.map(b=>m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[m.jsx("span",{className:`w-2 h-2 rounded-sm ${Yv[b]}`,"aria-hidden":!0}),i(`context.${b}`)]}),m.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",vs(c[b])]})]},b))})]})]})}const M0={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 cj(e,t,n){if(e==="openai"||e in M0)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 dj(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in M0?!0:cj(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in M0}const Bm=[{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 fj(){const e=Ve(),[t,n]=_.useState(!1),[i,o]=_.useState(""),[s,l]=_.useState(!0),c=_.useRef(null),d=_.useRef(null),[f,p]=_.useState("right"),[x,b]=_.useState(0),g=_.useRef(0),[y,E]=_.useState(0);_.useLayoutEffect(()=>{if(!t){E(0),g.current=0,b(0);return}const N=d.current;if(!N)return;const L=N.getBoundingClientRect(),A=L.left-g.current,C=L.right-g.current,I=window.innerWidth;if(y===0){if(A<8&&C<=I-8){p("left"),E(1);return}if(C>I-8&&A>=8){p("right"),E(1);return}E(1)}const R=Math.min(0,I-8-C)+Math.max(0,8-A);R!==g.current&&(g.current=R,b(R))},[t,y]);const T=_.useCallback(async()=>{var N;try{const[L,A,C,I,R]=await Promise.all([me.getSetting("active_provider"),me.getSetting("reasoning_effort"),me.getProviderPresets(),me.listCustomProviders(),me.getSetting("active_model")]),j=L??"glm",D=I.find(Q=>Q.id===j),P=((N=C.find(Q=>Q.id===j))==null?void 0:N.protocol)??(D==null?void 0:D.protocol)??"openai-compatible";l(dj(j,P,{baseUrl:D==null?void 0:D.baseUrl,model:R??(D==null?void 0:D.defaultModel)}));const B=A??"";o(B==="fast"||B==="deep"?B:"")}catch{l(!1)}},[]);_.useEffect(()=>{T();const N=()=>void T();return window.addEventListener("llm-config-changed",N),()=>window.removeEventListener("llm-config-changed",N)},[T]),_.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)},L=A=>{A.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",N),document.addEventListener("keydown",L),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",L)}},[t]);const w=async N=>{if(n(!1),N!==i){o(N);try{await me.setSetting("reasoning_effort",N)}catch{o(i)}}},M=Bm.find(N=>N.value===i)??Bm[0];return m.jsxs("div",{ref:c,className:"relative","data-testid":"composer-effort",children:[m.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:[m.jsx(cC,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"truncate",children:e(M.labelKey)}),m.jsx(gE,{className:`w-3 h-3 shrink-0 transition-transform ${t?"":"rotate-180"}`})]}),t&&m.jsx("div",{ref:d,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:x?`translateX(${x}px)`:void 0},className:`absolute bottom-full ${f==="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:Bm.map(N=>{const L=N.value===i;return m.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":L,onClick:()=>void w(N.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${L?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[m.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${L?"opacity-100":"opacity-0"}`}),m.jsxs("span",{className:"flex-1",children:[m.jsx("span",{className:"block text-label font-bold",children:e(N.labelKey)}),m.jsx("span",{className:"block text-caption text-ink-faint",children:e(N.descKey)})]})]},N.value||"auto")})})]})}function hj(e){const t=Math.floor(e/1e3),n=Math.floor(t/60);return`${String(n).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function mj({view:e,level:t,text:n,onTextChange:i,onSend:o,onRerecord:s,errorMessage:l,sendDisabled:c}){const d=Ve(),[f,p]=_.useState(0),x=_.useRef(performance.now());return _.useEffect(()=>{x.current=performance.now(),p(0)},[e]),_.useEffect(()=>{if(e!=="recording")return;const b=window.setInterval(()=>p(performance.now()-x.current),250);return()=>window.clearInterval(b)},[e]),m.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-20 rounded-2xl bg-surface-0 shadow-elevated p-4 flex flex-col gap-3",role:"status","aria-live":"polite","data-testid":e==="recording"?"voice-panel-recording":e==="transcribing"?"voice-panel-transcribing":e==="review"?"voice-panel-review":"voice-panel-error",children:[e==="recording"&&m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"w-11 h-11 shrink-0 rounded-full bg-warning/15 text-warning flex items-center justify-center",children:m.jsx(Cc,{className:"w-5 h-5 animate-pulse"})}),m.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between text-label text-ink-muted",children:[m.jsx("span",{children:d("chat.speech.recording_hint")}),m.jsx("span",{className:"tabular-nums",children:hj(f)})]}),m.jsx("span",{className:"block h-2 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":"voice-level",children:m.jsx("span",{className:"block h-full bg-warning transition-[width] duration-100",style:{width:`${Math.round(Math.min(1,t)*100)}%`}})})]})]}),e==="transcribing"&&m.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-body text-ink-muted",children:[m.jsx(AC,{className:"w-4 h-4 animate-spin"}),m.jsx("span",{children:d("chat.speech.transcribing")})]}),e==="review"&&m.jsxs(m.Fragment,{children:[m.jsx("textarea",{value:n,onChange:b=>i(b.target.value),autoFocus:!0,rows:4,"data-testid":"voice-result-text",className:"w-full bg-ink/[0.05] text-body text-ink-strong rounded-xl px-3 py-2 resize-none focus:outline-none focus:bg-ink/[0.08]"}),m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:s,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body",children:d("chat.speech.rerecord")}),m.jsxs("button",{type:"button",onClick:o,disabled:c,"data-testid":"voice-send",className:"btn-3d-brand px-4 py-1.5 text-body flex items-center gap-1.5 disabled:opacity-40",children:[m.jsx(zC,{className:"w-3.5 h-3.5"}),d("chat.send")]})]})]}),e==="error"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"text-body text-warning py-1",children:l??d("chat.speech.asr_failed")}),m.jsx("div",{className:"flex items-center justify-end",children:m.jsxs("button",{type:"button",onClick:s,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body flex items-center gap-1.5",children:[m.jsx(sl,{className:"w-3.5 h-3.5"}),d("chat.speech.retry")]})})]})]})}const pj={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},gj={direct:ii,guide:bE,practice:EC},xj={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},bj=["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 Gv=0;function yj({nodeId:e,agentReady:t,streaming:n,souls:i,activeSoul:o,starterPrompts:s,onPickSoul:l,onSend:c,onStop:d,onLogFriction:f,onGotoSettings:p,insertText:x,historyTokens:b}){const g=Ve(),y=RE(),[E,T]=_.useState(""),[w,M]=_.useState([]),[N,L]=_.useState(null),[A,C]=_.useState(null),[I,R]=_.useState(!1),j=_.useRef(null),D=_.useRef(0),[P,B]=_.useState(!0);_.useEffect(()=>{me.getSetting("asr_auto_stop").then(Se=>B(Se!=="0"))},[]);const[Q,q]=_.useState(!1),[z,H]=_.useState(""),[G,Z]=_.useState(!1),[ie,F]=_.useState(null),Y=oj(Se=>{H(Se),Z(!0)},{locale:y,autoStop:P}),J=Y.startError??Y.transcribeError;_.useEffect(()=>{if(!J)return;F(g(J==="no-speech"?"chat.speech.no_speech":J==="model-missing"?"chat.speech.asr_model_missing":J==="engine-unavailable"?"chat.speech.engine_unavailable":J==="groq-key-missing"?"chat.speech.groq_key_missing":J==="azure-key-missing"?"chat.speech.azure_stt_key_missing":J==="azure-region-missing"?"chat.speech.azure_stt_region_missing":J==="mic-unavailable"?"chat.speech.asr_start_fail":"chat.speech.asr_failed")),Y.clearTranscribeError()},[J,Y,g]);const U=ie?"error":Y.listening?"recording":Y.transcribing?"transcribing":G?"review":"idle",ne=_.useCallback(()=>{H(""),Z(!1),F(null)},[]),K=_.useCallback(()=>{q(!1),ne()},[ne]),$=()=>{const Se=z.trim();!Se||n||!e||(c(Se),K())};_.useEffect(()=>{x&&T(Se=>Se.trim()?`${Se}
552
+
553
+ ${x}`:x)},[x]),_.useEffect(()=>{if(!e){C(null);return}let Se=!1;(async()=>{try{const qe=await me.getContextUsage(e,y);Se||C(qe)}catch{Se||C(null)}})();const Qe=()=>{me.getContextUsage(e,y).then(qe=>{Se||C(qe)}).catch(()=>{})};return window.addEventListener("llm-config-changed",Qe),()=>{Se=!0,window.removeEventListener("llm-config-changed",Qe)}},[e,y]),_.useEffect(()=>{if(!N)return;const Se=setTimeout(()=>L(null),3e3);return()=>clearTimeout(Se)},[N]);const oe=_.useRef(new Set);_.useEffect(()=>()=>{for(const Se of oe.current)URL.revokeObjectURL(Se)},[]);const ce=_.useCallback(Se=>{M(Qe=>{const qe=Qe.find(pt=>pt.id===Se);return qe!=null&&qe.previewUrl&&(URL.revokeObjectURL(qe.previewUrl),oe.current.delete(qe.previewUrl)),Qe.filter(pt=>pt.id!==Se)})},[]),_e=_.useCallback(async Se=>{if(Se.length===0)return;const Qe=gl.maxPerMessage-w.length;if(Qe<=0){L(g("chat.attach.tooMany",{n:gl.maxPerMessage}));return}const qe=Se.length>Qe?Se.slice(0,Qe):Se;Se.length>Qe&&L(g("chat.attach.tooMany",{n:gl.maxPerMessage}));const pt=[],rt=[];for(const fe of qe){const Be=nj(fe.name,fe.type,fe.size);if(!Be.ok){L(Be.reason==="unsupported"?g("chat.attach.unsupported",{name:fe.name}):Be.reason==="tooLargeImage"?g("chat.attach.tooLargeImage",{name:fe.name}):g("chat.attach.tooLargeText",{name:fe.name}));continue}if(Be.kind==="image"){if((A==null?void 0:A.visionCapable)===!1){L(g("chat.attach.visionUnsupported"));continue}const je=await new Promise(ke=>{const De=new FileReader;De.onload=()=>{const Me=De.result;ke(typeof Me=="string"?Me.slice(Me.indexOf(",")+1):null)},De.onerror=()=>ke(null),De.readAsDataURL(fe)});if(je===null)continue;const pe=URL.createObjectURL(fe);rt.push(pe),pt.push({id:++Gv,kind:"image",name:fe.name,mime:fe.type||"image/png",size:fe.size,previewUrl:pe,base64:je})}else try{const je=await fe.text();pt.push({id:++Gv,kind:"text",name:fe.name,mime:fe.type||"text/plain",size:fe.size,text:je})}catch{}}if(pt.length>0){for(const fe of rt)oe.current.add(fe);M(fe=>[...fe,...pt])}else for(const fe of rt)URL.revokeObjectURL(fe)},[w.length,A==null?void 0:A.visionCapable,g]),Ke=Se=>{const Qe=Se.trim();if(n||!e||!Qe&&w.length===0)return;const qe=Qe||fp("chat.attach.imageOnlyText"),pt=w.map(rt=>({kind:rt.kind,name:rt.name,mime:rt.mime,size:rt.size,data:rt.kind==="image"?rt.base64??"":rt.text??"",...rt.kind==="image"&&rt.previewUrl?{previewUrl:rt.previewUrl}:{}}));c(qe,void 0,pt.length>0?pt:void 0),T(""),M([])},Je=()=>Ke(E),it=Se=>{n||(c(Se.message,Se.label),Se.frictionCategory&&(f==null||f(Se.frictionCategory,null)))},Ee=Se=>{const Qe=Array.from(Se.clipboardData.files??[]);Qe.length>0&&(Se.preventDefault(),_e(Qe))},Ye=Se=>{Se.dataTransfer.types.includes("Files")&&(Se.preventDefault(),D.current+=1,R(!0))},yt=Se=>{Se.dataTransfer.types.includes("Files")&&(D.current=Math.max(0,D.current-1),D.current===0&&R(!1))},Ot=Se=>{Se.dataTransfer.types.includes("Files")&&(Se.preventDefault(),D.current=0,R(!1),_e(Array.from(Se.dataTransfer.files??[])))},Xt=_.useMemo(()=>CE(E),[E]);return t?m.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[!Q&&s.length>0&&e&&m.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:s.map((Se,Qe)=>m.jsx("button",{onClick:()=>it(Se),disabled:n,"data-testid":`starter-prompt-${Qe}`,"data-tooltip":Se.hint??Se.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:Se.label},Qe))}),m.jsx("div",{className:`relative rounded-2xl transition-colors px-3 pt-2 pb-1.5 ${I?"bg-accent/10 ring-1 ring-accent":"bg-ink/[0.05] focus-within:bg-ink/[0.07]"}`,onDragEnter:Ye,onDragOver:Se=>{Se.dataTransfer.types.includes("Files")&&Se.preventDefault()},onDragLeave:yt,onDrop:Ot,"data-testid":"composer-card",children:Q?m.jsxs(m.Fragment,{children:[U!=="idle"&&m.jsx(mj,{view:U,level:Y.level,text:z,onTextChange:H,onSend:$,onRerecord:ne,errorMessage:ie,sendDisabled:n||!e||!z.trim()}),m.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[m.jsxs("span",{className:"flex items-center gap-1.5 text-label text-ink-muted font-medium",children:[m.jsx(Cc,{className:"w-3.5 h-3.5 text-accent"}),g("chat.speech.dictation")]}),m.jsxs("button",{type:"button",onClick:K,"data-tooltip":g("chat.speech.back_to_keyboard"),"aria-label":g("chat.speech.back_to_keyboard"),"data-testid":"voice-keyboard-toggle",className:"flex items-center gap-1 px-2 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[m.jsx(kC,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:g("chat.speech.keyboard")})]})]}),m.jsxs("button",{type:"button",onPointerDown:Se=>{Se.preventDefault(),Y.beginHold()},onPointerUp:Y.endHold,onPointerLeave:Y.endHold,onPointerCancel:Y.endHold,onContextMenu:Se=>Se.preventDefault(),disabled:!e||U!=="idle","data-testid":Y.listening?"voice-hold-btn-active":"voice-hold-btn",className:`w-full py-5 rounded-xl text-lead font-bold flex items-center justify-center gap-2 transition-all touch-none select-none disabled:opacity-40 ${Y.listening?"bg-accent/25 text-accent scale-[0.99]":"bg-accent/10 text-accent hover:bg-accent/20 active:bg-accent/25 active:scale-[0.99]"}`,children:[m.jsx(Cc,{className:"w-5 h-5"}),Y.listening?g("chat.speech.release_to_stop"):g("chat.speech.hold_to_talk")]})]}):m.jsxs(m.Fragment,{children:[i.length>0&&m.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[m.jsx("span",{className:"text-body text-ink-faint shrink-0",children:g("chat.soul.label")}),i.map(Se=>{const Qe=o===Se.name,qe=gj[Se.name]??bE,pt=g(xj[Se.name]??"soul.direct.desc");return m.jsxs("button",{onClick:()=>l(Se.name),"data-testid":`soul-pill-${Se.name}`,"data-tooltip":pt,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${Qe?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[m.jsx(qe,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:g(pj[Se.name]??"soul.direct")})]},Se.id)})]}),w.length>0&&m.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(A==null?void 0:A.visionBridgeModel)&&w.some(Se=>Se.kind==="image")&&m.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[m.jsx(BC,{className:"w-3.5 h-3.5 shrink-0"}),m.jsx("span",{children:g("chat.attach.bridgeChip",{model:A.visionBridgeModel})})]}),w.map(Se=>Se.kind==="image"?m.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[m.jsx("img",{src:Se.previewUrl,alt:Se.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),m.jsx("button",{type:"button",onClick:()=>ce(Se.id),"aria-label":g("chat.attach.remove",{name:Se.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:m.jsx(la,{className:"w-3 h-3"})})]},Se.id):m.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:[m.jsx(Dl,{className:"w-3 h-3 shrink-0 text-ink-faint"}),m.jsx("span",{className:"truncate max-w-[10rem]",children:Se.name}),m.jsx("button",{type:"button",onClick:()=>ce(Se.id),"aria-label":g("chat.attach.remove",{name:Se.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:m.jsx(la,{className:"w-2.5 h-2.5"})})]},Se.id))]}),N&&m.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:N}),m.jsxs("div",{className:"flex gap-2 items-end",children:[m.jsx("textarea",{value:E,onChange:Se=>T(Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&!Se.shiftKey&&(Se.preventDefault(),Je())},onPaste:Ee,placeholder:g(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?m.jsx("button",{onClick:d,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:g("chat.stop"),"aria-label":g("chat.stop"),children:m.jsx(up,{className:"w-3.5 h-3.5 fill-current"})}):m.jsx("button",{onClick:Je,disabled:n||!E.trim()&&w.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:g("chat.send"),"aria-label":g("chat.send"),children:m.jsx(lC,{className:"w-4 h-4"})})]}),m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[m.jsx("button",{type:"button",onClick:()=>{ne(),q(!0)},disabled:!e,"data-tooltip":g("chat.speech.dictation"),"aria-label":g("chat.speech.dictation"),"data-testid":"composer-mic",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 disabled:opacity-50",children:m.jsx(Cc,{className:"w-3.5 h-3.5"})}),m.jsx("button",{type:"button",onClick:()=>{var Se;return(Se=j.current)==null?void 0:Se.click()},"data-tooltip":g("chat.attach.add"),"aria-label":g("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:m.jsx(LC,{className:"w-3 h-3"})}),m.jsx("input",{ref:j,type:"file",multiple:!0,accept:bj,className:"hidden",onChange:Se=>{_e(Array.from(Se.target.files??[])),Se.target.value=""}}),m.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[m.jsx(fj,{}),m.jsx(uj,{info:A,historyTokens:b,draftTokens:Xt}),m.jsx(lj,{onGotoSettings:p})]})]})]})})]}):m.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:m.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[m.jsx("span",{children:g("chat.no_key.short")}),m.jsx("button",{onClick:p,className:"text-brand hover:underline font-bold",children:g("chat.no_key.cta")})]})})}function zm(e){return e.length>=200||e.includes("```")?90:60}function vj(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 Ej(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 Xv(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 Tj(e,t){const n=Ej(vj(t)),i=Xv(e.length,n),o={};for(const s of e)o[s.id]=Xv(Math.max(1,s.optionCount),n);return{questionOrder:i,optionPerms:o}}function Sj(e,t){const n=e[t];return String(n??t)}function kj({stars:e}){return m.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>m.jsx(qC,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function wj({examNode:e,locale:t,onExamCompleted:n,onSessionChange:i,paused:o}){const s=Ve(),[l,c]=_.useState("loading"),[d,f]=_.useState(null),[p,x]=_.useState([]),[b,g]=_.useState(null),[y,E]=_.useState(0),[T,w]=_.useState(null),[M,N]=_.useState(null),[L,A]=_.useState(""),[C,I]=_.useState(0),[R,j]=_.useState(null),D=_.useRef({}),P=_.useRef(null),B=_.useRef(null),Q=_.useRef(null),q=b?p[b.questionOrder[y]]??null:null,z=q&&b?b.optionPerms[q.id]??[]:[],H=(q==null?void 0:q.options)??[],G=z.length===H.length?z:H.map((U,ne)=>ne);_.useEffect(()=>{let U=!1;return c("loading"),A(""),N(null),f(null),(async()=>{try{const ne=await me.examGetStatus(e.id);if(U)return;f(ne),x(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"),me.examPrepare(e.id,t??null).catch(()=>{}))}catch(ne){U||(A(ne instanceof Error?ne.message:String(ne)),c("failed"))}})(),()=>{U=!0}},[e.id]),_.useEffect(()=>me.on("exam:status",ne=>{ne.nodeId===e.id&&(ne.status==="ready"?me.examGetStatus(e.id).then(K=>{f(K),x(K.exercises),c($=>$==="generating"?K.latestAttempt?"result":"ready":$)}).catch(()=>{}):ne.status==="failed"?(A(ne.error??s("exam.errorEmpty")),c("failed")):(f(K=>K&&{...K,...ne}),c(K=>K==="loading"?"generating":K)))}),[e.id]);const Z=_.useCallback(async()=>{var U;try{const ne=await me.examStartAttempt(e.id),K=Tj(ne.exercises.map($=>{var oe;return{id:$.id,optionCount:((oe=$.options)==null?void 0:oe.length)??0}}),ne.attemptId);x(ne.exercises),P.current=ne.attemptId,g(K),D.current={},E(0),w(null),N(null),B.current=null,c("answering"),I(zm(((U=ne.exercises[K.questionOrder[0]])==null?void 0:U.prompt)??""))}catch(ne){A(ne instanceof Error?ne.message:String(ne)),c("failed")}},[e.id]),ie=_.useCallback(()=>{j(null),N(null),c("generating"),f(U=>U&&{...U,status:"generating",done:0,total:0}),me.examRegenerate(e.id,t??null).then(U=>{U.status==="failed"&&(A(U.error??s("exam.errorEmpty")),c("failed"))}).catch(U=>{A(U instanceof Error?U.message:String(U)),c("failed")})},[e.id,t,s]),F=m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"btn-3d-neutral px-4 py-1.5 text-body","data-testid":"exam-regen-btn",onClick:U=>j(U.currentTarget.getBoundingClientRect()),children:[m.jsx(sl,{className:"w-3.5 h-3.5 inline"}),s("exam.regenerate")]}),R&&m.jsx(dd,{anchorRect:R,message:s("exam.regenerate.confirmMsg"),confirmLabel:s("exam.regenerate"),onConfirm:ie,onCancel:()=>j(null)})]});_.useEffect(()=>{var U;l!=="answering"||!q||B.current!==q.id&&(I(zm(q.prompt)),w(null),(U=Q.current)==null||U.scrollTo({top:0}))},[y,l]),_.useEffect(()=>{if(l!=="answering"||o)return;const U=setInterval(()=>{I(ne=>ne>0?ne-1:0)},1e3);return()=>clearInterval(U)},[l,o]);const Y=_.useCallback(U=>{const ne=q;if(!ne||l!=="answering"||B.current===ne.id)return;B.current=ne.id;const K=U===null?"":Sj(G,U),$={...D.current,[ne.id]:K};D.current=$,P.current&&me.examRecordAnswer(e.id,P.current,ne.id,K).catch(()=>{}),y+1<p.length?E(y+1):(c("submitting"),(async()=>{try{const oe=await me.examSubmitAttempt(e.id,P.current,$);N({correctCount:oe.correctCount,totalCount:oe.totalCount,stars:oe.stars,bestStars:oe.bestStars,terminated:oe.terminated,perQuestion:oe.perQuestion}),c("result"),n==null||n(),oe.stars>=1&&Nr("exam-pass")}catch(oe){A(oe instanceof Error?oe.message:String(oe)),c("failed")}})())},[q,l,G,y,p.length,e.id,n]),J=_.useCallback(()=>{T!==null&&Y(T)},[T,Y]);if(_.useEffect(()=>{l!=="answering"||C>0||o||Y(T)},[C,l,o]),_.useEffect(()=>{const U=async()=>{if(P.current)try{await me.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:U}:{active:!1,terminate:null}),()=>i==null?void 0:i({active:!1,terminate:null})},[l,e.id,n,i]),l==="loading")return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[m.jsx(Ls,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]});if(l==="generating"){const U=(d==null?void 0:d.done)??0,ne=(d==null?void 0:d.total)??0,K=ne>0?Math.round(U/ne*100):0;return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[m.jsx(Ls,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),m.jsx("div",{className:"text-title font-bold text-ink mb-2",children:s("exam.generating.title")}),m.jsx("div",{className:"text-body text-ink-muted mb-4",children:s("exam.generating.stage")}),m.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:m.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,K)}%`}})}),m.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:ne>0?s("exam.generating.kcProgress",{done:U,total:ne}):s("exam.generating.preparing")}),m.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:s("exam.generating.canLeave")})]})}if(l==="failed")return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[m.jsx(r0,{className:"w-10 h-10 text-warning mb-3"}),m.jsx("div",{className:"text-body font-bold text-ink mb-1",children:s("exam.errorTitle")}),m.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:L||s("exam.errorEmpty")}),m.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{c("generating"),me.examPrepare(e.id,t??null).catch(()=>{})},children:[m.jsx(sl,{className:"w-3.5 h-3.5 inline"}),s("exam.failed.retry")]})]});if(l==="ready"&&d){const U=d.exercises.reduce((K,$)=>K+zm($.prompt),0),ne=Math.max(1,Math.round(U/60));return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[m.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:m.jsx(Ls,{className:"w-7 h-7 text-brand"})}),m.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:s("exam.ready.title")}),m.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),m.jsx("div",{className:"text-label text-ink-muted mb-8",children:s("exam.ready.meta",{q:d.questionCount,kc:d.kcCount,min:ne})}),m.jsxs("div",{className:"flex flex-col items-center gap-3",children:[m.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:Z,"data-testid":"exam-start-btn",children:[s("exam.start"),m.jsx(i0,{className:"w-4 h-4 inline ml-1"})]}),F]})]})}if(l==="answering"||l==="submitting"){if(!q)return null;const U=C<=10;return m.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[m.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:s("exam.q.progress",{i:y+1,n:p.length})}),m.jsxs("div",{className:`flex items-center gap-1 text-label font-bold tabular-nums transition-colors ${U?"text-warning":"text-ink"}`,"data-testid":"exam-timer",children:[m.jsx(YC,{className:"w-3.5 h-3.5"}),Math.floor(C/60),":",String(C%60).padStart(2,"0")]})]}),m.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:m.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${y/p.length*100}%`}})})]}),m.jsxs("div",{ref:Q,className:"flex-1 min-h-0 overflow-y-auto px-6 pb-6 w-full max-w-2xl mx-auto",children:[q.kcTitle&&m.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:[m.jsx(Fc,{className:"w-3 h-3"}),q.kcTitle]}),m.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:q.prompt}),m.jsx("div",{className:"flex flex-col gap-2.5",children:G.map((ne,K)=>m.jsx("button",{onClick:()=>w(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:m.jsx("span",{className:"text-body break-words",children:H[ne]})},ne))}),m.jsx("div",{className:"mt-6 flex justify-end",children:l==="submitting"?m.jsx("div",{className:"text-body text-ink-muted",children:s("exam.submitting")}):m.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:T===null,onClick:J,"data-testid":"exam-next-btn",children:[y+1<p.length?s("exam.q.next"):s("exam.q.submit"),m.jsx(i0,{className:"w-3.5 h-3.5 inline ml-1"})]})})]})]})}if(l==="result"&&M){const U=M.totalCount>0?Math.round(M.correctCount/M.totalCount*100):0,ne=new Map;for(const $ of M.perQuestion){const oe=$.kcTitle??"";if(!oe)continue;const ce=ne.get(oe)??{correct:0,total:0};ce.total++,$.correct&&ce.correct++,ne.set(oe,ce)}const K=new Map(p.map($=>[$.id,$]));return m.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[m.jsxs("div",{className:"flex flex-col items-center mb-6",children:[m.jsx(kj,{stars:M.stars}),m.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:s("exam.result.score",{correct:M.correctCount,total:M.totalCount})}),m.jsx("div",{className:"text-body text-ink-muted mt-1",children:s("exam.result.accuracy",{pct:U})}),m.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[m.jsx("span",{children:s("exam.result.best",{stars:M.bestStars})}),d&&d.attemptCount>1&&m.jsx("span",{children:s("exam.result.attempts",{n:d.attemptCount})})]})]}),M.terminated&&m.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[m.jsx(r0,{className:"w-4 h-4 text-warning shrink-0"}),m.jsx("span",{className:"text-body text-ink",children:s("exam.terminated.banner")})]}),ne.size>0&&m.jsxs("div",{className:"mb-8",children:[m.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.kcBreakdown")}),m.jsx("div",{className:"flex flex-col gap-2",children:[...ne.entries()].map(([$,oe])=>{const _e=(oe.total>0?oe.correct/oe.total:0)<.6;return m.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(Fc,{className:"w-3.5 h-3.5 text-accent shrink-0"}),m.jsx("span",{className:"text-body text-ink truncate",children:$})]}),m.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[_e&&m.jsx("span",{className:"text-caption text-warning",children:s("exam.result.weakKc")}),m.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[oe.correct,"/",oe.total]})]})]},$)})})]}),m.jsxs("div",{className:"mb-8",children:[m.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.review")}),m.jsx("div",{className:"flex flex-col gap-2",children:M.perQuestion.map(($,oe)=>{const ce=K.get($.exerciseId),_e=$.options??(ce==null?void 0:ce.options)??null,Ke=$.prompt??(ce==null?void 0:ce.prompt)??`#${oe+1}`,Je=it=>_e&&it!==""&&_e[Number(it)]!==void 0?_e[Number(it)]:it;return m.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:m.jsxs("div",{className:"flex items-start gap-2",children:[$.correct?m.jsx(Fn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):m.jsx(la,{className:`w-4 h-4 shrink-0 mt-0.5 ${$.answered?"text-warning":"text-ink-muted"}`}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-body text-ink mb-1",children:Ke}),m.jsx("div",{className:"text-caption text-ink-muted",children:$.answered?$.correct?m.jsx("span",{className:"text-brand",children:s("exam.result.correctLabel")}):m.jsxs(m.Fragment,{children:[s("exam.result.yourAnswer"),":",Je($.userAnswer),m.jsx("span",{className:"mx-1",children:"·"}),s("exam.result.correctAnswer"),":",Je($.correctAnswer)]}):s("exam.result.unanswered")}),$.explanation&&m.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:$.explanation})]})]})},$.exerciseId)})})]}),m.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[m.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:Z,"data-testid":"exam-retry-btn",children:[m.jsx(sl,{className:"w-3.5 h-3.5 inline"}),s("exam.retryExam")]}),F]})]})}return null}const Aj=[{id:"explain_simple",icon:Fc,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:Dl,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:sp,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:dC,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:EE,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:Ls,labelKey:"command.exam_mode",group:"command.group.mode"}],Cj=["command.group.node","command.group.mode","command.group.nav"];function Nj({onClose:e,onPick:t,hasNode:n}){const i=Ve(),[o,s]=_.useState(""),[l,c]=_.useState(0),d=_.useRef(null),f=_.useRef(null);_.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]),Us(f,!0);const x=Aj.filter(g=>i(g.labelKey).toLowerCase().includes(o.toLowerCase())).filter(g=>!g.requiresNode||n),b=g=>{g.key==="ArrowDown"?(g.preventDefault(),c(y=>Math.min(y+1,x.length-1))):g.key==="ArrowUp"?(g.preventDefault(),c(y=>Math.max(y-1,0))):g.key==="Enter"&&x[l]&&(g.preventDefault(),t(x[l].id))};return m.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.jsxs("div",{ref:f,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:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[m.jsx(op,{className:"w-4 h-4 text-ink-faint"}),m.jsx("input",{ref:d,value:o,onChange:g=>{s(g.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"}),m.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:x.length===0?m.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:i(n?"command.empty.node":"command.empty.nonode")}):Cj.map(g=>{const y=x.filter(E=>E.group===g);return y.length===0?null:m.jsxs("div",{children:[m.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:i(g)}),y.map(E=>{const T=x.indexOf(E),w=E.icon;return m.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:[m.jsx(w,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"text-body font-medium flex-1",children:i(E.labelKey)})]},E.id)})]},g)})}),m.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[m.jsx("span",{children:i("command.footer.hint")}),m.jsx("span",{children:i("command.footer.keys")})]})]})]})}const $S="lookatstudy-theme",Kv="auto",WS="(prefers-color-scheme: dark)";function Um(){return typeof window>"u"||window.matchMedia(WS).matches?"dark":"light"}function _j(){if(typeof localStorage>"u")return Kv;const e=localStorage.getItem($S);return e==="auto"||e==="light"||e==="dark"?e:Kv}function Hm(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function Mj(){const[e,t]=_.useState(()=>_j()),[n,i]=_.useState(()=>e==="auto"?Um():e),o=_.useCallback(s=>{t(s),localStorage.setItem($S,s);const l=s==="auto"?Um():s;i(l),Hm(l)},[]);return _.useEffect(()=>{if(e!=="auto")return;const s=window.matchMedia(WS),l=c=>{const d=c.matches?"dark":"light";i(d),Hm(d)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),_.useEffect(()=>{const s=e==="auto"?Um():e;i(s),Hm(s)},[e]),{mode:e,resolved:n,setMode:o}}const an="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",Tr="bg-surface-3 text-ink-muted hover:bg-surface-3 hover:bg-surface-3 hover:text-ink-strong",Sr="bg-brand text-white shadow-sm";function zt(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function Rj(){const e=Ve(),[t,n]=_.useState([]),[i,o]=_.useState([]),[s,l]=_.useState("glm"),[c,d]=_.useState(""),[f,p]=_.useState(""),[x,b]=_.useState(null),[g,y]=_.useState(!1),[E,T]=_.useState(null),[w,M]=_.useState(!1),[N,L]=_.useState(!1),[A,C]=_.useState(""),[I,R]=_.useState("openai-compatible"),[j,D]=_.useState(""),[P,B]=_.useState(""),[Q,q]=_.useState(""),[z,H]=_.useState(!1),[G,Z]=_.useState(null),[ie,F]=_.useState([]),[Y,J]=_.useState(!1),[U,ne]=_.useState(null),[K,$]=_.useState(null),[oe,ce]=_.useState(""),[_e,Ke]=_.useState(!1),Je=Mj(),it=async()=>{J(!0),ne(null);try{const fe=await me.discoverModels();fe.ok&&fe.models?F(fe.models):ne(fe.error||e("settings.discover_failed"))}catch(fe){ne(fe instanceof Error?fe.message:String(fe))}finally{J(!1)}},Ee=_.useCallback(async()=>{try{const[fe,Be,je,pe]=await Promise.all([me.getProviderPresets(),me.listCustomProviders(),me.getSetting("active_provider"),me.getSetting("active_model")]);n(fe),o(Be);const ke=je??"glm";if(l(ke),ke.startsWith("custom-")){const De=Be.find(Me=>Me.id===ke);b(De!=null&&De.hasApiKey?e("settings.key.configured"):null)}else{const De=fe.find(Me=>Me.id===ke);if(De){const Me=await me.getSetting(De.apiKeySetting);b(Me?`${Me.slice(0,4)}…${Me.slice(-4)}`:null)}}if(ke.startsWith("custom-")){const De=Be.find(Me=>Me.id===ke);d(pe??(De==null?void 0:De.defaultModel)??"")}else{const De=fe.find(Me=>Me.id===ke);d(pe??(De==null?void 0:De.defaultModel)??"")}}catch(fe){console.error("[SettingsView] load() failed:",fe)}},[e]);_.useEffect(()=>{Ee()},[Ee]);const Ye=async fe=>{l(fe),T(null),p("");const Be=t.find(je=>je.id===fe);if(Be){const je=await me.getSetting(Be.apiKeySetting);b(je?`${je.slice(0,4)}…${je.slice(-4)}`:null),d(c||Be.defaultModel)}},yt=async()=>{M(!1);try{if(await me.setSetting("active_provider",s),await me.setSetting("active_model",c),f.trim()){const fe=t.find(Be=>Be.id===s);fe&&(await me.setSetting(fe.apiKeySetting,f.trim()),b(`${f.trim().slice(0,4)}…${f.trim().slice(-4)}`),p(""))}M(!0),setTimeout(()=>M(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},Ot=async()=>{y(!0),T(null);try{const fe=await me.testLlmConnection();T(fe)}catch(fe){T({ok:!1,detail:fe instanceof Error?fe.message:String(fe),errorKind:"unknown"})}finally{y(!1)}},Xt=async()=>{if(!(!j.trim()||!Q.trim()||z)){H(!0),Z(null);try{const fe=await me.testCustomProvider({label:A||e("settings.custom.test_label"),protocol:I,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:Q.trim()});Z({ok:fe.ok,detail:fe.detail})}catch(fe){Z({ok:!1,detail:fe instanceof Error?fe.message:String(fe)})}finally{H(!1)}}},Se=async()=>{if(!(!A.trim()||!j.trim()||!Q.trim()))try{const fe=await me.createCustomProvider({label:A.trim(),protocol:I,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:Q.trim()});await me.setSetting("active_provider",fe.id),await me.setSetting("active_model",fe.defaultModel),l(fe.id),d(fe.defaultModel),C(""),D(""),B(""),q(""),R("openai-compatible"),Z(null),L(!1),await Ee(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},Qe=async fe=>{try{await me.deleteCustomProvider(fe),s===fe&&(await me.setSetting("active_provider","glm"),l("glm")),await Ee()}catch{}},qe=s.startsWith("custom-")?i.find(fe=>fe.id===s):null;_.useEffect(()=>{if(!qe)return;const fe=qe.models.find(Be=>Be.id===c);ce(fe!=null&&fe.contextWindow?String(fe.contextWindow):"")},[qe,c]);const pt=async()=>{var ke,De;if(!qe)return;const fe=oe.trim().replace(/[,\s_]/g,""),Be=/^(\d+)([km]?)$/i.exec(fe);if(fe!==""&&!Be)return;const je=((ke=Be==null?void 0:Be[2])==null?void 0:ke.toLowerCase())==="k"?1e3:((De=Be==null?void 0:Be[2])==null?void 0:De.toLowerCase())==="m"?1e6:1,pe=fe===""||!Be?null:Math.max(1,Math.round(parseInt(Be[1],10)*je));Ke(!0);try{const Me=qe.models.map($e=>$e.id===c?{...$e,contextWindow:pe}:$e);await me.updateCustomProvider(qe.id,{models:Me}),await Ee(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{Ke(!1)}},rt=s.startsWith("custom-")?null:t.find(fe=>fe.id===s);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),m.jsxs("div",{className:"surface-card overflow-hidden",children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),m.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(fe=>m.jsx("button",{onClick:()=>Ye(fe.id),"data-testid":`provider-card-${fe.id}`,"aria-pressed":s===fe.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${s===fe.id?Sr:Tr}`,children:fe.label},fe.id)),i.map(fe=>m.jsxs("button",{onClick:()=>Ye(fe.id),"data-testid":`provider-card-${fe.id}`,"aria-pressed":s===fe.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${s===fe.id?Sr:Tr}`,children:[m.jsx(cp,{className:"w-3.5 h-3.5","aria-hidden":"true"}),fe.label]},fe.id)),m.jsxs("button",{onClick:()=>L(fe=>!fe),"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:[m.jsx(cd,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),N&&m.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:[m.jsx("div",{className:"text-label font-bold text-ink-strong",children:e("settings.custom.form_title")}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:A,onChange:fe=>C(fe.target.value),placeholder:e("settings.custom.label_ph"),"data-testid":"custom-label",className:`${an} flex-1 px-2.5 py-1.5`}),m.jsxs("select",{value:I,onChange:fe=>R(fe.target.value),"data-testid":"custom-protocol",className:`${an} px-2 py-1.5`,children:[m.jsx("option",{value:"openai-compatible",children:e("settings.proto.openai")}),m.jsx("option",{value:"anthropic",children:"Anthropic"}),m.jsx("option",{value:"google",children:"Google"})]})]}),m.jsx("input",{type:"text",value:j,onChange:fe=>D(fe.target.value),placeholder:e("settings.custom.baseurl_ph"),"data-testid":"custom-baseurl",className:`${an} w-full px-2.5 py-1.5 font-mono`}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:Q,onChange:fe=>q(fe.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"custom-model",className:`${an} flex-1 px-2.5 py-1.5 font-mono`}),m.jsx("input",{type:"password",value:P,onChange:fe=>B(fe.target.value),placeholder:e("settings.custom.apikey_ph"),"data-testid":"custom-apikey",className:`${an} flex-1 px-2.5 py-1.5`})]}),G&&m.jsxs("div",{className:`text-label rounded p-2 inline-flex items-start gap-1.5 ${G.ok?"bg-brand/10 text-brand":"bg-warning/10 text-warning"}`,children:[G.ok?m.jsx(ai,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):m.jsx(Ds,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"break-words",children:G.detail})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{onClick:Xt,disabled:!j.trim()||!Q.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")}),m.jsx("button",{onClick:Se,disabled:!A.trim()||!j.trim()||!Q.trim(),"data-testid":"custom-save",className:"btn-3d-brand px-3 py-1.5 text-label disabled:opacity-40",children:e("settings.custom.save")}),m.jsx("button",{onClick:()=>L(!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-")&&m.jsx("div",{className:zt(!0),children:m.jsx("button",{onClick:fe=>{const Be=fe.currentTarget.getBoundingClientRect(),je=i.find(pe=>pe.id===s);je&&$({id:je.id,label:je.label,rect:Be})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),rt&&m.jsxs(m.Fragment,{children:[rt.baseUrl&&m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),m.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:rt.baseUrl})]}),m.jsxs("div",{className:zt(!0),children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[m.jsxs("select",{value:c,onChange:fe=>d(fe.target.value),"data-testid":"model-select",className:`${an} flex-1 px-2.5 py-1.5`,children:[rt.models.map(fe=>m.jsx("option",{value:fe.id,children:fe.id},fe.id)),s==="openrouter"&&ie.map(fe=>m.jsx("option",{value:fe.id,children:fe.id},fe.id))]}),s==="openrouter"&&m.jsxs("button",{onClick:it,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:[m.jsx(PC,{className:`w-3.5 h-3.5 ${Y?"animate-spin":""}`,"aria-hidden":"true"}),e(Y?"settings.discovering":"settings.refresh")]})]})]}),U&&m.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:U})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[x&&m.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[m.jsx(ai,{className:"w-3.5 h-3.5","aria-hidden":"true"}),x]}),m.jsx("input",{type:"password",value:f,onChange:fe=>p(fe.target.value),placeholder:e(x?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${an} flex-1 px-2.5 py-1.5`}),m.jsx("a",{href:rt.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("button",{onClick:Ot,disabled:g,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(g?"settings.testing":"settings.test")}),E&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?m.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]}),qe&&!rt&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),m.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:qe.baseUrl})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),qe.models.length>1?m.jsx("select",{value:c,onChange:fe=>d(fe.target.value),"data-testid":"model-select-custom",className:`${an} flex-1 px-2.5 py-1.5`,children:qe.models.map(fe=>m.jsx("option",{value:fe.id,children:fe.id},fe.id))}):m.jsx("input",{type:"text",value:c,onChange:fe=>d(fe.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${an} flex-1 px-2.5 py-1.5 font-mono`})]})}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"text",inputMode:"numeric",value:oe,onChange:fe=>ce(fe.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${an} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),m.jsx("button",{onClick:pt,disabled:_e,"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")})]}),m.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("button",{onClick:Ot,disabled:g,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(g?"settings.testing":"settings.test")}),E&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?m.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]})]})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(Lj,{activeProvider:s,activeModel:c,presets:t,customProviders:i})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(Oj,{})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.speech.title")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(Pj,{})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),m.jsxs("div",{className:"surface-card overflow-hidden",children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),m.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:fe,label:Be})=>m.jsx("button",{onClick:()=>Je.setMode(fe),"data-testid":`theme-${fe}`,"aria-pressed":Je.mode===fe,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Je.mode===fe?Sr:Tr}`,children:Be},fe))}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:Je.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${Je.resolved}`)}):null})]}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),m.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(fe=>m.jsx("button",{onClick:()=>JC(fe),"data-testid":`lang-${fe}`,"aria-pressed":Os()===fe,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Os()===fe?Sr:Tr}`,children:fe==="zh-CN"?"中文":"English"},fe))})]}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),m.jsx(Dj,{})]})]})]})]}),m.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:[m.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),m.jsxs("button",{onClick:yt,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[w&&m.jsx(Fn,{className:"w-4 h-4","aria-hidden":"true"}),e(w?"settings.saved_text":"settings.footer.save")]})]}),K&&m.jsx(dd,{anchorRect:K.rect,message:e("settings.delete_custom_confirm",{name:K.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{Qe(K.id),$(null)},onCancel:()=>$(null)})]})}function Dj(){const[e,t]=_.useState("en"),[n,i]=_.useState(!1);_.useEffect(()=>{me.getSetting("pref_lang").then(l=>{l&&t(l),i(!0)})},[]);const o=async l=>{t(l),await me.setSetting("pref_lang",l)},s=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?m.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:s.map(l=>m.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?Sr:Tr}`,children:l.label},l.code))}):null}function Lj({activeProvider:e,activeModel:t,presets:n,customProviders:i}){const o=Ve(),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[f,p]=_.useState(""),[x,b]=_.useState("");_.useEffect(()=>{Promise.all([me.getSetting("flag_multimodal_import"),me.getSetting("vision_provider_override"),me.getSetting("vision_model_override")]).then(([C,I,R])=>{l(C==="true"),p(I??""),b(R??""),d(!0)})},[]);const g=async()=>{const C=!s;l(C),await me.setSetting("flag_multimodal_import",String(C))},y=async()=>{await me.setSetting("vision_provider_override",f),await me.setSetting("vision_model_override",x)},[E,T]=_.useState(!1),[w,M]=_.useState(null),N=async()=>{if(!E){await y(),T(!0),M(null);try{const C=await me.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)}}},L=f&&!f.startsWith("custom-")?n.find(C=>C.id===f):null,A=f.startsWith("custom-")?i.find(C=>C.id===f):null;return c?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[m.jsx(ZS,{checked:s,onChange:g,label:o("settings.multimodal.toggle"),testid:"multimodal-toggle"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body font-medium text-ink-strong",children:o("settings.multimodal.toggle")}),m.jsx("div",{className:"text-label text-ink-muted",children:o("settings.multimodal.toggle.desc")})]})]}),m.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[m.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[m.jsx("div",{className:"font-medium mb-1",children:o("settings.multimodal.current_model",{model:t||o("settings.multimodal.not_selected")})}),m.jsx("div",{children:e.startsWith("custom-")?o("settings.multimodal.hint_custom"):o("settings.multimodal.hint_preset")})]}),m.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[m.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:o("settings.multimodal.override_title")}),m.jsx("div",{className:"text-caption text-ink-muted mb-2",children:o("settings.multimodal.override_bridge_hint")}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("select",{value:f,onChange:C=>{p(C.target.value);const I=C.target.value;if(I.startsWith("custom-")){const R=i.find(j=>j.id===I);b((R==null?void 0:R.defaultModel)??"")}else{const R=n.find(j=>j.id===I);b((R==null?void 0:R.defaultModel)??"")}},className:`${an} w-full px-3 py-2`,children:[m.jsx("option",{value:"",children:o("settings.multimodal.no_override")}),m.jsx("optgroup",{label:o("settings.multimodal.group_preset"),children:n.map(C=>m.jsx("option",{value:C.id,children:C.label},C.id))}),i.length>0&&m.jsx("optgroup",{label:o("settings.multimodal.group_custom"),children:i.map(C=>m.jsx("option",{value:C.id,children:C.label},C.id))})]}),f&&m.jsxs(m.Fragment,{children:[((L==null?void 0:L.models.length)??0)>0?m.jsx("select",{value:x,onChange:C=>b(C.target.value),className:`${an} w-full px-3 py-2`,children:L.models.map(C=>m.jsxs("option",{value:C.id,children:[C.label,(C.capabilities??[]).includes("vision")?` · ${o("settings.multimodal.vision_capable")}`:""]},C.id))}):m.jsx("input",{type:"text",value:x,onChange:C=>b(C.target.value),placeholder:(A==null?void 0:A.defaultModel)??o("settings.custom.model_ph"),className:`${an} w-full px-3 py-2`}),m.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-start",children:[m.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")}),m.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")}),w&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${w.ok?"text-brand":"text-warning"}`,children:[w.ok?m.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),w.detail]})]})]})]})]})]})]}):null}function Oj(){const e=Ve(),[t,n]=_.useState(!1),[i,o]=_.useState(!1);_.useEffect(()=>{me.getSetting("flag_memory_system").then(l=>{n(l==="true"),o(!0)})},[]);const s=async()=>{const l=!t;n(l),await me.setSetting("flag_memory_system",String(l))};return i?m.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[m.jsx(ZS,{checked:t,onChange:s,label:e("settings.memory.toggle"),testid:"memory-toggle"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),m.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function ZS({checked:e,onChange:t,label:n,testid:i}){return m.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:m.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":""}`})})}const Ij=[{id:"zh-CN-XiaoxiaoNeural",label:"zh-CN · 晓晓(女)"},{id:"zh-CN-XiaoyiNeural",label:"zh-CN · 晓伊(女)"},{id:"zh-CN-YunxiNeural",label:"zh-CN · 云希(男)"},{id:"zh-CN-YunyangNeural",label:"zh-CN · 云扬(男·新闻)"},{id:"zh-CN-liaoning-XiaobeiNeural",label:"zh-CN · 晓北(女·东北)"},{id:"zh-CN-shaanxi-XiaoniNeural",label:"zh-CN · 晓妮(女·陕西)"},{id:"en-US-AriaNeural",label:"en-US · Aria(女)"},{id:"en-US-GuyNeural",label:"en-US · Guy(男)"},{id:"en-US-JennyNeural",label:"en-US · Jenny(女)"}],jj=[{sid:"45",label:"zf_xiaobei(女)"},{sid:"46",label:"zf_xiaoni(女)"},{sid:"47",label:"zf_xiaoxiao(女)"},{sid:"48",label:"zf_xiaoyi(女·默认)"},{sid:"49",label:"zm_yunjian(男)"},{sid:"50",label:"zm_yunxi(男)"},{sid:"51",label:"zm_yunxia(男)"},{sid:"52",label:"zm_yunyang(男)"}];function Pj(){const e=Ve(),[t,n]=_.useState([]),[i,o]=_.useState(null),[s,l]=_.useState(null),[c,d]=_.useState(null),[f,p]=_.useState(null),[x,b]=_.useState("edge"),[g,y]=_.useState("zh-CN-XiaoxiaoNeural"),[E,T]=_.useState("zh-CN-XiaoxiaoNeural"),[w,M]=_.useState("48"),[N,L]=_.useState("1.0"),[A,C]=_.useState(""),[I,R]=_.useState(""),[j,D]=_.useState(!1),[P,B]=_.useState("local"),[Q,q]=_.useState(""),[z,H]=_.useState(""),[G,Z]=_.useState(!1),[ie,F]=_.useState(!1),[Y,J]=_.useState(!0);_.useEffect(()=>{Promise.all([me.getSetting("tts_engine"),me.getSetting("tts_voice_edge"),me.getSetting("azure_tts_voice"),me.getSetting("tts_sid_local"),me.getSetting("tts_speed"),me.getSetting("azure_tts_region"),me.getSetting("azure_tts_api_key"),me.getSetting("asr_engine"),me.getSetting("azure_stt_region"),me.getSetting("azure_stt_api_key"),me.getSetting("groq_api_key"),me.getSetting("asr_auto_stop")]).then(([Ee,Ye,yt,Ot,Xt,Se,Qe,qe,pt,rt,fe,Be])=>{(Ee==="azure"||Ee==="local")&&b(Ee),Ye&&y(Ye),yt&&T(yt),Ot&&M(Ot),Xt&&L(Xt),Se&&R(Se),Qe&&(D(!0),C("")),(qe==="groq"||qe==="azure")&&B(qe),pt&&H(pt),rt&&(Z(!0),q("")),F(!!fe),J(Be!=="0")})},[]);const U=Ee=>{b(Ee),me.setSetting("tts_engine",Ee)},ne=Ee=>{B(Ee),me.setSetting("asr_engine",Ee)},K=_.useCallback(()=>{window.api.getSpeechModelStatus().then(Ee=>n(Ee)).catch(()=>{})},[]);_.useEffect(()=>(K(),window.api.on("speech:modelProgress",Ye=>{d({id:Ye.id,pct:Math.floor(Ye.progress*100),label:Ye.currentFile?Ye.currentFile.split("/").pop()??"":""})})),[K]);const $=Ee=>{l(null),o(Ee),d({id:Ee,pct:0,label:""}),window.api.ensureSpeechModel(Ee).then(()=>{o(null),d(null),K()}).catch(Ye=>{o(null),d(null),l(Ye instanceof Error?Ye.message:String(Ye)),K()})},oe=Ee=>{o(Ee),p(null),window.api.deleteSpeechModel(Ee).then(K).catch(Ye=>l(Ye instanceof Error?Ye.message:String(Ye))).finally(()=>o(null))},ce=Ee=>e(Ee==="tts-kokoro"?"settings.speech.model.tts":Ee==="asr-whisper-turbo"?"settings.speech.model.asr_turbo":Ee==="asr-whisper-small"?"settings.speech.model.asr_small":"settings.speech.model.asr"),_e=Ee=>Ee.startsWith("asr-whisper")?e("settings.speech.license_mit"):e("settings.speech.license"),Ke=Ee=>e(Ee==="ready"?"settings.speech.state.ready":Ee==="error"?"settings.speech.state.error":"settings.speech.state.absent"),Je=x==="azure"?E:g,it=Ee=>{x==="azure"?(T(Ee),me.setSetting("azure_tts_voice",Ee)):(y(Ee),me.setSetting("tts_voice_edge",Ee))};return m.jsxs("div",{className:"p-4 space-y-3","data-testid":"settings-speech",children:[m.jsx("p",{className:"text-label text-ink-muted",children:e("settings.speech.desc")}),m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.tts_engine")}),m.jsx("div",{className:"flex gap-2 flex-wrap",children:[{id:"edge",label:e("settings.speech.engine.edge")},{id:"azure",label:e("settings.speech.engine.azure")},{id:"local",label:e("settings.speech.engine.local")}].map(({id:Ee,label:Ye})=>m.jsx("button",{onClick:()=>U(Ee),"data-testid":`tts-engine-${Ee}`,"aria-pressed":x===Ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${x===Ee?Sr:Tr}`,children:Ye},Ee))}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e(x==="edge"?"settings.speech.engine.edge_note":x==="azure"?"settings.speech.engine.azure_note":"settings.speech.engine.local_note")})]}),x!=="local"&&m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.voice")}),m.jsx("select",{value:Je,onChange:Ee=>it(Ee.target.value),"data-testid":"tts-voice-select",className:`${an} flex-1 px-2.5 py-1.5`,children:Ij.map(Ee=>m.jsx("option",{value:Ee.id,children:Ee.label},Ee.id))})]})}),x==="local"&&m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.voice")}),m.jsx("select",{value:w,onChange:Ee=>{M(Ee.target.value),me.setSetting("tts_sid_local",Ee.target.value)},"data-testid":"tts-sid-select",className:`${an} flex-1 px-2.5 py-1.5`,children:jj.map(Ee=>m.jsx("option",{value:Ee.sid,children:Ee.label},Ee.sid))})]})}),m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.speed")}),m.jsx("input",{type:"range",min:.5,max:2,step:.05,value:Number(N),onChange:Ee=>L(Ee.target.value),onPointerUp:()=>void me.setSetting("tts_speed",N),onKeyUp:()=>void me.setSetting("tts_speed",N),"data-testid":"tts-speed-range",className:"flex-1 accent-brand"}),m.jsxs("span",{className:"text-label text-ink-muted w-10 text-right","data-testid":"tts-speed-value",children:[Number(N).toFixed(2),"×"]})]})}),x==="azure"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_key")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[j&&A===""&&m.jsx("span",{className:"text-label text-brand shrink-0",children:"✓"}),m.jsx("input",{type:"password",value:A,onChange:Ee=>C(Ee.target.value),onBlur:()=>{A.trim()&&(me.setSetting("azure_tts_api_key",A.trim()),D(!0),C(""))},placeholder:e(j?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"azure-tts-key-input",className:`${an} flex-1 px-2.5 py-1.5`})]})]})}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_region")}),m.jsx("input",{type:"text",value:I,onChange:Ee=>R(Ee.target.value),onBlur:()=>void me.setSetting("azure_tts_region",I.trim()),placeholder:"eastus","data-testid":"azure-tts-region-input",className:`${an} flex-1 px-2.5 py-1.5`})]})})]}),m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.asr_engine")}),m.jsx("div",{className:"flex gap-2 flex-wrap",children:[{id:"local",label:e("settings.speech.asr_engine.local")},{id:"groq",label:e("settings.speech.asr_engine.groq")},{id:"azure",label:e("settings.speech.asr_engine.azure")}].map(({id:Ee,label:Ye})=>m.jsx("button",{onClick:()=>ne(Ee),"data-testid":`asr-engine-${Ee}`,"aria-pressed":P===Ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${P===Ee?Sr:Tr}`,children:Ye},Ee))}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e(P==="local"?"settings.speech.asr_engine.local_note":P==="groq"?ie?"settings.speech.asr_engine.groq_ready":"settings.speech.asr_engine.groq_note":"settings.speech.asr_engine.azure_note")})]}),P==="azure"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_key")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[G&&Q===""&&m.jsx("span",{className:"text-label text-brand shrink-0",children:"✓"}),m.jsx("input",{type:"password",value:Q,onChange:Ee=>q(Ee.target.value),onBlur:()=>{Q.trim()&&(me.setSetting("azure_stt_api_key",Q.trim()),Z(!0),q(""))},placeholder:e(G?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"azure-stt-key-input",className:`${an} flex-1 px-2.5 py-1.5`})]})]})}),m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_region")}),m.jsx("input",{type:"text",value:z,onChange:Ee=>H(Ee.target.value),onBlur:()=>void me.setSetting("azure_stt_region",z.trim()),placeholder:"eastus","data-testid":"azure-stt-region-input",className:`${an} flex-1 px-2.5 py-1.5`})]})})]}),m.jsxs("div",{className:zt(!1),children:[m.jsxs("div",{className:"flex items-center justify-between gap-3",children:[m.jsx("div",{className:"text-label font-medium text-ink-strong",children:e("settings.speech.asr_auto_stop")}),m.jsx("button",{onClick:()=>{const Ee=!Y;J(Ee),me.setSetting("asr_auto_stop",Ee?"1":"0")},role:"switch","aria-checked":Y,"data-testid":"asr-auto-stop-toggle",className:`relative w-10 h-6 rounded-full transition-colors ${Y?"bg-brand":"bg-ink/[0.15]"}`,children:m.jsx("span",{className:`absolute top-0.5 w-5 h-5 rounded-full bg-white shadow transition-all ${Y?"left-[18px]":"left-0.5"}`})})]}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_ux_note")})]}),s&&m.jsx("div",{className:"text-label text-warning break-all",role:"alert",children:s==="engine-unavailable"?e("chat.speech.engine_unavailable"):s}),t.filter(Ee=>Ee.id!=="tts-kokoro"||x==="local").map(Ee=>m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:ce(Ee.id)}),m.jsxs("div",{className:"text-caption text-ink-muted",children:[Ke(Ee.state)," · ",_e(Ee.id)]}),i===Ee.id&&(c==null?void 0:c.id)===Ee.id&&m.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${Ee.id}`,children:m.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${c.pct}%`}})}),i===Ee.id&&(c==null?void 0:c.id)===Ee.id&&m.jsxs("div",{className:"text-caption text-ink-muted mt-0.5","data-testid":`speech-dl-pct-${Ee.id}`,children:[c.pct,"% ",c.label]})]}),Ee.state==="ready"?f===Ee.id?m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx("button",{onClick:()=>oe(Ee.id),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-warning text-white","data-testid":`speech-del-confirm-${Ee.id}`,children:e("action.confirm")}),m.jsx("button",{onClick:()=>p(null),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-ink/[0.08] text-ink",children:e("action.cancel")})]}):m.jsx("button",{onClick:()=>p(Ee.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-${Ee.id}`,children:e("settings.speech.delete")}):m.jsx("button",{onClick:()=>$(Ee.id),disabled:i!==null,className:"btn-3d-brand px-3 py-1.5 text-label","data-testid":`speech-dl-${Ee.id}`,children:i===Ee.id?`${(c==null?void 0:c.pct)??0}%`:e("settings.speech.download")})]},Ee.id))]})}function Bj(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 zj=0;const vc=()=>`msg-v2-${++zj}`;function Uj(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 Hj(e,t){const[n,i]=_.useState([]),[o,s]=_.useState(!1),l=_.useRef(null);_.useEffect(()=>{if(!e){i([]),s(!1),l.current=null;return}let b=!1;return(async()=>{try{const g=await me.threadGetMessages(e);if(b)return;i(g.map(y=>{const E=Uj(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]),_.useEffect(()=>me.on("chat:part",g=>{const E=l.current;i(T=>{let w=E,M=T;if(!(w&&T.some(A=>A.id===w))){const A=T[T.length-1];A&&A.role==="assistant"?w=A.id:(w=vc(),M=[...T,{id:w,role:"assistant",parts:[]}])}const L=w;return M.map(A=>A.id===L?{...A,parts:Bj(A.parts,g)}:A)})}),[]),_.useEffect(()=>me.on("chat:done",(g,y)=>{s(!1),l.current=null,y&&(y.userMessageId||y.assistantMessageId)&&i(E=>{let T=-1,w=-1;for(let M=E.length-1;M>=0&&(E[M].role==="user"&&T===-1&&(T=M),E[M].role==="assistant"&&w===-1&&(w=M),!(T!==-1&&w!==-1));M--);return E.map((M,N)=>N===T&&y.userMessageId?{...M,id:y.userMessageId}:N===w&&y.assistantMessageId?{...M,id:y.assistantMessageId}:M)})}),[]),_.useEffect(()=>me.on("chat:error",g=>{s(!1),l.current=null,i(y=>[...y,{id:vc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${g}`}]}])}),[]);const c=_.useCallback(async(b,g,y,E)=>{const T=g??e;if(!T||o||!b.trim())return;const w=b.trim(),M={id:vc(),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:w}],...y?{displayText:y}:{}};i(N=>[...N,M]),s(!0),l.current=null;try{await me.agentChatThread(T,w,y,t??null,E)}catch(N){s(!1),i(L=>[...L,{id:vc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${N instanceof Error?N.message:String(N)}`}]}])}},[e,o,t]),d=_.useCallback(async()=>{if(!(!e||!o)){try{await me.abortAgentChatThread(e)}catch{}s(!1),l.current=null}},[e,o]),f=_.useCallback(()=>{i([])},[]);_.useEffect(()=>{const b=g=>{const y=g.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,fp(T.labelKey))};return window.addEventListener("lookatstudy-command",b),()=>window.removeEventListener("lookatstudy-command",b)},[c]);const p=_.useCallback((b,g,y)=>{i(E=>E.map(T=>{if(T.id!==b)return T;const w=[...T.parts],M=w[g];return M&&M.type==="tool-call"&&(w[g]={...M,output:{...typeof M.output=="object"&&M.output?M.output:{},status:y?"applied":"rejected"}}),{...T,parts:w}}))},[]),x=_.useCallback(b=>{i(b)},[]);return{messages:n,streaming:o,send:c,stop:d,clear:f,markProposalStatus:p,setMessagesForNode:x}}const Ec=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function Fj(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function Vj(e,t){const n=e.detail.map((o,s)=>o.correct?t("quiz.hook.lineOk",{n:s+1,prompt:Ec(o.prompt)}):t("quiz.hook.lineWrong",{n:s+1,prompt:Ec(o.prompt),chosen:Ec(o.chosen,30),answer:Ec(o.answerText,30)})),i=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:i,correct:e.correct,total:e.total})+(n.length?`
554
+ `+n.join(`
555
+ `):"")}function qj(e,t){const[n,i]=_.useState([]),[o,s]=_.useState(null),l=_.useCallback(async()=>{if(!e||!t){i([]),s(null);return}try{const E=(await me.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]);_.useEffect(()=>{l()},[l]);const c=_.useCallback(async y=>{if(!e||!t)return null;try{const E=await me.threadCreate({...y,courseId:e,focusNodeId:t});return i(T=>[E,...T]),s(E.id),E}catch{return null}},[e,t]),d=_.useCallback(async(y,E)=>{try{const T=await me.threadUpdate(y,E);return T&&(T.status==="archived"?(i(w=>w.filter(M=>M.id!==y)),s(w=>{var N;return w!==y?w:((N=n.filter(L=>L.id!==y)[0])==null?void 0:N.id)??null})):i(w=>w.map(M=>M.id===y?T:M))),T}catch{return null}},[n]),f=_.useCallback(async y=>{try{await me.threadDelete(y),i(E=>E.filter(T=>T.id!==y)),s(E=>{var w;return E!==y?E:((w=n.filter(M=>M.id!==y)[0])==null?void 0:w.id)??null})}catch{}},[n]),p=_.useCallback(y=>{const E=n.find(T=>T.id===y)??null;return E?(i(T=>T.filter(w=>w.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]),x=_.useCallback(y=>{i(E=>[y,...E.filter(T=>T.id!==y.id)]),s(y.id)},[]),b=_.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]),g=n.find(y=>y.id===o)??null;return{threads:n,activeId:o,activeThread:g,setActiveId:s,reload:l,create:c,update:d,remove:f,removeWithUndo:p,restore:x,ensureThreadForSend:b}}function Yj({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:i,onCreate:o,onRename:s,onArchive:l,onDelete:c}){const d=Ve(),[f,p]=_.useState(null),[x,b]=_.useState(null),[g,y]=_.useState(null),[E,T]=_.useState(""),[w,M]=_.useState(null),N=_.useRef(null);_.useEffect(()=>{const I=R=>{N.current&&!N.current.contains(R.target)&&(p(null),b(null))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const L=(I,R)=>{I.stopPropagation();const j=I.currentTarget.getBoundingClientRect(),D=Math.max(8,j.right-128),P=j.bottom+4;b({top:P,left:D}),p(f===R?null:R)},A=I=>{y(I.id),T(I.title??""),p(null),b(null)},C=()=>{g&&E.trim()&&s(g,E.trim()),y(null)};return e.length===0?m.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:[m.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),m.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??d("thread.empty.no_node")}),m.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:d("thread.empty.hint")})]}):m.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[m.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(I=>{const R=I.id===(t==null?void 0:t.id),j=g===I.id;return m.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 ${R?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!j&&i(I.id),"data-testid":`thread-tab-${I.id.slice(0,8)}`,children:[m.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${R?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),j?m.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"}):m.jsx("span",{className:`text-label max-w-[120px] truncate ${R?"font-semibold":"font-normal"}`,"data-tooltip":I.title||d("toast.threadDefault"),children:I.title||d("toast.threadDefault")}),!j&&m.jsx("button",{onClick:D=>L(D,I.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-${I.id.slice(0,8)}`,title:d("thread.actions.label"),"aria-label":d("thread.actions.label"),children:m.jsx(Vc,{className:"w-3 h-3"})})]},I.id)}),m.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:m.jsx(cd,{className:"w-3.5 h-3.5"})})]}),f&&x&&(()=>{const I=e.find(R=>R.id===f);return I?m.jsxs("div",{ref:N,style:{position:"fixed",top:x.top,left:x.left},className:"z-50 w-32 bg-surface-0 rounded-lg shadow-pop py-1 border border-[var(--border-faint)]","data-testid":`thread-menu-${I.id.slice(0,8)}`,onClick:R=>R.stopPropagation(),children:[m.jsxs("button",{onClick:()=>A(I),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:[m.jsx(VC,{className:"w-3 h-3"}),d("thread.menu.rename")]}),m.jsxs("button",{onClick:()=>{l(I.id),p(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:[m.jsx(oC,{className:"w-3 h-3"}),d("thread.menu.archive")]}),m.jsxs("button",{onClick:R=>{const j=R.currentTarget.getBoundingClientRect();M({id:I.id,title:I.title??d("toast.threadDefault"),rect:j}),p(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:[m.jsx(o0,{className:"w-3 h-3"}),d("action.delete")]})]}):null})(),w&&m.jsx(dd,{anchorRect:w.rect,message:d("thread.delete.confirm",{name:w.title}),danger:!0,confirmLabel:d("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{c(w.id),M(null)},onCancel:()=>M(null)})]})}const Gj=1240,Xj=920;function Kj(e){return e>=Gj?1:e>=Xj?2:3}function Qj(e){return e==="rail"?"rail":"notebook"}function $j(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 Wj(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function Zj(){return Kj(typeof window>"u"?Jj:window.innerWidth)}const Jj=99999;function e9(){return _.useSyncExternalStore(Wj,Zj,()=>1)}const Pp=_.createContext({});function Bp(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const t9=typeof window<"u",Jc=t9?_.useLayoutEffect:_.useEffect,Nd=_.createContext(null);function zp(e,t){e.indexOf(t)===-1&&e.push(t)}function ed(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 _d=()=>{};const zi={},JS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ek=e=>typeof e=="object"&&e!==null,tk=e=>/^0[^.\s]+$/u.test(e);function nk(e){let t;return()=>(t===void 0&&(t=e()),t)}const oa=e=>e,Fl=(...e)=>e.reduce((t,n)=>i=>n(t(i))),Cl=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class Up{constructor(){this.subscriptions=[]}add(t){return zp(this.subscriptions,t),()=>ed(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,ak=(e,t)=>t?e*(1e3/t):0,ik=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,n9=1e-7,a9=12;function i9(e,t,n,i,o){let s,l,c=0;do l=t+(n-t)/2,s=ik(l,i,o)-e,s>0?n=l:t=l;while(Math.abs(s)>n9&&++c<a9);return l}function Vl(e,t,n,i){if(e===t&&n===i)return oa;const o=s=>i9(s,0,1,e,n);return s=>s===0||s===1?s:ik(o(s),t,i)}const rk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,sk=e=>t=>1-e(1-t),ok=Vl(.33,1.53,.69,.99),Hp=sk(ok),lk=rk(Hp),uk=e=>e>=1?1:(e*=2)<1?.5*Hp(e):.5*(2-Math.pow(2,-10*(e-1))),Fp=e=>1-Math.sin(Math.acos(e)),ck=sk(Fp),dk=rk(Fp),r9=Vl(.42,0,1,1),s9=Vl(0,0,.58,1),fk=Vl(.42,0,.58,1),o9=e=>Array.isArray(e)&&typeof e[0]!="number",hk=e=>Array.isArray(e)&&typeof e[0]=="number",l9={linear:oa,easeIn:r9,easeInOut:fk,easeOut:s9,circIn:Fp,circInOut:dk,circOut:ck,backIn:Hp,backInOut:lk,backOut:ok,anticipate:uk},u9=e=>typeof e=="string",Qv=e=>{if(hk(e)){_d(e.length===4);const[t,n,i,o]=e;return Vl(t,n,i,o)}else if(u9(e))return l9[e];return e},Tc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function c9(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(f){s.has(f)&&(d.schedule(f),e()),f(l)}const d={schedule:(f,p=!1,x=!1)=>{const g=x&&i?t:n;return p&&s.add(f),g.add(f),f},cancel:f=>{n.delete(f),s.delete(f)},process:f=>{if(l=f,i){o=!0;return}i=!0;const p=t;t=n,n=p,t.forEach(c),t.clear(),i=!1,o&&(o=!1,d.process(f))}};return d}const d9=40;function mk(e,t){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=Tc.reduce((N,L)=>(N[L]=c9(s),N),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:p,update:x,preRender:b,render:g,postRender:y}=l,E=()=>{const N=zi.useManualTiming,L=N?o.timestamp:performance.now();n=!1,N||(o.delta=i?1e3/60:Math.max(Math.min(L-o.timestamp,d9),1)),o.timestamp=L,o.isProcessing=!0,c.process(o),d.process(o),f.process(o),p.process(o),x.process(o),b.process(o),g.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:Tc.reduce((N,L)=>{const A=l[L];return N[L]=(C,I=!1,R=!1)=>(n||T(),A.schedule(C,I,R)),N},{}),cancel:N=>{for(let L=0;L<Tc.length;L++)l[Tc[L]].cancel(N)},state:o,steps:l}}const{schedule:Mt,cancel:Ui,state:hn,steps:Fm}=mk(typeof requestAnimationFrame<"u"?requestAnimationFrame:oa,!0);let Lc;function f9(){Lc=void 0}const En={now:()=>(Lc===void 0&&En.set(hn.isProcessing||zi.useManualTiming?hn.timestamp:performance.now()),Lc),set:e=>{Lc=e,queueMicrotask(f9)}},pk=e=>t=>typeof t=="string"&&t.startsWith(e),gk=pk("--"),h9=pk("var(--"),Vp=e=>h9(e)?m9.test(e.split("/*")[0].trim()):!1,m9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $v(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Gs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Nl={...Gs,transform:e=>Ra(0,1,e)},Sc={...Gs,default:1},xl=e=>Math.round(e*1e5)/1e5,qp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function p9(e){return e==null}const g9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yp=(e,t)=>n=>!!(typeof n=="string"&&g9.test(n)&&n.startsWith(e)||t&&!p9(n)&&Object.prototype.hasOwnProperty.call(n,t)),xk=(e,t,n)=>i=>{if(typeof i!="string")return i;const[o,s,l,c]=i.match(qp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},x9=e=>Ra(0,255,e),Vm={...Gs,transform:e=>Math.round(x9(e))},kr={test:Yp("rgb","red"),parse:xk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Vm.transform(e)+", "+Vm.transform(t)+", "+Vm.transform(n)+", "+xl(Nl.transform(i))+")"};function b9(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 R0={test:Yp("#"),parse:b9,transform:kr.transform},ql=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ei=ql("deg"),Ma=ql("%"),Ie=ql("px"),y9=ql("vh"),v9=ql("vw"),Wv={...Ma,parse:e=>Ma.parse(e)/100,transform:e=>Ma.transform(e*100)},_s={test:Yp("hsl","hue"),parse:xk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Ma.transform(xl(t))+", "+Ma.transform(xl(n))+", "+xl(Nl.transform(i))+")"},Jt={test:e=>kr.test(e)||R0.test(e)||_s.test(e),parse:e=>kr.test(e)?kr.parse(e):_s.test(e)?_s.parse(e):R0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kr.transform(e):_s.transform(e),getAnimatableNone:e=>{const t=Jt.parse(e);return t.alpha=0,Jt.transform(t)}},E9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function T9(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qp))==null?void 0:t.length)||0)+(((n=e.match(E9))==null?void 0:n.length)||0)>0}const bk="number",yk="color",S9="var",k9="var(",Zv="${}",w9=/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 Bs(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const c=t.replace(w9,d=>(Jt.test(d)?(i.color.push(s),o.push(yk),n.push(Jt.parse(d))):d.startsWith(k9)?(i.var.push(s),o.push(S9),n.push(d)):(i.number.push(s),o.push(bk),n.push(parseFloat(d))),++s,Zv)).split(Zv);return{values:n,split:c,indexes:i,types:o}}function A9(e){return Bs(e).values}function vk({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===bk?o+=xl(i[s]):l===yk?o+=Jt.transform(i[s]):o+=i[s]}return o}}function C9(e){return vk(Bs(e))}const N9=e=>typeof e=="number"?0:Jt.test(e)?Jt.getAnimatableNone(e):e,_9=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:N9(e);function M9(e){const t=Bs(e);return vk(t)(t.values.map((i,o)=>_9(i,t.split[o])))}const ba={test:T9,parse:A9,createTransformer:C9,getAnimatableNone:M9};function qm(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 R9({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=qm(d,c,e+1/3),s=qm(d,c,e),l=qm(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:i}}function td(e,t){return n=>n>0?t:e}const _t=(e,t,n)=>e+(t-e)*n,Ym=(e,t,n)=>{const i=e*e,o=n*(t*t-i)+i;return o<0?0:Math.sqrt(o)},D9=[R0,kr,_s],L9=e=>D9.find(t=>t.test(e));function Jv(e){const t=L9(e);if(!t)return!1;let n=t.parse(e);return t===_s&&(n=R9(n)),n}const e2=(e,t)=>{const n=Jv(e),i=Jv(t);if(!n||!i)return td(e,t);const o={...n};return s=>(o.red=Ym(n.red,i.red,s),o.green=Ym(n.green,i.green,s),o.blue=Ym(n.blue,i.blue,s),o.alpha=_t(n.alpha,i.alpha,s),kr.transform(o))},D0=new Set(["none","hidden"]);function O9(e,t){return D0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function I9(e,t){return n=>_t(e,t,n)}function Gp(e){return typeof e=="number"?I9:typeof e=="string"?Vp(e)?td:Jt.test(e)?e2:B9:Array.isArray(e)?Ek:typeof e=="object"?Jt.test(e)?e2:j9:td}function Ek(e,t){const n=[...e],i=n.length,o=e.map((s,l)=>Gp(s)(s,t[l]));return s=>{for(let l=0;l<i;l++)n[l]=o[l](s);return n}}function j9(e,t){const n={...e,...t},i={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(i[o]=Gp(e[o])(e[o],t[o]));return o=>{for(const s in i)n[s]=i[s](o);return n}}function P9(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 B9=(e,t)=>{const n=ba.createTransformer(t),i=Bs(e),o=Bs(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?D0.has(e)&&!o.values.length||D0.has(t)&&!i.values.length?O9(e,t):Fl(Ek(P9(i,o),o.values),n):td(e,t)};function Tk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):Gp(e)(e,t)}const z9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mt.update(t,n),stop:()=>Ui(t),now:()=>hn.isProcessing?hn.timestamp:En.now()}},Sk=(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)})`},nd=2e4;function Xp(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<nd;)t+=n,i=e.next(t);return t>=nd?1/0:t}function U9(e,t=100,n){const i=n({...e,keyframes:[0,t]}),o=Math.min(Xp(i),nd);return{type:"keyframes",ease:s=>i.next(o*s).value/t,duration:sa(o)}}const Ft={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 L0(e,t){return e*Math.sqrt(1-t*t)}const H9=12;function F9(e,t,n){let i=n;for(let o=1;o<H9;o++)i=i-e(i)/t(i);return i}const Gm=.001;function V9({duration:e=Ft.duration,bounce:t=Ft.bounce,velocity:n=Ft.velocity,mass:i=Ft.mass}){let o,s,l=1-t;l=Ra(Ft.minDamping,Ft.maxDamping,l),e=Ra(Ft.minDuration,Ft.maxDuration,sa(e)),l<1?(o=f=>{const p=f*l,x=p*e,b=p-n,g=L0(f,l),y=Math.exp(-x);return Gm-b/g*y},s=f=>{const x=f*l*e,b=x*n+n,g=Math.pow(l,2)*Math.pow(f,2)*e,y=Math.exp(-x),E=L0(Math.pow(f,2),l);return(-o(f)+Gm>0?-1:1)*((b-g)*y)/E}):(o=f=>{const p=Math.exp(-f*e),x=(f-n)*e+1;return-Gm+p*x},s=f=>{const p=Math.exp(-f*e),x=(n-f)*(e*e);return p*x});const c=5/e,d=F9(o,s,c);if(e=qn(e),isNaN(d))return{stiffness:Ft.stiffness,damping:Ft.damping,duration:e};{const f=Math.pow(d,2)*i;return{stiffness:f,damping:l*2*Math.sqrt(i*f),duration:e}}}const q9=["duration","bounce"],Y9=["stiffness","damping","mass"];function t2(e,t){return t.some(n=>e[n]!==void 0)}function G9(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!t2(e,Y9)&&t2(e,q9))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:Ft.mass,stiffness:o,damping:s}}else{const n=V9({...e,velocity:0});t={...t,...n,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function ad(e=Ft.visualDuration,t=Ft.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:f,mass:p,duration:x,velocity:b,isResolvedFromDuration:g}=G9({...n,velocity:-sa(n.velocity||0)}),y=b||0,E=f/(2*Math.sqrt(d*p)),T=l-s,w=sa(Math.sqrt(d/p)),M=Math.abs(T)<5;i||(i=M?Ft.restSpeed.granular:Ft.restSpeed.default),o||(o=M?Ft.restDelta.granular:Ft.restDelta.default);let N,L,A,C,I,R;if(E<1)A=L0(w,E),C=(y+E*w*T)/A,N=D=>{const P=Math.exp(-E*w*D);return l-P*(C*Math.sin(A*D)+T*Math.cos(A*D))},I=E*w*C+T*A,R=E*w*T-C*A,L=D=>Math.exp(-E*w*D)*(I*Math.sin(A*D)+R*Math.cos(A*D));else if(E===1){N=P=>l-Math.exp(-w*P)*(T+(y+w*T)*P);const D=y+w*T;L=P=>Math.exp(-w*P)*(w*D*P-y)}else{const D=w*Math.sqrt(E*E-1);N=q=>{const z=Math.exp(-E*w*q),H=Math.min(D*q,300);return l-z*((y+E*w*T)*Math.sinh(H)+D*T*Math.cosh(H))/D};const P=(y+E*w*T)/D,B=E*w*P-T*D,Q=E*w*T-P*D;L=q=>{const z=Math.exp(-E*w*q),H=Math.min(D*q,300);return z*(B*Math.sinh(H)+Q*Math.cosh(H))}}const j={calculatedDuration:g&&x||null,velocity:D=>qn(L(D)),next:D=>{if(!g&&E<1){const B=Math.exp(-E*w*D),Q=Math.sin(A*D),q=Math.cos(A*D),z=l-B*(C*Q+T*q),H=qn(B*(I*Q+R*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(g)c.done=D>=x;else{const B=qn(L(D));c.done=Math.abs(B)<=i&&Math.abs(l-P)<=o}return c.value=c.done?l:P,c},toString:()=>{const D=Math.min(Xp(j),nd),P=Sk(B=>j.next(D*B).value,D,30);return D+"ms "+P},toTransition:()=>{}};return j}ad.applyToOptions=e=>{const t=U9(e,100,ad);return e.ease=t.ease,e.duration=qn(t.duration),e.type="keyframes",e};const X9=5;function kk(e,t,n){const i=Math.max(t-X9,0);return ak(n-e(i),t-i)}function O0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:p}){const x=e[0],b={done:!1,value:x},g=R=>c!==void 0&&R<c||d!==void 0&&R>d,y=R=>c===void 0?d:d===void 0||Math.abs(c-R)<Math.abs(d-R)?c:d;let E=n*t;const T=x+E,w=l===void 0?T:l(T);w!==T&&(E=w-x);const M=R=>-E*Math.exp(-R/i),N=R=>w+M(R),L=R=>{const j=M(R),D=N(R);b.done=Math.abs(j)<=f,b.value=b.done?w:D};let A,C;const I=R=>{g(b.value)&&(A=R,C=ad({keyframes:[b.value,y(b.value)],velocity:kk(N,R,b.value),damping:o,stiffness:s,restDelta:f,restSpeed:p}))};return I(0),{calculatedDuration:null,next:R=>{let j=!1;return!C&&A===void 0&&(j=!0,L(R),I(R)),A!==void 0&&R>=A?C.next(R-A):(!j&&L(R),b)}}}function K9(e,t,n){const i=[],o=n||zi.mix||Tk,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=Fl(d,c)}i.push(c)}return i}function Q9(e,t,{clamp:n=!0,ease:i,mixer:o}={}){const s=e.length;if(_d(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=K9(t,i,o),d=c.length,f=p=>{if(l&&p<e[0])return t[0];let x=0;if(d>1)for(;x<e.length-2&&!(p<e[x+1]);x++);const b=Cl(e[x],e[x+1],p);return c[x](b)};return n?p=>f(Ra(e[0],e[s-1],p)):f}function $9(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const o=Cl(0,t,i);e.push(_t(n,1,o))}}function W9(e){const t=[0];return $9(t,e.length-1),t}function Z9(e,t){return e.map(n=>n*t)}function J9(e,t){return e.map(()=>t||fk).splice(0,e.length-1)}function bl({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const o=o9(i)?i.map(Qv):Qv(i),s={done:!1,value:t[0]},l=Z9(n&&n.length===t.length?n:W9(t),e),c=Q9(l,t,{ease:Array.isArray(o)?o:J9(t,o)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const eP=e=>e!==null;function Md(e,{repeat:t,repeatType:n="loop"},i,o=1){const s=e.filter(eP),c=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||i===void 0?s[c]:i}const tP={decay:O0,inertia:O0,tween:bl,keyframes:bl,spring:ad};function wk(e){typeof e.type=="string"&&(e.type=tP[e.type])}class Kp{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 nP=e=>e/100;class id extends Kp{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!==En.now()&&this.tick(En.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;wk(t);const{type:n=bl,repeat:i=0,repeatDelay:o=0,repeatType:s,velocity:l=0}=t;let{keyframes:c}=t;const d=n||bl;d!==bl&&typeof c[0]!="number"&&(this.mixKeyframes=Fl(nP,Tk(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=Xp(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(i+1)-o,this.generator=f}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:f=0,keyframes:p,repeat:x,repeatType:b,repeatDelay:g,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 w=this.currentTime-f*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?w<0:w>o;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let N=this.currentTime,L=i;if(x){const R=Math.min(this.currentTime,o)/c;let j=Math.floor(R),D=R%1;!D&&R>=1&&(D=1),D===1&&j--,j=Math.min(j,x+1),!!(j%2)&&(b==="reverse"?(D=1-D,g&&(D-=g/c)):b==="mirror"&&(L=l)),N=Ra(0,1,D)*c}let A;M?(this.delayState.value=p[0],A=this.delayState):A=L.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 I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return I&&y!==O0&&(A.value=Md(p,this.options,T,this.speed)),E&&E(A.value),I&&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 kk(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(En.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=sa(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=z9,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(En.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 aP(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const wr=e=>e*180/Math.PI,I0=e=>{const t=wr(Math.atan2(e[1],e[0]));return j0(t)},iP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:I0,rotateZ:I0,skewX:e=>wr(Math.atan(e[1])),skewY:e=>wr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},j0=e=>(e=e%360,e<0&&(e+=360),e),n2=I0,a2=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),i2=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),rP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:a2,scaleY:i2,scale:e=>(a2(e)+i2(e))/2,rotateX:e=>j0(wr(Math.atan2(e[6],e[5]))),rotateY:e=>j0(wr(Math.atan2(-e[2],e[0]))),rotateZ:n2,rotate:n2,skewX:e=>wr(Math.atan(e[4])),skewY:e=>wr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function P0(e){return e.includes("scale")?1:0}function B0(e,t){if(!e||e==="none")return P0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=rP,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=iP,o=c}if(!o)return P0(t);const s=i[t],l=o[1].split(",").map(oP);return typeof s=="function"?s(l):l[s]}const sP=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return B0(n,t)};function oP(e){return parseFloat(e.trim())}const Xs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ks=new Set([...Xs,"pathRotation"]),r2=e=>e===Gs||e===Ie,lP=new Set(["x","y","z"]),uP=Xs.filter(e=>!lP.has(e));function cP(e){const t=[];return uP.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})=>B0(t,"x"),y:(e,{transform:t})=>B0(t,"y")};Bi.translateX=Bi.x;Bi.translateY=Bi.y;const Rr=new Set;let z0=!1,U0=!1,H0=!1;function Ak(){if(U0){const e=Array.from(Rr).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const o=cP(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,z0=!1,Rr.forEach(e=>e.complete(H0)),Rr.clear()}function Ck(){Rr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(U0=!0)})}function dP(){H0=!0,Ck(),Ak(),H0=!1}class Qp{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?(Rr.add(this),z0||(z0=!0,Mt.read(Ck),Mt.resolveKeyframes(Ak))):(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])}aP(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Rr.delete(this)}cancel(){this.state==="scheduled"&&(Rr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fP=e=>e.startsWith("--");function Nk(e,t,n){fP(t)?e.style.setProperty(t,n):e.style[t]=n}const hP={};function _k(e,t){const n=nk(e);return()=>hP[t]??n()}const mP=_k(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Mk=_k(()=>{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})`,s2={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 Rk(e,t){if(e)return typeof e=="function"?Mk()?Sk(e,t):"ease-out":hk(e)?rl(e):Array.isArray(e)?e.map(n=>Rk(n,t)||s2.easeOut):s2[e]}function pP(e,t,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const p={[t]:n};d&&(p.offset=d);const x=Rk(c,o);Array.isArray(x)&&(p.easing=x);const b={delay:i,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"};return f&&(b.pseudoElement=f),e.animate(p,b)}function Dk(e){return typeof e=="function"&&"applyToOptions"in e}function gP({type:e,...t}){return Dk(e)&&Mk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Lk extends Kp{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,_d(typeof t.type!="string");const f=gP(t);this.animation=pP(n,i,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const p=Md(o,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(p),Nk(n,i,p),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&&mP()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),oa):o(this)}}const Ok={anticipate:uk,backInOut:lk,circInOut:dk};function xP(e){return e in Ok}function bP(e){typeof e.ease=="string"&&xP(e.ease)&&(e.ease=Ok[e.ease])}const Xm=10;class yP extends Lk{constructor(t){bP(t),wk(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 id({...l,autoplay:!1}),d=Math.max(Xm,En.now()-this.startTime),f=Ra(0,Xm,d-Xm),p=c.sample(d).value,{name:x}=this.options;s&&x&&Nk(s,x,p),n.setWithVelocity(c.sample(Math.max(0,d-f)).value,p,f),c.stop()}}const o2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ba.test(e)||e==="0")&&!e.startsWith("url("));function vP(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 EP(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=o2(o,t),c=o2(s,t);return!l||!c?!1:vP(e)||(n==="spring"||Dk(n))&&i}function F0(e){e.duration=0,e.type="keyframes"}const Ik=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),TP=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function SP(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&TP.test(e[t]))return!0;return!1}const kP=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),wP=nk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function AP(e){var x;const{motionValue:t,name:n,repeatDelay:i,repeatType:o,damping:s,type:l,keyframes:c}=e,d=(x=t==null?void 0:t.owner)==null?void 0:x.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:f,transformTemplate:p}=t.owner.getProps();return wP()&&n&&(Ik.has(n)||kP.has(n)&&SP(c))&&(n!=="transform"||!p)&&!f&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}const CP=40;class NP extends Kp{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:p,...x}){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=En.now();const b={autoplay:t,delay:n,type:i,repeat:o,repeatDelay:s,repeatType:l,name:d,motionValue:f,element:p,...x},g=(p==null?void 0:p.KeyframeResolver)||Qp;this.keyframeResolver=new g(c,(E,T,w)=>this.onKeyframesResolved(E,T,b,!w),d,f,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,i,o){var w,M;this.keyframeResolver=void 0;const{name:s,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:p}=i;this.resolvedAt=En.now();let x=!0;EP(t,s,l,c)||(x=!1,(zi.instantAnimations||!d)&&(p==null||p(Md(t,i,n))),t[0]=t[t.length-1],F0(i),i.repeat=0);const g={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>CP?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},y=x&&!f&&AP(g),E=(M=(w=g.motionValue)==null?void 0:w.owner)==null?void 0:M.current;let T;if(y)try{T=new yP({...g,element:E})}catch{T=new id(g)}else T=new id(g);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(),dP()),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 jk(e,t,n,i=0,o=1){const s=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*i;return typeof n=="function"?n(s,l):o===1?s*i:c-s*i}const l2=30,_P=e=>!isNaN(parseFloat(e));class MP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const o=En.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=En.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_P(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 Up);const i=this.events[t].add(n);return t==="change"?()=>{i(),Mt.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=En.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>l2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,l2);return ak(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 zs(e,t){return new MP(e,t)}function Pk(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function $p(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Pk(n,e):n}const RP={type:"spring",stiffness:500,damping:25,restSpeed:10},DP=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),LP={type:"keyframes",duration:.8},OP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IP=(e,{keyframes:t})=>t.length>2?LP:Ks.has(e)?e.startsWith("scale")?DP(t[1]):RP:OP,jP=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function PP(e){for(const t in e)if(!jP.has(t))return!0;return!1}const Wp=(e,t,n,i={},o,s)=>l=>{const c=$p(i,e)||{},d=c.delay||i.delay||0;let{elapsed:f=0}=i;f=f-qn(d);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,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};PP(c)||Object.assign(p,IP(e,p)),p.duration&&(p.duration=qn(p.duration)),p.repeatDelay&&(p.repeatDelay=qn(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let x=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(F0(p),p.delay===0&&(x=!0)),(zi.instantAnimations||zi.skipAnimations||o!=null&&o.shouldSkipAnimations||c.skipAnimations)&&(x=!0,F0(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,x&&!s&&t.get()!==void 0){const b=Md(p.keyframes,c);if(b!==void 0){Mt.update(()=>{p.onUpdate(b),p.onComplete()});return}}return c.isSync?new id(p):new NP(p)},BP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zP(e){const t=BP.exec(e);if(!t)return[,];const[,n,i,o]=t;return[`--${n??i}`,o]}function Bk(e,t,n=1){const[i,o]=zP(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const l=s.trim();return JS(l)?parseFloat(l):l}return Vp(o)?Bk(o,t,n+1):o}function u2(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Zp(e,t,n,i){if(typeof t=="function"){const[o,s]=u2(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]=u2(i);t=t(n!==void 0?n:e.custom,o,s)}return t}function Dr(e,t,n){const i=e.getProps();return Zp(i,t,n!==void 0?n:i.custom,e)}const zk=new Set(["width","height","top","left","right","bottom",...Xs]),V0=e=>Array.isArray(e);function UP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zs(n))}function HP(e){return V0(e)?e[e.length-1]||0:e}function FP(e,t){const n=Dr(e,t);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const l in s){const c=HP(s[l]);UP(e,l,c)}}const mn=e=>!!(e&&e.getVelocity);function VP(e){return!!(mn(e)&&e.add)}function q0(e,t){const n=e.getValue("willChange");if(VP(n))return n.add(t);if(!n&&zi.WillChange){const i=new zi.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Jp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const qP="framerAppearId",Uk="data-"+Jp(qP);function Hk(e){return e.props[Uk]}function YP({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Fk(e,t,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();s=s?Pk(s,d):d;const f=s==null?void 0:s.reduceMotion,p=s==null?void 0:s.skipAnimations;i&&(s=i);const x=[],b=o&&e.animationState&&e.animationState.getState()[o],g=s==null?void 0:s.path;g&&g.animateVisualElement(e,c,s,n,x);for(const y in c){const E=e.getValue(y,e.latestValues[y]??null),T=c[y];if(T===void 0||b&&YP(b,y))continue;const w={delay:n,...$p(s||{},y)};p&&(w.skipAnimations=!0);const M=E.get();if(M!==void 0&&!E.isAnimating()&&!Array.isArray(T)&&T===M&&!w.velocity){Mt.update(()=>E.set(T));continue}let N=!1;if(window.MotionHandoffAnimation){const C=Hk(e);if(C){const I=window.MotionHandoffAnimation(C,y,Mt);I!==null&&(w.startTime=I,N=!0)}}q0(e,y);const L=f??e.shouldReduceMotion;E.start(Wp(y,E,T,L&&zk.has(y)?{type:!1}:w,e,N));const A=E.animation;A&&x.push(A)}if(l){const y=()=>Mt.update(()=>{l&&FP(e,l)});x.length?Promise.all(x).then(y):y()}return x}function Y0(e,t,n={}){var d;const i=Dr(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(Fk(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:p=0,staggerChildren:x,staggerDirection:b}=o;return GP(e,t,f,p,x,b,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[f,p]=c==="beforeChildren"?[s,l]:[l,s];return f().then(()=>p())}else return Promise.all([s(),l(n.delay)])}function GP(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(Y0(d,t,{...l,delay:n+(typeof i=="function"?0:i)+jk(e.variantChildren,d,i,o,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function XP(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const o=t.map(s=>Y0(e,s,n));i=Promise.all(o)}else if(typeof t=="string")i=Y0(e,t,n);else{const o=typeof t=="function"?Dr(e,t,n.custom):t;i=Promise.all(Fk(e,o,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const KP={test:e=>e==="auto",parse:e=>e},Vk=e=>t=>t.test(e),qk=[Gs,Ie,Ma,ei,v9,y9,KP],c2=e=>qk.find(Vk(e));function QP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||tk(e):!0}const $P=new Set(["brightness","contrast","saturate","opacity"]);function WP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(qp)||[];if(!i)return e;const o=n.replace(i,"");let s=$P.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+o+")"}const ZP=/\b([a-z-]*)\(.*?\)/gu,G0={...ba,getAnimatableNone:e=>{const t=e.match(ZP);return t?t.map(WP).join(" "):e}},X0={...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))}},d2={...Gs,transform:Math.round},JP={rotate:ei,pathRotation:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:Sc,scaleX:Sc,scaleY:Sc,scaleZ:Sc,skew:ei,skewX:ei,skewY:ei,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:Nl,originX:Wv,originY:Wv,originZ:Ie},rd={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,inset:Ie,insetBlock:Ie,insetBlockStart:Ie,insetBlockEnd:Ie,insetInline:Ie,insetInlineStart:Ie,insetInlineEnd:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,paddingBlock:Ie,paddingBlockStart:Ie,paddingBlockEnd:Ie,paddingInline:Ie,paddingInlineStart:Ie,paddingInlineEnd:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,marginBlock:Ie,marginBlockStart:Ie,marginBlockEnd:Ie,marginInline:Ie,marginInlineStart:Ie,marginInlineEnd:Ie,fontSize:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie,...JP,zIndex:d2,fillOpacity:Nl,strokeOpacity:Nl,numOctaves:d2},e7={...rd,color:Jt,backgroundColor:Jt,outlineColor:Jt,fill:Jt,stroke:Jt,borderColor:Jt,borderTopColor:Jt,borderRightColor:Jt,borderBottomColor:Jt,borderLeftColor:Jt,filter:G0,WebkitFilter:G0,mask:X0,WebkitMask:X0},Yk=e=>e7[e],t7=new Set([G0,X0]);function Gk(e,t){let n=Yk(e);return t7.has(n)||(n=ba),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const n7=new Set(["auto","none","0"]);function a7(e,t,n){let i=0,o;for(;i<e.length&&!o;){const s=e[i];typeof s=="string"&&!n7.has(s)&&Bs(s).values.length&&(o=e[i]),i++}if(o&&n)for(const s of t)e[s]=Gk(n,o)}class i7 extends Qp{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 p=0;p<t.length;p++){let x=t[p];if(typeof x=="string"&&(x=x.trim(),Vp(x))){const b=Bk(x,n.current);b!==void 0&&(t[p]=b),p===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!zk.has(i)||t.length!==2)return;const[o,s]=t,l=c2(o),c=c2(s),d=$v(o),f=$v(s);if(d!==f&&Bi[i]){this.needsMeasurement=!0;return}if(l!==c)if(r2(l)&&r2(c))for(let p=0;p<t.length;p++){const x=t[p];typeof x=="string"&&(t[p]=parseFloat(x))}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||QP(t[o]))&&i.push(o);i.length&&a7(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,f])=>{t.getValue(d).set(f)}),this.resolveNoneKeyframes()}}const eg=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Xk(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 K0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Oc(e){return ek(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:tg}=mk(queueMicrotask,!1),pa={x:!1,y:!1};function Kk(){return pa.x||pa.y}function r7(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 Qk(e,t){const n=Xk(e),i=new AbortController,o={passive:!0,...t,signal:i.signal};return[n,o,()=>i.abort()]}function s7(e){return!(e.pointerType==="touch"||Kk())}function o7(e,t,n={}){const[i,o,s]=Qk(e,n);return i.forEach(l=>{let c=!1,d=!1,f;const p=()=>{l.removeEventListener("pointerleave",y)},x=T=>{f&&(f(T),f=void 0),p()},b=T=>{c=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),d&&(d=!1,x(T))},g=()=>{c=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},y=T=>{if(T.pointerType!=="touch"){if(c){d=!0;return}x(T)}},E=T=>{if(!s7(T))return;d=!1;const w=t(l,T);typeof w=="function"&&(f=w,l.addEventListener("pointerleave",y,o))};l.addEventListener("pointerenter",E,o),l.addEventListener("pointerdown",g,o)}),s}const $k=(e,t)=>t?e===t?!0:$k(e,t.parentElement):!1,ng=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,l7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function u7(e){return l7.has(e.tagName)||e.isContentEditable===!0}const c7=new Set(["INPUT","SELECT","TEXTAREA"]);function d7(e){return c7.has(e.tagName)||e.isContentEditable===!0}const Ic=new WeakSet;function f2(e){return t=>{t.key==="Enter"&&e(t)}}function Km(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const f7=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=f2(()=>{if(Ic.has(n))return;Km(n,"down");const o=f2(()=>{Km(n,"up")}),s=()=>Km(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 h2(e){return ng(e)&&!Kk()}const m2=new WeakSet;function h7(e,t,n={}){const[i,o,s]=Qk(e,n),l=c=>{const d=c.currentTarget;if(!h2(c)||m2.has(c))return;Ic.add(d),n.stopPropagation&&m2.add(c);const f=t(d,c),p={...o,capture:!0},x=(y,E)=>{window.removeEventListener("pointerup",b,p),window.removeEventListener("pointercancel",g,p),Ic.has(d)&&Ic.delete(d),h2(y)&&typeof f=="function"&&f(y,{success:E})},b=y=>{x(y,d===window||d===document||n.useGlobalTarget||$k(d,y.target))},g=y=>{x(y,!1)};window.addEventListener("pointerup",b,p),window.addEventListener("pointercancel",g,p)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),Oc(c)&&(c.addEventListener("focus",f=>f7(f,o)),!u7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function ag(e){return ek(e)&&"ownerSVGElement"in e}const jc=new WeakMap;let Ii;const Wk=(e,t,n)=>(i,o)=>o&&o[0]?o[0][e+"Size"]:ag(i)&&"getBBox"in i?i.getBBox()[t]:i[n],m7=Wk("inline","width","offsetWidth"),p7=Wk("block","height","offsetHeight");function g7({target:e,borderBoxSize:t}){var n;(n=jc.get(e))==null||n.forEach(i=>{i(e,{get width(){return m7(e,t)},get height(){return p7(e,t)}})})}function x7(e){e.forEach(g7)}function b7(){typeof ResizeObserver>"u"||(Ii=new ResizeObserver(x7))}function y7(e,t){Ii||b7();const n=Xk(e);return n.forEach(i=>{let o=jc.get(i);o||(o=new Set,jc.set(i,o)),o.add(t),Ii==null||Ii.observe(i)}),()=>{n.forEach(i=>{const o=jc.get(i);o==null||o.delete(t),o!=null&&o.size||Ii==null||Ii.unobserve(i)})}}const Pc=new Set;let Ms;function v7(){Ms=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Pc.forEach(t=>t(e))},window.addEventListener("resize",Ms)}function E7(e){return Pc.add(e),Ms||v7(),()=>{Pc.delete(e),!Pc.size&&typeof Ms=="function"&&(window.removeEventListener("resize",Ms),Ms=void 0)}}function p2(e,t){return typeof e=="function"?E7(e):y7(e,t)}function T7(e){return ag(e)&&e.tagName==="svg"}const S7=[...qk,Jt,ba],k7=e=>S7.find(Vk(e)),g2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rs=()=>({x:g2(),y:g2()}),x2=()=>({min:0,max:0}),nn=()=>({x:x2(),y:x2()}),w7=new WeakMap;function Rd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function _l(e){return typeof e=="string"||Array.isArray(e)}const ig=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rg=["initial",...ig];function Dd(e){return Rd(e.animate)||rg.some(t=>_l(e[t]))}function Zk(e){return!!(Dd(e)||e.variants)}function A7(e,t,n){for(const i in t){const o=t[i],s=n[i];if(mn(o))e.addValue(i,o);else if(mn(s))e.addValue(i,zs(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,zs(l!==void 0?l:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Q0={current:null},Jk={current:!1},C7=typeof window<"u";function N7(){if(Jk.current=!0,!!C7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Q0.current=e.matches;e.addEventListener("change",t),t()}else Q0.current=!1}const b2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sd={};function ew(e){sd=e}function _7(){return sd}class M7{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=Qp,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 g=En.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Mt.render(this.render,!1,!0))};const{latestValues:f,renderState:p}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=p,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=Dd(n),this.isVariantNode=Zk(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in b){const y=b[g];f[g]!==void 0&&mn(y)&&y.set(f[g])}}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,w7.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:(Jk.current||N7(),this.shouldReduceMotion=Q0.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(),Ui(this.notifyUpdate),Ui(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&&Ik.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:f,duration:p}=n.accelerate,x=new Lk({element:this.current,name:t,keyframes:c,times:d,ease:f,duration:qn(p)}),b=l(x);this.valueSubscriptions.set(t,()=>{b(),x.cancel()});return}const i=Ks.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Mt.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 sd){const n=sd[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):nn()}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<b2.length;i++){const o=b2[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=A7(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=zs(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"&&(JS(i)||tk(i))?i=parseFloat(i):!k7(i)&&ba.test(n)&&(i=Gk(t,n)),this.setBaseTarget(t,mn(i)?i.get():i)),mn(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=Zp(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&&!mn(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 Up),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){tg.render(this.render)}}class tw extends M7{constructor(){super(...arguments),this.KeyframeResolver=i7}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;mn(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 nw({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function R7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function D7(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 Qm(e){return e===void 0||e===1}function $0({scale:e,scaleX:t,scaleY:n}){return!Qm(e)||!Qm(t)||!Qm(n)}function vr(e){return $0(e)||aw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aw(e){return y2(e.x)||y2(e.y)}function y2(e){return e&&e!=="0%"}function od(e,t,n){const i=e-n,o=t*i;return n+o}function v2(e,t,n,i,o){return o!==void 0&&(e=od(e,o,i)),od(e,n,i)+t}function W0(e,t=0,n=1,i,o){e.min=v2(e.min,t,n,i,o),e.max=v2(e.max,t,n,i,o)}function iw(e,{x:t,y:n}){W0(e.x,t.translate,t.scale,t.originPoint),W0(e.y,n.translate,n.scale,n.originPoint)}const E2=.999999999999,T2=1.0000000000001;function L7(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:f}=s.options;f&&f.props.style&&f.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,iw(e,l)),i&&vr(s.latestValues)&&Bc(e,s.latestValues,(c=s.layout)==null?void 0:c.layoutBox))}t.x<T2&&t.x>E2&&(t.x=1),t.y<T2&&t.y>E2&&(t.y=1)}function _a(e,t){e.min+=t,e.max+=t}function S2(e,t,n,i,o=.5){const s=_t(e.min,e.max,o);W0(e,t,n,s,i)}function k2(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Bc(e,t,n){const i=n??e;S2(e.x,k2(t.x,i.x),t.scaleX,t.scale,t.originX),S2(e.y,k2(t.y,i.y),t.scaleY,t.scale,t.originY)}function rw(e,t){return nw(D7(e.getBoundingClientRect(),t))}function O7(e,t,n){const i=rw(e,n),{scroll:o}=t;return o&&(_a(i.x,o.offset.x),_a(i.y,o.offset.y)),i}const I7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},j7=Xs.length;function P7(e,t,n){let i="",o=!0;for(let l=0;l<j7;l++){const c=Xs[l],d=e[c];if(d===void 0)continue;let f=!0;if(typeof d=="number")f=d===(c.startsWith("scale")?1:0);else{const p=parseFloat(d);f=c.startsWith("scale")?p===1:p===0}if(!f||n){const p=K0(d,rd[c]);if(!f){o=!1;const x=I7[c]||c;i+=`${x}(${p}) `}n&&(t[c]=p)}}const s=e.pathRotation;return s&&(o=!1,i+=`rotate(${K0(s,rd.pathRotation)}) `),i=i.trim(),n?i=n(t,o?"":i):o&&(i="none"),i}function sg(e,t,n){const{style:i,vars:o,transformOrigin:s}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(Ks.has(d)){l=!0;continue}else if(gk(d)){o[d]=f;continue}else{const p=K0(f,rd[d]);d.startsWith("origin")?(c=!0,s[d]=p):i[d]=p}}if(t.transform||(l||n?i.transform=P7(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=s;i.transformOrigin=`${d} ${f} ${p}`}}function sw(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 w2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const el={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const n=w2(e,t.target.x),i=w2(e,t.target.y);return`${n}% ${i}%`}},B7={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 f=_t(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=f),typeof o[3+l]=="number"&&(o[3+l]/=f),s(o)}},Z0={borderRadius:{...el,applyTo:[...eg]},borderTopLeftRadius:el,borderTopRightRadius:el,borderBottomLeftRadius:el,borderBottomRightRadius:el,boxShadow:B7};function ow(e,{layout:t,layoutId:n}){return Ks.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Z0[e]||e==="opacity")}function og(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)(mn(i[c])||o&&mn(o[c])||ow(c,e)||((l=n==null?void 0:n.getValue(c))==null?void 0:l.liveStyle)!==void 0)&&(s[c]=i[c]);return s}function z7(e){return window.getComputedStyle(e)}class U7 extends tw{constructor(){super(...arguments),this.type="html",this.renderInstance=sw}mount(t){_d(!!t.style),super.mount(t)}readValueFromInstance(t,n){var i;if(Ks.has(n))return(i=this.projection)!=null&&i.isProjecting?P0(n):sP(t,n);{const o=z7(t),s=(gk(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rw(t,n)}build(t,n,i){sg(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return og(t,n,i)}}const H7={offset:"stroke-dashoffset",array:"stroke-dasharray"},F7={offset:"strokeDashoffset",array:"strokeDasharray"};function V7(e,t,n=1,i=0,o=!0){e.pathLength=1;const s=o?H7:F7;e[s.offset]=`${-i}`,e[s.array]=`${t} ${n}`}const lw=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function uw(e,{attrX:t,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...c},d,f,p){if(sg(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:b}=e;for(const g of lw)x[g]!==void 0&&(b[g]=x[g],delete x[g]);(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete x.transformBox),t!==void 0&&(x.x=t),n!==void 0&&(x.y=n),i!==void 0&&(x.scale=i),o!==void 0&&V7(x,o,s,l,!1)}const cw=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"]),dw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function q7(e,t,n,i){sw(e,t,void 0,i);for(const o in t.attrs)e.setAttribute(cw.has(o)?o:Jp(o),t.attrs[o])}function fw(e,t,n){const i=og(e,t,n);for(const o in e)if(mn(e[o])||mn(t[o])){const s=Xs.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;i[s]=e[o]}return i}class Y7 extends tw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=nn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ks.has(n)){const i=Yk(n);return i&&i.default||0}if(lw.includes(n)){const o=getComputedStyle(t)[n];if(typeof o=="string"&&o)return o.trim()}return n=cw.has(n)?n:Jp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return fw(t,n,i)}build(t,n,i){uw(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,o){q7(t,n,i,o)}mount(t){this.isSVGTag=dw(t.tagName),super.mount(t)}}const G7=rg.length;function hw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?hw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<G7;n++){const i=rg[n],o=e.props[i];(_l(o)||o===!1)&&(t[i]=o)}return t}function mw(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 X7=[...ig].reverse(),K7=ig.length;function Q7(e){return t=>Promise.all(t.map(({animation:n,options:i})=>XP(e,n,i)))}function $7(e){let t=Q7(e),n=A2(),i=!0,o=!1;const s=f=>(p,x)=>{var g;const b=Dr(e,x,f==="exit"?(g=e.presenceContext)==null?void 0:g.custom:void 0);if(b){const{transition:y,transitionEnd:E,...T}=b;p={...p,...T,...E}}return p};function l(f){t=f(e)}function c(f){const{props:p}=e,x=hw(e.parent)||{},b=[],g=new Set;let y={},E=1/0;for(let w=0;w<K7;w++){const M=X7[w],N=n[M],L=p[M]!==void 0?p[M]:x[M],A=_l(L),C=M===f?N.isActive:null;C===!1&&(E=w);let I=L===x[M]&&L!==p[M]&&A;if(I&&(i||o)&&e.manuallyAnimateOnMount&&(I=!1),N.protectedKeys={...y},!N.isActive&&C===null||!L&&!N.prevProp||Rd(L)||typeof L=="boolean")continue;if(M==="exit"&&N.isActive&&C!==!0){N.prevResolvedValues&&(y={...y,...N.prevResolvedValues});continue}const R=W7(N.prevProp,L);let j=R||M===f&&N.isActive&&!I&&A||w>E&&A,D=!1;const P=Array.isArray(L)?L:[L];let B=P.reduce(s(M),{});C===!1&&(B={});const{prevResolvedValues:Q={}}=N,q={...Q,...B},z=Z=>{j=!0,g.has(Z)&&(D=!0,g.delete(Z)),N.needsAnimating[Z]=!0;const ie=e.getValue(Z);ie&&(ie.liveStyle=!1)};for(const Z in q){const ie=B[Z],F=Q[Z];if(y.hasOwnProperty(Z))continue;let Y=!1;V0(ie)&&V0(F)?Y=!mw(ie,F)||R:Y=ie!==F,Y?ie!=null?z(Z):g.add(Z):ie!==void 0&&g.has(Z)?z(Z):N.protectedKeys[Z]=!0}N.prevProp=L,N.prevResolvedValues=B,N.isActive&&(y={...y,...B}),(i||o)&&e.blockInitialAnimation&&(j=!1);const H=I&&R;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:F}=e,Y=Dr(F,Z);if(F.enteringChildren&&Y){const{delayChildren:J}=Y.transition||{};ie.delay=jk(F.enteringChildren,e,J)}}return{animation:Z,options:ie}}))}if(g.size){const w={};if(typeof p.initial!="boolean"){const M=Dr(e,Array.isArray(p.initial)?p.initial[0]:p.initial);M&&M.transition&&(w.transition=M.transition)}g.forEach(M=>{const N=e.getBaseTarget(M),L=e.getValue(M);L&&(L.liveStyle=!0),w[M]=N??null}),b.push({animation:w})}let T=!!b.length;return i&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,o=!1,T?t(b):Promise.resolve()}function d(f,p){var b;if(n[f].isActive===p)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(g=>{var y;return(y=g.animationState)==null?void 0:y.setActive(f,p)}),n[f].isActive=p;const x=c(f);for(const g in n)n[g].protectedKeys={};return x}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=A2(),o=!0}}}function W7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!mw(t,e):!1}function gr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function A2(){return{animate:gr(!0),whileInView:gr(),whileHover:gr(),whileTap:gr(),whileDrag:gr(),whileFocus:gr(),exit:gr()}}function J0(e,t){e.min=t.min,e.max=t.max}function ma(e,t){J0(e.x,t.x),J0(e.y,t.y)}function C2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const pw=1e-4,Z7=1-pw,J7=1+pw,gw=.01,eB=0-gw,tB=0+gw;function Tn(e){return e.max-e.min}function nB(e,t,n){return Math.abs(e-t)<=n}function N2(e,t,n,i=.5){e.origin=i,e.originPoint=_t(t.min,t.max,e.origin),e.scale=Tn(n)/Tn(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Z7&&e.scale<=J7||isNaN(e.scale))&&(e.scale=1),(e.translate>=eB&&e.translate<=tB||isNaN(e.translate))&&(e.translate=0)}function yl(e,t,n,i){N2(e.x,t.x,n.x,i?i.originX:void 0),N2(e.y,t.y,n.y,i?i.originY:void 0)}function _2(e,t,n,i=0){const o=i?_t(n.min,n.max,i):n.min;e.min=o+t.min,e.max=e.min+Tn(t)}function aB(e,t,n,i){_2(e.x,t.x,n.x,i==null?void 0:i.x),_2(e.y,t.y,n.y,i==null?void 0:i.y)}function M2(e,t,n,i=0){const o=i?_t(n.min,n.max,i):n.min;e.min=t.min-o,e.max=e.min+Tn(t)}function ld(e,t,n,i){M2(e.x,t.x,n.x,i==null?void 0:i.x),M2(e.y,t.y,n.y,i==null?void 0:i.y)}function R2(e,t,n,i,o){return e-=t,e=od(e,1/n,i),o!==void 0&&(e=od(e,1/o,i)),e}function iB(e,t=0,n=1,i=.5,o,s=e,l=e){if(Ma.test(t)&&(t=parseFloat(t),t=_t(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=_t(s.min,s.max,i);e===s&&(c-=t),e.min=R2(e.min,t,n,c,o),e.max=R2(e.max,t,n,c,o)}function D2(e,t,[n,i,o],s,l){iB(e,t[n],t[i],t[o],t.scale,s,l)}const rB=["x","scaleX","originX"],sB=["y","scaleY","originY"];function L2(e,t,n,i){D2(e.x,t,rB,n?n.x:void 0,i?i.x:void 0),D2(e.y,t,sB,n?n.y:void 0,i?i.y:void 0)}function O2(e){return e.translate===0&&e.scale===1}function xw(e){return O2(e.x)&&O2(e.y)}function I2(e,t){return e.min===t.min&&e.max===t.max}function oB(e,t){return I2(e.x,t.x)&&I2(e.y,t.y)}function j2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bw(e,t){return j2(e.x,t.x)&&j2(e.y,t.y)}function P2(e){return Tn(e.x)/Tn(e.y)}function B2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Aa(e){return[e("x"),e("y")]}function lB(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:f,rotate:p,pathRotation:x,rotateX:b,rotateY:g,skewX:y,skewY:E}=n;f&&(i=`perspective(${f}px) ${i}`),p&&(i+=`rotate(${p}deg) `),x&&(i+=`rotate(${x}deg) `),b&&(i+=`rotateX(${b}deg) `),g&&(i+=`rotateY(${g}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 uB=eg.length,z2=e=>typeof e=="string"?parseFloat(e):e,U2=e=>typeof e=="number"||Ie.test(e);function cB(e,t,n,i,o,s){o?(e.opacity=_t(0,n.opacity??1,dB(i)),e.opacityExit=_t(t.opacity??1,0,fB(i))):s&&(e.opacity=_t(t.opacity??1,n.opacity??1,i));for(let l=0;l<uB;l++){const c=eg[l];let d=H2(t,c),f=H2(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||U2(d)===U2(f)?(e[c]=Math.max(_t(z2(d),z2(f),i),0),(Ma.test(f)||Ma.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,i))}function H2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const dB=yw(0,.5,ck),fB=yw(.5,.95,oa);function yw(e,t,n){return i=>i<e?0:i>t?1:n(Cl(e,t,i))}function hB(e,t,n){const i=mn(e)?e:zs(e);return i.start(Wp("",i,t,n)),i.animation}function Ml(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const mB=(e,t)=>e.depth-t.depth;class pB{constructor(){this.children=[],this.isDirty=!1}add(t){zp(this.children,t),this.isDirty=!0}remove(t){ed(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mB),this.isDirty=!1,this.children.forEach(t)}}function gB(e,t){const n=En.now(),i=({timestamp:o})=>{const s=o-n;s>=t&&(Ui(i),e(s-t))};return Mt.setup(i,!0),()=>Ui(i)}function zc(e){return mn(e)?e.get():e}class xB{constructor(){this.members=[]}add(t){zp(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&&(ed(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(ed(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},$m=["","X","Y","Z"],bB=1e3;let yB=0;function Wm(e,t,n,i){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),i&&(i[e]=0))}function vw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Hk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Mt,!(o||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&vw(i)}function Ew({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=yB++,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(TB),this.nodes.forEach(NB),this.nodes.forEach(_B),this.nodes.forEach(SB)},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 pB)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Up),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=ag(l)&&!T7(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let p,x=0;const b=()=>this.root.updateBlockedByResize=!1;Mt.read(()=>{x=window.innerWidth}),e(l,()=>{const g=window.innerWidth;g!==x&&(x=g,this.root.updateBlockedByResize=!0,p&&p(),p=gB(b,250),Uc.hasAnimatedSinceResize&&(Uc.hasAnimatedSinceResize=!1,this.nodes.forEach(q2)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||OB,{onLayoutAnimationStart:E,onLayoutAnimationComplete:T}=f.getProps(),w=!this.targetLayout||!bw(this.targetLayout,g),M=!x&&b;if(this.options.layoutRoot||this.resumeFrom||M||x&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...$p(y,"layout"),onPlay:E,onComplete:T};(f.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(p,M,N.path)}else x||q2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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(),Ui(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(MB),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&&vw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const x=this.path[p];x.shouldResetTransform=!0,(typeof x.latestValues.x=="string"||typeof x.latestValues.y=="string")&&(x.isLayoutDirty=!0),x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(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(wB),this.nodes.forEach(F2);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(V2);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(AB),this.nodes.forEach(CB),this.nodes.forEach(vB),this.nodes.forEach(EB)):this.nodes.forEach(V2),this.clearAllSnapshots();const c=En.now();hn.delta=Ra(0,1e3/60,c-hn.timestamp),hn.timestamp=c,hn.isProcessing=!0,Fm.update.process(hn),Fm.preRender.process(hn),Fm.render.process(hn),hn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kB),this.sharedNodes.forEach(RB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Tn(this.snapshot.measuredBox.x)&&!Tn(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=nn()),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&&!xw(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||vr(this.latestValues)||p)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),IB(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:l}=this.options;if(!l)return nn();const c=l.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(jB))){const{scroll:p}=this.root;p&&(_a(c.x,p.offset.x),_a(c.y,p.offset.y))}return c}removeElementScroll(l){var d;const c=nn();if(ma(c,l),(d=this.scroll)!=null&&d.wasRoot)return c;for(let f=0;f<this.path.length;f++){const p=this.path[f],{scroll:x,options:b}=p;p!==this.root&&x&&b.layoutScroll&&(x.wasRoot&&ma(c,l),_a(c.x,x.offset.x),_a(c.y,x.offset.y))}return c}applyTransform(l,c=!1,d){var p,x;const f=d||nn();ma(f,l);for(let b=0;b<this.path.length;b++){const g=this.path[b];!c&&g.options.layoutScroll&&g.scroll&&g!==g.root&&(_a(f.x,-g.scroll.offset.x),_a(f.y,-g.scroll.offset.y)),vr(g.latestValues)&&Bc(f,g.latestValues,(p=g.layout)==null?void 0:p.layoutBox)}return vr(this.latestValues)&&Bc(f,this.latestValues,(x=this.layout)==null?void 0:x.layoutBox),f}removeTransform(l){var d;const c=nn();ma(c,l);for(let f=0;f<this.path.length;f++){const p=this.path[f];if(!vr(p.latestValues))continue;let x;p.instance&&($0(p.latestValues)&&p.updateSnapshot(),x=nn(),ma(x,p.measurePageBox())),L2(c,p.latestValues,(d=p.snapshot)==null?void 0:d.layoutBox,x)}return vr(this.latestValues)&&L2(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!==hn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var g;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||(g=this.parent)!=null&&g.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:x}=this.options;if(!this.layout||!(p||x))return;this.resolvedRelativeTargetAt=hn.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=nn(),this.targetWithTransforms=nn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),aB(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),iw(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||$0(this.parent.latestValues)||aw(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=nn(),this.relativeTargetOrigin=nn(),ld(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===hn.timestamp&&(d=!1),d)return;const{layout:f,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||p))return;ma(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;L7(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=nn());const{target:g}=l;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(C2(this.prevProjectionDelta.x,this.projectionDelta.x),C2(this.prevProjectionDelta.y,this.projectionDelta.y)),yl(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!B2(this.projectionDelta.x,this.prevProjectionDelta.x)||!B2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}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=Rs(),this.projectionDelta=Rs(),this.projectionDeltaWithTransform=Rs()}setAnimationOrigin(l,c=!1,d){const f=this.snapshot,p=f?f.latestValues:{},x={...this.latestValues},b=Rs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=nn(),y=f?f.source:void 0,E=this.layout?this.layout.source:void 0,T=y!==E,w=this.getStack(),M=!w||w.members.length<=1,N=!!(T&&!M&&this.options.crossfade===!0&&!this.path.some(LB));this.animationProgress=0;let L;const A=d==null?void 0:d.interpolateProjection(l);this.mixTargetDelta=C=>{const I=C/1e3,R=A==null?void 0:A(I);R?(b.x.translate=R.x,b.x.scale=_t(l.x.scale,1,I),b.x.origin=l.x.origin,b.x.originPoint=l.x.originPoint,b.y.translate=R.y,b.y.scale=_t(l.y.scale,1,I),b.y.origin=l.y.origin,b.y.originPoint=l.y.originPoint):(Y2(b.x,l.x,I),Y2(b.y,l.y,I)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ld(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),DB(this.relativeTarget,this.relativeTargetOrigin,g,I),L&&oB(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=nn()),ma(L,this.relativeTarget)),T&&(this.animationValues=x,cB(x,p,this.latestValues,I,N,M)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=x),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,d,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||f.stop(),this.pendingAnimation&&(Ui(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mt.update(()=>{Uc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zs(0)),this.motionValue.jump(0,!1),this.currentAnimation=hB(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},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(bB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:p}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&Tw(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||nn();const x=Tn(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+x;const b=Tn(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+b}ma(c,d),Bc(c,p),yl(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new xB),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.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 f=this.getStack();f&&f.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 f={};d.z&&Wm("z",l,f,this.animationValues);for(let p=0;p<$m.length;p++)Wm(`rotate${$m[p]}`,l,f,this.animationValues),Wm(`skew${$m[p]}`,l,f,this.animationValues);l.render();for(const p in f)l.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);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=zc(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=zc(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!vr(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let x=lB(this.projectionDeltaWithTransform,this.treeScale,p);d&&(x=d(p,x)),l.transform=x;const{x:b,y:g}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${g.origin*100}% 0`,f.animationValues?l.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in Z0){if(p[y]===void 0)continue;const{correct:E,applyTo:T,isCSSVariable:w}=Z0[y],M=x==="none"?p[y]:E(p[y],f);if(T){const N=T.length;for(let L=0;L<N;L++)l[T[L]]=M}else w?this.options.visualElement.renderState.vars[y]=M:l[y]=M}this.options.layoutId&&(l.pointerEvents=f===this?zc(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(F2),this.root.sharedNodes.clear()}}}function vB(e){e.updateLayout()}function EB(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(x=>{const b=l?t.measuredBox[x]:t.layoutBox[x],g=Tn(b);b.min=i[x].min,b.max=b.min+g});else if(s==="x"||s==="y"){const x=s==="x"?"y":"x";J0(l?t.measuredBox[x]:t.layoutBox[x],i[x])}else Tw(s,t.layoutBox,i)&&Aa(x=>{const b=l?t.measuredBox[x]:t.layoutBox[x],g=Tn(i[x]);b.max=b.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[x].max=e.relativeTarget[x].min+g)});const c=Rs();yl(c,i,t.layoutBox);const d=Rs();l?yl(d,e.applyTransform(o,!0),t.measuredBox):yl(d,i,t.layoutBox);const f=!xw(c);let p=!1;if(!e.resumeFrom){const x=e.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:b,layout:g}=x;if(b&&g){const y=e.options.layoutAnchor||void 0,E=nn();ld(E,t.layoutBox,b.layoutBox,y);const T=nn();ld(T,i,g.layoutBox,y),bw(E,T)||(p=!0),x.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=E,e.relativeParent=x)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function TB(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 SB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kB(e){e.clearSnapshot()}function F2(e){e.clearMeasurements()}function wB(e){e.isLayoutDirty=!0,e.updateLayout()}function V2(e){e.isLayoutDirty=!1}function AB(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function CB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function q2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NB(e){e.resolveTargetDelta()}function _B(e){e.calcProjection()}function MB(e){e.resetSkewAndRotation()}function RB(e){e.removeLeadSnapshot()}function Y2(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function G2(e,t,n,i){e.min=_t(t.min,n.min,i),e.max=_t(t.max,n.max,i)}function DB(e,t,n,i){G2(e.x,t.x,n.x,i),G2(e.y,t.y,n.y,i)}function LB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const OB={duration:.45,ease:[.4,0,.1,1]},X2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),K2=X2("applewebkit/")&&!X2("chrome/")?Math.round:oa;function Q2(e){e.min=K2(e.min),e.max=K2(e.max)}function IB(e){Q2(e.x),Q2(e.y)}function Tw(e,t,n){return e==="position"||e==="preserve-aspect"&&!nB(P2(t),P2(n),.2)}function jB(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const PB=Ew({attachResizeListener:(e,t)=>Ml(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}),Zm={current:void 0},Sw=Ew({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zm.current){const e=new PB({});e.mount(window),e.setOptions({layoutScroll:!0}),Zm.current=e}return Zm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lg=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function BB(...e){return t=>{let n=!1;const i=e.map(o=>{const s=$2(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():$2(e[o],null)}}}}function zB(...e){return _.useCallback(BB(...e),e)}class UB extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Oc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,o=Oc(i)&&i.offsetWidth||0,s=Oc(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 HB({children:e,isPresent:t,anchorX:n,anchorY:i,root:o,pop:s}){var b;const l=_.useId(),c=_.useRef(null),d=_.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=_.useContext(lg),p=s!==!1?((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref):void 0,x=zB(c,p);return _.useInsertionEffect(()=>{const{width:g,height:y,top:E,left:T,right:w,bottom:M,direction:N}=d.current;if(t||s===!1||!c.current||!g||!y)return;const L=N==="rtl",A=n==="left"?L?`right: ${w}`:`left: ${T}`:L?`left: ${T}`:`right: ${w}`,C=i==="bottom"?`bottom: ${M}`:`top: ${E}`;c.current.dataset.motionPopId=l;const I=document.createElement("style");f&&(I.nonce=f);const R=o??document.head;return R.appendChild(I),I.sheet&&I.sheet.insertRule(`
556
+ [data-motion-pop-id="${l}"] {
557
+ position: absolute !important;
558
+ width: ${g}px !important;
559
+ height: ${y}px !important;
560
+ ${A}px !important;
561
+ ${C}px !important;
562
+ }
563
+ `),()=>{var j;(j=c.current)==null||j.removeAttribute("data-motion-pop-id"),R.contains(I)&&R.removeChild(I)}},[t]),m.jsx(UB,{isPresent:t,childRef:c,sizeRef:d,pop:s,children:s===!1?e:_.cloneElement(e,{ref:x})})}const FB=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:d,root:f})=>{const p=Bp(VB),x=_.useId(),b=_.useRef(n),g=_.useRef(i);Jc(()=>{b.current=n,g.current=i});let y=!0,E=_.useMemo(()=>(y=!1,{id:x,initial:t,isPresent:n,custom:o,onExitComplete:T=>{p.set(T,!0);for(const w of p.values())if(!w)return;i&&i()},register:T=>(p.set(T,!1),()=>{var w;p.delete(T),!b.current&&!p.size&&((w=g.current)==null||w.call(g))})}),[n,p,i]);return s&&y&&(E={...E}),_.useMemo(()=>{p.forEach((T,w)=>p.set(w,!1))},[n]),_.useEffect(()=>{!n&&!p.size&&i&&i()},[n]),e=m.jsx(HB,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:f,children:e}),m.jsx(Nd.Provider,{value:E,children:e})};function VB(){return new Map}function kw(e=!0){const t=_.useContext(Nd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=t,s=_.useId();_.useEffect(()=>{if(e)return o(s)},[e]);const l=_.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,l]:[!0]}const kc=e=>e.key||"";function W2(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const qB=({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:f})=>{const[p,x]=kw(l),b=_.useMemo(()=>W2(e),[e]),g=l&&!p?[]:b.map(kc),y=_.useRef(!0),E=_.useRef(b),T=Bp(()=>new Map),w=_.useRef(new Set),[M,N]=_.useState(b),[L,A]=_.useState(b);Jc(()=>{l&&!p&&!L.length&&(x==null||x())},[p,l,L.length,x]),Jc(()=>{y.current=!1,E.current=b;for(let R=0;R<L.length;R++){const j=kc(L[R]);g.includes(j)?(T.delete(j),w.current.delete(j)):T.get(j)!==!0&&T.set(j,!1)}},[L,g.length,g.join("-")]);const C=[];if(b!==M){let R=[...b];for(let j=0;j<L.length;j++){const D=L[j],P=kc(D);g.includes(P)||(R.splice(j,0,D),C.push(D))}return s==="wait"&&C.length&&(R=C),A(W2(R)),N(b),null}const{forceRender:I}=_.useContext(Pp);return m.jsx(m.Fragment,{children:L.map(R=>{const j=kc(R),D=l&&!p?!1:b===L||g.includes(j),P=()=>{if(w.current.has(j))return;if(T.has(j))w.current.add(j),T.set(j,!0);else return;let B=!0;T.forEach(Q=>{Q||(B=!1)}),B&&(I==null||I(),A(E.current),l&&(x==null||x()),i&&i())};return m.jsx(FB,{isPresent:D,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:D?void 0:P,anchorX:c,anchorY:d,children:R},j)})})},ww=_.createContext({strict:!1}),Z2={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 J2=!1;function YB(){if(J2)return;const e={};for(const t in Z2)e[t]={isEnabled:n=>Z2[t].some(i=>!!n[i])};ew(e),J2=!0}function Aw(){return YB(),_7()}function GB(e){const t=Aw();for(const n in e)t[n]={...t[n],...e[n]};ew(t)}const Ld=_.createContext({});function XB(e,t){if(Dd(e)){const{initial:n,animate:i}=e;return{initial:n===!1||_l(n)?n:void 0,animate:_l(i)?i:void 0}}return e.inherit!==!1?t:{}}function KB(e){const{initial:t,animate:n}=XB(e,_.useContext(Ld));return _.useMemo(()=>({initial:t,animate:n}),[eE(t),eE(n)])}function eE(e){return Array.isArray(e)?e.join(" "):e}const ug=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Cw(e,t,n){for(const i in t)!mn(t[i])&&!ow(i,n)&&(e[i]=t[i])}function QB({transformTemplate:e},t){return _.useMemo(()=>{const n=ug();return sg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $B(e,t){const n=e.style||{},i={};return Cw(i,n,e),Object.assign(i,QB(e,t)),i}function WB(e,t){const n={},i=$B(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 Nw=()=>({...ug(),attrs:{}});function ZB(e,t,n,i){const o=_.useMemo(()=>{const s=Nw();return uw(s,t,dw(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Cw(s,e.style,e),o.style={...s,...o.style}}return o}const JB=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 ud(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||JB.has(e)}function ez(e,t){return e.startsWith("on")?!ud(e):(t==null?void 0:t(e))??!ud(e)}function tz(e,t,n,i){const o={};for(const s in e)s==="values"&&typeof e.values=="object"||mn(e[s])||(ez(s,i)||n===!0&&ud(s)||!t&&!ud(s)||e.draggable&&s.startsWith("onDrag"))&&(o[s]=e[s]);return o}const nz=["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 cg(e){return typeof e!="string"||e.includes("-")?!1:!!(nz.indexOf(e)>-1||/[A-Z]/u.test(e))}function az(e,t,n,{latestValues:i},o,s=!1,l,c){const f=(l??cg(e)?ZB:WB)(t,i,o,e),p=tz(t,typeof e=="string",s,c),x=e!==_.Fragment?{...p,...f,ref:n}:{},{children:b}=t,g=_.useMemo(()=>mn(b)?b.get():b,[b]);return _.createElement(e,{...x,children:g})}function iz({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,o){return{latestValues:rz(n,i,o,e),renderState:t()}}function rz(e,t,n,i){const o={},s=i(e,{});for(const b in s)o[b]=zc(s[b]);let{initial:l,animate:c}=e;const d=Dd(e),f=Zk(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const x=p?c:l;if(x&&typeof x!="boolean"&&!Rd(x)){const b=Array.isArray(x)?x:[x];for(let g=0;g<b.length;g++){const y=Zp(e,b[g]);if(y){const{transitionEnd:E,transition:T,...w}=y;for(const M in w){let N=w[M];if(Array.isArray(N)){const L=p?N.length-1:0;N=N[L]}N!==null&&(o[M]=N)}for(const M in E)o[M]=E[M]}}}return o}const _w=e=>(t,n)=>{const i=_.useContext(Ld),o=_.useContext(Nd),s=()=>iz(e,t,i,o);return n?s():Bp(s)},sz=_w({scrapeMotionValuesFromProps:og,createRenderState:ug}),oz=_w({scrapeMotionValuesFromProps:fw,createRenderState:Nw}),lz=Symbol.for("motionComponentSymbol");function uz(e,t,n){const i=_.useRef(n);_.useInsertionEffect(()=>{i.current=n});const o=_.useRef(null);return _.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 Mw=_.createContext({});function Cs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cz(e,t,n,i,o,s){var N,L;const{visualElement:l}=_.useContext(Ld),c=_.useContext(ww),d=_.useContext(Nd),f=_.useContext(lg),p=f.reducedMotion,x=f.skipAnimations,b=_.useRef(null),g=_.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:p,skipAnimations:x,isSVG:s}),g.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const y=b.current,E=_.useContext(Mw);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&dz(b.current,n,o,E);const T=_.useRef(!1);_.useInsertionEffect(()=>{y&&T.current&&y.update(n,d)});const w=n[Uk],M=_.useRef(!!w&&typeof window<"u"&&!((N=window.MotionHandoffIsComplete)!=null&&N.call(window,w))&&((L=window.MotionHasOptimisedAnimation)==null?void 0:L.call(window,w)));return Jc(()=>{g.current=!0,y&&(T.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),M.current&&y.animationState&&y.animationState.animateChanges())}),_.useEffect(()=>{y&&(!M.current&&y.animationState&&y.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,w)}),M.current=!1),y.enteringChildren=void 0)}),y}function dz(e,t,n,i){const{layoutId:o,layout:s,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutAnchor:p,layoutCrossfade:x}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Rw(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!l||c&&Cs(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:x,layoutScroll:d,layoutRoot:f,layoutAnchor:p})}function Rw(e){if(e)return e.options.allowProjection!==!1?e.projection:Rw(e.parent)}function Jm(e,{forwardMotionProps:t=!1,type:n}={},i,o){i&&GB(i);const s=n?n==="svg":cg(e),l=s?oz:sz;function c(f,p){let x;const b={..._.useContext(lg),...f,layoutId:fz(f)},{isStatic:g,isValidProp:y}=b,E=KB(f),T=l(f,g);if(!g&&typeof window<"u"){hz();const w=mz(b);x=w.MeasureLayout,E.visualElement=cz(e,T,b,o,w.ProjectionNode,s)}return m.jsxs(Ld.Provider,{value:E,children:[x&&E.visualElement?m.jsx(x,{visualElement:E.visualElement,...b}):null,az(e,f,uz(T,E.visualElement,p),T,g,t,s,y)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=_.forwardRef(c);return d[lz]=e,d}function fz({layoutId:e}){const t=_.useContext(Pp).id;return t&&e!==void 0?t+"-"+e:e}function hz(e,t){_.useContext(ww).strict}function mz(e){const t=Aw(),{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 pz(e,t){if(typeof Proxy>"u")return Jm;const n=new Map,i=(s,l)=>Jm(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,Jm(l,void 0,e,t)),n.get(l))})}const gz=(e,t)=>t.isSVG??cg(e)?new Y7(t):new U7(t,{allowProjection:e!==_.Fragment});class xz extends Vi{constructor(t){super(t),t.animationState||(t.animationState=$7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Rd(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 bz=0;class yz extends Vi{constructor(){super(...arguments),this.id=bz++,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=Dr(this.node,l,c);if(d){const{transition:f,transitionEnd:p,...x}=d;for(const b in x)(s=this.node.getValue(b))==null||s.jump(x[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 vz={animation:{Feature:xz},exit:{Feature:yz}};function Yl(e){return{point:{x:e.pageX,y:e.pageY}}}const Ez=e=>t=>ng(t)&&e(t,Yl(t));function vl(e,t,n,i){return Ml(e,t,Ez(n),i)}const Dw=({current:e})=>e?e.ownerDocument.defaultView:null,tE=(e,t)=>Math.abs(e-t);function Tz(e,t){const n=tE(e.x,t.x),i=tE(e.y,t.y);return Math.sqrt(n**2+i**2)}const nE=new Set(["auto","scroll"]);class Lw{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=e0(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,T=Tz(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!E&&!T)return;const{point:w}=y,{timestamp:M}=hn;this.history.push({...w,timestamp:M});const{onStart:N,onMove:L}=this.handlers;E||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,y)},this.handlePointerMove=(y,E)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=E,this.lastMoveEventInfo=wc(E,this.transformPagePoint),Mt.update(this.updatePoint,!0)},this.handlePointerUp=(y,E)=>{this.end();const{onEnd:T,onSessionEnd:w,resumeAnimation:M}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=e0(y.type==="pointercancel"?this.lastMoveEventInfo:wc(E,this.transformPagePoint),this.history);this.startEvent&&T&&T(y,N),w&&w(y,N)},!ng(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=o||window;const d=Yl(t),f=wc(d,this.transformPagePoint),{point:p}=f,{timestamp:x}=hn;this.history=[{...p,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,e0(f,this.history));const g={passive:!0,capture:!0};this.removeListeners=Fl(vl(this.contextWindow,"pointermove",this.handlePointerMove,g),vl(this.contextWindow,"pointerup",this.handlePointerUp,g),vl(this.contextWindow,"pointercancel",this.handlePointerUp,g)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(nE.has(i.overflowX)||nE.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),Mt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ui(this.updatePoint)}}function wc(e,t){return t?{point:t(e.point)}:e}function aE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function e0({point:e},t){return{point:e,delta:aE(e,Ow(t)),offset:aE(e,Sz(t)),velocity:kz(t,.1)}}function Sz(e){return e[0]}function Ow(e){return e[e.length-1]}function kz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const o=Ow(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 wz(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?_t(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?_t(n,e,i.max):Math.min(e,n)),e}function iE(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 Az(e,{top:t,left:n,bottom:i,right:o}){return{x:iE(e.x,n,o),y:iE(e.y,t,i)}}function rE(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 Cz(e,t){return{x:rE(e.x,t.x),y:rE(e.y,t.y)}}function Nz(e,t){let n=.5;const i=Tn(e),o=Tn(t);return o>i?n=Cl(t.min,t.max-i,e.min):i>o&&(n=Cl(e.min,e.max-o,t.min)),Ra(0,1,n)}function _z(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 ep=.35;function Mz(e=ep){return e===!1?e=0:e===!0&&(e=ep),{x:sE(e,"left","right"),y:sE(e,"top","bottom")}}function sE(e,t,n){return{min:oE(e,t),max:oE(e,n)}}function oE(e,t){return typeof e=="number"?e:e[t]||0}const Rz=new WeakMap;class Dz{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=nn(),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=x=>{n&&this.snapToCursor(Yl(x).point),this.stopAnimation()},l=(x,b)=>{const{drag:g,dragPropagation:y,onDragStart:E}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=r7(g),!this.openDragLock))return;this.latestPointerEvent=x,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(w=>{let M=this.getAxisMotionValue(w).get()||0;if(Ma.test(M)){const{projection:N}=this.visualElement;if(N&&N.layout){const L=N.layout.layoutBox[w];L&&(M=Tn(L)*(parseFloat(M)/100))}}this.originPoint[w]=M}),E&&Mt.update(()=>E(x,b),!1,!0),q0(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:E,onDrag:T}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=b;if(y&&this.currentDirection===null){this.currentDirection=Oz(w),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",b.point,w),this.updateAxis("y",b.point,w),this.visualElement.render(),T&&Mt.update(()=>T(x,b),!1,!0)},d=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b,this.stop(x,b),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:x}=this.getProps();(x||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new Lw(t,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:i,contextWindow:Dw(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&&Mt.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||!Ac(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=wz(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&&Cs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=Az(i.layoutBox,t):this.constraints=!1,this.elastic=Mz(n),o!==this.constraints&&!Cs(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Aa(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=_z(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Cs(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=O7(i,o.root,this.visualElement.getTransformPagePoint());let l=Cz(o.layout.layoutBox,s);if(n){const c=n(R7(l));this.hasMutatedConstraints=!!c,c&&(l=nw(c))}return l}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=Aa(p=>{if(!Ac(p,n,this.currentDirection))return;let x=d&&d[p]||{};(l===!0||l===p)&&(x={min:0,max:0});const b=o?200:1e6,g=o?40:1e7,y={type:"inertia",velocity:i?t[p]:0,bounceStiffness:b,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...x};return this.startAxisValueAnimation(p,y)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return q0(this.visualElement,t),i.start(Wp(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(!Ac(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]-_t(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Cs(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]=Nz({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(!Ac(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(_t(d,f,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Rz.set(this.visualElement,this);const t=this.visualElement.current,n=vl(t,"pointerdown",f=>{const{drag:p,dragListener:x=!0}=this.getProps(),b=f.target,g=b!==t&&d7(b);p&&x&&!g&&this.start(f)});let i;const o=()=>{const{dragConstraints:f}=this.getProps();Cs(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Lz(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Mt.read(o);const c=Ml(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(Aa(x=>{const b=this.getAxisMotionValue(x);b&&(this.originPoint[x]+=f[x].translate,b.set(b.get()+f[x].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=ep,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function lE(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Lz(e,t,n){const i=p2(e,lE(n)),o=p2(t,lE(n));return()=>{i(),o()}}function Ac(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Oz(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Iz extends Vi{constructor(t){super(t),this.removeGroupControls=oa,this.removeListeners=oa,this.controls=new Dz(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 t0=e=>(t,n)=>{e&&Mt.update(()=>e(t,n),!1,!0)};class jz extends Vi{constructor(){super(...arguments),this.removePointerDownListener=oa}onPointerDown(t){this.session=new Lw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Dw(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:t0(t),onStart:t0(n),onMove:t0(i),onEnd:(s,l)=>{delete this.session,o&&Mt.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=vl(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 n0=!1;class Pz extends _.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),n0&&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}),n0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||Mt.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(),tg.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:o}=t;n0=!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 Iw(e){const[t,n]=kw(),i=_.useContext(Pp);return m.jsx(Pz,{...e,layoutGroup:i,switchLayoutGroup:_.useContext(Mw),isPresent:t,safeToRemove:n})}const Bz={pan:{Feature:jz},drag:{Feature:Iz,ProjectionNode:Sw,MeasureLayout:Iw}};function uE(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&&Mt.postRender(()=>s(t,Yl(t)))}class zz extends Vi{mount(){const{current:t}=this.node;t&&(this.unmount=o7(t,(n,i)=>(uE(this.node,i,"Start"),o=>uE(this.node,o,"End"))))}unmount(){}}class Uz 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=Fl(Ml(this.node.current,"focus",()=>this.onFocus()),Ml(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function cE(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&&Mt.postRender(()=>s(t,Yl(t)))}class Hz extends Vi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=h7(t,(o,s)=>(cE(this.node,s,"Start"),(l,{success:c})=>cE(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const tp=new WeakMap,a0=new WeakMap,Fz=e=>{const t=tp.get(e.target);t&&t(e)},Vz=e=>{e.forEach(Fz)};function qz({root:e,...t}){const n=e||document;a0.has(n)||a0.set(n,{});const i=a0.get(n),o=JSON.stringify(t);return i[o]||(i[o]=new IntersectionObserver(Vz,{root:e,...t})),i[o]}function Yz(e,t,n){const i=qz(t);return tp.set(e,n),i.observe(e),()=>{tp.delete(e),i.unobserve(e)}}const Gz={some:0,all:1};class Xz 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:Gz[o]},c=f=>{const{isIntersecting:p}=f;if(this.isInView===p||(this.isInView=p,s&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:x,onViewportLeave:b}=this.node.getProps(),g=p?x:b;g&&g(f)};this.stopObserver=Yz(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(Kz(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Kz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Qz={inView:{Feature:Xz},tap:{Feature:Hz},focus:{Feature:Uz},hover:{Feature:zz}},$z={layout:{ProjectionNode:Sw,MeasureLayout:Iw}},Wz={...vz,...Qz,...Bz,...$z},Zz=pz(Wz,gz),Jz=Zz;function eU(e){switch(e){case"correct":return{Icon:ai,color:"var(--brand)"};case"wrong":return{Icon:Ds,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:yE,color:"var(--gold)"};case"unlock":return{Icon:s0,color:"var(--brand)"};case"streak":return{Icon:vE,color:"var(--review)"};case"energy-full":return{Icon:l0,color:"var(--brand)"};case"exam-pass":return{Icon:uC,color:"var(--exam)"};case"lesson-complete":return{Icon:GC,color:"var(--gold)"};default:return{Icon:s0,color:"var(--brand)"}}}function tU(){const e=zE(),t=_.useRef(null),n=_.useRef([]),i=_.useRef(0),[o,s]=_.useState(null);return _.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 f=()=>{c.clearRect(0,0,window.innerWidth,window.innerHeight);const b=n.current;for(let g=b.length-1;g>=0;g--){const y=b[g];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(g,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(f):0},x=vy(b=>{var w,M;const g=a5(b.kind),y=Math.round(g.particles*(b.intensity??1)),E=((w=b.origin)==null?void 0:w.x)??window.innerWidth/2,T=((M=b.origin)==null?void 0:M.y)??window.innerHeight/2;for(let N=0;N<y;N++){const L=Math.PI*2*N/y+Math.random()*.3,A=3+Math.random()*6,C=g.durationMs/16*(.7+Math.random()*.5);n.current.push({x:E,y:T,vx:Math.cos(L)*A,vy:Math.sin(L)*A-2,life:C,maxLife:C,color:g.colors[N%g.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(f))});return()=>{x(),window.removeEventListener("resize",d),i.current&&cancelAnimationFrame(i.current),i.current=0,n.current=[]}},[e]),_.useEffect(()=>{if(!e)return;let l=0;return vy(d=>{const f=++l;s({kind:d.kind,id:f}),setTimeout(()=>{f===l&&s(null)},600)})},[e]),e?m.jsx(qB,{children:o&&(()=>{const{Icon:l,color:c}=eU(o.kind);return m.jsx(Jz.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:m.jsx(l,{className:"w-24 h-24",color:c,strokeWidth:1.5})},o.id)})()}):m.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const dE=["direct","guide","practice"];function nU(){const e=Ve(),[t,n]=_.useState([]),[i,o]=_.useState([]),[s,l]=_.useState({}),[c,d]=_.useState(null),[f,p]=_.useState(null),[x,b]=_.useState(null),[g,y]=_.useState(null),E=_.useCallback(se=>{y(se instanceof Error?se.message:String(se)),console.error(se)},[]),[T,w]=_.useState([]),[M,N]=_.useState(null),[L,A]=_.useState([]),[C,I]=_.useState(null),[R,j]=_.useState("map"),[D,P]=_.useState(null),[B,Q]=_.useState(new Set),[q,z]=_.useState(null),H=_.useRef({active:!1,terminate:null}),[G,Z]=_.useState({open:!1,pendingAction:null}),ie=_.useRef(null),[F,Y]=_.useState(null),[J,U]=_.useState(!1),[ne,K]=_.useState(!0),[$,oe]=_.useState(!0),ce=e9(),[_e,Ke]=_.useState("notebook"),[Je,it]=_.useState("chat"),Ee=_.useRef(Je);Ee.current=Je;const Ye=_.useRef(ce);_.useEffect(()=>{Ye.current!==ce&&(ce===1?(K(!0),oe(!0)):ce===2&&Ye.current===3&&Ke(Qj(Ee.current)),Ye.current=ce)},[ce]);const yt=ce===3?Je==="rail":ce===2?_e==="rail":ne,Ot=ce===3?Je==="notebook":ce===2?_e==="notebook":$,Xt=ce!==3||Je==="chat",Se=()=>{ce===1?K(se=>!se):ce===2?Ke(se=>se==="rail"?"notebook":"rail"):it(se=>se==="rail"?"chat":"rail")},Qe=()=>{ce===1?oe(se=>!se):ce===2?Ke(se=>se==="notebook"?"rail":"notebook"):it(se=>se==="notebook"?"chat":"notebook")},qe=_.useRef(null),pt=se=>{var Re,ze;if(ce!==3)return;const ye=se.touches[0];qe.current={x:ye.clientX,y:ye.clientY,multi:se.touches.length>1,noswipe:!!((ze=(Re=se.target).closest)!=null&&ze.call(Re,"[data-noswipe]"))}},rt=se=>{const ye=qe.current;if(qe.current=null,!ye||ye.multi||ye.noswipe||ce!==3)return;const Re=se.changedTouches[0],ze=$j(Ee.current,Re.clientX-ye.x,Re.clientY-ye.y);ze&&it(ze)},[fe,Be]=_.useState(!1),[je,pe]=_.useState(null),[ke,De]=_.useState([]),Me=qj(x,q),$e=RE(),Ne=Hj(Me.activeId,$e),[nt,tt]=_.useState(""),We=_.useCallback(se=>{tt(se)},[]),rn=_.useCallback((se,ye,Re)=>{if(se.type==="content"){if(Y("content"),Re){const ze=mt=>{document.querySelector(`mark[data-note-id="${Re}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:Re})):mt>0&&setTimeout(()=>ze(mt-1),150)};setTimeout(()=>ze(10),100)}}else if(se.threadId!==Me.activeId&&Me.setActiveId(se.threadId),Re){const ze=mt=>{document.querySelector(`mark[data-note-id="${Re}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:Re})):mt>0&&setTimeout(()=>ze(mt-1),150)};setTimeout(()=>ze(10),120)}},[Me]),[vt,Yn]=_.useState(null);_.useEffect(()=>{if(!q){Yn(null);return}let se=!1;return me.getNodeSummary(q,$e).then(ye=>{se||Yn(ye)}).catch(()=>{se||Yn(null)}),()=>{se=!0}},[q,$e]);const dt=_.useMemo(()=>i.find(se=>se.id===q)??null,[i,q]),Od=_.useMemo(()=>ke.map(se=>({...se,label:e(`starter.${se.key}.label`),hint:e(`starter.${se.key}.hint`),message:e(`starter.${se.key}.message`,{title:(dt==null?void 0:dt.title)??""})})),[ke,dt,e]),Gn=_.useRef(null),Pr=_.useCallback(()=>{var se;dt&&((se=Gn.current)==null||se.call(Gn,e("chat.action.startLearningPrompt",{title:dt.title}),e("chat.action.startLearning",{title:dt.title})))},[dt,e]),Ln=_.useCallback(async()=>{try{const[se,ye,Re,ze,mt,Bt]=await Promise.all([me.listCourses(),me.getStreak(),me.listSouls(),me.getActiveSoul(),me.getXpStatus(),me.getDueReviews()]);n(se),d(ye),A(Re),p(mt),I(ze),Q(new Set(Bt)),x&&!se.some(Sn=>Sn.id===x)&&(b(null),z(null),o([]),l({}),P(null),w([]),N(null))}catch(se){y(se instanceof Error?se.message:String(se))}},[x]);_.useEffect(()=>{Ln()},[Ln]);const ua=_.useCallback(async()=>{try{pe(await me.isAgentReady())}catch{pe({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);_.useEffect(()=>{ua();const se=()=>ua();return window.addEventListener("llm-config-changed",se),()=>window.removeEventListener("llm-config-changed",se)},[ua]);const qi=_.useRef(0),oi=_.useRef(0);_.useEffect(()=>{qi.current=(f==null?void 0:f.todayXp)??0},[f]),_.useEffect(()=>{oi.current=(c==null?void 0:c.currentStreak)??0},[c]);const Br=_.useCallback(async()=>{const se=i.filter(ze=>ze.type==="lesson"||ze.type==="exam"),ye=await Promise.all(se.map(async ze=>{const mt=await me.getProgress(ze.id);return[ze.id,mt]})),Re={};for(const[ze,mt]of ye)mt&&(Re[ze]=mt);l(Re)},[i]);_.useEffect(()=>me.on("state:changed",ye=>{ye==="xp"?me.getXpStatus().then(Re=>{p(Re),qi.current<100&&Re.todayXp>=100&&Nr("energy-full")}).catch(()=>{}):ye==="streak"?me.getStreak().then(Re=>{d(Re),Re.currentStreak>oi.current&&Nr("streak")}).catch(()=>{}):ye==="mastery"&&(Nr("mastery"),Ln(),Br())}),[Ln,Br]),_.useEffect(()=>{x&&(me.getCourseLanguages(x).then(w).catch(()=>w([])),me.getCourseLanguage(x).then(N).catch(()=>N(null)))},[x]),_.useEffect(()=>{x&&(me.getCourseTree(x,M??void 0).then(async se=>{o(se);const ye=se.filter(mt=>mt.type==="lesson"||mt.type==="exam"),Re=await Promise.all(ye.map(async mt=>{const Bt=await me.getProgress(mt.id);return[mt.id,Bt]})),ze={};for(const[mt,Bt]of Re)Bt&&(ze[mt]=Bt);l(ze)}).catch(E),me.getDashboard(x).then(P).catch(E))},[x,M,E]),_.useEffect(()=>{if(!q){De([]);return}me.getStarterPrompts(q).then(De).catch(()=>De([]))},[q]),_.useEffect(()=>{const se=ye=>{if(ye.key==="Escape"&&Me.activeId&&(me.abortAgentChatThread(Me.activeId).catch(()=>{}),U(!1),Be(!1)),(ye.ctrlKey||ye.metaKey)&&ye.key==="k"&&(ye.preventDefault(),Be(Re=>!Re)),(ye.ctrlKey||ye.metaKey)&&ye.key==="b"&&(ye.preventDefault(),Se()),(ye.ctrlKey||ye.metaKey)&&ye.key==="Tab"){if(ye.preventDefault(),H.current.active)return;const Re=Me.threads;if(Re.length>1){const ze=Re.findIndex(Bt=>Bt.id===Me.activeId),mt=ye.shiftKey?(ze-1+Re.length)%Re.length:(ze+1)%Re.length;Me.setActiveId(Re[mt].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(),U(!0)))};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[q]);const zr=_.useCallback(async se=>{var ye;try{if(se.type==="exam"){z(se.id),Y("content");return}if(((ye=s[se.id])==null?void 0:ye.status)==="locked"){z(null);return}await me.markNodeAttempted(se.id);const Re=await me.getStreak();await Br(),d(Re),z(se.id),Y("content"),eo(!1)}catch(Re){E(Re)}},[s,Br,E]),Yi=_.useCallback(se=>{if(H.current.active){Z({open:!0,pendingAction:se});return}se()},[]),Gi=_.useCallback(se=>{if(H.current.active&&se.id!==q){Z({open:!0,pendingAction:()=>void zr(se)});return}zr(se)},[zr,q]),Id=_.useCallback(se=>{H.current=se},[]),Gl=_.useCallback(async()=>{const se=G.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{}se==null||se()},[G.pendingAction]);Us(ie,G.open),_.useEffect(()=>{if(!G.open)return;const se=ye=>{ye.key==="Escape"&&Z({open:!1,pendingAction:null})};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[G.open]);const Xl=async se=>{try{await me.setActiveSoul(se),I(se)}catch(ye){E(ye)}},Kl=_.useCallback(async(se,ye,Re)=>{try{await me.applyProposal(se),Ne.markProposalStatus(ye,Re,!0)}catch(ze){E(ze)}},[Ne,E]),Qs=_.useCallback(async(se,ye,Re)=>{try{await me.rejectProposal(se),Ne.markProposalStatus(ye,Re,!1)}catch(ze){E(ze)}},[Ne,E]),Xi=t.find(se=>se.id===x),$s=_.useMemo(()=>{const se=new Set(i.map(ye=>ye.id));return new Set([...B].filter(ye=>se.has(ye)))},[B,i]),Ki=$s.size,va=_.useMemo(()=>i.filter(se=>se.type==="section").sort((se,ye)=>se.orderIdx-ye.orderIdx),[i]),en=_.useMemo(()=>{const se=dE.map(Re=>L.find(ze=>ze.name===Re)).filter(Re=>!!Re),ye=L.filter(Re=>!dE.includes(Re.name));return[...se,...ye]},[L]),St=HI(x),Oa=VI(),Pt=jp();_.useEffect(()=>me.on("exam:status",ye=>{if(ye.status!=="ready"||ye.nodeId===q)return;const Re=i.find(ze=>ze.id===ye.nodeId);Re&&Pt.show(e("exam.ready.toast",{title:Re.title}),{duration:4e3})}),[q,i,Pt,e]);const jd=_.useCallback(async se=>{const ye=t.find(Re=>Re.id===se);try{await me.deleteCourse(se),Pt.show(e("import.deleted",{title:(ye==null?void 0:ye.title)??se}),{duration:3e3}),Ln()}catch(Re){E(Re)}},[t,Ln,E,Pt,e]),Ws=_.useCallback(async(se,ye,Re)=>{if(!se.trim()||Ne.streaming)return;if(!Me.activeId){const mt=await Me.ensureThreadForSend(se,ye);if(mt){Ne.send(se,mt,ye,Re);return}Pt.show(e("toast.threadCreateFailed"));return}const ze=Me.activeThread;ze&&!ze.title&&Me.update(ze.id,{title:(ye??se).trim()}),Ne.send(se,void 0,ye,Re)},[Ne,Me,Pt,e]),Zs=_.useRef(Ne.streaming);Zs.current=Ne.streaming;const Qi=_.useCallback(se=>{const ye=Vj(se,e),Re=Fj(se,e),ze=mt=>{var Bt;if(!Zs.current){(Bt=Gn.current)==null||Bt.call(Gn,ye,Re);return}mt>0&&setTimeout(()=>ze(mt-1),2e3)};ze(10)},[e]);Gn.current=Ws;const Ur=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Xn=_.useMemo(()=>{const se=Fv(Ne.messages).filter(Re=>{var ze;return Ur.has(((ze=Re.output)==null?void 0:ze.artifactType)??"")});if(se.length)return se[se.length-1];const ye=St.items.filter(Re=>Ur.has(Re.artifactType)).map(Re=>{try{return{id:Re.id,toolName:Re.artifactType,output:JSON.parse(Re.data)}}catch{return null}}).filter(Re=>Re!==null);return ye.length?ye[ye.length-1]:null},[Ne.messages,St.items]),Ia=_.useRef(new Set);_.useEffect(()=>{!Xn||Ia.current.has(Xn.id)||(Ia.current.add(Xn.id),Ne.streaming&&Y("board"))},[Xn,Ne.streaming]);const $i=_.useMemo(()=>Ne.messages.reduce((se,ye)=>se+ye.parts.reduce((Re,ze)=>ze.type==="text"?Re+CE(ze.text):Re,0),0),[Ne.messages]),ja=_.useRef(!1);_.useEffect(()=>{Ki>0&&!ja.current&&(ja.current=!0,Pt.show(e("review.nudge",{n:Ki}),{duration:4e3}))},[Ki,Pt,e]);const Vt=_.useMemo(()=>Fv(Ne.messages),[Ne.messages]),Js=_.useRef(new Set);_.useEffect(()=>{for(const se of Vt){const ye=se.output;if(!ye||!ye.artifactType)continue;const Re=`${ye.artifactType}:${JSON.stringify(ye)}`;Js.current.has(Re)||(Js.current.add(Re),St.save({nodeId:q,artifactType:ye.artifactType,title:ye.title??null,data:ye}),Pt.show(e("toast.artifactSaved"),{duration:3e3}))}},[Vt,St,q,Pt,e]),_.useEffect(()=>{R!=="map"&&Y(null)},[R]);const[Ql,ca]=_.useState(!1),[li,eo]=_.useState(!1);return m.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[m.jsx(iU,{streak:c,xp:f,fontSize:Oa.size,onFontBump:Oa.bump,onOpenSettings:()=>U(!0),leftVisible:yt,rightVisible:Ot,onToggleLeft:Se,onToggleRight:Qe,tier:ce,bottomBar:ce===3?m.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:sp,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:NC,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:OC,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:se,icon:ye,label:Re,testid:ze})=>m.jsx("button",{role:"tab","aria-selected":Je===se,"aria-label":Re,"data-testid":ze,"data-tooltip":Re,onClick:()=>it(se),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${Je===se?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:m.jsx(ye,{className:"w-4 h-4"})},se))}):void 0}),g&&m.jsx(oU,{message:g,onClose:()=>y(null)}),m.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:pt,onTouchEnd:rt,children:[yt&&m.jsx(o5,{fullWidth:ce===3,view:R,onViewChange:j,courseTitle:(Xi==null?void 0:Xi.title)??null,courseId:x,courses:t,sections:va,tree:i,progressMap:s,selectedNodeId:q,dueCount:Ki,dueNodeIds:$s,overallMastery:(D==null?void 0:D.overallMastery)??0,streak:(c==null?void 0:c.currentStreak)??0,streaming:Ne.streaming,onJumpNode:se=>{if(Ne.streaming)return;const ye=i.find(Re=>Re.id===se);ye&&Gi(ye),ce===3&&it("chat")},onOpenReview:()=>ca(!0),onSelectCourse:se=>Yi(()=>{b(se),Ln()}),onDeleteCourse:se=>Yi(()=>{jd(se)}),onCoursesChanged:()=>{Ln()},availableLanguages:T,currentLocale:M,onLocaleChange:async se=>{x&&(await me.setCourseLanguage(x,se),N(se))}}),m.jsxs(m.Fragment,{children:[Xt&&m.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:ce===3?{flex:1}:Ot?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:x?(dt==null?void 0:dt.type)==="exam"?m.jsx(wj,{examNode:dt,locale:$e,onSessionChange:Id,paused:G.open,onExamCompleted:()=>{me.getProgress(dt.id).then(se=>{se&&l(ye=>({...ye,[dt.id]:se}))})}}):m.jsxs(m.Fragment,{children:[m.jsx(Yj,{threads:Me.threads,activeThread:Me.activeThread,focusNodeTitle:(dt==null?void 0:dt.title)??null,onPickThread:se=>{Ne.streaming||Me.setActiveId(se)},onCreate:()=>{Ne.streaming||(Me.create({title:null}),Pt.show(e("toast.threadCreated")))},onRename:(se,ye)=>{Me.update(se,{title:ye}),Pt.show(e("toast.threadRenamed"))},onArchive:se=>{Me.update(se,{status:"archived"}),Pt.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>Me.update(se,{status:"active"})}})},onDelete:se=>{const ye=Me.removeWithUndo(se);ye&&(Pt.show(`${e("toast.threadDeleted")}${ye.title?`「${ye.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{Me.restore(ye),Pt.show(e("toast.restored"))}}}),setTimeout(()=>{me.threadDelete(ye.id).catch(()=>{})},5500))}}),m.jsx(XI,{messages:Ne.messages,streaming:Ne.streaming,onApplyProposal:Kl,onRejectProposal:Qs,summary:vt,onStartLearning:je!=null&&je.ready?Pr:void 0,agentReady:(je==null?void 0:je.ready)??!1,onGotoSettings:()=>U(!0),hasNode:!!dt,selectedNodeId:q,threadId:Me.activeId,onPickQuizAction:se=>{Ws(se)},onQuizCompleted:Qi,cardMode:ce===3,chatNotes:St.items.filter(se=>se.artifactType==="user_note"&&se.sourceAnchor),onSaveChatNote:(se,ye,Re,ze)=>{!dt||!Me.activeId||(St.saveUserNote({nodeId:dt.id,text:se,sourceType:"chat",sourceAnchor:{type:"chat",threadId:Me.activeId,msgId:ye,startOffset:Re,endOffset:ze}}),Pt.show(e("toast.noteSaved"),{duration:2e3}))}}),m.jsx(yj,{nodeId:q,agentReady:(je==null?void 0:je.ready)??!1,streaming:Ne.streaming,souls:en,activeSoul:C,starterPrompts:Ne.messages.length>0?Od:[],onPickSoul:Xl,onSend:Ws,onStop:Ne.stop,onLogFriction:q?(se,ye)=>{me.logFriction(q,se,ye),Pt.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>U(!0),insertText:nt,historyTokens:$i})]}):m.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:m.jsxs("div",{className:"text-center max-w-sm",children:[m.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),m.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),Ot&&m.jsx("main",{className:ce===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":ce===3?"notebook-pane-full":void 0,children:m.jsx(jI,{selectedNode:dt,items:St.items,loading:St.loading,forceTab:F,canvasArtifact:Xn,onUserTabChange:()=>Y(null),onRemove:se=>{St.remove(se),Pt.show(e("toast.noteDeleted"))},onTogglePin:se=>{St.togglePin(se)},onRecordQuizResult:(se,ye)=>{St.recordQuizResult(se,ye)},onUpdateNoteComment:(se,ye)=>{St.updateUserNoteComment(se,ye)},onSaveContentNote:(se,ye)=>{dt&&(St.saveUserNote({nodeId:dt.id,text:se,sourceType:"content",sourceAnchor:ye}),Pt.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:rn,onQuoteToChat:We,locale:M,isReviewing:li,onReviewDone:()=>eo(!1)})})]})]}),J&&m.jsx(rU,{onClose:()=>U(!1)}),Ql&&m.jsx(sU,{onClose:()=>ca(!1),tree:i,dashboard:D,progressMap:s,onPickNode:se=>{Yi(()=>{z(se),Y("content"),ca(!1),eo(!0)})}}),G.open&&m.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:m.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:[m.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[m.jsx(ri,{className:"w-5 h-5 text-warning shrink-0"}),m.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),m.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.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")}),m.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 Gl(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),fe&&m.jsx(Nj,{onClose:()=>Be(!1),onPick:se=>{Be(!1),aU(se)},hasNode:!!q}),m.jsx(b5,{}),m.jsx(tU,{})]})}function aU(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function iU({streak:e,xp:t,fontSize:n,onFontBump:i,onOpenSettings:o,leftVisible:s,rightVisible:l,onToggleLeft:c,onToggleRight:d,tier:f,bottomBar:p}){const x=Ve();return p?m.jsx("header",{className:"app-header shrink-0",children:m.jsxs("div",{className:"flex items-center h-12 px-4",children:[m.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&m.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:x("header.energy"),children:[m.jsx(l0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),m.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),p,m.jsx("div",{className:"flex-1 flex items-center justify-end",children:m.jsx("button",{onClick:o,"data-testid":"header-settings","aria-label":x("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:x("header.settings"),children:m.jsx(Vc,{className:"w-4 h-4"})})})]})}):m.jsx("header",{className:"app-header shrink-0 flex flex-col",children:m.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[m.jsx("div",{className:"flex items-center gap-2 min-w-0",children:m.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",m.jsx("span",{className:"text-brand",children:"Study"})]})}),m.jsxs("div",{className:"flex items-center gap-3",children:[f!==3&&m.jsxs("div",{className:"flex items-center gap-0.5",children:[m.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:x("header.toggleLeft"),children:m.jsx(RC,{className:"w-4 h-4"})}),m.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:x("header.toggleRight"),children:m.jsx(DC,{className:"w-4 h-4"})})]}),f!==3&&m.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[m.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:x("header.font.smaller"),children:"A-"}),m.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:x("header.font.larger"),children:"A+"})]}),t&&m.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:x("header.energy"),children:[m.jsx(l0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),m.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),m.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&m.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:x("header.level.title"),children:m.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&m.jsx(lU,{streak:e}),m.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:x("header.settings"),children:m.jsx(Vc,{className:"w-4 h-4"})})]})]})})}function rU({onClose:e}){const t=Ve(),n=_.useRef(null);return Us(n,!0),m.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.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:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[m.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),m.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:"✕"})]}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsx(Rj,{})})]})]})}function sU({onClose:e,tree:t,onPickNode:n,dashboard:i,progressMap:o}){const s=Ve(),l=_.useRef(null);Us(l,!0);const[c,d]=_.useState([]);_.useEffect(()=>{me.getAllSrsItems().then(N=>d(N)).catch(()=>d([]))},[]);const f=_.useMemo(()=>new Map(c.map(N=>[N.nodeId,N])),[c]),p=_.useMemo(()=>{const N=new Map(t.map(A=>[A.id,A])),L=c.filter(A=>N.has(A.nodeId));return{overdue:L.filter(A=>A.overdue),short:L.filter(A=>!A.overdue&&A.intervalDays>0&&A.intervalDays<=7),long:L.filter(A=>!A.overdue&&A.intervalDays>7),inactive:L.filter(A=>A.repetitions===0&&!A.overdue)}},[c,t]),x=_.useMemo(()=>t.filter(L=>L.type==="section"&&(L.world??"study")==="study").sort((L,A)=>L.orderIdx-A.orderIdx).map(L=>({section:L,lessons:t.filter(A=>A.parentId===L.id&&A.type==="lesson").sort((A,C)=>A.orderIdx-C.orderIdx)})),[t]),b=_.useMemo(()=>{const N=new Map;for(const L of(i==null?void 0:i.sections)??[])N.set(L.sectionId,L.avgMastery);return N},[i]),g=_.useMemo(()=>t.filter(N=>{var A;const L=(A=o[N.id])==null?void 0:A.status;return N.type==="lesson"&&(N.world??"study")==="study"&&(L==="in_progress"||L==="mastered")}),[t,o]),[y,E]=_.useState(new Set),T=N=>E(L=>{const A=new Set(L);return A.has(N)?A.delete(N):A.add(N),A}),w=N=>{const L=f.get(N);return L?L.overdue?{color:"bg-review",title:s("review.quadrant.overdue")}:L.intervalDays>0&&L.intervalDays<=7?{color:"bg-gold",title:s("review.quadrant.short")}:L.intervalDays>7?{color:"bg-brand",title:s("review.quadrant.long")}:null:null},M=p.overdue.length>0;return m.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.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:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[m.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[m.jsx(ii,{className:"w-4 h-4","aria-hidden":"true"})," ",s("review.title")]}),m.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:"✕"})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[g.length>0&&m.jsxs("button",{onClick:()=>{const N=g[Math.floor(Math.random()*g.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:[m.jsx(FC,{className:"w-4 h-4"}),s("review.interleave")]}),c.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.srsHint")}),m.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:p.overdue,label:s("review.quadrant.overdue"),dot:"bg-review"},{items:p.short,label:s("review.quadrant.short"),dot:"bg-gold"},{items:p.long,label:s("review.quadrant.long"),dot:"bg-brand"},{items:p.inactive,label:s("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(N=>N.items.length>0).map(N=>m.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[m.jsx("span",{className:`w-2 h-2 rounded-full ${N.dot}`}),m.jsx("span",{className:"text-label text-ink-muted",children:N.label}),m.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:N.items.length})]},N.label))}),M&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:s("review.overdueQuickHint")}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.overdue.slice(0,8).map(N=>{const L=t.find(A=>A.id===N.nodeId);return L?m.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:L.title},N.nodeId):null})})]})]}),x.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.myProgress")}),m.jsx("div",{className:"space-y-1",children:x.map(({section:N,lessons:L})=>{const A=Math.round((b.get(N.id)??0)*100),C=y.has(N.id),I=L.filter(R=>{var D;const j=(D=o[R.id])==null?void 0:D.status;return j==="in_progress"||j==="mastered"});return m.jsxs("div",{children:[m.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?m.jsx(ip,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):m.jsx(fC,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:N.title}),I.length>0&&m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:m.jsx("div",{className:`h-full rounded-full ${A>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,A)}%`}})}),m.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[A,"%"]})]})]}),C&&m.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:L.length===0?m.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):L.map(R=>{const j=o[R.id],D=j?Math.round((j.mastery??0)*100):null,P=w(R.id),B=(j==null?void 0:j.status)==="in_progress"||(j==null?void 0:j.status)==="mastered";return m.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?m.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${P.color} shrink-0`,title:P.title}):m.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),m.jsx("span",{className:`text-label truncate flex-1 ${B?"text-ink-strong":"text-ink-faint"}`,children:R.title}),D!==null&&m.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[D,"%"]}),B&&m.jsx("button",{onClick:()=>n(R.id),"data-testid":`review-lesson-${R.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")})]},R.id)})})]},N.id)})})]}),i&&i.frictionByNode.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:s("dashboard.mini.struggle")}),i.frictionByNode.map(N=>m.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:[m.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[N.count,"×"]}),m.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:N.title})]},N.nodeId))]}),g.length===0&&c.length===0&&x.length===0&&m.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body text-ink-muted",children:s("review.empty.title")}),m.jsx("div",{className:"text-label text-ink-faint mt-1",children:s("review.empty.desc")})]})]})]})]})}function oU({message:e,onClose:t}){const n=Ve();return m.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:[m.jsxs("span",{children:["⚠️ ",e]}),m.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function lU({streak:e}){const t=Ve();return m.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:[m.jsx(vE,{className:"w-4 h-4 text-review flame-flicker"}),m.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&m.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:[m.jsx(HC,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),m.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 uU({rejected:e}){const t=navigator.language.startsWith("zh"),[n,i]=ap.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&&Hc(async()=>{const{setWebToken:d}=await import("./api-web-CfrRrKkd.js");return{setWebToken:d}},[],import.meta.url).then(({setWebToken:d})=>d(c))};return m.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:m.jsxs("form",{onSubmit:o,className:"w-full max-w-sm text-center",children:[m.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),m.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),m.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&&m.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),m.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"}),m.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"}),m.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 jw=aC.createRoot(document.getElementById("root"));function cU(){jw.render(m.jsx(ap.StrictMode,{children:m.jsx(RI,{children:m.jsx(nU,{})})}))}function fE(e){jw.render(m.jsx(ap.StrictMode,{children:m.jsx(uU,{rejected:e})}))}async function dU(){const{installAppHeight:e}=await Hc(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await Hc(()=>import("./api-web-CfrRrKkd.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>fE(!0)),!t.hasWebToken()){fE(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}cU()}dU();export{Hc as _,Rl as g};