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
@@ -1,553 +0,0 @@
1
- var VA=Object.defineProperty;var qA=(e,t,n)=>t in e?VA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qh=(e,t,n)=>qA(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 YA="modulepreload",GA=function(e,t){return new URL(e,t).href},$b={},Uc=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let l=function(m){return Promise.all(m.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(m=>{if(m=GA(m,i),m in $b)return;$b[m]=!0;const x=m.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(!!i)for(let E=c.length-1;E>=0;E--){const T=c[E];if(T.href===m&&(!x||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const y=document.createElement("link");if(y.rel=x?"stylesheet":YA,x||(y.as="script"),y.crossOrigin="",y.href=m,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 ${m}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var Qb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh={exports:{}},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 Wb;function XA(){if(Wb)return Vo;Wb=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 Zb;function KA(){return Zb||(Zb=1,Yh.exports=XA()),Yh.exports}var g=KA(),Gh={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 Jb;function $A(){if(Jb)return Xe;Jb=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"),m=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function p(Y){return Y===null||typeof Y!="object"?null:(Y=b&&Y[b]||Y["@@iterator"],typeof Y=="function"?Y:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function w(Y,te,U){this.props=Y,this.context=te,this.refs=T,this.updater=U||y}w.prototype.isReactComponent={},w.prototype.setState=function(Y,te){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,te,"setState")},w.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function M(){}M.prototype=w.prototype;function N(Y,te,U){this.props=Y,this.context=te,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,te,U){var ie=U.ref;return{$$typeof:e,type:Y,key:te,ref:ie!==void 0?ie:null,props:U}}function D(Y,te){return j(Y.type,te,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function B(Y){var te={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(U){return te[U]})}var Q=/\/+/g;function F(Y,te){return typeof Y=="object"&&Y!==null&&Y.key!=null?B(""+Y.key):te.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(te){Y.status==="pending"&&(Y.status="fulfilled",Y.value=te)},function(te){Y.status==="pending"&&(Y.status="rejected",Y.reason=te)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function H(Y,te,U,ie,K){var $=typeof Y;($==="undefined"||$==="boolean")&&(Y=null);var J=!1;if(Y===null)J=!0;else switch($){case"bigint":case"string":case"number":J=!0;break;case"object":switch(Y.$$typeof){case e:case t:J=!0;break;case m:return J=Y._init,H(J(Y._payload),te,U,ie,K)}}if(J)return K=K(Y),J=ie===""?"."+F(Y,0):ie,A(K)?(U="",J!=null&&(U=J.replace(Q,"$&/")+"/"),H(K,te,U,"",function(Pe){return Pe})):K!=null&&(P(K)&&(K=D(K,U+(K.key==null||Y&&Y.key===K.key?"":(""+K.key).replace(Q,"$&/")+"/")+J)),te.push(K)),1;J=0;var se=ie===""?".":ie+":";if(A(Y))for(var ke=0;ke<Y.length;ke++)ie=Y[ke],$=se+F(ie,ke),J+=H(ie,te,U,$,K);else if(ke=p(Y),typeof ke=="function")for(Y=ke.call(Y),ke=0;!(ie=Y.next()).done;)ie=ie.value,$=se+F(ie,ke++),J+=H(ie,te,U,$,K);else if($==="object"){if(typeof Y.then=="function")return H(z(Y),te,U,ie,K);throw te=String(Y),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return J}function G(Y,te,U){if(Y==null)return Y;var ie=[],K=0;return H(Y,ie,"","",function($){return te.call(U,$,K++)}),ie}function W(Y){if(Y._status===-1){var te=Y._result;te=te(),te.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=te)}if(Y._status===1)return Y._result.default;throw Y._result}var ae=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=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(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},V={map:G,forEach:function(Y,te,U){G(Y,function(){te.apply(this,arguments)},U)},count:function(Y){var te=0;return G(Y,function(){te++}),te},toArray:function(Y){return G(Y,function(te){return te})||[]},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=V,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,te,U){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var ie=E({},Y.props),K=Y.key;if(te!=null)for($ in te.key!==void 0&&(K=""+te.key),te)!R.call(te,$)||$==="key"||$==="__self"||$==="__source"||$==="ref"&&te.ref===void 0||(ie[$]=te[$]);var $=arguments.length-2;if($===1)ie.children=U;else if(1<$){for(var J=Array($),se=0;se<$;se++)J[se]=arguments[se+2];ie.children=J}return j(Y.type,K,ie)},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,te,U){var ie,K={},$=null;if(te!=null)for(ie in te.key!==void 0&&($=""+te.key),te)R.call(te,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(K[ie]=te[ie]);var J=arguments.length-2;if(J===1)K.children=U;else if(1<J){for(var se=Array(J),ke=0;ke<J;ke++)se[ke]=arguments[ke+2];K.children=se}if(Y&&Y.defaultProps)for(ie in J=Y.defaultProps,J)K[ie]===void 0&&(K[ie]=J[ie]);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:m,_payload:{_status:-1,_result:Y},_init:W}},Xe.memo=function(Y,te){return{$$typeof:f,type:Y,compare:te===void 0?null:te}},Xe.startTransition=function(Y){var te=I.T,U={};I.T=U;try{var ie=Y(),K=I.S;K!==null&&K(U,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(C,ae)}catch($){ae($)}finally{te!==null&&U.types!==null&&(te.types=U.types),I.T=te}},Xe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Xe.use=function(Y){return I.H.use(Y)},Xe.useActionState=function(Y,te,U){return I.H.useActionState(Y,te,U)},Xe.useCallback=function(Y,te){return I.H.useCallback(Y,te)},Xe.useContext=function(Y){return I.H.useContext(Y)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(Y,te){return I.H.useDeferredValue(Y,te)},Xe.useEffect=function(Y,te){return I.H.useEffect(Y,te)},Xe.useEffectEvent=function(Y){return I.H.useEffectEvent(Y)},Xe.useId=function(){return I.H.useId()},Xe.useImperativeHandle=function(Y,te,U){return I.H.useImperativeHandle(Y,te,U)},Xe.useInsertionEffect=function(Y,te){return I.H.useInsertionEffect(Y,te)},Xe.useLayoutEffect=function(Y,te){return I.H.useLayoutEffect(Y,te)},Xe.useMemo=function(Y,te){return I.H.useMemo(Y,te)},Xe.useOptimistic=function(Y,te){return I.H.useOptimistic(Y,te)},Xe.useReducer=function(Y,te,U){return I.H.useReducer(Y,te,U)},Xe.useRef=function(Y){return I.H.useRef(Y)},Xe.useState=function(Y){return I.H.useState(Y)},Xe.useSyncExternalStore=function(Y,te,U){return I.H.useSyncExternalStore(Y,te,U)},Xe.useTransition=function(){return I.H.useTransition()},Xe.version="19.2.8",Xe}var ey;function tp(){return ey||(ey=1,Gh.exports=$A()),Gh.exports}var _=tp();const np=Ml(_);var Xh={exports:{}},qo={},Kh={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 ty;function QA(){return ty||(ty=1,(function(e){function t(H,G){var W=H.length;H.push(G);e:for(;0<W;){var ae=W-1>>>1,V=H[ae];if(0<o(V,G))H[ae]=G,H[W]=V,W=ae;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],W=H.pop();if(W!==G){H[0]=W;e:for(var ae=0,V=H.length,Y=V>>>1;ae<Y;){var te=2*(ae+1)-1,U=H[te],ie=te+1,K=H[ie];if(0>o(U,W))ie<V&&0>o(K,U)?(H[ae]=K,H[ie]=W,ae=ie):(H[ae]=U,H[te]=W,ae=te);else if(ie<V&&0>o(K,W))H[ae]=K,H[ie]=W,ae=ie;else break e}}return G}function o(H,G){var W=H.sortIndex-G.sortIndex;return W!==0?W: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=[],m=1,x=null,b=3,p=!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),p=!0;var W=b;try{t:{for(L(H),x=n(d);x!==null&&!(x.expirationTime>H&&D());){var ae=x.callback;if(typeof ae=="function"){x.callback=null,b=x.priorityLevel;var V=ae(x.expirationTime<=H);if(H=e.unstable_now(),typeof V=="function"){x.callback=V,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=W,p=!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,F=Q.port2;Q.port1.onmessage=P,B=function(){F.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 W=b;b=G;try{return H()}finally{b=W}},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 W=b;b=H;try{return G()}finally{b=W}},e.unstable_scheduleCallback=function(H,G,W){var ae=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ae+W:ae):W=ae,H){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=W+V,H={id:m++,callback:G,priorityLevel:H,startTime:W,expirationTime:V,sortIndex:-1},W>ae?(H.sortIndex=W,t(f,H),n(d)===null&&H===n(f)&&(E?(M(I),I=-1):E=!0,z(A,W-ae))):(H.sortIndex=V,t(d,H),y||p||(y=!0,C||(C=!0,B()))),H},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(H){var G=b;return function(){var W=b;b=G;try{return H.apply(this,arguments)}finally{b=W}}}})($h)),$h}var ny;function WA(){return ny||(ny=1,Kh.exports=QA()),Kh.exports}var Qh={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 ay;function ZA(){if(ay)return pn;ay=1;var e=tp();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}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,m){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:m}}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 m=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,m)},pn.flushSync=function(d){var f=l.T,m=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=f,i.p=m,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 m=f.as,x=c(m,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,p=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?i.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:p}):m==="script"&&i.d.X(d,{crossOrigin:x,integrity:b,fetchPriority:p,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 m=c(f.as,f.crossOrigin);i.d.M(d,{crossOrigin:m,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 m=f.as,x=c(m,f.crossOrigin);i.d.L(d,m,{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 m=c(f.as,f.crossOrigin);i.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,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,m){return l.H.useFormState(d,f,m)},pn.useFormStatus=function(){return l.H.useHostTransitionStatus()},pn.version="19.2.8",pn}var iy;function hE(){if(iy)return Qh.exports;iy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qh.exports=ZA(),Qh.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 ry;function JA(){if(ry)return qo;ry=1;var e=WA(),t=tp(),n=hE();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,q=v.child;q;){if(q===u){O=!0,u=v,h=S;break}if(q===h){O=!0,h=v,u=S;break}q=q.sibling}if(!O){for(q=S.child;q;){if(q===u){O=!0,u=S,h=v;break}if(q===h){O=!0,h=S,u=v;break}q=q.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 m(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=m(a),r!==null)return r;a=a.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),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 F(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:F(a.type)||"Memo";case R:r=a._payload,a=a._init;try{return F(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,W={pending:!1,data:null,method:null,action:null},ae=[],V=-1;function Y(a){return{current:a}}function te(a){0>V||(a.current=ae[V],ae[V]=null,V--)}function U(a,r){V++,ae[V]=a.current,a.current=r}var ie=Y(null),K=Y(null),$=Y(null),J=Y(null);function se(a,r){switch(U($,r),U(K,a),U(ie,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?bb(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=bb(r),a=yb(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}te(ie),U(ie,a)}function ke(){te(ie),te(K),te($)}function Pe(a){a.memoizedState!==null&&U(J,a);var r=ie.current,u=yb(r,a.type);r!==u&&(U(K,a),U(ie,u))}function Be(a){K.current===a&&(te(ie),te(K)),J.current===a&&(te(J),zo._currentValue=W)}var ze,St;function pt(a){if(ze===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);ze=r&&r[1]||"",St=-1<u.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ze+a+St}var ye=!1;function Ke(a,r){if(!a||ye)return"";ye=!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(pe){var he=pe}Reflect.construct(a,[],Te)}else{try{Te.call()}catch(pe){he=pe}a.call(Te.prototype)}}else{try{throw Error()}catch(pe){he=pe}(Te=a())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.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],q=S[1];if(O&&q){var ne=O.split(`
44
- `),de=q.split(`
45
- `);for(v=h=0;h<ne.length&&!ne[h].includes("DetermineComponentFrameRoot");)h++;for(;v<de.length&&!de[v].includes("DetermineComponentFrameRoot");)v++;if(h===ne.length||v===de.length)for(h=ne.length-1,v=de.length-1;1<=h&&0<=v&&ne[h]!==de[v];)v--;for(;1<=h&&0<=v;h--,v--)if(ne[h]!==de[v]){if(h!==1||v!==1)do if(h--,v--,0>v||ne[h]!==de[v]){var be=`
46
- `+ne[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{ye=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?pt(u):""}function Ot(a,r){switch(a.tag){case 26:case 27:case 5:return pt(a.type);case 16:return pt("Lazy");case 13:return a.child!==r&&r!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return Ke(a.type,!1);case 11:return Ke(a.type.render,!1);case 1:return Ke(a.type,!0);case 31:return pt("Activity");default:return""}}function Bt(a){try{var r="",u=null;do r+=Ot(a,u),u=a,a=a.return;while(a);return r}catch(h){return`
47
- Error generating stack: `+h.message+`
48
- `+h.stack}}var zt=Object.prototype.hasOwnProperty,ht=e.unstable_scheduleCallback,ln=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,xe=e.unstable_requestPaint,Fe=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Me=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Ne=e.log,et=e.unstable_setDisableYieldValue,Je=null,Qe=null;function an(a){if(typeof Ne=="function"&&et(a),Qe&&typeof Qe.setStrictMode=="function")try{Qe.setStrictMode(Je,a)}catch{}}var gt=Math.clz32?Math.clz32:Ld,Yn=Math.log,ot=Math.LN2;function Ld(a){return a>>>=0,a===0?32:31-(Yn(a)/ot|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 q=h&134217727;return q!==0?(h=q&~S,h!==0?v=ua(h):(O&=q,O!==0?v=ua(O):u||(u=q&~a,u!==0&&(v=ua(u))))):(q=h&~S,q!==0?v=ua(q):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 Od(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 q=a.entanglements,ne=a.expirationTimes,de=a.hiddenUpdates;for(u=O&~u;0<u;){var be=31-gt(u),Te=1<<be;q[be]=0,ne[be]=-1;var he=de[be];if(he!==null)for(de[be]=null,be=0;be<he.length;be++){var pe=he[be];pe!==null&&(pe.lane&=-536870913)}u&=~Te}h!==0&&Yl(a,h,0),S!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=S&~(O&~r))}function Yl(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var h=31-gt(r);a.entangledLanes|=r,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function Gl(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var h=31-gt(u),v=1<<h;v&r|a[h]&r&&(a[h]|=r),u&=~v}}function Xl(a,r){var u=r&-r;return u=(u&42)!==0?1:$s(u),(u&(a.suspendedLanes|r))!==0?0:u}function $s(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 Qs(){var a=G.p;return a!==0?a:(a=window.event,a===void 0?32:Fb(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),Jt="__reactFiber$"+va,yt="__reactProps$"+va,Oa="__reactContainer$"+va,It="__reactEvents$"+va,Id="__reactListeners$"+va,Ws="__reactHandles$"+va,Zs="__reactResources$"+va,$i="__reactMarker$"+va;function Ur(a){delete a[Jt],delete a[yt],delete a[It],delete a[Id],delete a[Ws]}function Xn(a){var r=a[Jt];if(r)return r;for(var u=a.parentNode;u;){if(r=u[Oa]||u[Jt]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Ab(a);a!==null;){if(u=a[Jt])return u;a=Ab(a)}return r}a=u,u=a.parentNode}return null}function Ia(a){if(a=a[Jt]||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 Qi(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[$i]=!0}var Js=new Set,Kl={};function ca(a,r){li(a,r),li(a+"Capture",r)}function li(a,r){for(Kl[a]=r,a=0;a<r.length;a++)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]*$"),le={},ve={};function _e(a){return zt.call(ve,a)?!0:zt.call(le,a)?!1:eo.test(a)?ve[a]=!0:(le[a]=!0,!1)}function Ue(a,r,u){if(_e(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 ct(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 jt(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 cg(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function jw(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 jd(a){if(!a._valueTracker){var r=cg(a)?"checked":"value";a._valueTracker=jw(a,r,""+a[r])}}function dg(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),h="";return a&&(h=cg(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 Pw=/[\n"\\]/g;function Kn(a){return a.replace(Pw,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Pd(a,r,u,h,v,S,O,q){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?Bd(a,O,Sn(r)):u!=null?Bd(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"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?a.name=""+Sn(q):a.removeAttribute("name")}function fg(a,r,u,h,v,S,O,q){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),r!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||r!=null)){jd(a);return}u=u!=null?""+Sn(u):"",r=r!=null?""+Sn(r):u,q||r===a.value||(a.value=r),a.defaultValue=r}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=q?a.checked:!!h,a.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.name=O),jd(a)}function Bd(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 hg(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 mg(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),jd(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 Bw=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 pg(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||Bw.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function gg(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&&pg(a,v,h)}else for(var S in r)r.hasOwnProperty(S)&&pg(a,S,r[S])}function zd(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 zw=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"]]),Uw=/^[\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 Ql(a){return Uw.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Pa(){}var Ud=null;function Hd(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 xg(a){var r=Ia(a);if(r&&(a=r.stateNode)){var u=a[yt]||null;e:switch(a=r.stateNode,r.type){case"input":if(Pd(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Kn(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var h=u[r];if(h!==a&&h.form===a.form){var v=h[yt]||null;if(!v)throw Error(i(90));Pd(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&&dg(h)}break e;case"textarea":hg(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&Hr(a,!!u.multiple,r,!1)}}}var Fd=!1;function bg(a,r,u){if(Fd)return a(r,u);Fd=!0;try{var h=a(r);return h}finally{if(Fd=!1,(Vr!==null||qr!==null)&&(Pu(),Vr&&(r=Vr,a=qr,qr=Vr=null,xg(r),a)))for(r=0;r<a.length;r++)xg(a[r])}}function to(a,r){var u=a.stateNode;if(u===null)return null;var h=u[yt]||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"),Vd=!1;if(Ba)try{var no={};Object.defineProperty(no,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Vd=!1}var ui=null,qd=null,Wl=null;function yg(){if(Wl)return Wl;var a,r=qd,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 Wl=v.slice(a,1<h?1-h:void 0)}function Zl(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function Jl(){return!0}function vg(){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 q in a)a.hasOwnProperty(q)&&(u=a[q],this[q]=u?u(S):S[q]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Jl:vg,this.isPropagationStopped=vg,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=Jl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),r}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=kn(Wi),ao=x({},Wi,{view:0,detail:0}),Hw=kn(ao),Yd,Gd,io,tu=x({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==io&&(io&&a.type==="mousemove"?(Yd=a.screenX-io.screenX,Gd=a.screenY-io.screenY):Gd=Yd=0,io=a),Yd)},movementY:function(a){return"movementY"in a?a.movementY:Gd}}),Eg=kn(tu),Fw=x({},tu,{dataTransfer:0}),Vw=kn(Fw),qw=x({},ao,{relatedTarget:0}),Xd=kn(qw),Yw=x({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),Gw=kn(Yw),Xw=x({},Wi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Kw=kn(Xw),$w=x({},Wi,{data:0}),Tg=kn($w),Qw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ww={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"},Zw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jw(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=Zw[a])?!!r[a]:!1}function Kd(){return Jw}var e3=x({},ao,{key:function(a){if(a.key){var r=Qw[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Zl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Ww[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kd,charCode:function(a){return a.type==="keypress"?Zl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Zl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),t3=kn(e3),n3=x({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sg=kn(n3),a3=x({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kd}),i3=kn(a3),r3=x({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),s3=kn(r3),o3=x({},tu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),l3=kn(o3),u3=x({},Wi,{newState:0,oldState:0}),c3=kn(u3),d3=[9,13,27,32],$d=Ba&&"CompositionEvent"in window,ro=null;Ba&&"documentMode"in document&&(ro=document.documentMode);var f3=Ba&&"TextEvent"in window&&!ro,kg=Ba&&(!$d||ro&&8<ro&&11>=ro),wg=" ",Ag=!1;function Cg(a,r){switch(a){case"keyup":return d3.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ng(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Yr=!1;function h3(a,r){switch(a){case"compositionend":return Ng(r);case"keypress":return r.which!==32?null:(Ag=!0,wg);case"textInput":return a=r.data,a===wg&&Ag?null:a;default:return null}}function m3(a,r){if(Yr)return a==="compositionend"||!$d&&Cg(a,r)?(a=yg(),Wl=qd=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 kg&&r.locale!=="ko"?null:r.data;default:return null}}var p3={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 _g(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!p3[a.type]:r==="textarea"}function Mg(a,r,u,h){Vr?qr?qr.push(h):qr=[h]:Vr=h,r=qu(r,"onChange"),0<r.length&&(u=new eu("onChange","change",null,u,h),a.push({event:u,listeners:r}))}var so=null,oo=null;function g3(a){fb(a,0)}function nu(a){var r=Qi(a);if(dg(r))return a}function Rg(a,r){if(a==="change")return r}var Dg=!1;if(Ba){var Qd;if(Ba){var Wd="oninput"in document;if(!Wd){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),Wd=typeof Lg.oninput=="function"}Qd=Wd}else Qd=!1;Dg=Qd&&(!document.documentMode||9<document.documentMode)}function Og(){so&&(so.detachEvent("onpropertychange",Ig),oo=so=null)}function Ig(a){if(a.propertyName==="value"&&nu(oo)){var r=[];Mg(r,oo,a,Hd(a)),bg(g3,r)}}function x3(a,r,u){a==="focusin"?(Og(),so=r,oo=u,so.attachEvent("onpropertychange",Ig)):a==="focusout"&&Og()}function b3(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return nu(oo)}function y3(a,r){if(a==="click")return nu(r)}function v3(a,r){if(a==="input"||a==="change")return nu(r)}function E3(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var On=typeof Object.is=="function"?Object.is:E3;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(!zt.call(r,v)||!On(a[v],r[v]))return!1}return!0}function jg(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Pg(a,r){var u=jg(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=jg(u)}}function Bg(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?Bg(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function zg(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 Zd(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var T3=Ba&&"documentMode"in document&&11>=document.documentMode,Gr=null,Jd=null,uo=null,ef=!1;function Ug(a,r,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ef||Gr==null||Gr!==$l(h)||(h=Gr,"selectionStart"in h&&Zd(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=qu(Jd,"onSelect"),0<h.length&&(r=new eu("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")},tf={},Hg={};Ba&&(Hg=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(tf[a])return tf[a];if(!Xr[a])return a;var r=Xr[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Hg)return tf[a]=r[u];return a}var Fg=Ji("animationend"),Vg=Ji("animationiteration"),qg=Ji("animationstart"),S3=Ji("transitionrun"),k3=Ji("transitionstart"),w3=Ji("transitioncancel"),Yg=Ji("transitionend"),Gg=new Map,nf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");nf.push("scrollEnd");function da(a,r){Gg.set(a,r),ca(r,[a])}var au=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},$n=[],Kr=0,af=0;function iu(){for(var a=Kr,r=af=Kr=0;r<a;){var u=$n[r];$n[r++]=null;var h=$n[r];$n[r++]=null;var v=$n[r];$n[r++]=null;var S=$n[r];if($n[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&&Xg(u,v,S)}}function ru(a,r,u,h){$n[Kr++]=a,$n[Kr++]=r,$n[Kr++]=u,$n[Kr++]=h,af|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function rf(a,r,u,h){return ru(a,r,u,h),su(a)}function er(a,r){return ru(a,null,null,r),su(a)}function Xg(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-gt(u),a=S.hiddenUpdates,h=a[v],h===null?a[v]=[r]:h.push(r),r.lane=u|536870912),S):null}function su(a){if(50<Do)throw Do=0,mh=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var $r={};function A3(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 A3(a,r,u,h)}function sf(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 Kg(a,r){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,r=u.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function ou(a,r,u,h,v,S){var O=0;if(h=a,typeof a=="function")sf(a)&&(O=1);else if(typeof a=="string")O=RA(a,u,ie.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 of(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 lf(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 Qg=new WeakMap;function Qn(a,r){if(typeof a=="object"&&a!==null){var u=Qg.get(a);return u!==void 0?u:(r={value:a,source:r,stack:Bt(r)},Qg.set(a,r),r)}return{value:a,source:r,stack:Bt(r)}}var Qr=[],Wr=0,lu=null,co=0,Wn=[],Zn=0,ci=null,Ea=1,Ta="";function Ua(a,r){Qr[Wr++]=co,Qr[Wr++]=lu,lu=a,co=r}function Wg(a,r,u){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,ci=a;var h=Ea;a=Ta;var v=32-gt(h)-1;h&=~(1<<v),u+=1;var S=32-gt(r)+v;if(30<S){var O=v-v%5;S=(h&(1<<O)-1).toString(32),h>>=O,v-=O,Ea=1<<32-gt(r)+v|u<<v|h,Ta=S+a}else Ea=1<<S|u<<v|h,Ta=a}function uf(a){a.return!==null&&(Ua(a,1),Wg(a,1,0))}function cf(a){for(;a===lu;)lu=Qr[--Wr],Qr[Wr]=null,co=Qr[--Wr],Qr[Wr]=null;for(;a===ci;)ci=Wn[--Zn],Wn[Zn]=null,Ta=Wn[--Zn],Wn[Zn]=null,Ea=Wn[--Zn],Wn[Zn]=null}function Zg(a,r){Wn[Zn++]=Ea,Wn[Zn++]=Ta,Wn[Zn++]=ci,Ea=r.id,Ta=r.overflow,ci=a}var un=null,_t=null,lt=!1,di=null,Jn=!1,df=Error(i(519));function fi(a){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo(Qn(r,a)),df}function Jg(a){var r=a.stateNode,u=a.type,h=a.memoizedProps;switch(r[Jt]=a,r[yt]=h,u){case"dialog":at("cancel",r),at("close",r);break;case"iframe":case"object":case"embed":at("load",r);break;case"video":case"audio":for(u=0;u<Oo.length;u++)at(Oo[u],r);break;case"source":at("error",r);break;case"img":case"image":case"link":at("error",r),at("load",r);break;case"details":at("toggle",r);break;case"input":at("invalid",r),fg(r,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":at("invalid",r);break;case"textarea":at("invalid",r),mg(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||gb(r.textContent,u)?(h.popover!=null&&(at("beforetoggle",r),at("toggle",r)),h.onScroll!=null&&at("scroll",r),h.onScrollEnd!=null&&at("scrollend",r),h.onClick!=null&&(r.onclick=Pa),r=!0):r=!1,r||fi(a,!0)}function e1(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(!lt)return e1(a),lt=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||_h(a.type,a.memoizedProps)),u=!u),u&&_t&&fi(a),e1(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));_t=wb(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));_t=wb(a)}else r===27?(r=_t,Ai(a.type)?(a=Oh,Oh=null,_t=a):_t=r):_t=un?ta(a.stateNode.nextSibling):null;return!0}function nr(){_t=un=null,lt=!1}function ff(){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 hf=Y(null),ar=null,Ha=null;function hi(a,r,u){U(hf,r._currentValue),r._currentValue=u}function Fa(a){a._currentValue=hf.current,te(hf)}function mf(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 pf(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 q=S;S=v;for(var ne=0;ne<r.length;ne++)if(q.context===r[ne]){S.lanes|=u,q=S.alternate,q!==null&&(q.lanes|=u),mf(S.return,u,a),h||(O=null);break e}S=q.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),mf(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 q=v.type;On(v.pendingProps.value,O.value)||(a!==null?a.push(q):a=[q])}}else if(v===J.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&&pf(r,a,u,h),r.flags|=262144}function uu(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 t1(ar,a)}function cu(a,r){return ar===null&&ir(a),t1(a,r)}function t1(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 C3=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()})}},N3=e.unstable_scheduleCallback,_3=e.unstable_NormalPriority,Xt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new C3,data:new Map,refCount:0}}function ho(a){a.refCount--,a.refCount===0&&N3(_3,function(){a.controller.abort()})}var mo=null,xf=0,es=0,ts=null;function M3(a,r){if(mo===null){var u=mo=[];xf=0,es=vh(),ts={status:"pending",value:void 0,then:function(h){u.push(h)}}}return xf++,r.then(n1,n1),r}function n1(){if(--xf===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 R3(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 a1=H.S;H.S=function(a,r){Ux=Fe(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&M3(a,r),a1!==null&&a1(a,r)};var rr=Y(null);function bf(){var a=rr.current;return a!==null?a:kt.pooledCache}function du(a,r){r===null?U(rr,rr.current):U(rr,r.pool)}function i1(){var a=bf();return a===null?null:{parent:Xt._currentValue,pool:a}}var ns=Error(i(460)),yf=Error(i(474)),fu=Error(i(542)),hu={then:function(){}};function r1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function s1(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,l1(a),a;default:if(typeof r.status=="string")r.then(Pa,Pa);else{if(a=kt,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,l1(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 o1(){if(or===null)throw Error(i(459));var a=or;return or=null,a}function l1(a){if(a===ns||a===fu)throw Error(i(483))}var as=null,po=0;function mu(a){var r=po;return po+=1,as===null&&(as=[]),s1(as,a,r)}function go(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function pu(a,r){throw r.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(r),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function u1(a){function r(oe,re){if(a){var ce=oe.deletions;ce===null?(oe.deletions=[re],oe.flags|=16):ce.push(re)}}function u(oe,re){if(!a)return null;for(;re!==null;)r(oe,re),re=re.sibling;return null}function h(oe){for(var re=new Map;oe!==null;)oe.key!==null?re.set(oe.key,oe):re.set(oe.index,oe),oe=oe.sibling;return re}function v(oe,re){return oe=za(oe,re),oe.index=0,oe.sibling=null,oe}function S(oe,re,ce){return oe.index=ce,a?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<re?(oe.flags|=67108866,re):ce):(oe.flags|=67108866,re)):(oe.flags|=1048576,re)}function O(oe){return a&&oe.alternate===null&&(oe.flags|=67108866),oe}function q(oe,re,ce,Ee){return re===null||re.tag!==6?(re=of(ce,oe.mode,Ee),re.return=oe,re):(re=v(re,ce),re.return=oe,re)}function ne(oe,re,ce,Ee){var He=ce.type;return He===E?be(oe,re,ce.props.children,Ee,ce.key):re!==null&&(re.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&sr(He)===re.type)?(re=v(re,ce.props),go(re,ce),re.return=oe,re):(re=ou(ce.type,ce.key,ce.props,null,oe.mode,Ee),go(re,ce),re.return=oe,re)}function de(oe,re,ce,Ee){return re===null||re.tag!==4||re.stateNode.containerInfo!==ce.containerInfo||re.stateNode.implementation!==ce.implementation?(re=lf(ce,oe.mode,Ee),re.return=oe,re):(re=v(re,ce.children||[]),re.return=oe,re)}function be(oe,re,ce,Ee,He){return re===null||re.tag!==7?(re=tr(ce,oe.mode,Ee,He),re.return=oe,re):(re=v(re,ce),re.return=oe,re)}function Te(oe,re,ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=of(""+re,oe.mode,ce),re.return=oe,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case p:return ce=ou(re.type,re.key,re.props,null,oe.mode,ce),go(ce,re),ce.return=oe,ce;case y:return re=lf(re,oe.mode,ce),re.return=oe,re;case R:return re=sr(re),Te(oe,re,ce)}if(z(re)||B(re))return re=tr(re,oe.mode,ce,null),re.return=oe,re;if(typeof re.then=="function")return Te(oe,mu(re),ce);if(re.$$typeof===N)return Te(oe,cu(oe,re),ce);pu(oe,re)}return null}function he(oe,re,ce,Ee){var He=re!==null?re.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return He!==null?null:q(oe,re,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case p:return ce.key===He?ne(oe,re,ce,Ee):null;case y:return ce.key===He?de(oe,re,ce,Ee):null;case R:return ce=sr(ce),he(oe,re,ce,Ee)}if(z(ce)||B(ce))return He!==null?null:be(oe,re,ce,Ee,null);if(typeof ce.then=="function")return he(oe,re,mu(ce),Ee);if(ce.$$typeof===N)return he(oe,re,cu(oe,ce),Ee);pu(oe,ce)}return null}function pe(oe,re,ce,Ee,He){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return oe=oe.get(ce)||null,q(re,oe,""+Ee,He);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case p:return oe=oe.get(Ee.key===null?ce:Ee.key)||null,ne(re,oe,Ee,He);case y:return oe=oe.get(Ee.key===null?ce:Ee.key)||null,de(re,oe,Ee,He);case R:return Ee=sr(Ee),pe(oe,re,ce,Ee,He)}if(z(Ee)||B(Ee))return oe=oe.get(ce)||null,be(re,oe,Ee,He,null);if(typeof Ee.then=="function")return pe(oe,re,ce,mu(Ee),He);if(Ee.$$typeof===N)return pe(oe,re,ce,cu(re,Ee),He);pu(re,Ee)}return null}function Le(oe,re,ce,Ee){for(var He=null,dt=null,Ie=re,Ze=re=0,st=null;Ie!==null&&Ze<ce.length;Ze++){Ie.index>Ze?(st=Ie,Ie=null):st=Ie.sibling;var ft=he(oe,Ie,ce[Ze],Ee);if(ft===null){Ie===null&&(Ie=st);break}a&&Ie&&ft.alternate===null&&r(oe,Ie),re=S(ft,re,Ze),dt===null?He=ft:dt.sibling=ft,dt=ft,Ie=st}if(Ze===ce.length)return u(oe,Ie),lt&&Ua(oe,Ze),He;if(Ie===null){for(;Ze<ce.length;Ze++)Ie=Te(oe,ce[Ze],Ee),Ie!==null&&(re=S(Ie,re,Ze),dt===null?He=Ie:dt.sibling=Ie,dt=Ie);return lt&&Ua(oe,Ze),He}for(Ie=h(Ie);Ze<ce.length;Ze++)st=pe(Ie,oe,Ze,ce[Ze],Ee),st!==null&&(a&&st.alternate!==null&&Ie.delete(st.key===null?Ze:st.key),re=S(st,re,Ze),dt===null?He=st:dt.sibling=st,dt=st);return a&&Ie.forEach(function(Ri){return r(oe,Ri)}),lt&&Ua(oe,Ze),He}function qe(oe,re,ce,Ee){if(ce==null)throw Error(i(151));for(var He=null,dt=null,Ie=re,Ze=re=0,st=null,ft=ce.next();Ie!==null&&!ft.done;Ze++,ft=ce.next()){Ie.index>Ze?(st=Ie,Ie=null):st=Ie.sibling;var Ri=he(oe,Ie,ft.value,Ee);if(Ri===null){Ie===null&&(Ie=st);break}a&&Ie&&Ri.alternate===null&&r(oe,Ie),re=S(Ri,re,Ze),dt===null?He=Ri:dt.sibling=Ri,dt=Ri,Ie=st}if(ft.done)return u(oe,Ie),lt&&Ua(oe,Ze),He;if(Ie===null){for(;!ft.done;Ze++,ft=ce.next())ft=Te(oe,ft.value,Ee),ft!==null&&(re=S(ft,re,Ze),dt===null?He=ft:dt.sibling=ft,dt=ft);return lt&&Ua(oe,Ze),He}for(Ie=h(Ie);!ft.done;Ze++,ft=ce.next())ft=pe(Ie,oe,Ze,ft.value,Ee),ft!==null&&(a&&ft.alternate!==null&&Ie.delete(ft.key===null?Ze:ft.key),re=S(ft,re,Ze),dt===null?He=ft:dt.sibling=ft,dt=ft);return a&&Ie.forEach(function(FA){return r(oe,FA)}),lt&&Ua(oe,Ze),He}function Tt(oe,re,ce,Ee){if(typeof ce=="object"&&ce!==null&&ce.type===E&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case p:e:{for(var He=ce.key;re!==null;){if(re.key===He){if(He=ce.type,He===E){if(re.tag===7){u(oe,re.sibling),Ee=v(re,ce.props.children),Ee.return=oe,oe=Ee;break e}}else if(re.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&sr(He)===re.type){u(oe,re.sibling),Ee=v(re,ce.props),go(Ee,ce),Ee.return=oe,oe=Ee;break e}u(oe,re);break}else r(oe,re);re=re.sibling}ce.type===E?(Ee=tr(ce.props.children,oe.mode,Ee,ce.key),Ee.return=oe,oe=Ee):(Ee=ou(ce.type,ce.key,ce.props,null,oe.mode,Ee),go(Ee,ce),Ee.return=oe,oe=Ee)}return O(oe);case y:e:{for(He=ce.key;re!==null;){if(re.key===He)if(re.tag===4&&re.stateNode.containerInfo===ce.containerInfo&&re.stateNode.implementation===ce.implementation){u(oe,re.sibling),Ee=v(re,ce.children||[]),Ee.return=oe,oe=Ee;break e}else{u(oe,re);break}else r(oe,re);re=re.sibling}Ee=lf(ce,oe.mode,Ee),Ee.return=oe,oe=Ee}return O(oe);case R:return ce=sr(ce),Tt(oe,re,ce,Ee)}if(z(ce))return Le(oe,re,ce,Ee);if(B(ce)){if(He=B(ce),typeof He!="function")throw Error(i(150));return ce=He.call(ce),qe(oe,re,ce,Ee)}if(typeof ce.then=="function")return Tt(oe,re,mu(ce),Ee);if(ce.$$typeof===N)return Tt(oe,re,cu(oe,ce),Ee);pu(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,re!==null&&re.tag===6?(u(oe,re.sibling),Ee=v(re,ce),Ee.return=oe,oe=Ee):(u(oe,re),Ee=of(ce,oe.mode,Ee),Ee.return=oe,oe=Ee),O(oe)):u(oe,re)}return function(oe,re,ce,Ee){try{po=0;var He=Tt(oe,re,ce,Ee);return as=null,He}catch(Ie){if(Ie===ns||Ie===fu)throw Ie;var dt=In(29,Ie,null,oe.mode);return dt.lanes=Ee,dt.return=oe,dt}finally{}}}var lr=u1(!0),c1=u1(!1),mi=!1;function vf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function pi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function gi(a,r,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(mt&2)!==0){var v=h.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),h.pending=r,r=su(a),Xg(a,null,u),r}return ru(a,h,r,u),su(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,Gl(a,u)}}function Tf(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 Sf=!1;function bo(){if(Sf){var a=ts;if(a!==null)throw a}}function yo(a,r,u,h){Sf=!1;var v=a.updateQueue;mi=!1;var S=v.firstBaseUpdate,O=v.lastBaseUpdate,q=v.shared.pending;if(q!==null){v.shared.pending=null;var ne=q,de=ne.next;ne.next=null,O===null?S=de:O.next=de,O=ne;var be=a.alternate;be!==null&&(be=be.updateQueue,q=be.lastBaseUpdate,q!==O&&(q===null?be.firstBaseUpdate=de:q.next=de,be.lastBaseUpdate=ne))}if(S!==null){var Te=v.baseState;O=0,be=de=ne=null,q=S;do{var he=q.lane&-536870913,pe=he!==q.lane;if(pe?(rt&he)===he:(h&he)===he){he!==0&&he===es&&(Sf=!0),be!==null&&(be=be.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Le=a,qe=q;he=r;var Tt=u;switch(qe.tag){case 1:if(Le=qe.payload,typeof Le=="function"){Te=Le.call(Tt,Te,he);break e}Te=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=qe.payload,he=typeof Le=="function"?Le.call(Tt,Te,he):Le,he==null)break e;Te=x({},Te,he);break e;case 2:mi=!0}}he=q.callback,he!==null&&(a.flags|=64,pe&&(a.flags|=8192),pe=v.callbacks,pe===null?v.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:q.tag,payload:q.payload,callback:q.callback,next:null},be===null?(de=be=pe,ne=Te):be=be.next=pe,O|=he;if(q=q.next,q===null){if(q=v.shared.pending,q===null)break;pe=q,q=pe.next,pe.next=null,v.lastBaseUpdate=pe,v.shared.pending=null}}while(!0);be===null&&(ne=Te),v.baseState=ne,v.firstBaseUpdate=de,v.lastBaseUpdate=be,S===null&&(v.shared.lanes=0),Ei|=O,a.lanes=O,a.memoizedState=Te}}function d1(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function f1(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)d1(u[a],r)}var is=Y(null),gu=Y(0);function h1(a,r){a=Wa,U(gu,a),U(is,r),Wa=a|r.baseLanes}function kf(){U(gu,Wa),U(is,is.current)}function wf(){Wa=gu.current,te(is),te(gu)}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 Af(a){U(qt,qt.current),U(jn,a),ea===null&&(ea=a)}function m1(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){te(jn),ea===a&&(ea=null),te(qt)}var qt=Y(0);function xu(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Dh(u)||Lh(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Va=0,We=null,vt=null,Kt=null,bu=!1,rs=!1,ur=!1,yu=0,vo=0,ss=null,D3=0;function Ut(){throw Error(i(321))}function Cf(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!On(a[u],r[u]))return!1;return!0}function Nf(a,r,u,h,v,S){return Va=S,We=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?W1:Vf,ur=!1,S=u(h,v),ur=!1,rs&&(S=g1(r,u,h,v)),p1(a),S}function p1(a){H.H=So;var r=vt!==null&&vt.next!==null;if(Va=0,Kt=vt=We=null,bu=!1,vo=0,ss=null,r)throw Error(i(300));a===null||$t||(a=a.dependencies,a!==null&&uu(a)&&($t=!0))}function g1(a,r,u,h){We=a;var v=0;do{if(rs&&(ss=null),vo=0,rs=!1,25<=v)throw Error(i(301));if(v+=1,Kt=vt=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=Z1,S=r(u,h)}while(rs);return S}function L3(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?Eo(r):r,a=a.useState()[0],(vt!==null?vt.memoizedState:null)!==a&&(We.flags|=1024),r}function _f(){var a=yu!==0;return yu=0,a}function Mf(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function Rf(a){if(bu){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}bu=!1}Va=0,Kt=vt=We=null,rs=!1,vo=yu=0,ss=null}function yn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?We.memoizedState=Kt=a:Kt=Kt.next=a,Kt}function Yt(){if(vt===null){var a=We.alternate;a=a!==null?a.memoizedState:null}else a=vt.next;var r=Kt===null?We.memoizedState:Kt.next;if(r!==null)Kt=r,vt=a;else{if(a===null)throw We.alternate===null?Error(i(467)):Error(i(310));vt=a,a={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Kt===null?We.memoizedState=Kt=a:Kt=Kt.next=a}return Kt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(a){var r=vo;return vo+=1,ss===null&&(ss=[]),a=s1(ss,a,r),r=We,(Kt===null?r.memoizedState:Kt.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?W1:Vf),a}function Eu(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 Df(a){var r=null,u=We.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var h=We.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=vu(),We.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 Tu(a){var r=Yt();return Lf(r,vt,a)}function Lf(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 q=O=null,ne=null,de=r,be=!1;do{var Te=de.lane&-536870913;if(Te!==de.lane?(rt&Te)===Te:(Va&Te)===Te){var he=de.revertLane;if(he===0)ne!==null&&(ne=ne.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},ne===null?(q=ne=Te,O=S):ne=ne.next=Te,We.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},ne===null?(q=ne=he,O=S):ne=ne.next=he,We.lanes|=Te,Ei|=Te;de=de.next}while(de!==null&&de!==r);if(ne===null?O=S:ne.next=q,!On(S,a.memoizedState)&&($t=!0,be&&(u=ts,u!==null)))throw u;a.memoizedState=S,a.baseState=O,a.baseQueue=ne,h.lastRenderedState=S}return v===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Of(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 x1(a,r,u){var h=We,v=Yt(),S=lt;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=r();var O=!On((vt||v).memoizedState,u);if(O&&(v.memoizedState=u,$t=!0),v=v.queue,Pf(v1.bind(null,h,v,a),[a]),v.getSnapshot!==r||O||Kt!==null&&Kt.memoizedState.tag&1){if(h.flags|=2048,os(9,{destroy:void 0},y1.bind(null,h,v,u,r),null),kt===null)throw Error(i(349));S||(Va&127)!==0||b1(h,r,u)}return u}function b1(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=We.updateQueue,r===null?(r=vu(),We.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function y1(a,r,u,h){r.value=u,r.getSnapshot=h,E1(r)&&T1(a)}function v1(a,r,u){return u(function(){E1(r)&&T1(a)})}function E1(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!On(a,u)}catch{return!0}}function T1(a){var r=er(a,2);r!==null&&_n(r,a,2)}function If(a){var r=yn();if(typeof a=="function"){var u=a;if(a=u(),ur){an(!0);try{u()}finally{an(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:a},r}function S1(a,r,u,h){return a.baseState=u,Lf(a,vt,typeof h=="function"?h:qa)}function O3(a,r,u,h,v){if(wu(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,k1(r,S)):(S.next=u.next,r.pending=u.next=S)}}function k1(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 q=u(v,h),ne=H.S;ne!==null&&ne(O,q),w1(a,r,q)}catch(de){jf(a,r,de)}finally{S!==null&&O.types!==null&&(S.types=O.types),H.T=S}}else try{S=u(v,h),w1(a,r,S)}catch(de){jf(a,r,de)}}function w1(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){A1(a,r,h)},function(h){return jf(a,r,h)}):A1(a,r,u)}function A1(a,r,u){r.status="fulfilled",r.value=u,C1(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,k1(a,u)))}function jf(a,r,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do r.status="rejected",r.reason=u,C1(r),r=r.next;while(r!==h)}a.action=null}function C1(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function N1(a,r){return r}function _1(a,r){if(lt){var u=kt.formState;if(u!==null){e:{var h=We;if(lt){if(_t){t:{for(var v=_t,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){_t=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:N1,lastRenderedState:r},u.queue=h,u=K1.bind(null,We,h),h.dispatch=u,h=If(!1),S=Ff.bind(null,We,!1,h.queue),h=yn(),v={state:r,dispatch:null,action:a,pending:null},h.queue=v,u=O3.bind(null,We,v,S,u),v.dispatch=u,h.memoizedState=a,[r,u,!1]}function M1(a){var r=Yt();return R1(r,vt,a)}function R1(a,r,u){if(r=Lf(a,r,N1)[0],a=Tu(qa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var h=Eo(r)}catch(O){throw O===ns?fu:O}else h=r;r=Yt();var v=r.queue,S=v.dispatch;return u!==r.memoizedState&&(We.flags|=2048,os(9,{destroy:void 0},I3.bind(null,v,u),null)),[h,S,a]}function I3(a,r){a.action=r}function D1(a){var r=Yt(),u=vt;if(u!==null)return R1(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=We.updateQueue,r===null&&(r=vu(),We.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 L1(){return Yt().memoizedState}function Su(a,r,u,h){var v=yn();We.flags|=a,v.memoizedState=os(1|r,{destroy:void 0},u,h===void 0?null:h)}function ku(a,r,u,h){var v=Yt();h=h===void 0?null:h;var S=v.memoizedState.inst;vt!==null&&h!==null&&Cf(h,vt.memoizedState.deps)?v.memoizedState=os(r,S,u,h):(We.flags|=a,v.memoizedState=os(1|r,S,u,h))}function O1(a,r){Su(8390656,8,a,r)}function Pf(a,r){ku(2048,8,a,r)}function j3(a){We.flags|=4;var r=We.updateQueue;if(r===null)r=vu(),We.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function I1(a){var r=Yt().memoizedState;return j3({ref:r,nextImpl:a}),function(){if((mt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function j1(a,r){return ku(4,2,a,r)}function P1(a,r){return ku(4,4,a,r)}function B1(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 z1(a,r,u){u=u!=null?u.concat([a]):null,ku(4,4,B1.bind(null,r,a),u)}function Bf(){}function U1(a,r){var u=Yt();r=r===void 0?null:r;var h=u.memoizedState;return r!==null&&Cf(r,h[1])?h[0]:(u.memoizedState=[a,r],a)}function H1(a,r){var u=Yt();r=r===void 0?null:r;var h=u.memoizedState;if(r!==null&&Cf(r,h[1]))return h[0];if(h=a(),ur){an(!0);try{a()}finally{an(!1)}}return u.memoizedState=[h,r],h}function zf(a,r,u){return u===void 0||(Va&1073741824)!==0&&(rt&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=Fx(),We.lanes|=a,Ei|=a,u)}function F1(a,r,u,h){return On(u,r)?u:is.current!==null?(a=zf(a,u,h),On(a,r)||($t=!0),a):(Va&42)===0||(Va&1073741824)!==0&&(rt&261930)===0?($t=!0,a.memoizedState=u):(a=Fx(),We.lanes|=a,Ei|=a,r)}function V1(a,r,u,h,v){var S=G.p;G.p=S!==0&&8>S?S:8;var O=H.T,q={};H.T=q,Ff(a,!1,r,u);try{var ne=v(),de=H.S;if(de!==null&&de(q,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var be=R3(ne,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&&q.types!==null&&(O.types=q.types),H.T=O}}function P3(){}function Uf(a,r,u,h){if(a.tag!==5)throw Error(i(476));var v=q1(a).queue;V1(a,v,r,W,u===null?P3:function(){return Y1(a),u(h)})}function q1(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:W},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 Y1(a){var r=q1(a);r.next===null&&(r=a.alternate.memoizedState),To(a,r.next.queue,{},Un())}function Hf(){return cn(zo)}function G1(){return Yt().memoizedState}function X1(){return Yt().memoizedState}function B3(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:gf()},a.payload=r;return}r=r.return}}function z3(a,r,u){var h=Un();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},wu(a)?$1(r,u):(u=rf(a,r,u,h),u!==null&&(_n(u,a,h),Q1(u,r,h)))}function K1(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(wu(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,q=S(O,u);if(v.hasEagerState=!0,v.eagerState=q,On(q,O))return ru(a,r,v,0),kt===null&&iu(),!1}catch{}finally{}if(u=rf(a,r,v,h),u!==null)return _n(u,a,h),Q1(u,r,h),!0}return!1}function Ff(a,r,u,h){if(h={lane:2,revertLane:vh(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},wu(a)){if(r)throw Error(i(479))}else r=rf(a,u,h,2),r!==null&&_n(r,a,2)}function wu(a){var r=a.alternate;return a===We||r!==null&&r===We}function $1(a,r){rs=bu=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function Q1(a,r,u){if((u&4194048)!==0){var h=r.lanes;h&=a.pendingLanes,u|=h,r.lanes=u,Gl(a,u)}}var So={readContext:cn,use:Eu,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 W1={readContext:cn,use:Eu,useCallback:function(a,r){return yn().memoizedState=[a,r===void 0?null:r],a},useContext:cn,useEffect:O1,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,Su(4194308,4,B1.bind(null,r,a),u)},useLayoutEffect:function(a,r){return Su(4194308,4,a,r)},useInsertionEffect:function(a,r){Su(4,2,a,r)},useMemo:function(a,r){var u=yn();r=r===void 0?null:r;var h=a();if(ur){an(!0);try{a()}finally{an(!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){an(!0);try{u(r)}finally{an(!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=z3.bind(null,We,a),[h.memoizedState,a]},useRef:function(a){var r=yn();return a={current:a},r.memoizedState=a},useState:function(a){a=If(a);var r=a.queue,u=K1.bind(null,We,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:Bf,useDeferredValue:function(a,r){var u=yn();return zf(u,a,r)},useTransition:function(){var a=If(!1);return a=V1.bind(null,We,a.queue,!0,!1),yn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var h=We,v=yn();if(lt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=r(),kt===null)throw Error(i(349));(rt&127)!==0||b1(h,r,u)}v.memoizedState=u;var S={value:u,getSnapshot:r};return v.queue=S,O1(v1.bind(null,h,S,a),[a]),h.flags|=2048,os(9,{destroy:void 0},y1.bind(null,h,S,u,r),null),u},useId:function(){var a=yn(),r=kt.identifierPrefix;if(lt){var u=Ta,h=Ea;u=(h&~(1<<32-gt(h)-1)).toString(32)+u,r="_"+r+"R_"+u,u=yu++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=D3++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:Hf,useFormState:_1,useActionState:_1,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=Ff.bind(null,We,!0,u),u.dispatch=r,[a,r]},useMemoCache:Df,useCacheRefresh:function(){return yn().memoizedState=B3.bind(null,We)},useEffectEvent:function(a){var r=yn(),u={impl:a};return r.memoizedState=u,function(){if((mt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Vf={readContext:cn,use:Eu,useCallback:U1,useContext:cn,useEffect:Pf,useImperativeHandle:z1,useInsertionEffect:j1,useLayoutEffect:P1,useMemo:H1,useReducer:Tu,useRef:L1,useState:function(){return Tu(qa)},useDebugValue:Bf,useDeferredValue:function(a,r){var u=Yt();return F1(u,vt.memoizedState,a,r)},useTransition:function(){var a=Tu(qa)[0],r=Yt().memoizedState;return[typeof a=="boolean"?a:Eo(a),r]},useSyncExternalStore:x1,useId:G1,useHostTransitionStatus:Hf,useFormState:M1,useActionState:M1,useOptimistic:function(a,r){var u=Yt();return S1(u,vt,a,r)},useMemoCache:Df,useCacheRefresh:X1};Vf.useEffectEvent=I1;var Z1={readContext:cn,use:Eu,useCallback:U1,useContext:cn,useEffect:Pf,useImperativeHandle:z1,useInsertionEffect:j1,useLayoutEffect:P1,useMemo:H1,useReducer:Of,useRef:L1,useState:function(){return Of(qa)},useDebugValue:Bf,useDeferredValue:function(a,r){var u=Yt();return vt===null?zf(u,a,r):F1(u,vt.memoizedState,a,r)},useTransition:function(){var a=Of(qa)[0],r=Yt().memoizedState;return[typeof a=="boolean"?a:Eo(a),r]},useSyncExternalStore:x1,useId:G1,useHostTransitionStatus:Hf,useFormState:D1,useActionState:D1,useOptimistic:function(a,r){var u=Yt();return vt!==null?S1(u,vt,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Df,useCacheRefresh:X1};Z1.useEffectEvent=I1;function qf(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 Yf={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 J1(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 ex(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&&Yf.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 tx(a){au(a)}function nx(a){console.error(a)}function ax(a){au(a)}function Au(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(h){setTimeout(function(){throw h})}}function ix(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 Gf(a,r,u){return u=pi(u),u.tag=3,u.payload={element:null},u.callback=function(){Au(a,r)},u}function rx(a){return a=pi(a),a.tag=3,a}function sx(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(){ix(r,u,h)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(a.callback=function(){ix(r,u,h),typeof v!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var q=h.stack;this.componentDidCatch(h.value,{componentStack:q!==null?q:""})})}function U3(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?Bu():u.alternate===null&&Ht===0&&(Ht=3),u.flags&=-257,u.flags|=65536,u.lanes=v,h===hu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([h]):r.add(h),xh(a,h,v)),!1;case 22:return u.flags|=65536,h===hu?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)),xh(a,h,v)),!1}throw Error(i(435,u.tag))}return xh(a,h,v),Bu(),!1}if(lt)return r=jn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,h!==df&&(a=Error(i(422),{cause:h}),fo(Qn(a,u)))):(h!==df&&(r=Error(i(423),{cause:h}),fo(Qn(r,u))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,h=Qn(h,u),v=Gf(a.stateNode,h,v),Tf(a,v),Ht!==4&&(Ht=2)),!1;var S=Error(i(520),{cause:h});if(S=Qn(S,u),Ro===null?Ro=[S]:Ro.push(S),Ht!==4&&(Ht=2),r===null)return!0;h=Qn(h,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=v&-v,u.lanes|=a,a=Gf(u.stateNode,h,a),Tf(u,a),!1;case 1:if(r=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ti===null||!Ti.has(S))))return u.flags|=65536,v&=-v,u.lanes|=v,v=rx(v),sx(v,a,u,h),Tf(u,v),!1}u=u.return}while(u!==null);return!1}var Xf=Error(i(461)),$t=!1;function dn(a,r,u,h){r.child=a===null?c1(r,null,u,h):lr(r,a.child,u,h)}function ox(a,r,u,h,v){u=u.render;var S=r.ref;if("ref"in h){var O={};for(var q in h)q!=="ref"&&(O[q]=h[q])}else O=h;return ir(r),h=Nf(a,r,u,O,S,v),q=_f(),a!==null&&!$t?(Mf(a,r,v),Ya(a,r,v)):(lt&&q&&uf(r),r.flags|=1,dn(a,r,h,v),r.child)}function lx(a,r,u,h,v){if(a===null){var S=u.type;return typeof S=="function"&&!sf(S)&&S.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=S,ux(a,r,S,h,v)):(a=ou(u.type,null,h,r,r.mode,v),a.ref=r.ref,a.return=r,r.child=a)}if(S=a.child,!th(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 ux(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,th(a,v))(a.flags&131072)!==0&&($t=!0);else return r.lanes=a.lanes,Ya(a,r,v)}return Kf(a,r,u,h,v)}function cx(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 dx(a,r,S,u,h)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&du(r,S!==null?S.cachePool:null),S!==null?h1(r,S):kf(),m1(r);else return h=r.lanes=536870912,dx(a,r,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(du(r,S.cachePool),h1(r,S),bi(),r.memoizedState=null):(a!==null&&du(r,null),kf(),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 dx(a,r,u,h,v){var S=bf();return S=S===null?null:{parent:Xt._currentValue,pool:S},r.memoizedState={baseLanes:u,cachePool:S},a!==null&&du(r,null),kf(),m1(r),a!==null&&Jr(a,r,h,!0),r.childLanes=v,null}function Cu(a,r){return r=_u({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function fx(a,r,u){return lr(r,a.child,null,u),a=Cu(r,r.pendingProps),a.flags|=2,Pn(r),r.memoizedState=null,a}function H3(a,r,u){var h=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(lt){if(h.mode==="hidden")return a=Cu(r,h),r.lanes=536870912,ko(null,a);if(Af(r),(a=_t)?(a=kb(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,_t=null)):a=null,a===null)throw fi(r);return r.lanes=536870912,null}return Cu(r,h)}var S=a.memoizedState;if(S!==null){var O=S.dehydrated;if(Af(r),v)if(r.flags&256)r.flags&=-257,r=fx(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=kt,h!==null&&(O=Xl(h,u),O!==0&&O!==S.retryLane))throw S.retryLane=O,er(a,O),_n(h,a,O),Xf;Bu(),r=fx(a,r,u)}else a=S.treeContext,_t=ta(O.nextSibling),un=r,lt=!0,di=null,Jn=!1,a!==null&&Zg(r,a),r=Cu(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 Nu(a,r){var u=r.ref;if(u===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(a===null||a.ref!==u)&&(r.flags|=4194816)}}function Kf(a,r,u,h,v){return ir(r),u=Nf(a,r,u,h,void 0,v),h=_f(),a!==null&&!$t?(Mf(a,r,v),Ya(a,r,v)):(lt&&h&&uf(r),r.flags|=1,dn(a,r,u,v),r.child)}function hx(a,r,u,h,v,S){return ir(r),r.updateQueue=null,u=g1(r,h,u,v),p1(a),h=_f(),a!==null&&!$t?(Mf(a,r,S),Ya(a,r,S)):(lt&&h&&uf(r),r.flags|=1,dn(a,r,u,S),r.child)}function mx(a,r,u,h,v){if(ir(r),r.stateNode===null){var S=$r,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=Yf,r.stateNode=S,S._reactInternals=r,S=r.stateNode,S.props=h,S.state=r.memoizedState,S.refs={},vf(r),O=u.contextType,S.context=typeof O=="object"&&O!==null?cn(O):$r,S.state=r.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(qf(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&&Yf.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 q=r.memoizedProps,ne=cr(u,q);S.props=ne;var de=S.context,be=u.contextType;O=$r,typeof be=="object"&&be!==null&&(O=cn(be));var Te=u.getDerivedStateFromProps;be=typeof Te=="function"||typeof S.getSnapshotBeforeUpdate=="function",q=r.pendingProps!==q,be||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(q||de!==O)&&ex(r,S,h,O),mi=!1;var he=r.memoizedState;S.state=he,yo(r,h,S,v),bo(),de=r.memoizedState,q||he!==de||mi?(typeof Te=="function"&&(qf(r,u,Te,h),de=r.memoizedState),(ne=mi||J1(r,u,ne,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=ne):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{S=r.stateNode,Ef(a,r),O=r.memoizedProps,be=cr(u,O),S.props=be,Te=r.pendingProps,he=S.context,de=u.contextType,ne=$r,typeof de=="object"&&de!==null&&(ne=cn(de)),q=u.getDerivedStateFromProps,(de=typeof q=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(O!==Te||he!==ne)&&ex(r,S,h,ne),mi=!1,he=r.memoizedState,S.state=he,yo(r,h,S,v),bo();var pe=r.memoizedState;O!==Te||he!==pe||mi||a!==null&&a.dependencies!==null&&uu(a.dependencies)?(typeof q=="function"&&(qf(r,u,q,h),pe=r.memoizedState),(be=mi||J1(r,u,be,h,he,pe,ne)||a!==null&&a.dependencies!==null&&uu(a.dependencies))?(de||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,pe,ne),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,pe,ne)),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=pe),S.props=h,S.state=pe,S.context=ne,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,Nu(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 px(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 Qf(a){return{baseLanes:a,cachePool:i1()}}function Wf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=zn),a}function gx(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(lt){if(v?xi(r):bi(),(a=_t)?(a=kb(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,_t=null)):a=null,a===null)throw fi(r);return Lh(a)?r.lanes=32:r.lanes=536870912,null}var q=h.children;return h=h.fallback,v?(bi(),v=r.mode,q=_u({mode:"hidden",children:q},v),h=tr(h,v,u,null),q.return=r,h.return=r,q.sibling=h,r.child=q,h=r.child,h.memoizedState=Qf(u),h.childLanes=Wf(a,O,u),r.memoizedState=$f,ko(null,h)):(xi(r),Zf(r,q))}var ne=a.memoizedState;if(ne!==null&&(q=ne.dehydrated,q!==null)){if(S)r.flags&256?(xi(r),r.flags&=-257,r=Jf(a,r,u)):r.memoizedState!==null?(bi(),r.child=a.child,r.flags|=128,r=null):(bi(),q=h.fallback,v=r.mode,h=_u({mode:"visible",children:h.children},v),q=tr(q,v,u,null),q.flags|=2,h.return=r,q.return=r,h.sibling=q,r.child=h,lr(r,a.child,null,u),h=r.child,h.memoizedState=Qf(u),h.childLanes=Wf(a,O,u),r.memoizedState=$f,r=ko(null,h));else if(xi(r),Lh(q)){if(O=q.nextSibling&&q.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=Jf(a,r,u)}else if($t||Jr(a,r,u,!1),O=(u&a.childLanes)!==0,$t||O){if(O=kt,O!==null&&(h=Xl(O,u),h!==0&&h!==ne.retryLane))throw ne.retryLane=h,er(a,h),_n(O,a,h),Xf;Dh(q)||Bu(),r=Jf(a,r,u)}else Dh(q)?(r.flags|=192,r.child=a.child,r=null):(a=ne.treeContext,_t=ta(q.nextSibling),un=r,lt=!0,di=null,Jn=!1,a!==null&&Zg(r,a),r=Zf(r,h.children),r.flags|=4096);return r}return v?(bi(),q=h.fallback,v=r.mode,ne=a.child,de=ne.sibling,h=za(ne,{mode:"hidden",children:h.children}),h.subtreeFlags=ne.subtreeFlags&65011712,de!==null?q=za(de,q):(q=tr(q,v,u,null),q.flags|=2),q.return=r,h.return=r,h.sibling=q,r.child=h,ko(null,h),h=r.child,q=a.child.memoizedState,q===null?q=Qf(u):(v=q.cachePool,v!==null?(ne=Xt._currentValue,v=v.parent!==ne?{parent:ne,pool:ne}:v):v=i1(),q={baseLanes:q.baseLanes|u,cachePool:v}),h.memoizedState=q,h.childLanes=Wf(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 Zf(a,r){return r=_u({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function _u(a,r){return a=In(22,a,null,r),a.lanes=0,a}function Jf(a,r,u){return lr(r,a.child,null,u),a=Zf(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function xx(a,r,u){a.lanes|=r;var h=a.alternate;h!==null&&(h.lanes|=r),mf(a.return,r,u)}function eh(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 bx(a,r,u){var h=r.pendingProps,v=h.revealOrder,S=h.tail;h=h.children;var O=qt.current,q=(O&2)!==0;if(q?(O=O&1|2,r.flags|=128):O&=1,U(qt,O),dn(a,r,h,u),h=lt?co:0,!q&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&xx(a,u,r);else if(a.tag===19)xx(a,u,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(u=r.child,v=null;u!==null;)a=u.alternate,a!==null&&xu(a)===null&&(v=u),u=u.sibling;u=v,u===null?(v=r.child,r.child=null):(v=u.sibling,u.sibling=null),eh(r,!1,v,u,S,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&&xu(a)===null){r.child=v;break}a=v.sibling,v.sibling=u,u=v,v=a}eh(r,!0,u,null,S,h);break;case"together":eh(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 th(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&uu(a)))}function F3(a,r,u){switch(r.tag){case 3:se(r,r.stateNode.containerInfo),hi(r,Xt,a.memoizedState.cache),nr();break;case 27:case 5:Pe(r);break;case 4:se(r,r.stateNode.containerInfo);break;case 10:hi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Af(r),null;break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(xi(r),r.flags|=128,null):(u&r.child.childLanes)!==0?gx(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 bx(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,cx(a,r,u,r.pendingProps);case 24:hi(r,Xt,a.memoizedState.cache)}return Ya(a,r,u)}function yx(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)$t=!0;else{if(!th(a,u)&&(r.flags&128)===0)return $t=!1,F3(a,r,u);$t=(a.flags&131072)!==0}else $t=!1,lt&&(r.flags&1048576)!==0&&Wg(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")sf(a)?(h=cr(a,h),r.tag=1,r=mx(null,r,a,h,u)):(r.tag=0,r=Kf(null,r,a,h,u));else{if(a!=null){var v=a.$$typeof;if(v===L){r.tag=11,r=ox(null,r,a,h,u);break e}else if(v===I){r.tag=14,r=lx(null,r,a,h,u);break e}}throw r=F(a)||a,Error(i(306,r,""))}}return r;case 0:return Kf(a,r,r.type,r.pendingProps,u);case 1:return h=r.type,v=cr(h,r.pendingProps),mx(a,r,h,v,u);case 3:e:{if(se(r,r.stateNode.containerInfo),a===null)throw Error(i(387));h=r.pendingProps;var S=r.memoizedState;v=S.element,Ef(a,r),yo(r,h,null,u);var O=r.memoizedState;if(h=O.cache,hi(r,Xt,h),h!==S.cache&&pf(r,[Xt],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=px(a,r,h,u);break e}else if(h!==v){v=Qn(Error(i(424)),r),fo(v),r=px(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(_t=ta(a.firstChild),un=r,lt=!0,di=null,Jn=!0,u=c1(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 Nu(a,r),a===null?(u=Mb(r.type,null,r.pendingProps,null))?r.memoizedState=u:lt||(u=r.type,a=r.pendingProps,h=Yu($.current).createElement(u),h[Jt]=r,h[yt]=a,fn(h,u,a),Vt(h),r.stateNode=h):r.memoizedState=Mb(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Pe(r),a===null&&lt&&(h=r.stateNode=Cb(r.type,r.pendingProps,$.current),un=r,Jn=!0,v=_t,Ai(r.type)?(Oh=v,_t=ta(h.firstChild)):_t=v),dn(a,r,r.pendingProps.children,u),Nu(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&lt&&((v=h=_t)&&(h=bA(h,r.type,r.pendingProps,Jn),h!==null?(r.stateNode=h,un=r,_t=ta(h.firstChild),Jn=!1,v=!0):v=!1),v||fi(r)),Pe(r),v=r.type,S=r.pendingProps,O=a!==null?a.memoizedProps:null,h=S.children,_h(v,S)?h=null:O!==null&&_h(v,O)&&(r.flags|=32),r.memoizedState!==null&&(v=Nf(a,r,L3,null,null,u),zo._currentValue=v),Nu(a,r),dn(a,r,h,u),r.child;case 6:return a===null&&lt&&((a=u=_t)&&(u=yA(u,r.pendingProps,Jn),u!==null?(r.stateNode=u,un=r,_t=null,a=!0):a=!1),a||fi(r)),null;case 13:return gx(a,r,u);case 4:return se(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 ox(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 lx(a,r,r.type,r.pendingProps,u);case 15:return ux(a,r,r.type,r.pendingProps,u);case 19:return bx(a,r,u);case 31:return H3(a,r,u);case 22:return cx(a,r,u,r.pendingProps);case 24:return ir(r),h=cn(Xt),a===null?(v=bf(),v===null&&(v=kt,S=gf(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=u),v=S),r.memoizedState={parent:h,cache:v},vf(r),hi(r,Xt,v)):((a.lanes&u)!==0&&(Ef(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,Xt,h)):(h=S.cache,hi(r,Xt,h),h!==v.cache&&pf(r,[Xt],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 nh(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(Gx())a.flags|=8192;else throw or=hu,yf}else a.flags&=-16777217}function vx(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Ib(r))if(Gx())a.flags|=8192;else throw or=hu,yf}function Mu(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(!lt)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 Mt(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 V3(a,r,u){var h=r.pendingProps;switch(cf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(r),null;case 1:return Mt(r),null;case 3:return u=r.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),Fa(Xt),ke(),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,ff())),Mt(r),null;case 26:var v=r.type,S=r.memoizedState;return a===null?(Ga(r),S!==null?(Mt(r),vx(r,S)):(Mt(r),nh(r,v,null,h,u))):S?S!==a.memoizedState?(Ga(r),Mt(r),vx(r,S)):(Mt(r),r.flags&=-16777217):(a=a.memoizedProps,a!==h&&Ga(r),Mt(r),nh(r,v,a,h,u)),null;case 27:if(Be(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 Mt(r),null}a=ie.current,Zr(r)?Jg(r):(a=Cb(v,h,u),r.stateNode=a,Ga(r))}return Mt(r),null;case 5:if(Be(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 Mt(r),null}if(S=ie.current,Zr(r))Jg(r);else{var O=Yu($.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[Jt]=r,S[yt]=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 Mt(r),nh(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[Jt]=r,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||gb(a.nodeValue,u)),a||fi(r,!0)}else a=Yu(a).createTextNode(h),a[Jt]=r,r.stateNode=a}return Mt(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[Jt]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Mt(r),a=!1}else u=ff(),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 Mt(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[Jt]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Mt(r),v=!1}else v=ff(),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),Mu(r,r.updateQueue),Mt(r),null);case 4:return ke(),a===null&&kh(r.stateNode.containerInfo),Mt(r),null;case 10:return Fa(r.type),Mt(r),null;case 19:if(te(qt),h=r.memoizedState,h===null)return Mt(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=xu(a),S!==null){for(r.flags|=128,wo(h,!1),a=S.updateQueue,r.updateQueue=a,Mu(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Kg(u,a),u=u.sibling;return U(qt,qt.current&1|2),lt&&Ua(r,h.treeForkCount),r.child}a=a.sibling}h.tail!==null&&Fe()>Iu&&(r.flags|=128,v=!0,wo(h,!1),r.lanes=4194304)}else{if(!v)if(a=xu(S),a!==null){if(r.flags|=128,v=!0,a=a.updateQueue,r.updateQueue=a,Mu(r,a),wo(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!lt)return Mt(r),null}else 2*Fe()-h.renderingStartTime>Iu&&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=Fe(),a.sibling=null,u=qt.current,U(qt,v?u&1|2:u&1),lt&&Ua(r,h.treeForkCount),a):(Mt(r),null);case 22:case 23:return Pn(r),wf(),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&&(Mt(r),r.subtreeFlags&6&&(r.flags|=8192)):Mt(r),u=r.updateQueue,u!==null&&Mu(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048),a!==null&&te(rr),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Fa(Xt),Mt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function q3(a,r){switch(cf(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Fa(Xt),ke(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return Be(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 te(qt),null;case 4:return ke(),null;case 10:return Fa(r.type),null;case 22:case 23:return Pn(r),wf(),a!==null&&te(rr),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Fa(Xt),null;case 25:return null;default:return null}}function Ex(a,r){switch(cf(r),r.tag){case 3:Fa(Xt),ke();break;case 26:case 27:case 5:Be(r);break;case 4:ke();break;case 31:r.memoizedState!==null&&Pn(r);break;case 13:Pn(r);break;case 19:te(qt);break;case 10:Fa(r.type);break;case 22:case 23:Pn(r),wf(),a!==null&&te(rr);break;case 24:Fa(Xt)}}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(q){bt(r,r.return,q)}}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,q=O.destroy;if(q!==void 0){O.destroy=void 0,v=r;var ne=u,de=q;try{de()}catch(be){bt(v,ne,be)}}}h=h.next}while(h!==S)}}catch(be){bt(r,r.return,be)}}function Tx(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{f1(r,u)}catch(h){bt(a,a.return,h)}}}function Sx(a,r,u){u.props=cr(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){bt(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){bt(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){bt(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){bt(a,r,v)}else u.current=null}function kx(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){bt(a,a.return,v)}}function ah(a,r,u){try{var h=a.stateNode;fA(h,a.type,u,r),h[yt]=r}catch(v){bt(a,a.return,v)}}function wx(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ai(a.type)||a.tag===4}function ih(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||wx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ai(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function rh(a,r,u){var 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(rh(a,r,u),a=a.sibling;a!==null;)rh(a,r,u),a=a.sibling}function Ru(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(Ru(a,r,u),a=a.sibling;a!==null;)Ru(a,r,u),a=a.sibling}function Ax(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[Jt]=a,r[yt]=u}catch(S){bt(a,a.return,S)}}var Xa=!1,Qt=!1,sh=!1,Cx=typeof WeakSet=="function"?WeakSet:Set,rn=null;function Y3(a,r){if(a=a.containerInfo,Ch=Zu,a=zg(a),Zd(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var 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,q=-1,ne=-1,de=0,be=0,Te=a,he=null;t:for(;;){for(var pe;Te!==u||v!==0&&Te.nodeType!==3||(q=O+v),Te!==S||h!==0&&Te.nodeType!==3||(ne=O+h),Te.nodeType===3&&(O+=Te.nodeValue.length),(pe=Te.firstChild)!==null;)he=Te,Te=pe;for(;;){if(Te===a)break t;if(he===u&&++de===v&&(q=O),he===S&&++be===h&&(ne=O),(pe=Te.nextSibling)!==null)break;Te=he,he=Te.parentNode}Te=pe}u=q===-1||ne===-1?null:{start:q,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Nh={focusedElem:a,selectionRange:u},Zu=!1,rn=r;rn!==null;)if(r=rn,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,rn=a;else for(;rn!==null;){switch(r=rn,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 Le=cr(u.type,v);a=h.getSnapshotBeforeUpdate(Le,S),h.__reactInternalSnapshotBeforeUpdate=a}catch(qe){bt(u,u.return,qe)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Rh(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Rh(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=r.sibling,a!==null){a.return=r.return,rn=a;break}rn=r.return}}function Nx(a,r,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:$a(a,u),h&4&&Ao(5,u);break;case 1:if($a(a,u),h&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(O){bt(u,u.return,O)}else{var v=cr(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(v,r,a.__reactInternalSnapshotBeforeUpdate)}catch(O){bt(u,u.return,O)}}h&64&&Tx(u),h&512&&Co(u,u.return);break;case 3:if($a(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{f1(a,r)}catch(O){bt(u,u.return,O)}}break;case 27:r===null&&h&4&&Ax(u);case 26:case 5:$a(a,u),r===null&&h&4&&kx(u),h&512&&Co(u,u.return);break;case 12:$a(a,u);break;case 31:$a(a,u),h&4&&Rx(a,u);break;case 13:$a(a,u),h&4&&Dx(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=eA.bind(null,u),vA(a,u))));break;case 22:if(h=u.memoizedState!==null||Xa,!h){r=r!==null&&r.memoizedState!==null||Qt,v=Xa;var S=Qt;Xa=h,(Qt=r)&&!S?Qa(a,u,(u.subtreeFlags&8772)!==0):$a(a,u),Xa=v,Qt=S}break;case 30:break;default:$a(a,u)}}function _x(a){var r=a.alternate;r!==null&&(a.alternate=null,_x(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 Dt=null,wn=!1;function Ka(a,r,u){for(u=u.child;u!==null;)Mx(a,r,u),u=u.sibling}function Mx(a,r,u){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(Je,u)}catch{}switch(u.tag){case 26:Qt||Sa(u,r),Ka(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Qt||Sa(u,r);var h=Dt,v=wn;Ai(u.type)&&(Dt=u.stateNode,wn=!1),Ka(a,r,u),jo(u.stateNode),Dt=h,wn=v;break;case 5:Qt||Sa(u,r);case 6:if(h=Dt,v=wn,Dt=null,Ka(a,r,u),Dt=h,wn=v,Dt!==null)if(wn)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(u.stateNode)}catch(S){bt(u,r,S)}else try{Dt.removeChild(u.stateNode)}catch(S){bt(u,r,S)}break;case 18:Dt!==null&&(wn?(a=Dt,Tb(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),ys(a)):Tb(Dt,u.stateNode));break;case 4:h=Dt,v=wn,Dt=u.stateNode.containerInfo,wn=!0,Ka(a,r,u),Dt=h,wn=v;break;case 0:case 11:case 14:case 15:yi(2,u,r),Qt||yi(4,u,r),Ka(a,r,u);break;case 1:Qt||(Sa(u,r),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Sx(u,r,h)),Ka(a,r,u);break;case 21:Ka(a,r,u);break;case 22:Qt=(h=Qt)||u.memoizedState!==null,Ka(a,r,u),Qt=h;break;default:Ka(a,r,u)}}function Rx(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ys(a)}catch(u){bt(r,r.return,u)}}}function Dx(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){bt(r,r.return,u)}}function G3(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Cx),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Cx),r;default:throw Error(i(435,a.tag))}}function Du(a,r){var u=G3(a);r.forEach(function(h){if(!u.has(h)){u.add(h);var v=tA.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,q=O;e:for(;q!==null;){switch(q.tag){case 27:if(Ai(q.type)){Dt=q.stateNode,wn=!1;break e}break;case 5:Dt=q.stateNode,wn=!1;break e;case 3:case 4:Dt=q.stateNode.containerInfo,wn=!0;break e}q=q.return}if(Dt===null)throw Error(i(160));Mx(S,O,v),Dt=null,wn=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Lx(r,a),r=r.sibling}var fa=null;function Lx(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&&(Qt||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&&(Qt||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[$i]||S[Jt]||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[Jt]=a,Vt(S),h=S;break e;case"link":var O=Lb("link","href",v).get(h+(u.href||""));if(O){for(var q=0;q<O.length;q++)if(S=O[q],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(q,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;case"meta":if(O=Lb("meta","content",v).get(h+(u.content||""))){for(q=0;q<O.length;q++)if(S=O[q],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(q,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;default:throw Error(i(468,h))}S[Jt]=a,Vt(S),h=S}a.stateNode=h}else Ob(v,a.type,a.stateNode);else a.stateNode=Db(v,h,a.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Ob(v,a.type,a.stateNode):Db(v,h,a.memoizedProps)):h===null&&a.stateNode!==null&&ah(a,a.memoizedProps,u.memoizedProps)}break;case 27:An(r,a),Cn(a),h&512&&(Qt||u===null||Sa(u,u.return)),u!==null&&h&4&&ah(a,a.memoizedProps,u.memoizedProps);break;case 5:if(An(r,a),Cn(a),h&512&&(Qt||u===null||Sa(u,u.return)),a.flags&32){v=a.stateNode;try{Fr(v,"")}catch(Le){bt(a,a.return,Le)}}h&4&&a.stateNode!=null&&(v=a.memoizedProps,ah(a,v,u!==null?u.memoizedProps:v)),h&1024&&(sh=!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(Le){bt(a,a.return,Le)}}break;case 3:if(Ku=null,v=fa,fa=Gu(r.containerInfo),An(r,a),fa=v,Cn(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{ys(r.containerInfo)}catch(Le){bt(a,a.return,Le)}sh&&(sh=!1,Ox(a));break;case 4:h=fa,fa=Gu(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,Du(a,h)));break;case 13:An(r,a),Cn(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Ou=Fe()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Du(a,h)));break;case 22:v=a.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,de=Xa,be=Qt;if(Xa=de||v,Qt=be||ne,An(r,a),Qt=be,Xa=de,Cn(a),h&8192)e:for(r=a.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(u===null||ne||Xa||Qt||dr(a)),u=null,r=a;;){if(r.tag===5||r.tag===26){if(u===null){ne=u=r;try{if(S=ne.stateNode,v)O=S.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{q=ne.stateNode;var Te=ne.memoizedProps.style,he=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;q.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Le){bt(ne,ne.return,Le)}}}else if(r.tag===6){if(u===null){ne=r;try{ne.stateNode.nodeValue=v?"":ne.memoizedProps}catch(Le){bt(ne,ne.return,Le)}}}else if(r.tag===18){if(u===null){ne=r;try{var pe=ne.stateNode;v?Sb(pe,!0):Sb(ne.stateNode,!1)}catch(Le){bt(ne,ne.return,Le)}}}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,Du(a,u))));break;case 19:An(r,a),Cn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Du(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(wx(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var v=u.stateNode,S=ih(a);Ru(a,S,v);break;case 5:var O=u.stateNode;u.flags&32&&(Fr(O,""),u.flags&=-33);var q=ih(a);Ru(a,q,O);break;case 3:case 4:var ne=u.stateNode.containerInfo,de=ih(a);rh(a,de,ne);break;default:throw Error(i(161))}}catch(be){bt(a,a.return,be)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function Ox(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;Ox(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function $a(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Nx(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"&&Sx(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 Qa(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:Qa(v,S,u),Ao(4,S);break;case 1:if(Qa(v,S,u),h=S,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(de){bt(h,h.return,de)}if(h=S,v=h.updateQueue,v!==null){var q=h.stateNode;try{var ne=v.shared.hiddenCallbacks;if(ne!==null)for(v.shared.hiddenCallbacks=null,v=0;v<ne.length;v++)d1(ne[v],q)}catch(de){bt(h,h.return,de)}}u&&O&64&&Tx(S),Co(S,S.return);break;case 27:Ax(S);case 26:case 5:Qa(v,S,u),u&&h===null&&O&4&&kx(S),Co(S,S.return);break;case 12:Qa(v,S,u);break;case 31:Qa(v,S,u),u&&O&4&&Rx(v,S);break;case 13:Qa(v,S,u),u&&O&4&&Dx(v,S);break;case 22:S.memoizedState===null&&Qa(v,S,u),Co(S,S.return);break;case 30:break;default:Qa(v,S,u)}r=r.sibling}}function oh(a,r){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&ho(u))}function lh(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&ho(a))}function ha(a,r,u,h){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ix(a,r,u,h),r=r.sibling}function Ix(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,q=S.onPostCommit;typeof q=="function"&&q(O,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(ne){bt(r,r.return,ne)}}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&&oh(O,r);break;case 24:ha(a,r,u,h),v&2048&&lh(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,q=u,ne=h,de=O.flags;switch(O.tag){case 0:case 11:case 15:ls(S,O,q,ne,v),Ao(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?ls(S,O,q,ne,v):No(S,O):(be._visibility|=2,ls(S,O,q,ne,v)),v&&de&2048&&oh(O.alternate,O);break;case 24:ls(S,O,q,ne,v),v&&de&2048&&lh(O.alternate,O);break;default:ls(S,O,q,ne,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&&oh(h.alternate,h);break;case 24:No(u,h),v&2048&&lh(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;)jx(a,r,u),a=a.sibling}function jx(a,r,u){switch(a.tag){case 26:us(a,r,u),a.flags&_o&&a.memoizedState!==null&&DA(u,fa,a.memoizedState,a.memoizedProps);break;case 5:us(a,r,u);break;case 3:case 4:var h=fa;fa=Gu(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 Px(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];rn=h,zx(h,a)}Px(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Bx(a),a=a.sibling}function Bx(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,Lu(a)):Mo(a);break;default:Mo(a)}}function Lu(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var h=r[u];rn=h,zx(h,a)}Px(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:yi(8,r,r.return),Lu(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,Lu(r));break;default:Lu(r)}a=a.sibling}}function zx(a,r){for(;rn!==null;){var u=rn;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,rn=h;else e:for(u=a;rn!==null;){h=rn;var v=h.sibling,S=h.return;if(_x(h),h===u){rn=null;break e}if(v!==null){v.return=S,rn=v;break e}rn=S}}}var X3={getCacheForType:function(a){var r=cn(Xt),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return cn(Xt).controller.signal}},K3=typeof WeakMap=="function"?WeakMap:Map,mt=0,kt=null,nt=null,rt=0,xt=0,Bn=null,vi=!1,cs=!1,uh=!1,Wa=0,Ht=0,Ei=0,fr=0,ch=0,zn=0,ds=0,Ro=null,Nn=null,dh=!1,Ou=0,Ux=0,Iu=1/0,ju=null,Ti=null,en=0,Si=null,fs=null,Za=0,fh=0,hh=null,Hx=null,Do=0,mh=null;function Un(){return(mt&2)!==0&&rt!==0?rt&-rt:H.T!==null?vh():Qs()}function Fx(){if(zn===0)if((rt&536870912)===0||lt){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===kt&&(xt===2||xt===9)||a.cancelPendingCommit!==null)&&(hs(a,0),ki(a,rt,zn,!1)),Gi(a,u),((mt&2)===0||a!==kt)&&(a===kt&&((mt&2)===0&&(fr|=u),Ht===4&&ki(a,rt,zn,!1)),ka(a))}function Vx(a,r,u){if((mt&6)!==0)throw Error(i(327));var h=!u&&(r&127)===0&&(r&a.expiredLanes)===0||oi(a,r),v=h?W3(a,r):gh(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=gh(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 q=a;v=Ro;var ne=q.current.memoizedState.isDehydrated;if(ne&&(hs(q,O).flags|=256),O=gh(q,O,!1),O!==2){if(uh&&!ne){q.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=Ou+300-Fe(),10<v)){if(ki(h,r,zn,!vi),qi(h,0,!0)!==0)break e;Za=r,h.timeoutHandle=vb(qx.bind(null,h,u,Nn,ju,dh,r,zn,fr,ds,vi,S,"Throttled",-0,0),v);break e}qx(h,u,Nn,ju,dh,r,zn,fr,ds,vi,S,null,-0,0)}}break}while(!0);ka(a)}function qx(a,r,u,h,v,S,O,q,ne,de,be,Te,he,pe){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},jx(r,S,Te);var Le=(S&62914560)===S?Ou-Fe():(S&4194048)===S?Ux-Fe():0;if(Le=LA(Te,Le),Le!==null){Za=S,a.cancelPendingCommit=Le(Zx.bind(null,a,r,S,u,h,v,O,q,ne,be,Te,null,he,pe)),ki(a,S,O,!de);return}}Zx(a,r,S,u,h,v,O,q,ne)}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&=~ch,r&=~fr,a.suspendedLanes|=r,a.pingedLanes&=~r,h&&(a.warmLanes|=r),h=a.expirationTimes;for(var v=r;0<v;){var S=31-gt(v),O=1<<S;h[S]=-1,v&=~O}u!==0&&Yl(a,u,r)}function Pu(){return(mt&6)===0?(Lo(0),!1):!0}function ph(){if(nt!==null){if(xt===0)var a=nt.return;else a=nt,Ha=ar=null,Rf(a),as=null,po=0,a=nt;for(;a!==null;)Ex(a.alternate,a),a=a.return;nt=null}}function hs(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,pA(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Za=0,ph(),kt=a,nt=u=za(a.current,null),rt=r,xt=0,Bn=null,vi=!1,cs=oi(a,r),uh=!1,ds=zn=ch=fr=Ei=Ht=0,Nn=Ro=null,dh=!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-gt(h),S=1<<v;r|=a[v],h&=~S}return Wa=r,iu(),u}function Yx(a,r){We=null,H.H=So,r===ns||r===fu?(r=o1(),xt=3):r===yf?(r=o1(),xt=4):xt=r===Xf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Bn=r,nt===null&&(Ht=1,Au(a,Qn(r,a.current)))}function Gx(){var a=jn.current;return a===null?!0:(rt&4194048)===rt?ea===null:(rt&62914560)===rt||(rt&536870912)!==0?a===ea:!1}function Xx(){var a=H.H;return H.H=So,a===null?So:a}function Kx(){var a=H.A;return H.A=X3,a}function Bu(){Ht=4,vi||(rt&4194048)!==rt&&jn.current!==null||(cs=!0),(Ei&134217727)===0&&(fr&134217727)===0||kt===null||ki(kt,rt,zn,!1)}function gh(a,r,u){var h=mt;mt|=2;var v=Xx(),S=Kx();(kt!==a||rt!==r)&&(ju=null,hs(a,r)),r=!1;var O=Ht;e:do try{if(xt!==0&&nt!==null){var q=nt,ne=Bn;switch(xt){case 8:ph(),O=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(r=!0);var de=xt;if(xt=0,Bn=null,ms(a,q,ne,de),u&&cs){O=0;break e}break;default:de=xt,xt=0,Bn=null,ms(a,q,ne,de)}}Q3(),O=Ht;break}catch(be){Yx(a,be)}while(!0);return r&&a.shellSuspendCounter++,Ha=ar=null,mt=h,H.H=v,H.A=S,nt===null&&(kt=null,rt=0,iu()),O}function Q3(){for(;nt!==null;)$x(nt)}function W3(a,r){var u=mt;mt|=2;var h=Xx(),v=Kx();kt!==a||rt!==r?(ju=null,Iu=Fe()+500,hs(a,r)):cs=oi(a,r);e:do try{if(xt!==0&&nt!==null){r=nt;var S=Bn;t:switch(xt){case 1:xt=0,Bn=null,ms(a,r,S,1);break;case 2:case 9:if(r1(S)){xt=0,Bn=null,Qx(r);break}r=function(){xt!==2&&xt!==9||kt!==a||(xt=7),ka(a)},S.then(r,r);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:r1(S)?(xt=0,Bn=null,Qx(r)):(xt=0,Bn=null,ms(a,r,S,7));break;case 5:var O=null;switch(nt.tag){case 26:O=nt.memoizedState;case 5:case 27:var q=nt;if(O?Ib(O):q.stateNode.complete){xt=0,Bn=null;var ne=q.sibling;if(ne!==null)nt=ne;else{var de=q.return;de!==null?(nt=de,zu(de)):nt=null}break t}}xt=0,Bn=null,ms(a,r,S,5);break;case 6:xt=0,Bn=null,ms(a,r,S,6);break;case 8:ph(),Ht=6;break e;default:throw Error(i(462))}}Z3();break}catch(be){Yx(a,be)}while(!0);return Ha=ar=null,H.H=h,H.A=v,mt=u,nt!==null?0:(kt=null,rt=0,iu(),Ht)}function Z3(){for(;nt!==null&&!Rt();)$x(nt)}function $x(a){var r=yx(a.alternate,a,Wa);a.memoizedProps=a.pendingProps,r===null?zu(a):nt=r}function Qx(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=hx(u,r,r.pendingProps,r.type,void 0,rt);break;case 11:r=hx(u,r,r.pendingProps,r.type.render,r.ref,rt);break;case 5:Rf(r);default:Ex(u,r),r=nt=Kg(r,Wa),r=yx(u,r,Wa)}a.memoizedProps=a.pendingProps,r===null?zu(a):nt=r}function ms(a,r,u,h){Ha=ar=null,Rf(r),as=null,po=0;var v=r.return;try{if(U3(a,v,r,u,rt)){Ht=1,Au(a,Qn(u,a.current)),nt=null;return}}catch(S){if(v!==null)throw nt=v,S;Ht=1,Au(a,Qn(u,a.current)),nt=null;return}r.flags&32768?(lt||h===1?a=!0:cs||(rt&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))),Wx(r,a)):zu(r)}function zu(a){var r=a;do{if((r.flags&32768)!==0){Wx(r,vi);return}a=r.return;var u=V3(r.alternate,r,Wa);if(u!==null){nt=u;return}if(r=r.sibling,r!==null){nt=r;return}nt=r=a}while(r!==null);Ht===0&&(Ht=5)}function Wx(a,r){do{var u=q3(a.alternate,a);if(u!==null){u.flags&=32767,nt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){nt=a;return}nt=a=u}while(a!==null);Ht=6,nt=null}function Zx(a,r,u,h,v,S,O,q,ne){a.cancelPendingCommit=null;do Uu();while(en!==0);if((mt&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(S=r.lanes|r.childLanes,S|=af,Od(a,u,S,O,q,ne),a===kt&&(nt=kt=null,rt=0),fs=r,Si=a,Za=u,fh=S,hh=v,Hx=h,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,nA(De,function(){return ab(),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=mt,mt|=4;try{Y3(a,r,u)}finally{mt=O,G.p=v,H.T=h}}en=1,Jx(),eb(),tb()}}function Jx(){if(en===1){en=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=mt;mt|=4;try{Lx(r,a);var S=Nh,O=zg(a.containerInfo),q=S.focusedElem,ne=S.selectionRange;if(O!==q&&q&&q.ownerDocument&&Bg(q.ownerDocument.documentElement,q)){if(ne!==null&&Zd(q)){var de=ne.start,be=ne.end;if(be===void 0&&(be=de),"selectionStart"in q)q.selectionStart=de,q.selectionEnd=Math.min(be,q.value.length);else{var Te=q.ownerDocument||document,he=Te&&Te.defaultView||window;if(he.getSelection){var pe=he.getSelection(),Le=q.textContent.length,qe=Math.min(ne.start,Le),Tt=ne.end===void 0?qe:Math.min(ne.end,Le);!pe.extend&&qe>Tt&&(O=Tt,Tt=qe,qe=O);var oe=Pg(q,qe),re=Pg(q,Tt);if(oe&&re&&(pe.rangeCount!==1||pe.anchorNode!==oe.node||pe.anchorOffset!==oe.offset||pe.focusNode!==re.node||pe.focusOffset!==re.offset)){var ce=Te.createRange();ce.setStart(oe.node,oe.offset),pe.removeAllRanges(),qe>Tt?(pe.addRange(ce),pe.extend(re.node,re.offset)):(ce.setEnd(re.node,re.offset),pe.addRange(ce))}}}}for(Te=[],pe=q;pe=pe.parentNode;)pe.nodeType===1&&Te.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<Te.length;q++){var Ee=Te[q];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}Zu=!!Ch,Nh=Ch=null}finally{mt=v,G.p=h,H.T=u}}a.current=r,en=2}}function eb(){if(en===2){en=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=mt;mt|=4;try{Nx(a,r.alternate,r)}finally{mt=v,G.p=h,H.T=u}}en=3}}function tb(){if(en===4||en===3){en=0,xe();var a=Si,r=fs,u=Za,h=Hx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?en=5:(en=0,fs=Si=null,nb(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Ti=null),Xi(u),r=r.stateNode,Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(Je,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 q=h[O];S(q.value,{componentStack:q.stack})}}finally{H.T=r,G.p=v}}(Za&3)!==0&&Uu(),ka(a),v=a.pendingLanes,(u&261930)!==0&&(v&42)!==0?a===mh?Do++:(Do=0,mh=a):Do=0,Lo(0)}}function nb(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,ho(r)))}function Uu(){return Jx(),eb(),tb(),ab()}function ab(){if(en!==5)return!1;var a=Si,r=fh;fh=0;var u=Xi(Za),h=H.T,v=G.p;try{G.p=32>u?32:u,H.T=null,u=hh,hh=null;var S=Si,O=Za;if(en=0,fs=Si=null,Za=0,(mt&6)!==0)throw Error(i(331));var q=mt;if(mt|=4,Bx(S.current),Ix(S,S.current,O,u),mt=q,Lo(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(Je,S)}catch{}return!0}finally{G.p=v,H.T=h,nb(a,r)}}function ib(a,r,u){r=Qn(u,r),r=Gf(a.stateNode,r,2),a=gi(a,r,2),a!==null&&(Gi(a,2),ka(a))}function bt(a,r,u){if(a.tag===3)ib(a,a,u);else for(;r!==null;){if(r.tag===3){ib(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=Qn(u,a),u=rx(2),h=gi(r,u,2),h!==null&&(sx(u,h,r,a),Gi(h,2),ka(h));break}}r=r.return}}function xh(a,r,u){var h=a.pingCache;if(h===null){h=a.pingCache=new K3;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)||(uh=!0,v.add(u),a=J3.bind(null,a,r,u),r.then(a,a))}function J3(a,r,u){var h=a.pingCache;h!==null&&h.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,kt===a&&(rt&u)===u&&(Ht===4||Ht===3&&(rt&62914560)===rt&&300>Fe()-Ou?(mt&2)===0&&hs(a,0):ch|=u,ds===rt&&(ds=0)),ka(a)}function rb(a,r){r===0&&(r=zr()),a=er(a,r),a!==null&&(Gi(a,r),ka(a))}function eA(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),rb(a,u)}function tA(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),rb(a,u)}function nA(a,r){return ht(a,r)}var Hu=null,ps=null,bh=!1,Fu=!1,yh=!1,wi=0;function ka(a){a!==ps&&a.next===null&&(ps===null?Hu=ps=a:ps=ps.next=a),Fu=!0,bh||(bh=!0,iA())}function Lo(a,r){if(!yh&&Fu){yh=!0;do for(var u=!1,h=Hu;h!==null;){if(a!==0){var v=h.pendingLanes;if(v===0)var S=0;else{var O=h.suspendedLanes,q=h.pingedLanes;S=(1<<31-gt(42|a)+1)-1,S&=v&~(O&~q),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,ub(h,S))}else S=rt,S=qi(h,h===kt?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||oi(h,S)||(u=!0,ub(h,S));h=h.next}while(u);yh=!1}}function aA(){sb()}function sb(){Fu=bh=!1;var a=0;wi!==0&&mA()&&(a=wi);for(var r=Fe(),u=null,h=Hu;h!==null;){var v=h.next,S=ob(h,r);S===0?(h.next=null,u===null?Hu=v:u.next=v,v===null&&(ps=u)):(u=h,(a!==0||(S&3)!==0)&&(Fu=!0)),h=v}en!==0&&en!==5||Lo(a),wi!==0&&(wi=0)}function ob(a,r){for(var u=a.suspendedLanes,h=a.pingedLanes,v=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var O=31-gt(S),q=1<<O,ne=v[O];ne===-1?((q&u)===0||(q&h)!==0)&&(v[O]=Br(q,r)):ne<=r&&(a.expiredLanes|=q),S&=~q}if(r=kt,u=rt,u=qi(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===r&&(xt===2||xt===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&ln(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&&ln(h),Xi(u)){case 2:case 8:u=Se;break;case 32:u=De;break;case 268435456:u=$e;break;default:u=De}return h=lb.bind(null,a),u=ht(u,h),a.callbackPriority=r,a.callbackNode=u,r}return h!==null&&h!==null&&ln(h),a.callbackPriority=2,a.callbackNode=null,2}function lb(a,r){if(en!==0&&en!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Uu()&&a.callbackNode!==u)return null;var h=rt;return h=qi(a,a===kt?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(Vx(a,h,r),ob(a,Fe()),a.callbackNode!=null&&a.callbackNode===u?lb.bind(null,a):null)}function ub(a,r){if(Uu())return null;Vx(a,r,!0)}function iA(){gA(function(){(mt&6)!==0?ht(me,aA):sb()})}function vh(){if(wi===0){var a=es;a===0&&(a=Gn,Gn<<=1,(Gn&261888)===0&&(Gn=256)),wi=a}return wi}function cb(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ql(""+a)}function db(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 rA(a,r,u,h,v){if(r==="submit"&&u&&u.stateNode===v){var S=cb((v[yt]||null).action),O=h.submitter;O&&(r=(r=O[yt]||null)?cb(r.formAction):O.getAttribute("formAction"),r!==null&&(S=r,O=null));var q=new eu("action","action",null,h,v);a.push({event:q,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(wi!==0){var ne=O?db(v,O):new FormData(v);Uf(u,{pending:!0,data:ne,method:v.method,action:S},null,ne)}}else typeof S=="function"&&(q.preventDefault(),ne=O?db(v,O):new FormData(v),Uf(u,{pending:!0,data:ne,method:v.method,action:S},S,ne))},currentTarget:v}]})}}for(var Eh=0;Eh<nf.length;Eh++){var Th=nf[Eh],sA=Th.toLowerCase(),oA=Th[0].toUpperCase()+Th.slice(1);da(sA,"on"+oA)}da(Fg,"onAnimationEnd"),da(Vg,"onAnimationIteration"),da(qg,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(S3,"onTransitionRun"),da(k3,"onTransitionStart"),da(w3,"onTransitionCancel"),da(Yg,"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(" "),lA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oo));function fb(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 q=h[O],ne=q.instance,de=q.currentTarget;if(q=q.listener,ne!==S&&v.isPropagationStopped())break e;S=q,v.currentTarget=de;try{S(v)}catch(be){au(be)}v.currentTarget=null,S=ne}else for(O=0;O<h.length;O++){if(q=h[O],ne=q.instance,de=q.currentTarget,q=q.listener,ne!==S&&v.isPropagationStopped())break e;S=q,v.currentTarget=de;try{S(v)}catch(be){au(be)}v.currentTarget=null,S=ne}}}}function at(a,r){var u=r[It];u===void 0&&(u=r[It]=new Set);var h=a+"__bubble";u.has(h)||(hb(r,a,2,!1),u.add(h))}function Sh(a,r,u){var h=0;r&&(h|=4),hb(u,a,h,r)}var Vu="_reactListening"+Math.random().toString(36).slice(2);function kh(a){if(!a[Vu]){a[Vu]=!0,Js.forEach(function(u){u!=="selectionchange"&&(lA.has(u)||Sh(u,!1,a),Sh(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Vu]||(r[Vu]=!0,Sh("selectionchange",!1,r))}}function hb(a,r,u,h){switch(Fb(r)){case 2:var v=jA;break;case 8:v=PA;break;default:v=zh}u=v.bind(null,r,u,a),v=void 0,!Vd||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 wh(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 q=h.stateNode.containerInfo;if(q===v)break;if(O===4)for(O=h.return;O!==null;){var ne=O.tag;if((ne===3||ne===4)&&O.stateNode.containerInfo===v)return;O=O.return}for(;q!==null;){if(O=Xn(q),O===null)return;if(ne=O.tag,ne===5||ne===6||ne===26||ne===27){h=S=O;continue e}q=q.parentNode}}h=h.return}bg(function(){var de=S,be=Hd(u),Te=[];e:{var he=Gg.get(a);if(he!==void 0){var pe=eu,Le=a;switch(a){case"keypress":if(Zl(u)===0)break e;case"keydown":case"keyup":pe=t3;break;case"focusin":Le="focus",pe=Xd;break;case"focusout":Le="blur",pe=Xd;break;case"beforeblur":case"afterblur":pe=Xd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Vw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=i3;break;case Fg:case Vg:case qg:pe=Gw;break;case Yg:pe=s3;break;case"scroll":case"scrollend":pe=Hw;break;case"wheel":pe=l3;break;case"copy":case"cut":case"paste":pe=Kw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Sg;break;case"toggle":case"beforetoggle":pe=c3}var qe=(r&4)!==0,Tt=!qe&&(a==="scroll"||a==="scrollend"),oe=qe?he!==null?he+"Capture":null:he;qe=[];for(var re=de,ce;re!==null;){var Ee=re;if(ce=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||ce===null||oe===null||(Ee=to(re,oe),Ee!=null&&qe.push(Io(re,Ee,ce))),Tt)break;re=re.return}0<qe.length&&(he=new pe(he,Le,null,u,be),Te.push({event:he,listeners:qe}))}}if((r&7)===0){e:{if(he=a==="mouseover"||a==="pointerover",pe=a==="mouseout"||a==="pointerout",he&&u!==Ud&&(Le=u.relatedTarget||u.fromElement)&&(Xn(Le)||Le[Oa]))break e;if((pe||he)&&(he=be.window===be?be:(he=be.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(Le=u.relatedTarget||u.toElement,pe=de,Le=Le?Xn(Le):null,Le!==null&&(Tt=s(Le),qe=Le.tag,Le!==Tt||qe!==5&&qe!==27&&qe!==6)&&(Le=null)):(pe=null,Le=de),pe!==Le)){if(qe=Eg,Ee="onMouseLeave",oe="onMouseEnter",re="mouse",(a==="pointerout"||a==="pointerover")&&(qe=Sg,Ee="onPointerLeave",oe="onPointerEnter",re="pointer"),Tt=pe==null?he:Qi(pe),ce=Le==null?he:Qi(Le),he=new qe(Ee,re+"leave",pe,u,be),he.target=Tt,he.relatedTarget=ce,Ee=null,Xn(be)===de&&(qe=new qe(oe,re+"enter",Le,u,be),qe.target=ce,qe.relatedTarget=Tt,Ee=qe),Tt=Ee,pe&&Le)t:{for(qe=uA,oe=pe,re=Le,ce=0,Ee=oe;Ee;Ee=qe(Ee))ce++;Ee=0;for(var He=re;He;He=qe(He))Ee++;for(;0<ce-Ee;)oe=qe(oe),ce--;for(;0<Ee-ce;)re=qe(re),Ee--;for(;ce--;){if(oe===re||re!==null&&oe===re.alternate){qe=oe;break t}oe=qe(oe),re=qe(re)}qe=null}else qe=null;pe!==null&&mb(Te,he,pe,qe,!1),Le!==null&&Tt!==null&&mb(Te,Tt,Le,qe,!0)}}e:{if(he=de?Qi(de):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var dt=Rg;else if(_g(he))if(Dg)dt=v3;else{dt=b3;var Ie=x3}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&zd(de.elementType)&&(dt=Rg):dt=y3;if(dt&&(dt=dt(a,de))){Mg(Te,dt,u,be);break e}Ie&&Ie(a,he,de),a==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&Bd(he,"number",he.value)}switch(Ie=de?Qi(de):window,a){case"focusin":(_g(Ie)||Ie.contentEditable==="true")&&(Gr=Ie,Jd=de,uo=null);break;case"focusout":uo=Jd=Gr=null;break;case"mousedown":ef=!0;break;case"contextmenu":case"mouseup":case"dragend":ef=!1,Ug(Te,u,be);break;case"selectionchange":if(T3)break;case"keydown":case"keyup":Ug(Te,u,be)}var Ze;if($d)e:{switch(a){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Yr?Cg(a,u)&&(st="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(st="onCompositionStart");st&&(kg&&u.locale!=="ko"&&(Yr||st!=="onCompositionStart"?st==="onCompositionEnd"&&Yr&&(Ze=yg()):(ui=be,qd="value"in ui?ui.value:ui.textContent,Yr=!0)),Ie=qu(de,st),0<Ie.length&&(st=new Tg(st,a,null,u,be),Te.push({event:st,listeners:Ie}),Ze?st.data=Ze:(Ze=Ng(u),Ze!==null&&(st.data=Ze)))),(Ze=f3?h3(a,u):m3(a,u))&&(st=qu(de,"onBeforeInput"),0<st.length&&(Ie=new Tg("onBeforeInput","beforeinput",null,u,be),Te.push({event:Ie,listeners:st}),Ie.data=Ze)),rA(Te,a,de,u,be)}fb(Te,r)})}function Io(a,r,u){return{instance:a,listener:r,currentTarget:u}}function qu(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 uA(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function mb(a,r,u,h,v){for(var S=r._reactName,O=[];u!==null&&u!==h;){var q=u,ne=q.alternate,de=q.stateNode;if(q=q.tag,ne!==null&&ne===h)break;q!==5&&q!==26&&q!==27||de===null||(ne=de,v?(de=to(u,S),de!=null&&O.unshift(Io(u,de,ne))):v||(de=to(u,S),de!=null&&O.push(Io(u,de,ne)))),u=u.return}O.length!==0&&a.push({event:r,listeners:O})}var cA=/\r\n?/g,dA=/\u0000|\uFFFD/g;function pb(a){return(typeof a=="string"?a:""+a).replace(cA,`
49
- `).replace(dA,"")}function gb(a,r){return r=pb(r),pb(a)===r}function Et(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":ct(a,"class",h);break;case"tabIndex":ct(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ct(a,u,h);break;case"style":gg(a,h,S);break;case"data":if(r!=="object"){ct(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=Ql(""+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"&&Et(a,r,"name",v.name,v,null),Et(a,r,"formEncType",v.formEncType,v,null),Et(a,r,"formMethod",v.formMethod,v,null),Et(a,r,"formTarget",v.formTarget,v,null)):(Et(a,r,"encType",v.encType,v,null),Et(a,r,"method",v.method,v,null),Et(a,r,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Ql(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Pa);break;case"onScroll":h!=null&&at("scroll",a);break;case"onScrollEnd":h!=null&&at("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=Ql(""+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":at("beforetoggle",a),at("toggle",a),Ue(a,"popover",h);break;case"xlinkActuate":jt(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":jt(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":jt(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":jt(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":jt(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":jt(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":jt(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":jt(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":jt(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Ue(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=zw.get(u)||u,Ue(a,u,h))}}function Ah(a,r,u,h,v,S){switch(u){case"style":gg(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&&at("scroll",a);break;case"onScrollEnd":h!=null&&at("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(!Kl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(v=u.endsWith("Capture"),r=u.slice(2,v?u.length-7:void 0),S=a[yt]||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,""):Ue(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":at("error",a),at("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:Et(a,r,S,O,u,null)}}v&&Et(a,r,"srcSet",u.srcSet,u,null),h&&Et(a,r,"src",u.src,u,null);return;case"input":at("invalid",a);var q=S=O=v=null,ne=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":ne=be;break;case"defaultChecked":de=be;break;case"value":S=be;break;case"defaultValue":q=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(i(137,r));break;default:Et(a,r,h,be,u,null)}}fg(a,S,q,ne,de,O,v,!1);return;case"select":at("invalid",a),h=O=S=null;for(v in u)if(u.hasOwnProperty(v)&&(q=u[v],q!=null))switch(v){case"value":S=q;break;case"defaultValue":O=q;break;case"multiple":h=q;default:Et(a,r,v,q,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":at("invalid",a),S=v=h=null;for(O in u)if(u.hasOwnProperty(O)&&(q=u[O],q!=null))switch(O){case"value":h=q;break;case"defaultValue":v=q;break;case"children":S=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(91));break;default:Et(a,r,O,q,u,null)}mg(a,h,v,S);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(h=u[ne],h!=null))switch(ne){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Et(a,r,ne,h,u,null)}return;case"dialog":at("beforetoggle",a),at("toggle",a),at("cancel",a),at("close",a);break;case"iframe":case"object":at("load",a);break;case"video":case"audio":for(h=0;h<Oo.length;h++)at(Oo[h],a);break;case"image":at("error",a),at("load",a);break;case"details":at("toggle",a);break;case"embed":case"source":case"link":at("error",a),at("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:Et(a,r,de,h,u,null)}return;default:if(zd(r)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Ah(a,r,be,h,u,void 0));return}}for(q in u)u.hasOwnProperty(q)&&(h=u[q],h!=null&&Et(a,r,q,h,u,null))}function fA(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,q=null,ne=null,de=null,be=null;for(pe in u){var Te=u[pe];if(u.hasOwnProperty(pe)&&Te!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":ne=Te;default:h.hasOwnProperty(pe)||Et(a,r,pe,null,h,Te)}}for(var he in h){var pe=h[he];if(Te=u[he],h.hasOwnProperty(he)&&(pe!=null||Te!=null))switch(he){case"type":S=pe;break;case"name":v=pe;break;case"checked":de=pe;break;case"defaultChecked":be=pe;break;case"value":O=pe;break;case"defaultValue":q=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(i(137,r));break;default:pe!==Te&&Et(a,r,he,pe,h,Te)}}Pd(a,O,q,ne,de,be,S,v);return;case"select":pe=O=q=he=null;for(S in u)if(ne=u[S],u.hasOwnProperty(S)&&ne!=null)switch(S){case"value":break;case"multiple":pe=ne;default:h.hasOwnProperty(S)||Et(a,r,S,null,h,ne)}for(v in h)if(S=h[v],ne=u[v],h.hasOwnProperty(v)&&(S!=null||ne!=null))switch(v){case"value":he=S;break;case"defaultValue":q=S;break;case"multiple":O=S;default:S!==ne&&Et(a,r,v,S,h,ne)}r=q,u=O,h=pe,he!=null?Hr(a,!!u,he,!1):!!h!=!!u&&(r!=null?Hr(a,!!u,r,!0):Hr(a,!!u,u?[]:"",!1));return;case"textarea":pe=he=null;for(q in u)if(v=u[q],u.hasOwnProperty(q)&&v!=null&&!h.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Et(a,r,q,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":pe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==S&&Et(a,r,O,v,h,S)}hg(a,he,pe);return;case"option":for(var Le in u)if(he=u[Le],u.hasOwnProperty(Le)&&he!=null&&!h.hasOwnProperty(Le))switch(Le){case"selected":a.selected=!1;break;default:Et(a,r,Le,null,h,he)}for(ne in h)if(he=h[ne],pe=u[ne],h.hasOwnProperty(ne)&&he!==pe&&(he!=null||pe!=null))switch(ne){case"selected":a.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Et(a,r,ne,he,h,pe)}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 qe in u)he=u[qe],u.hasOwnProperty(qe)&&he!=null&&!h.hasOwnProperty(qe)&&Et(a,r,qe,null,h,he);for(de in h)if(he=h[de],pe=u[de],h.hasOwnProperty(de)&&he!==pe&&(he!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,r));break;default:Et(a,r,de,he,h,pe)}return;default:if(zd(r)){for(var Tt in u)he=u[Tt],u.hasOwnProperty(Tt)&&he!==void 0&&!h.hasOwnProperty(Tt)&&Ah(a,r,Tt,void 0,h,he);for(be in h)he=h[be],pe=u[be],!h.hasOwnProperty(be)||he===pe||he===void 0&&pe===void 0||Ah(a,r,be,he,h,pe);return}}for(var oe in u)he=u[oe],u.hasOwnProperty(oe)&&he!=null&&!h.hasOwnProperty(oe)&&Et(a,r,oe,null,h,he);for(Te in h)he=h[Te],pe=u[Te],!h.hasOwnProperty(Te)||he===pe||he==null&&pe==null||Et(a,r,Te,he,h,pe)}function xb(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hA(){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,q=v.duration;if(S&&q&&xb(O)){for(O=0,q=v.responseEnd,h+=1;h<u.length;h++){var ne=u[h],de=ne.startTime;if(de>q)break;var be=ne.transferSize,Te=ne.initiatorType;be&&xb(Te)&&(ne=ne.responseEnd,O+=be*(ne<q?1:(q-de)/(ne-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 Ch=null,Nh=null;function Yu(a){return a.nodeType===9?a:a.ownerDocument}function bb(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 yb(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function _h(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Mh=null;function mA(){var a=window.event;return a&&a.type==="popstate"?a===Mh?!1:(Mh=a,!0):(Mh=null,!1)}var vb=typeof setTimeout=="function"?setTimeout:void 0,pA=typeof clearTimeout=="function"?clearTimeout:void 0,Eb=typeof Promise=="function"?Promise:void 0,gA=typeof queueMicrotask=="function"?queueMicrotask:typeof Eb<"u"?function(a){return Eb.resolve(null).then(a).catch(xA)}:vb;function xA(a){setTimeout(function(){throw a})}function Ai(a){return a==="head"}function Tb(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,q=S.nodeName;S[$i]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=O}}else u==="body"&&jo(a.ownerDocument.body);u=v}while(u);ys(r)}function Sb(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 Rh(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Rh(u),Ur(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function bA(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[$i])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 yA(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 kb(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=ta(a.nextSibling),a===null))return null;return a}function Dh(a){return a.data==="$?"||a.data==="$~"}function Lh(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function vA(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 Oh=null;function wb(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 Ab(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 Cb(a,r,u){switch(r=Yu(u),a){case"html":if(a=r.documentElement,!a)throw Error(i(452));return a;case"head":if(a=r.head,!a)throw Error(i(453));return a;case"body":if(a=r.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function jo(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Ur(a)}var na=new Map,Nb=new Set;function Gu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ja=G.d;G.d={f:EA,r:TA,D:SA,C:kA,L:wA,m:AA,X:NA,S:CA,M:_A};function EA(){var a=Ja.f(),r=Pu();return a||r}function TA(a){var r=Ia(a);r!==null&&r.tag===5&&r.type==="form"?Y1(r):Ja.r(a)}var gs=typeof document>"u"?null:document;function _b(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+'"]'),Nb.has(v)||(Nb.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 SA(a){Ja.D(a),_b("dns-prefetch",a,null)}function kA(a,r){Ja.C(a,r),_b("preconnect",a,r)}function wA(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 AA(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 CA(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 q={loading:0,preload:null};if(O=h.querySelector(Po(S)))q.loading=5;else{a=x({rel:"stylesheet",href:a,"data-precedence":r},u),(u=na.get(S))&&Ih(a,u);var ne=O=h.createElement("link");Vt(ne),fn(ne,"link",a),ne._p=new Promise(function(de,be){ne.onload=de,ne.onerror=be}),ne.addEventListener("load",function(){q.loading|=1}),ne.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Xu(O,r,h)}O={type:"stylesheet",instance:O,count:1,state:q},v.set(S,O)}}}function NA(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))&&jh(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 _A(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))&&jh(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 Mb(a,r,u,h){var v=(v=$.current)?Gu(v):null;if(!v)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=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||MA(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 Rb(a){return x({},a,{"data-precedence":a.precedence,precedence:null})}function MA(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 Db(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),Xu(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=Rb(u),(v=na.get(v))&&Ih(h,v),S=(a.ownerDocument||a).createElement("link"),Vt(S);var O=S;return O._p=new Promise(function(q,ne){O.onload=q,O.onerror=ne}),fn(S,"link",h),r.state.loading|=4,Xu(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),jh(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,Xu(h,u.precedence,a));return r.instance}function Xu(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 q=h[O];if(q.dataset.precedence===r)S=q;else if(S!==v)break}S?S.parentNode.insertBefore(a,S.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function Ih(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function jh(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Ku=null;function Lb(a,r,u){if(Ku===null){var h=new Map,v=Ku=new Map;v.set(u,h)}else v=Ku,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[$i]||S[Jt]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var O=S.getAttribute(r)||"";O=a+O;var q=h.get(O);q?q.push(S):h.set(O,[S])}}return h}function Ob(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function RA(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 Ib(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function DA(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=Rb(h),(v=na.get(v))&&Ih(h,v),S=S.createElement("link"),Vt(S);var O=S;O._p=new Promise(function(q,ne){O.onload=q,O.onerror=ne}),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 Ph=0;function LA(a,r){return a.stylesheets&&a.count===0&&Wu(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&Wu(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+r);0<a.imgBytes&&Ph===0&&(Ph=62500*hA());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Wu(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Ph?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function $u(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wu(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Qu=null;function Wu(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Qu=new Map,r.forEach(OA,a),Qu=null,$u.call(a))}function OA(a,r){if(!(r.state.loading&4)){var u=Qu.get(a);if(u)var h=u.get(null);else{u=new Map,Qu.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:W,_currentValue2:W,_threadCount:0};function IA(a,r,u,h,v,S,O,q,ne){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=ne,this.incompleteTransitions=new Map}function jb(a,r,u,h,v,S,O,q,ne,de,be,Te){return a=new IA(a,r,u,O,ne,de,be,Te,q),r=1,S===!0&&(r|=24),S=In(3,null,null,r),a.current=S,S.stateNode=a,r=gf(),r.refCount++,a.pooledCache=r,r.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:r},vf(S),a}function Pb(a){return a?(a=$r,a):$r}function Bb(a,r,u,h,v,S){v=Pb(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 zb(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Bh(a,r){zb(a,r),(a=a.alternate)&&zb(a,r)}function Ub(a){if(a.tag===13||a.tag===31){var r=er(a,67108864);r!==null&&_n(r,a,67108864),Bh(a,67108864)}}function Hb(a){if(a.tag===13||a.tag===31){var r=Un();r=$s(r);var u=er(a,r);u!==null&&_n(u,a,r),Bh(a,r)}}var Zu=!0;function jA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=2,zh(a,r,u,h)}finally{G.p=S,H.T=v}}function PA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=8,zh(a,r,u,h)}finally{G.p=S,H.T=v}}function zh(a,r,u,h){if(Zu){var v=Uh(h);if(v===null)wh(a,r,h,Ju,u),Vb(a,h);else if(zA(v,a,r,u,h))h.stopPropagation();else if(Vb(a,h),r&4&&-1<BA.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 q=S;for(q.pendingLanes|=2,q.entangledLanes|=2;O;){var ne=1<<31-gt(O);q.entanglements[1]|=ne,O&=~ne}ka(S),(mt&6)===0&&(Iu=Fe()+500,Lo(0))}}break;case 31:case 13:q=er(S,2),q!==null&&_n(q,S,2),Pu(),Bh(S,2)}if(S=Uh(h),S===null&&wh(a,r,h,Ju,u),S===v)break;v=S}v!==null&&h.stopPropagation()}else wh(a,r,h,null,u)}}function Uh(a){return a=Hd(a),Hh(a)}var Ju=null;function Hh(a){if(Ju=null,a=Xn(a),a!==null){var r=s(a);if(r===null)a=null;else{var u=r.tag;if(u===13){if(a=l(r),a!==null)return a;a=null}else if(u===31){if(a=c(r),a!==null)return a;a=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return Ju=a,null}function Fb(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 me:return 2;case Se:return 8;case De:case Me:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ci=null,Ni=null,_i=null,Uo=new Map,Ho=new Map,Mi=[],BA="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 Vb(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&&Ub(r)),a):(a.eventSystemFlags|=h,r=a.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),a)}function zA(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 qb(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(){Hb(u)});return}}else if(r===31){if(r=c(u),r!==null){a.blockedOn=r,Ki(a.priority,function(){Hb(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function ec(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=Uh(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);Ud=h,u.target.dispatchEvent(h),Ud=null}else return r=Ia(u),r!==null&&Ub(r),a.blockedOn=u,!1;r.shift()}return!0}function Yb(a,r,u){ec(a)&&u.delete(r)}function UA(){Fh=!1,Ci!==null&&ec(Ci)&&(Ci=null),Ni!==null&&ec(Ni)&&(Ni=null),_i!==null&&ec(_i)&&(_i=null),Uo.forEach(Yb),Ho.forEach(Yb)}function tc(a,r){a.blockedOn===r&&(a.blockedOn=null,Fh||(Fh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UA)))}var nc=null;function Gb(a){nc!==a&&(nc=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nc===a&&(nc=null);for(var r=0;r<a.length;r+=3){var u=a[r],h=a[r+1],v=a[r+2];if(typeof h!="function"){if(Hh(h||u)===null)continue;break}var S=Ia(u);S!==null&&(a.splice(r,3),r-=3,Uf(S,{pending:!0,data:v,method:u.method,action:h},h,v))}}))}function ys(a){function r(ne){return tc(ne,a)}Ci!==null&&tc(Ci,a),Ni!==null&&tc(Ni,a),_i!==null&&tc(_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);)qb(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[yt]||null;if(typeof S=="function")O||Gb(u);else if(O){var q=null;if(S&&S.hasAttribute("formAction")){if(v=S,O=S[yt]||null)q=O.formAction;else if(Hh(v)!==null)continue}else q=O.action;typeof q=="function"?u[h+1]=q:(u.splice(h,3),h-=3),Gb(u)}}}function Xb(){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 Vh(a){this._internalRoot=a}ac.prototype.render=Vh.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var u=r.current,h=Un();Bb(u,h,a,r,null,null)},ac.prototype.unmount=Vh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;Bb(a.current,2,null,a,null,null),Pu(),r[Oa]=null}};function ac(a){this._internalRoot=a}ac.prototype.unstable_scheduleHydration=function(a){if(a){var r=Qs();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&&qb(a)}};var Kb=t.version;if(Kb!=="19.2.8")throw Error(i(527,Kb,"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?m(a):null,a=a===null?null:a.stateNode,a};var HA={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Je=ic.inject(HA),Qe=ic}catch{}}return qo.createRoot=function(a,r){if(!o(a))throw Error(i(299));var u=!1,h="",v=tx,S=nx,O=ax;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=jb(a,1,!1,null,null,u,h,null,v,S,O,Xb),a[Oa]=r.current,kh(a),new Vh(r)},qo.hydrateRoot=function(a,r,u){if(!o(a))throw Error(i(299));var h=!1,v="",S=tx,O=nx,q=ax,ne=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&&(q=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),r=jb(a,1,!0,r,u??null,h,v,ne,S,O,q,Xb),r.context=Pb(null),u=r.current,h=Un(),h=$s(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,kh(a),new ac(r)},qo.version="19.2.8",qo}var sy;function eC(){if(sy)return Xh.exports;sy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xh.exports=JA(),Xh.exports}var tC=eC();const nC=Ml(tC);/**
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 aC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mE=(...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 iC={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 rC=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:l,...c},d)=>_.createElement("svg",{ref:d,...iC,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:mE("lucide",o),...c},[...l.map(([f,m])=>_.createElement(f,m)),...Array.isArray(s)?s:[s]]));/**
65
- * @license lucide-react v0.468.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const Re=(e,t)=>{const n=_.forwardRef(({className:i,...o},s)=>_.createElement(rC,{ref:s,iconNode:t,className:mE(`lucide-${aC(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 sC=Re("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
75
- * @license lucide-react v0.468.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const a0=Re("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 oC=Re("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 lC=Re("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=Re("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 uC=Re("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 cC=Re("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=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
110
- * @license lucide-react v0.468.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const ap=Re("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 dC=Re("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 pE=Re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
125
- * @license lucide-react v0.468.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const i0=Re("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=Re("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 fC=Re("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 hC=Re("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=Re("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 gE=Re("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 xE=Re("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 mC=Re("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 bE=Re("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 pC=Re("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 gC=Re("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
180
- * @license lucide-react v0.468.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const Rl=Re("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 yE=Re("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 xC=Re("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 bC=Re("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 yC=Re("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 vE=Re("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 vC=Re("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 EC=Re("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 TC=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
225
- * @license lucide-react v0.468.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const Hc=Re("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
230
- * @license lucide-react v0.468.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const SC=Re("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
235
- * @license lucide-react v0.468.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const ip=Re("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
240
- * @license lucide-react v0.468.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const kC=Re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 wC=Re("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"}]]);/**
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 rp=Re("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"}]]);/**
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 Dl=Re("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"}]]);/**
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 EE=Re("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
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 AC=Re("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"}]]);/**
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 CC=Re("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"}]]);/**
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 NC=Re("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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=Re("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"}]]);/**
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 oy=Re("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"}]]);/**
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 MC=Re("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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=Re("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
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=Re("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"}]]);/**
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=Re("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"}]]);/**
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 vl=Re("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"}]]);/**
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 ly=Re("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"}]]);/**
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 ud=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Wh=Re("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"}]]);/**
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 TE=Re("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"}]]);/**
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 OC=Re("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"}]]);/**
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=Re("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"}]]);/**
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 Ac=Re("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"}]]);/**
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 jC=Re("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"}]]);/**
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=Re("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"}]]);/**
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 sp=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 BC=Re("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"}]]);/**
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 Fc=Re("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"}]]);/**
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 op=Re("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"}]]);/**
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 zC=Re("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"}]]);/**
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 UC=Re("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"}]]);/**
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 r0=Re("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"}]]);/**
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 HC=Re("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"}]]);/**
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 lp=Re("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 FC=Re("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"}]]);/**
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 SE=Re("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"}]]);/**
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 Ls=Re("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"}]]);/**
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 VC=Re("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"}]]);/**
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 kE=Re("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"}]]);/**
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 s0=Re("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"}]]);/**
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 ri=Re("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"}]]);/**
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 qC=Re("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"}]]);/**
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 wE=Re("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"}]]);/**
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 YC=Re("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"}]]);/**
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 up=Re("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"}]]);/**
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 la=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 o0=Re("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"}]]),fe=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"),GC=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function AE(e){if(!e)return 0;const t=(e.match(GC)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function XC(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function KC(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 CE=.5,$C=.9,QC=.85;var cp=hE();const NE="lookatstudy-lang";let Vc=typeof localStorage>"u"?"zh-CN":localStorage.getItem(NE)||"zh-CN";const l0=new Set;function _E(e){return l0.add(e),()=>{l0.delete(e)}}const uy={"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}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
470
- 1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
471
- 2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
472
- 3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
473
- 铁律:起手不要讲座、不要用 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":`
474
-
475
- 网络受限或私有仓库请改用「Markdown」方式。`,"import.progress.elapsed":"已 {s}s","import.progress.title":"正在导入课程…","import.progress.starting":"正在启动…","import.progress.note":"导入在后台进行,可继续浏览其他课程","import.progress.cancel":"取消导入","import.cancelled":"已取消导入","toast.threadCreateFailed":"创建失败了,再试一次","toast.threadCreated":"新对话","toast.threadRenamed":"已重命名","toast.threadArchived":"已归档","toast.threadDeleted":"已删除","toast.threadDefault":"新会话","toast.restored":"已恢复","toast.noteSaved":"已加到笔记","toast.noteDeleted":"已删除笔记","toast.artifactSaved":"已记到笔记本","artifact.type.concept_map":"概念图","artifact.type.quiz":"练习题","artifact.type.compare_table":"对比表","artifact.type.diagram":"流程图","artifact.type.code_walkthrough":"代码讲解","artifact.type.unknown":"产物","command.placeholder":"输入指令或问题…(↑↓ 选择,Enter 确认)","command.empty.node":"没有匹配的命令","command.empty.nonode":"先在左侧选一个节点,才能用这些命令","command.footer.hint":"AI 导师会根据指令生成对应内容","command.footer.keys":"↵ 确认 · esc 关闭","command.group.node":"基于当前节点","command.group.mode":"学习模式","command.group.nav":"导航","command.explain_simple":"用大白话解释这一节","command.quiz_3":"出 3 道练习题考考我","command.concept_map":"画个概念图理清结构","command.compare_prev":"和上一节做对比表","command.socratic":"切到苏格拉底模式(提问引导)","command.exam_mode":"切到考试冲刺模式","review.title":"复习","review.nudge":"📅 今天有 {n} 个待复习,点左侧地图的「复习」入口巩固一下","review.loading":"正在检查哪些课该复习了…","review.empty.title":"还没有复习项","review.empty.desc":"完成一些练习后,这里会出现间隔复习提醒","review.due.count":"个待复习","review.start":"开始复习","review.shuffle":"混合练习(随机交错)","review.interleave":"交错复习","review.reviewLesson":"复习该课","review.selectSection":"选择章节","review.dueIn":"待复习","review.noDueInSection":"该章节暂无待复习内容","review.srsHint":"复习提醒","review.myProgress":"我的课程进度","review.overdueQuickHint":"逾期项,点击直接复习","review.quadrant.overdue":"逾期","review.quadrant.short":"短期","review.quadrant.long":"长期","review.quadrant.inactive":"待激活","review.quadrant.more":"更多","review.tip":"复习采用 SM-2 间隔重复算法。逾期项优先复习;长期记忆项间隔更长。单次复习封顶 {n} 题,避免积压压垮节奏。","review.selfrated":"✓ 已记录,掌握度已更新","review.selfrate.title":"复习完了吗?给自己打分","review.selfrate.again":"忘了","review.selfrate.again.hint":"明天重练","review.selfrate.remembered":"记得","review.selfrate.remembered.hint":"推迟几天","review.selfrate.mastered":"很熟","review.selfrate.mastered.hint":"很久后再看","lang.original":"原文","error.checkReadyFailed":"无法检查就绪状态","notebook.tab.explain":"讲解","notebook.tab.notes":"笔记","notebook.tab.board":"黑板","notebook.board.empty":"对话里产生概念图、流程图、对比表、代码讲解时,这里会实时展示最新的一幅大图,方便边看边问。","notebook.zone.understand":"理解","notebook.zone.note":"记录","notebook.zone.practice":"练习","notebook.empty.explain.title":"选一节课开始","notebook.empty.explain.desc":"在左侧地图选一个课时,这里会显示讲解内容","notebook.empty.notes.title":"还没有笔记","notebook.empty.notes.desc":"选中讲解文字画线,或让 AI 生成概念图/对比表,会出现在这里","settings.heading.provider":"AI 服务商","settings.heading.custom":"自定义 Provider","settings.heading.goal":"学习目标","settings.heading.language":"界面语言","settings.heading.multimodal":"多模态 / 图片","settings.group.ai":"AI 模型","settings.group.vision":"AI 看图","settings.group.appearance":"外观与语言","settings.row.provider":"服务商","settings.row.theme":"主题","settings.row.interface_lang":"界面语言","settings.row.import_lang":"导入偏好","settings.custom.form_title":"添加自定义 Provider","settings.footer.hint":"AI 模型区的改动需保存后生效,其余即时生效","settings.footer.save":"保存 AI 配置","header.energy":"今日能量","header.level.title":"等级(累计经验值的持久成长线,不随每日能量清零)","settings.title":"设置","view.tree":"技能树","view.dashboard":"仪表盘","view.import":"导入课程","mode.chat":"💬 对话","mode.exercise":"📝 练习","mode.settings":"⚙️ 设置","chat.starter.hint":"💡 从下面选一个开始,或者直接输入你的问题","chat.no_key.title":"还没有配置 AI 模型","chat.no_key.desc":"配置后即可开始 AI 导师对话和练习","chat.no_key.btn":"去配置模型","chat.input.placeholder":"问 AI 导师…(Enter 发送)","chat.input.no_node":"先在左侧选一个 lesson…","chat.send":"发送","chat.stop":"停止","chat.clear":"清空对话历史","chat.selection.quote":"提问这段","chat.soul.label":"风格:","chat.no_key.short":"未配置 AI 模型","chat.no_key.cta":"去配置 →","chat.attach.add":"添加图片或文件(可粘贴 / 拖拽)","chat.attach.remove":"移除 {name}","chat.attach.tooMany":"一条消息最多 {n} 个附件","chat.attach.tooLargeImage":"图片超过 5MB:{name}","chat.attach.tooLargeText":"文本文件超过 256KB:{name}","chat.attach.unsupported":"暂不支持该类型:{name}(支持图片与常见文本 / 代码文件)","chat.attach.visionUnsupported":"当前模型不支持看图,请用右侧模型切换器选一个带眼睛图标的模型,或在设置 → AI 看图里配置视觉模型覆盖","chat.attach.bridgeChip":"主模型是纯文本:图片将先由 {model} 转译成文字再交给它","chat.attach.preview":"查看 {name}","chat.attach.textChip":"文本附件,内容已随消息发给 AI","chat.attach.imageOnlyText":"请看这张图片。","context.label":"上下文","context.aria":"上下文已用 {p}","context.approx":"约","context.system":"系统提示","context.node":"课文","context.learner":"学习者状态","context.history":"对话历史","context.draft":"草稿","context.unknownWindow":"模型窗口未知","model.picker.label":"模型","model.picker.manage":"管理模型与密钥…","model.picker.vision":"支持看图","model.picker.noneConfigured":"还没有配置任何 provider 密钥","effort.label":"思考强度","effort.auto.label":"自动","effort.auto.desc":"模型默认行为,不干预","effort.fast.label":"快速","effort.fast.desc":"尽量关思考,答得快、省 token","effort.deep.label":"深度","effort.deep.desc":"尽量开思考,难题多想几步","effort.unsupported":"当前 provider 暂不支持思考强度切换","soul.direct":"精讲","soul.guide":"引导","soul.practice":"实战","soul.direct.desc":"精讲派 · 新手/想搞懂时用。先讲清楚再确认,给完整范例,不让你猜","soul.guide.desc":"引导派 · 有点基础、想自己推时用。不直接给答案,用引导性问题帮你推导","soul.practice.desc":"实战派 · 想动手时用。围绕真实世界的乱问题,在做中把概念织成网","settings.provider":"AI 服务商(Provider)","settings.model":"模型(Model)","settings.apikey":"API Key","settings.test":"测试连接","settings.testing":"测试中…","settings.save":"保存设置","settings.saved":"✅ 已保存","settings.daily_goal":"每日学习目标(XP)","settings.custom.add":"+ 添加自定义 Provider","settings.language":"语言(Language)","settings.add_custom":"自定义","settings.custom.label_ph":"名称","settings.custom.baseurl_ph":"Base URL(如 https://api.example.com/v1)","settings.custom.model_ph":"模型 ID","settings.custom.apikey_ph":"API Key(可选)","settings.custom.save":"保存","settings.custom.windowLabel":"上下文窗口(tokens)","settings.custom.windowPh":"如 128000 或 128k(留空 = 未知)","settings.custom.windowHint":"当前模型的最大上下文,可在模型官方文档查到。填了输入框旁的上下文表才会显示占比。","settings.delete_custom":"删除此自定义 Provider","settings.delete_custom_confirm":"删除自定义 Provider「{name}」?无法撤销。","settings.key.overwrite_ph":"覆盖…","settings.key.paste_ph":"粘贴 key","settings.key.get":"获取 →","settings.refresh":"刷新","settings.discovering":"刷新中…","settings.discover_failed":"刷新失败(可能网络受限)","settings.daily_goal.hint":"XP / 天(每答对一题 +10 XP)","settings.heading.theme":"外观","settings.theme.auto":"跟随系统","settings.theme.light":"浅色","settings.theme.dark":"深色","settings.theme.following":"当前跟随系统:{mode}","settings.heading.lang_pref":"语言偏好","settings.lang_pref.desc":"导入课程时自动按此偏好选择翻译。仓库原文语言与偏好一致时直接用原文;无对应翻译时也用原文。","settings.img_download":"图片下载","settings.img_download.desc":"导入课程时自动下载 md/notebook 里引用的图片(默认开启)","settings.multimodal.toggle":"AI 看图(聊天时)","settings.multimodal.toggle.desc":"开启后,聊天时 AI 能看到当前课关联的图片并讲解;问图/图表/架构图时生效(需 vision 模型)。导入时下载图片由上面的「图片下载」控制。","settings.group.memory":"学习者记忆","settings.memory.toggle":"让 AI 记住我","settings.memory.toggle.desc":"开启后,AI 会跨会话记住你的学习方式(偏好/卡点/反复混淆),越教越懂你。你拿皇冠(通关一节)时自动总结;也可手动触发。所有记忆只存本地。","settings.multimodal.current_model":"当前主模型:{model}","settings.multimodal.not_selected":"(未选)","settings.multimodal.hint_custom":"自定义 provider — 视觉能力未知。如不支持看图,在下方覆盖一个 vision 模型。","settings.multimodal.hint_preset":"如当前模型不支持 vision,可在下方配置专门的 vision 模型。常见:GLM-4V / GPT-4o / Claude 3.5 / Gemini。","settings.multimodal.override_title":"Vision 模型覆盖(可选 — 留空则复用主模型)","settings.multimodal.override_bridge_hint":"主模型不支持看图时,聊天中上传的图片会先由该模型转译成文字描述,再交给主模型解读(图像转译桥)。","settings.multimodal.no_override":"(不覆盖 — 用主模型)","settings.multimodal.group_preset":"预设 Provider","settings.multimodal.group_custom":"自定义 Provider","settings.multimodal.vision_capable":"vision","settings.multimodal.save_override":"保存覆盖配置","settings.multimodal.test_override":"测试模型","settings.saved_text":"已保存","settings.key.configured":"已配置","settings.custom.test_label":"(测试)","settings.proto.openai":"OpenAI 兼容","chat.empty.overview":"这是这一课的概览","chat.empty.summary.title":"本课摘要","chat.empty.summary.none":"暂无摘要,点开始学习让 AI 帮你了解这一课","chat.empty.start":"开始学习","chat.empty.greeting":"👋 准备好了吗?这一课我们慢慢来。","chat.empty.keyless.title":"内容已在右侧,先读一读","chat.empty.keyless.desc":"配置好 AI 模型,就能和我对练、做练习、追踪掌握度。","chat.empty.keyless.btn":"去配置 AI 模型","chat.empty.no_node.title":"从左侧地图选一个节点","chat.empty.no_node.desc":"点击圆球节点开始学习。绿色=可学,金色=已掌握,紫色=章节考试","chat.scroll.bottom":"回到底部","chat.speech.speak":"朗读这条消息","chat.speech.stop":"停止朗读","chat.speech.progress":"{n}/{total} 句","chat.speech.model_missing":"语音模型还没下载。到 设置 → 语音能力 下载后即可朗读。","chat.speech.engine_unavailable":"语音引擎未就位。桌面版开箱可用;Termux 端运行 bash install-termux.sh --voice 安装(约 12MB)。","chat.speech.dictation":"语音输入","chat.speech.dictation_stop":"结束听写","chat.speech.dictation_ptt":"语音输入(点击或按住说话)","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_auto_send":"静音后自动发送","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}}。下面是逐题情况:
476
- 请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"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:
477
- 1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
478
- 2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
479
- 3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
480
- 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":`
481
-
482
- For restricted networks or private repos, use the Markdown method.`,"import.progress.elapsed":"{s}s elapsed","import.progress.title":"Importing course…","import.progress.starting":"Starting…","import.progress.note":"Import runs in the background — keep browsing other courses","import.progress.cancel":"Cancel import","import.cancelled":"Import cancelled","toast.threadCreateFailed":"Couldn't create — try again","toast.threadCreated":"New chat","toast.threadRenamed":"Renamed","toast.threadArchived":"Archived","toast.threadDeleted":"Deleted","toast.threadDefault":"New thread","toast.restored":"Restored","toast.noteSaved":"Added to notes","toast.noteDeleted":"Note deleted","toast.artifactSaved":"Saved to notebook","artifact.type.concept_map":"Concept Map","artifact.type.quiz":"Quiz","artifact.type.compare_table":"Comparison Table","artifact.type.diagram":"Diagram","artifact.type.code_walkthrough":"Code Walkthrough","artifact.type.unknown":"Artifact","command.placeholder":"Type a command or question… (↑↓ to select, Enter to confirm)","command.empty.node":"No matching commands","command.empty.nonode":"Select a node on the left first","command.footer.hint":"The AI tutor generates content based on your command","command.footer.keys":"↵ confirm · esc to close","command.group.node":"Current Node","command.group.mode":"Study Mode","command.group.nav":"Navigation","command.explain_simple":"Explain this section in plain words","command.quiz_3":"Give me 3 practice questions","command.concept_map":"Draw a concept map","command.compare_prev":"Compare with the previous section","command.socratic":"Switch to Socratic mode (guided questions)","command.exam_mode":"Switch to Exam prep mode","review.title":"Review","review.nudge":"📅 {n} review(s) due today — tap the Review entry in the map to consolidate","review.loading":"Checking what to review…","review.empty.title":"No reviews yet","review.empty.desc":"Complete some exercises and spaced-repetition reminders will appear here","review.due.count":"due","review.start":"Start Review","review.shuffle":"Shuffle (interleaved)","review.interleave":"Interleaved Review","review.reviewLesson":"Review","review.selectSection":"Select a section","review.dueIn":"due","review.noDueInSection":"No reviews in this section","review.srsHint":"Review Reminders","review.myProgress":"My Progress","review.overdueQuickHint":"Overdue items — click to review","review.quadrant.overdue":"Overdue","review.quadrant.short":"Short-term","review.quadrant.long":"Long-term","review.quadrant.inactive":"Inactive","review.quadrant.more":"more","review.tip":"Review uses the SM-2 spaced repetition algorithm. Overdue items first; long-term memory items have longer intervals. Capped at {n} items per session to avoid backlog overwhelm.","review.selfrated":"✓ Recorded. Mastery updated.","review.selfrate.title":"Done reviewing? Rate yourself","review.selfrate.again":"Forgot","review.selfrate.again.hint":"Review tomorrow","review.selfrate.remembered":"Recalled","review.selfrate.remembered.hint":"In a few days","review.selfrate.mastered":"Easy","review.selfrate.mastered.hint":"Much later","lang.original":"Original","error.checkReadyFailed":"Could not check readiness","notebook.tab.explain":"Explain","notebook.tab.notes":"Notes","notebook.tab.board":"Blackboard","notebook.board.empty":"When the tutor produces a concept map, diagram, comparison table, or code walkthrough in chat, the latest one is rendered here in full size.","notebook.zone.understand":"Understand","notebook.zone.note":"Notes","notebook.zone.practice":"Practice","notebook.empty.explain.title":"Pick a lesson to start","notebook.empty.explain.desc":"Select a lesson in the map on the left; its explanation shows here.","notebook.empty.notes.title":"No notes yet","notebook.empty.notes.desc":"Highlight text in the explanation, or have the AI generate a concept map / comparison table — it shows up here.","settings.heading.provider":"AI Provider","settings.heading.custom":"Custom Provider","settings.heading.goal":"Study Goal","settings.heading.language":"Interface Language","settings.heading.multimodal":"Multimodal / Images","settings.group.ai":"AI Model","settings.group.vision":"AI Vision","settings.group.appearance":"Appearance & Language","settings.row.provider":"Provider","settings.row.theme":"Theme","settings.row.interface_lang":"Interface language","settings.row.import_lang":"Import preference","settings.custom.form_title":"Add custom provider","settings.footer.hint":"AI Model changes need Save; everything else is instant.","settings.footer.save":"Save AI config","header.energy":"Today's energy","header.level.title":"Level (cumulative XP growth line — doesn't reset with daily energy)","settings.title":"Settings","view.tree":"Skill Tree","view.dashboard":"Dashboard","view.import":"Import Course","mode.chat":"💬 Chat","mode.exercise":"📝 Practice","mode.settings":"⚙️ Settings","chat.starter.hint":"💡 Pick one to start, or type your question","chat.no_key.title":"No AI model configured","chat.no_key.desc":"Configure a model to start AI tutoring and practice","chat.no_key.btn":"Configure Model","chat.input.placeholder":"Ask your AI tutor… (Enter to send)","chat.input.no_node":"Select a lesson on the left…","chat.send":"Send","chat.stop":"Stop","chat.clear":"Clear chat history","chat.selection.quote":"Ask about this","chat.soul.label":"Style:","chat.no_key.short":"AI model not configured","chat.no_key.cta":"Configure →","chat.attach.add":"Add image or file (paste / drag also works)","chat.attach.remove":"Remove {name}","chat.attach.tooMany":"Up to {n} attachments per message","chat.attach.tooLargeImage":"Image over 5MB: {name}","chat.attach.tooLargeText":"Text file over 256KB: {name}","chat.attach.unsupported":"Unsupported type: {name} (images and common text / code files)","chat.attach.visionUnsupported":"Current model can't see images — pick one with the eye icon in the model switcher, or set a vision model override in Settings → AI vision","chat.attach.bridgeChip":"Main model is text-only: images will be transcribed to text by {model} first","chat.attach.preview":"View {name}","chat.attach.textChip":"Text attachment, content sent with the message","chat.attach.imageOnlyText":"Please look at this image.","context.label":"Context","context.aria":"{p} of context used","context.approx":"~","context.system":"System prompt","context.node":"Lesson","context.learner":"Learner state","context.history":"History","context.draft":"Draft","context.unknownWindow":"model window unknown","model.picker.label":"Model","model.picker.manage":"Manage models & keys…","model.picker.vision":"Vision capable","model.picker.noneConfigured":"No provider key configured yet","effort.label":"Thinking effort","effort.auto.label":"Auto","effort.auto.desc":"Model default, no override","effort.fast.label":"Fast","effort.fast.desc":"Thinking off when possible — quicker, fewer tokens","effort.deep.label":"Deep","effort.deep.desc":"Thinking on when possible — extra steps for hard problems","effort.unsupported":"Current provider doesn't support effort switching","soul.direct":"Direct","soul.guide":"Guide","soul.practice":"Practice","soul.direct.desc":"Direct · for beginners or low energy. Explains clearly then checks, gives full worked examples — never makes you guess","soul.guide.desc":"Guide · when you have some footing and want to reason it out. No direct answers — guiding questions help you derive it","soul.practice.desc":"Practice · for hands-on learners. Each concept lands on a messy real-world problem; learn by doing and connect the dots","settings.provider":"AI Provider","settings.model":"Model","settings.apikey":"API Key","settings.test":"Test Connection","settings.testing":"Testing…","settings.save":"Save Settings","settings.saved":"✅ Saved","settings.daily_goal":"Daily Goal (XP)","settings.custom.add":"+ Add Custom Provider","settings.language":"Language","settings.add_custom":"Custom","settings.custom.label_ph":"Name","settings.custom.baseurl_ph":"Base URL (e.g. https://api.example.com/v1)","settings.custom.model_ph":"Model ID","settings.custom.apikey_ph":"API Key (optional)","settings.custom.save":"Save","settings.custom.windowLabel":"Context window (tokens)","settings.custom.windowPh":"e.g. 128000 or 128k (empty = unknown)","settings.custom.windowHint":"Max context of the current model, found in its official docs. The composer context meter only shows a percentage when this is set.","settings.delete_custom":"Delete this custom provider","settings.delete_custom_confirm":'Delete custom provider "{name}"? This cannot be undone.',"settings.key.overwrite_ph":"Overwrite…","settings.key.paste_ph":"Paste key","settings.key.get":"Get key →","settings.refresh":"Refresh","settings.discovering":"Refreshing…","settings.discover_failed":"Refresh failed (network may be restricted)","settings.daily_goal.hint":"XP / day (+10 XP per correct answer)","settings.heading.theme":"Appearance","settings.theme.auto":"System","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.following":"Following system: {mode}","settings.heading.lang_pref":"Language Preference","settings.lang_pref.desc":"When importing a course, auto-pick the translation matching this preference. If the repo's source language already matches, the original is used; if no translation exists, the original is used as well.","settings.img_download":"Image download","settings.img_download.desc":"Auto-download images referenced in markdown/notebooks during import (on by default)","settings.multimodal.toggle":"AI vision (in chat)","settings.multimodal.toggle.desc":"When on, the AI can see and explain this lesson's images during chat — used for diagrams/charts/architecture (needs a vision model). Import-time image download is controlled by “Image download” above.","settings.group.memory":"Learner memory","settings.memory.toggle":"Let the AI remember me","settings.memory.toggle.desc":"When on, the AI remembers how you learn across sessions (preferences / stuck points / recurring confusions) and adapts over time. Auto-summarized when you earn a crown (clear a node); also manually triggerable. All memory stays local.","settings.multimodal.current_model":"Current main model: {model}","settings.multimodal.not_selected":"(none)","settings.multimodal.hint_custom":"Custom provider — vision capability unknown. If it can't see images, override a vision model below.","settings.multimodal.hint_preset":"If the current model lacks vision, configure a dedicated vision model below. Common: GLM-4V / GPT-4o / Claude 3.5 / Gemini.","settings.multimodal.override_title":"Vision model override (optional — leave blank to reuse main model)","settings.multimodal.override_bridge_hint":"When the main model is text-only, images uploaded in chat are transcribed to text by this model before reaching the main model (image bridge).","settings.multimodal.no_override":"(no override — use main model)","settings.multimodal.group_preset":"Preset providers","settings.multimodal.group_custom":"Custom providers","settings.multimodal.vision_capable":"vision","settings.multimodal.save_override":"Save override","settings.multimodal.test_override":"Test model","settings.saved_text":"Saved","settings.key.configured":"Configured","settings.custom.test_label":"(test)","settings.proto.openai":"OpenAI-compatible","chat.empty.overview":"Overview of this lesson","chat.empty.summary.title":"Lesson Summary","chat.empty.summary.none":"No summary yet — click Start to let the AI walk you through this lesson.","chat.empty.start":"Start Learning","chat.empty.greeting":"👋 Ready? Let's take this one step at a time.","chat.empty.keyless.title":"The lesson is on the right — give it a read","chat.empty.keyless.desc":"Configure an AI model to practice with me, do exercises, and track mastery.","chat.empty.keyless.btn":"Configure AI model","chat.empty.no_node.title":"Pick a node from the map on the left","chat.empty.no_node.desc":"Click a node to start learning. Green = available, Gold = mastered, Purple = chapter exam","chat.scroll.bottom":"Scroll to bottom","chat.speech.speak":"Read aloud","chat.speech.stop":"Stop reading","chat.speech.progress":"{n}/{total}","chat.speech.model_missing":"Speech model not downloaded yet. Get it in Settings → Speech.","chat.speech.engine_unavailable":"Speech engine not installed. Desktop has it built in; on Termux run: bash install-termux.sh --voice (~12MB).","chat.speech.dictation":"Voice input","chat.speech.dictation_stop":"Stop dictation","chat.speech.dictation_ptt":"Voice input (click, or hold to talk)","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_auto_send":"Auto-send after silence","settings.speech.asr_ux_note":"Hold the mic button to talk (release to finish); a quick click still toggles.","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:
483
- 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 Vc}function WC(e){e!==Vc&&(Vc=e,typeof localStorage<"u"&&localStorage.setItem(NE,e),l0.forEach(t=>t()))}function dp(e,t=Vc,n){var o,s;let i=((o=uy[t])==null?void 0:o[e])??((s=uy["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 Ye(){const e=_.useSyncExternalStore(_E,Os,Os);return _.useCallback((t,n)=>dp(t,e,n),[e])}function ME(){return _.useSyncExternalStore(_E,Os,Os)}const ZC=["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 cy(e){return Array.from(e.querySelectorAll(ZC)).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=cy(n)[0]??n,l=window.setTimeout(()=>s.focus(),0),c=d=>{if(d.key!=="Tab")return;const f=cy(n);if(f.length===0){d.preventDefault(),n.focus();return}const m=f[0],x=f[f.length-1];d.shiftKey?(document.activeElement===m||!n.contains(document.activeElement))&&(d.preventDefault(),x.focus()):document.activeElement===x&&(d.preventDefault(),m.focus())};return n.addEventListener("keydown",c),()=>{if(window.clearTimeout(l),n.removeEventListener("keydown",c),i&&document.body.contains(i))try{i.focus()}catch{}}},[e,t])}const rc=220;function cd({anchorRect:e,message:t,onConfirm:n,onCancel:i,confirmLabel:o,cancelLabel:s,danger:l=!1,testid:c="confirm-card"}){const d=Ye(),f=_.useRef(null);Us(f,!0);const m=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,p=window.innerHeight,y=e.right-rc,E=Math.max(8,Math.min(y,b-rc-8)),T=e.bottom+4+rc>p?Math.max(8,e.top-4-rc):e.bottom+4;return cp.createPortal(g.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:[g.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),g.jsxs("div",{className:"flex gap-2 justify-end",children:[g.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}),g.jsx("button",{onClick:n,"data-testid":`${c}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:l?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:m})]})]}),document.body)}function JC(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)>=CE});return{section:i,lessons:o,chapterLessonsMastered:l}})}function u0(e,t,n){var i;return e.type==="exam"?!n:(((i=t[e.id])==null?void 0:i.status)??"locked")==="locked"}function eN(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 tN(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 nN(e){const t=Ye(),[n,i]=_.useState(""),[o,s]=_.useState([]),l=_.useRef(null);_.useEffect(()=>{var E;(E=l.current)==null||E.focus()},[]);const c=_.useMemo(()=>JC(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),d=_.useMemo(()=>eN(c,n),[c,n]),f=_.useMemo(()=>new Set(e.tree.map(E=>E.id)),[e.tree]),m=_.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(()=>{fe.searchContent(E).then(w=>{s(w.filter(M=>f.has(M.nodeId)&&!m.has(M.nodeId)).slice(0,8))}).catch(()=>s([]))},250);return()=>clearTimeout(T)},[n,f,m]);const p=_.useMemo(()=>{for(const E of d){const T=E.lessons.find(w=>!u0(w,e.progressMap,E.chapterLessonsMastered));if(T)return T}return null},[d,e.progressMap]),y=d.length>0||o.length>0;return g.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:[g.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:[g.jsx(sp,{className:"w-4 h-4 text-white/50 shrink-0"}),g.jsx("input",{ref:l,value:n,onChange:E=>i(E.target.value),onKeyDown:E=>{E.key==="Enter"&&p&&e.onJump(p)},placeholder:t("map.search.placeholder"),"data-testid":"course-search-input",className:"flex-1 bg-transparent text-body text-white placeholder:text-white/35 outline-none min-w-0"}),n&&g.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:g.jsx(la,{className:"w-3.5 h-3.5"})}),g.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:g.jsx(la,{className:"w-3.5 h-3.5"})})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!y&&g.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)=>g.jsx(aN,{row:E,sectionIndex:T,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},E.section.id)),o.length>0&&g.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[g.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=u0(T,e.progressMap,b.get(T.parentId??"")??!1);return g.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:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),g.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:g.jsx(c0,{text:E.title,query:n})})]}),g.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:E.snippet})]},E.nodeId)})]})]})]})}function aN({row:e,sectionIndex:t,query:n,progressMap:i,selectedNodeId:o,onPick:s}){const l=Ye(),c=(e.section.world??"study")==="practice";return g.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[g.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[g.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}),g.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:g.jsx(c0,{text:e.section.title,query:n})}),c&&g.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=u0(d,i,e.chapterLessonsMastered),m=((b=i[d.id])==null?void 0:b.status)??"locked",x=d.type==="exam";return g.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?g.jsx(wC,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):x?g.jsx(Ls,{className:"w-3.5 h-3.5 text-accent shrink-0"}):m==="mastered"?g.jsx(bE,{className:"w-3.5 h-3.5 text-gold shrink-0"}):g.jsx(ii,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),g.jsx("span",{className:"flex-1 text-label text-white truncate",children:g.jsx(c0,{text:d.title,query:n})})]},d.id)})]})}function c0({text:e,query:t}){const n=tN(e,t);return n?g.jsxs(g.Fragment,{children:[e.slice(0,n[0]),g.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):g.jsx(g.Fragment,{children:e})}const iN=268,fp=28,rN=20,RE=fp*2+rN,sN=RE+8,oN=104,lN=18,Zh=fp+6,uN=26,cN=22;function d0(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function dN(e,t=iN,n=""){const i=[],o=t/2,s=t/2-lN-fp;for(let d=0;d<e;d++){const f=Zh+d*oN,x=d0(`${n}:${d}`)/4294967295*2-1,b=o+x*s,y=d0(`${n}:${d}:y`)/4294967295*2-1,E=f+y*uN;i.push({x:b,y:E,index:d})}if(i.length>0){i[0].y<Zh&&(i[0].y=Zh);for(let d=1;d<i.length;d++){const f=i[d-1].y+sN;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+RE/2+10;return{nodes:i,segments:l,height:c}}function fN(e){const{from:t,to:n}=e,i=(t.y+n.y)/2+cN;return`M ${t.x} ${t.y} C ${t.x} ${i}, ${n.x} ${i}, ${n.x} ${n.y}`}var Cc={exports:{}};/*!
484
- * matter-js 0.19.0 by @liabru
485
- * http://brm.io/matter-js/
486
- * License MIT
487
- *
488
- * The MIT License (MIT)
489
- *
490
- * Copyright (c) Liam Brummitt and contributors.
491
- *
492
- * Permission is hereby granted, free of charge, to any person obtaining a copy
493
- * of this software and associated documentation files (the "Software"), to deal
494
- * in the Software without restriction, including without limitation the rights
495
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
496
- * copies of the Software, and to permit persons to whom the Software is
497
- * furnished to do so, subject to the following conditions:
498
- *
499
- * The above copyright notice and this permission notice shall be included in
500
- * all copies or substantial portions of the Software.
501
- *
502
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
503
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
504
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
505
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
506
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
507
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
508
- * THE SOFTWARE.
509
- */var hN=Cc.exports,dy;function mN(){return dy||(dy=1,(function(e,t){(function(i,o){e.exports=o()})(hN,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 m=d;m<arguments.length;m++){var x=arguments[m];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 m in l)c.push(l[m]);return c},o.get=function(l,c,d,f){c=c.split(".").slice(d,f);for(var m=0;m<c.length;m+=1)l=l[c[m]];return l},o.set=function(l,c,d,f,m){var x=c.split(".").slice(f,m);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 m in l)!d[m]&&!f[m]&&o._topologicalSort(m,d,f,l,c);return c},o._topologicalSort=function(l,c,d,f,m){var x=f[l]||[];d[l]=!0;for(var b=0;b<x.length;b+=1){var p=x[b];d[p]||c[p]||o._topologicalSort(p,c,d,f,m)}d[l]=!1,c[l]=!0,m.push(l)},o.chain=function(){for(var l=[],c=0;c<arguments.length;c+=1){var d=arguments[c];d._chained?l.push.apply(l,d._chained):l.push(d)}var f=function(){for(var m,x=new Array(arguments.length),b=0,p=arguments.length;b<p;b++)x[b]=arguments[b];for(b=0;b<l.length;b+=1){var y=l[b].apply(m,x);typeof y<"u"&&(m=y)}return m};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 Qb<"u"&&(l=Qb.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 m=s.x*d-s.y*f;return c.y=s.x*f+s.y*d,c.x=m,c},o.rotateAbout=function(s,l,c,d){var f=Math.cos(l),m=Math.sin(l);d||(d={});var x=c.x+((s.x-c.x)*f-(s.y-c.y)*m);return d.y=c.y+((s.x-c.x)*m+(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 m=[],x=0;x<d.length;x++){var b=d[x],p={x:b.x,y:b.y,index:x,body:f,isInternal:!1};m.push(p)}return m},s.fromPath=function(d,f){var m=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,x=[];return d.replace(m,function(b,p,y){x.push({x:parseFloat(p),y:parseFloat(y)})}),s.create(x,f)},s.centre=function(d){for(var f=s.area(d,!0),m={x:0,y:0},x,b,p,y=0;y<d.length;y++)p=(y+1)%d.length,x=l.cross(d[y],d[p]),b=l.mult(l.add(d[y],d[p]),x),m=l.add(m,b);return l.div(m,6*f)},s.mean=function(d){for(var f={x:0,y:0},m=0;m<d.length;m++)f.x+=d[m].x,f.y+=d[m].y;return l.div(f,d.length)},s.area=function(d,f){for(var m=0,x=d.length-1,b=0;b<d.length;b++)m+=(d[x].x-d[b].x)*(d[x].y+d[b].y),x=b;return f?m/2:Math.abs(m)/2},s.inertia=function(d,f){for(var m=0,x=0,b=d,p,y,E=0;E<b.length;E++)y=(E+1)%b.length,p=Math.abs(l.cross(b[y],b[E])),m+=p*(l.dot(b[y],b[y])+l.dot(b[y],b[E])+l.dot(b[E],b[E])),x+=p;return f/6*(m/x)},s.translate=function(d,f,m){m=typeof m<"u"?m:1;var x=d.length,b=f.x*m,p=f.y*m,y;for(y=0;y<x;y++)d[y].x+=b,d[y].y+=p;return d},s.rotate=function(d,f,m){if(f!==0){var x=Math.cos(f),b=Math.sin(f),p=m.x,y=m.y,E=d.length,T,w,M,N;for(N=0;N<E;N++)T=d[N],w=T.x-p,M=T.y-y,T.x=p+(w*x-M*b),T.y=y+(w*b+M*x);return d}},s.contains=function(d,f){for(var m=f.x,x=f.y,b=d.length,p=d[b-1],y,E=0;E<b;E++){if(y=d[E],(m-p.x)*(y.y-p.y)+(x-p.y)*(p.x-y.x)>0)return!1;p=y}return!0},s.scale=function(d,f,m,x){if(f===1&&m===1)return d;x=x||s.centre(d);for(var b,p,y=0;y<d.length;y++)b=d[y],p=l.sub(b,x),d[y].x=x.x+p.x*f,d[y].y=x.y+p.y*m;return d},s.chamfer=function(d,f,m,x,b){typeof f=="number"?f=[f]:f=f||[8],m=typeof m<"u"?m:-1,x=x||2,b=b||14;for(var p=[],y=0;y<d.length;y++){var E=d[y-1>=0?y-1:d.length-1],T=d[y],w=d[(y+1)%d.length],M=f[y<f.length?y:f.length-1];if(M===0){p.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=m;m===-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++)p.push(l.add(l.rotate(C,P*B),R))}return p},s.clockwiseSort=function(d){var f=s.mean(d);return d.sort(function(m,x){return l.angle(f,m)-l.angle(f,x)}),d},s.isConvex=function(d){var f=0,m=d.length,x,b,p,y;if(m<3)return null;for(x=0;x<m;x++)if(b=(x+1)%m,p=(x+2)%m,y=(d[b].x-d[x].x)*(d[p].y-d[b].y),y-=(d[b].y-d[x].y)*(d[p].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=[],m=[],x,b;for(d=d.slice(0),d.sort(function(p,y){var E=p.x-y.x;return E!==0?E:p.y-y.y}),b=0;b<d.length;b+=1){for(x=d[b];m.length>=2&&l.cross3(m[m.length-2],m[m.length-1],x)<=0;)m.pop();m.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(),m.pop(),f.concat(m)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),f=o(0),m=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(p){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,p);return b(E,p),E},s.nextGroup=function(p){return p?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var b=function(p,y){y=y||{},s.set(p,{bounds:p.bounds||m.create(p.vertices),positionPrev:p.positionPrev||c.clone(p.position),anglePrev:p.anglePrev||p.angle,vertices:p.vertices,parts:p.parts||[p],isStatic:p.isStatic,isSleeping:p.isSleeping,parent:p.parent||p}),l.rotate(p.vertices,p.angle,p.position),x.rotate(p.axes,p.angle),m.update(p.bounds,p.vertices,p.velocity),s.set(p,{axes:y.axes||p.axes,area:y.area||p.area,mass:y.mass||p.mass,inertia:y.inertia||p.inertia});var E=p.isStatic?"#14151f":f.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),T=p.isStatic?"#555":"#ccc",w=p.isStatic&&p.render.fillStyle===null?1:0;p.render.fillStyle=p.render.fillStyle||E,p.render.strokeStyle=p.render.strokeStyle||T,p.render.lineWidth=p.render.lineWidth||w,p.render.sprite.xOffset+=-(p.bounds.min.x-p.position.x)/(p.bounds.max.x-p.bounds.min.x),p.render.sprite.yOffset+=-(p.bounds.min.y-p.position.y)/(p.bounds.max.y-p.bounds.min.y)};s.set=function(p,y,E){var T;typeof y=="string"&&(T=y,y={},y[T]=E);for(T in y)if(Object.prototype.hasOwnProperty.call(y,T))switch(E=y[T],T){case"isStatic":s.setStatic(p,E);break;case"isSleeping":d.set(p,E);break;case"mass":s.setMass(p,E);break;case"density":s.setDensity(p,E);break;case"inertia":s.setInertia(p,E);break;case"vertices":s.setVertices(p,E);break;case"position":s.setPosition(p,E);break;case"angle":s.setAngle(p,E);break;case"velocity":s.setVelocity(p,E);break;case"angularVelocity":s.setAngularVelocity(p,E);break;case"speed":s.setSpeed(p,E);break;case"angularSpeed":s.setAngularSpeed(p,E);break;case"parts":s.setParts(p,E);break;case"centre":s.setCentre(p,E);break;default:p[T]=E}},s.setStatic=function(p,y){for(var E=0;E<p.parts.length;E++){var T=p.parts[E];T.isStatic=y,y?(T._original={restitution:T.restitution,friction:T.friction,mass:T.mass,inertia:T.inertia,density:T.density,inverseMass:T.inverseMass,inverseInertia:T.inverseInertia},T.restitution=0,T.friction=1,T.mass=T.inertia=T.density=1/0,T.inverseMass=T.inverseInertia=0,T.positionPrev.x=T.position.x,T.positionPrev.y=T.position.y,T.anglePrev=T.angle,T.angularVelocity=0,T.speed=0,T.angularSpeed=0,T.motion=0):T._original&&(T.restitution=T._original.restitution,T.friction=T._original.friction,T.mass=T._original.mass,T.inertia=T._original.inertia,T.density=T._original.density,T.inverseMass=T._original.inverseMass,T.inverseInertia=T._original.inverseInertia,T._original=null)}},s.setMass=function(p,y){var E=p.inertia/(p.mass/6);p.inertia=E*(y/6),p.inverseInertia=1/p.inertia,p.mass=y,p.inverseMass=1/p.mass,p.density=p.mass/p.area},s.setDensity=function(p,y){s.setMass(p,y*p.area),p.density=y},s.setInertia=function(p,y){p.inertia=y,p.inverseInertia=1/p.inertia},s.setVertices=function(p,y){y[0].body===p?p.vertices=y:p.vertices=l.create(y,p),p.axes=x.fromVertices(p.vertices),p.area=l.area(p.vertices),s.setMass(p,p.density*p.area);var E=l.centre(p.vertices);l.translate(p.vertices,E,-1),s.setInertia(p,s._inertiaScale*l.inertia(p.vertices,p.mass)),l.translate(p.vertices,p.position),m.update(p.bounds,p.vertices,p.velocity)},s.setParts=function(p,y,E){var T;for(y=y.slice(0),p.parts.length=0,p.parts.push(p),p.parent=p,T=0;T<y.length;T++){var w=y[T];w!==p&&(w.parent=p,p.parts.push(w))}if(p.parts.length!==1){if(E=typeof E<"u"?E:!0,E){var M=[];for(T=0;T<y.length;T++)M=M.concat(y[T].vertices);l.clockwiseSort(M);var N=l.hull(M),L=l.centre(N);s.setVertices(p,N),l.translate(p.vertices,L)}var A=s._totalProperties(p);p.area=A.area,p.parent=p,p.position.x=A.centre.x,p.position.y=A.centre.y,p.positionPrev.x=A.centre.x,p.positionPrev.y=A.centre.y,s.setMass(p,A.mass),s.setInertia(p,A.inertia),s.setPosition(p,A.centre)}},s.setCentre=function(p,y,E){E?(p.positionPrev.x+=y.x,p.positionPrev.y+=y.y,p.position.x+=y.x,p.position.y+=y.y):(p.positionPrev.x=y.x-(p.position.x-p.positionPrev.x),p.positionPrev.y=y.y-(p.position.y-p.positionPrev.y),p.position.x=y.x,p.position.y=y.y)},s.setPosition=function(p,y,E){var T=c.sub(y,p.position);E?(p.positionPrev.x=p.position.x,p.positionPrev.y=p.position.y,p.velocity.x=T.x,p.velocity.y=T.y,p.speed=c.magnitude(T)):(p.positionPrev.x+=T.x,p.positionPrev.y+=T.y);for(var w=0;w<p.parts.length;w++){var M=p.parts[w];M.position.x+=T.x,M.position.y+=T.y,l.translate(M.vertices,T),m.update(M.bounds,M.vertices,p.velocity)}},s.setAngle=function(p,y,E){var T=y-p.angle;E?(p.anglePrev=p.angle,p.angularVelocity=T,p.angularSpeed=Math.abs(T)):p.anglePrev+=T;for(var w=0;w<p.parts.length;w++){var M=p.parts[w];M.angle+=T,l.rotate(M.vertices,T,p.position),x.rotate(M.axes,T),m.update(M.bounds,M.vertices,p.velocity),w>0&&c.rotateAbout(M.position,T,p.position,M.position)}},s.setVelocity=function(p,y){var E=p.deltaTime/s._baseDelta;p.positionPrev.x=p.position.x-y.x*E,p.positionPrev.y=p.position.y-y.y*E,p.velocity.x=(p.position.x-p.positionPrev.x)/E,p.velocity.y=(p.position.y-p.positionPrev.y)/E,p.speed=c.magnitude(p.velocity)},s.getVelocity=function(p){var y=s._baseDelta/p.deltaTime;return{x:(p.position.x-p.positionPrev.x)*y,y:(p.position.y-p.positionPrev.y)*y}},s.getSpeed=function(p){return c.magnitude(s.getVelocity(p))},s.setSpeed=function(p,y){s.setVelocity(p,c.mult(c.normalise(s.getVelocity(p)),y))},s.setAngularVelocity=function(p,y){var E=p.deltaTime/s._baseDelta;p.anglePrev=p.angle-y*E,p.angularVelocity=(p.angle-p.anglePrev)/E,p.angularSpeed=Math.abs(p.angularVelocity)},s.getAngularVelocity=function(p){return(p.angle-p.anglePrev)*s._baseDelta/p.deltaTime},s.getAngularSpeed=function(p){return Math.abs(s.getAngularVelocity(p))},s.setAngularSpeed=function(p,y){s.setAngularVelocity(p,f.sign(s.getAngularVelocity(p))*y)},s.translate=function(p,y,E){s.setPosition(p,c.add(p.position,y),E)},s.rotate=function(p,y,E,T){if(!E)s.setAngle(p,p.angle+y,T);else{var w=Math.cos(y),M=Math.sin(y),N=p.position.x-E.x,L=p.position.y-E.y;s.setPosition(p,{x:E.x+(N*w-L*M),y:E.y+(N*M+L*w)},T),s.setAngle(p,p.angle+y,T)}},s.scale=function(p,y,E,T){var w=0,M=0;T=T||p.position;for(var N=0;N<p.parts.length;N++){var L=p.parts[N];l.scale(L.vertices,y,E,T),L.axes=x.fromVertices(L.vertices),L.area=l.area(L.vertices),s.setMass(L,p.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,m.update(L.bounds,L.vertices,p.velocity)}p.parts.length>1&&(p.area=w,p.isStatic||(s.setMass(p,p.density*w),s.setInertia(p,M))),p.circleRadius&&(y===E?p.circleRadius*=y:p.circleRadius=null)},s.update=function(p,y){y=(typeof y<"u"?y:1e3/60)*p.timeScale;var E=y*y,T=s._timeCorrection?y/(p.deltaTime||y):1,w=1-p.frictionAir*(y/f._baseDelta),M=(p.position.x-p.positionPrev.x)*T,N=(p.position.y-p.positionPrev.y)*T;p.velocity.x=M*w+p.force.x/p.mass*E,p.velocity.y=N*w+p.force.y/p.mass*E,p.positionPrev.x=p.position.x,p.positionPrev.y=p.position.y,p.position.x+=p.velocity.x,p.position.y+=p.velocity.y,p.deltaTime=y,p.angularVelocity=(p.angle-p.anglePrev)*w*T+p.torque/p.inertia*E,p.anglePrev=p.angle,p.angle+=p.angularVelocity;for(var L=0;L<p.parts.length;L++){var A=p.parts[L];l.translate(A.vertices,p.velocity),L>0&&(A.position.x+=p.velocity.x,A.position.y+=p.velocity.y),p.angularVelocity!==0&&(l.rotate(A.vertices,p.angularVelocity,p.position),x.rotate(A.axes,p.angularVelocity),L>0&&c.rotateAbout(A.position,p.angularVelocity,p.position,A.position)),m.update(A.bounds,A.vertices,p.velocity)}},s.updateVelocities=function(p){var y=s._baseDelta/p.deltaTime,E=p.velocity;E.x=(p.position.x-p.positionPrev.x)*y,E.y=(p.position.y-p.positionPrev.y)*y,p.speed=Math.sqrt(E.x*E.x+E.y*E.y),p.angularVelocity=(p.angle-p.anglePrev)*y,p.angularSpeed=Math.abs(p.angularVelocity)},s.applyForce=function(p,y,E){var T={x:y.x-p.position.x,y:y.y-p.position.y};p.force.x+=E.x,p.force.y+=E.y,p.torque+=T.x*E.y-T.y*E.x},s._totalProperties=function(p){for(var y={mass:0,area:0,inertia:0,centre:{x:0,y:0}},E=p.parts.length===1?0:1;E<p.parts.length;E++){var T=p.parts[E],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 m=d.split(" "),x,b=0;b<m.length;b++)x=m[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 m=d.split(" "),x=0;x<m.length;x++){var b=c.events[m[x]],p=[];if(f&&b)for(var y=0;y<b.length;y++)b[y]!==f&&p.push(b[y]);c.events[m[x]]=p}},s.trigger=function(c,d,f){var m,x,b,p,y=c.events;if(y&&l.keys(y).length>0){f||(f={}),m=d.split(" ");for(var E=0;E<m.length;E++)if(x=m[E],b=y[x],b){p=l.clone(f,!1),p.name=x,p.source=c;for(var T=0;T<b.length;T++)b[T].apply(c,[p])}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(0),d=o(1),f=o(4);(function(){s.create=function(m){return c.extend({id:c.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},m)},s.setModified=function(m,x,b,p){if(m.isModified=x,x&&m.cache&&(m.cache.allBodies=null,m.cache.allConstraints=null,m.cache.allComposites=null),b&&m.parent&&s.setModified(m.parent,x,b,p),p)for(var y=0;y<m.composites.length;y++){var E=m.composites[y];s.setModified(E,x,b,p)}},s.add=function(m,x){var b=[].concat(x);l.trigger(m,"beforeAdd",{object:x});for(var p=0;p<b.length;p++){var y=b[p];switch(y.type){case"body":if(y.parent!==y){c.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}s.addBody(m,y);break;case"constraint":s.addConstraint(m,y);break;case"composite":s.addComposite(m,y);break;case"mouseConstraint":s.addConstraint(m,y.constraint);break}}return l.trigger(m,"afterAdd",{object:x}),m},s.remove=function(m,x,b){var p=[].concat(x);l.trigger(m,"beforeRemove",{object:x});for(var y=0;y<p.length;y++){var E=p[y];switch(E.type){case"body":s.removeBody(m,E,b);break;case"constraint":s.removeConstraint(m,E,b);break;case"composite":s.removeComposite(m,E,b);break;case"mouseConstraint":s.removeConstraint(m,E.constraint);break}}return l.trigger(m,"afterRemove",{object:x}),m},s.addComposite=function(m,x){return m.composites.push(x),x.parent=m,s.setModified(m,!0,!0,!1),m},s.removeComposite=function(m,x,b){var p=c.indexOf(m.composites,x);if(p!==-1&&s.removeCompositeAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeComposite(m.composites[y],x,!0);return m},s.removeCompositeAt=function(m,x){return m.composites.splice(x,1),s.setModified(m,!0,!0,!1),m},s.addBody=function(m,x){return m.bodies.push(x),s.setModified(m,!0,!0,!1),m},s.removeBody=function(m,x,b){var p=c.indexOf(m.bodies,x);if(p!==-1&&s.removeBodyAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeBody(m.composites[y],x,!0);return m},s.removeBodyAt=function(m,x){return m.bodies.splice(x,1),s.setModified(m,!0,!0,!1),m},s.addConstraint=function(m,x){return m.constraints.push(x),s.setModified(m,!0,!0,!1),m},s.removeConstraint=function(m,x,b){var p=c.indexOf(m.constraints,x);if(p!==-1&&s.removeConstraintAt(m,p),b)for(var y=0;y<m.composites.length;y++)s.removeConstraint(m.composites[y],x,!0);return m},s.removeConstraintAt=function(m,x){return m.constraints.splice(x,1),s.setModified(m,!0,!0,!1),m},s.clear=function(m,x,b){if(b)for(var p=0;p<m.composites.length;p++)s.clear(m.composites[p],x,!0);return x?m.bodies=m.bodies.filter(function(y){return y.isStatic}):m.bodies.length=0,m.constraints.length=0,m.composites.length=0,s.setModified(m,!0,!0,!1),m},s.allBodies=function(m){if(m.cache&&m.cache.allBodies)return m.cache.allBodies;for(var x=[].concat(m.bodies),b=0;b<m.composites.length;b++)x=x.concat(s.allBodies(m.composites[b]));return m.cache&&(m.cache.allBodies=x),x},s.allConstraints=function(m){if(m.cache&&m.cache.allConstraints)return m.cache.allConstraints;for(var x=[].concat(m.constraints),b=0;b<m.composites.length;b++)x=x.concat(s.allConstraints(m.composites[b]));return m.cache&&(m.cache.allConstraints=x),x},s.allComposites=function(m){if(m.cache&&m.cache.allComposites)return m.cache.allComposites;for(var x=[].concat(m.composites),b=0;b<m.composites.length;b++)x=x.concat(s.allComposites(m.composites[b]));return m.cache&&(m.cache.allComposites=x),x},s.get=function(m,x,b){var p,y;switch(b){case"body":p=s.allBodies(m);break;case"constraint":p=s.allConstraints(m);break;case"composite":p=s.allComposites(m).concat(m);break}return p?(y=p.filter(function(E){return E.id.toString()===x.toString()}),y.length===0?null:y[0]):null},s.move=function(m,x,b){return s.remove(m,x),s.add(b,x),m},s.rebase=function(m){for(var x=s.allBodies(m).concat(s.allConstraints(m)).concat(s.allComposites(m)),b=0;b<x.length;b++)x[b].id=c.nextId();return m},s.translate=function(m,x,b){for(var p=b?s.allBodies(m):m.bodies,y=0;y<p.length;y++)f.translate(p[y],x);return m},s.rotate=function(m,x,b,p){for(var y=Math.cos(x),E=Math.sin(x),T=p?s.allBodies(m):m.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 m},s.scale=function(m,x,b,p,y){for(var E=y?s.allBodies(m):m.bodies,T=0;T<E.length;T++){var w=E[T],M=w.position.x-p.x,N=w.position.y-p.y;f.setPosition(w,{x:p.x+M*x,y:p.y+N*b}),f.scale(w,x,b)}return m},s.bounds=function(m){for(var x=s.allBodies(m),b=[],p=0;p<x.length;p+=1){var y=x[p];b.push(y.bounds.min,y.bounds.max)}return d.create(b)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(5),d=o(0);(function(){s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(f,m){for(var x=m/d._baseDelta,b=s._motionSleepThreshold,p=0;p<f.length;p++){var y=f[p],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 m=s._motionSleepThreshold,x=0;x<f.length;x++){var b=f[x];if(b.isActive){var p=b.collision,y=p.bodyA.parent,E=p.bodyB.parent;if(!(y.isSleeping&&E.isSleeping||y.isStatic||E.isStatic)&&(y.isSleeping||E.isSleeping)){var T=y.isSleeping&&!y.isStatic?y:E,w=T===y?E:y;!T.isStatic&&w.motion>m&&s.set(T,!1)}}}},s.set=function(f,m){var x=f.isSleeping;m?(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},m={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,p){if(s._overlapAxes(f,x.vertices,b.vertices,x.axes),f.overlap<=0||(s._overlapAxes(m,b.vertices,x.vertices,b.axes),m.overlap<=0))return null;var y=p&&p.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<m.overlap?T=f:T=m;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,p,y){var E=b.length,T=p.length,w=b[0].x,M=b[0].y,N=p[0].x,L=p[0].y,A=y.length,C=Number.MAX_VALUE,I=0,R,j,D,P,B,Q;for(B=0;B<A;B++){var F=y[B],z=F.x,H=F.y,G=w*z+M*H,W=N*z+L*H,ae=G,V=W;for(Q=1;Q<E;Q+=1)P=b[Q].x*z+b[Q].y*H,P>ae?ae=P:P<G&&(G=P);for(Q=1;Q<T;Q+=1)P=p[Q].x*z+p[Q].y*H,P>V?V=P:P<W&&(W=P);if(j=ae-W,D=V-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,p){for(var y=b[0].x*p.x+b[0].y*p.y,E=y,T=1;T<b.length;T+=1){var w=b[T].x*p.x+b[T].y*p.y;w>E?E=w:w<y&&(y=w)}x.min=y,x.max=E},s._findSupports=function(x,b,p,y){var E=b.vertices,T=E.length,w=x.position.x,M=x.position.y,N=p.x*y,L=p.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,m=c.bodyB,x={id:s.id(f,m),bodyA:f,bodyB:m,collision:c,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:f.isSensor||m.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 m=c.contacts,x=d.supports,b=c.activeContacts,p=d.parentA,y=d.parentB,E=p.vertices.length;c.isActive=!0,c.timeUpdated=f,c.collision=d,c.separation=d.depth,c.inverseMass=p.inverseMass+y.inverseMass,c.friction=p.friction<y.friction?p.friction:y.friction,c.frictionStatic=p.frictionStatic>y.frictionStatic?p.frictionStatic:y.frictionStatic,c.restitution=p.restitution>y.restitution?p.restitution:y.restitution,c.slop=p.slop>y.slop?p.slop:y.slop,d.pair=c,b.length=0;for(var T=0;T<x.length;T++){var w=x[T],M=w.body===p?w.index:E+w.index,N=m[M];N?b.push(N):b.push(m[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),m=o(11),x=o(0);(function(){s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(b){var p=b;p.bodyA&&!p.pointA&&(p.pointA={x:0,y:0}),p.bodyB&&!p.pointB&&(p.pointB={x:0,y:0});var y=p.bodyA?c.add(p.bodyA.position,p.pointA):p.pointA,E=p.bodyB?c.add(p.bodyB.position,p.pointB):p.pointB,T=c.magnitude(c.sub(y,E));p.length=typeof p.length<"u"?p.length:T,p.id=p.id||x.nextId(),p.label=p.label||"Constraint",p.type="constraint",p.stiffness=p.stiffness||(p.length>0?1:.7),p.damping=p.damping||0,p.angularStiffness=p.angularStiffness||0,p.angleA=p.bodyA?p.bodyA.angle:p.angleA,p.angleB=p.bodyB?p.bodyB.angle:p.angleB,p.plugin={};var w={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return p.length===0&&p.stiffness>.1?(w.type="pin",w.anchors=!1):p.stiffness<.9&&(w.type="spring"),p.render=x.extend(w,p.render),p},s.preSolveAll=function(b){for(var p=0;p<b.length;p+=1){var y=b[p],E=y.constraintImpulse;y.isStatic||E.x===0&&E.y===0&&E.angle===0||(y.position.x+=E.x,y.position.y+=E.y,y.angle+=E.angle)}},s.solveAll=function(b,p){for(var y=x.clamp(p/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,p){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*p:b.stiffness*p*p,j=b.damping*p,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,F,z,H,G,W;if(j>0){var ae=c.create();H=c.div(L,A),W=c.sub(E&&c.sub(E.position,E.positionPrev)||ae,y&&c.sub(y.position,y.positionPrev)||ae),G=c.dot(H,W)}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),F=c.cross(T,D)/Q*s._torqueDampen*y.inverseInertia*(1-b.angularStiffness),y.constraintImpulse.angle-=F,y.angle-=F),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),F=c.cross(w,D)/Q*s._torqueDampen*E.inverseInertia*(1-b.angularStiffness),E.constraintImpulse.angle+=F,E.angle+=F)}}},s.postSolveAll=function(b){for(var p=0;p<b.length;p++){var y=b[p],E=y.constraintImpulse;if(!(y.isStatic||E.x===0&&E.y===0&&E.angle===0)){d.set(y,!1);for(var T=0;T<y.parts.length;T++){var 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),m.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={},m=0;m<d.length;m++){var x=(m+1)%d.length,b=l.normalise({x:d[x].y-d[m].y,y:d[m].x-d[x].x}),p=b.y===0?1/0:b.x/b.y;p=p.toFixed(3).toString(),f[p]=b}return c.values(f)},s.rotate=function(d,f){if(f!==0)for(var m=Math.cos(f),x=Math.sin(f),b=0;b<d.length;b++){var p=d[b],y;y=p.x*m-p.y*x,p.y=p.x*x+p.y*m,p.x=y}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(4),f=o(1),m=o(2);(function(){s.rectangle=function(x,b,p,y,E){E=E||{};var T={label:"Rectangle Body",position:{x,y:b},vertices:l.fromPath("L 0 0 L "+p+" 0 L "+p+" "+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,p,y,E,T){T=T||{},E*=.5;var w=(1-E*2)*p,M=p*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,p,y,E){y=y||{};var T={label:"Circle Body",circleRadius:p};E=E||25;var w=Math.ceil(Math.max(10,Math.min(E,p)));return w%2===1&&(w+=1),s.polygon(x,b,w,p,c.extend({},T,y))},s.polygon=function(x,b,p,y,E){if(E=E||{},p<3)return s.circle(x,b,y,E);for(var T=2*Math.PI/p,w="",M=T*.5,N=0;N<p;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,p,y,E,T,w,M){var N=c.getDecomp(),L,A,C,I,R,j,D,P,B,Q,F;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(p[0])||(p=[p]),Q=0;Q<p.length;Q+=1)if(j=p[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],W=G.map(function($){return{x:$[0],y:$[1]}});w>0&&l.area(W)<w||C.push({position:l.centre(W),vertices:W})}}for(D=0;D<C.length;D++)C[D]=d.create(c.extend(C[D],y));if(E){var ae=5;for(D=0;D<C.length;D++){var V=C[D];for(P=D+1;P<C.length;P++){var Y=C[P];if(f.overlaps(V.bounds,Y.bounds)){var te=V.vertices,U=Y.vertices;for(B=0;B<V.vertices.length;B++)for(F=0;F<Y.vertices.length;F++){var ie=m.magnitudeSquared(m.sub(te[(B+1)%te.length],U[F])),K=m.magnitudeSquared(m.sub(te[B],U[(F+1)%U.length]));ie<ae&&K<ae&&(te[B].isInternal=!0,U[F].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=[],m=d.pairs,x=d.bodies,b=x.length,p=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))&&p(w.collisionFilter,j.collisionFilter)){var P=j.parts.length;if(R&&P===1){var B=y(w,j,m);B&&f.push(B)}else for(var Q=I>1?1:0,F=P>1?1:0,z=Q;z<I;z++)for(var H=w.parts[z],M=H.bounds,G=F;G<P;G++){var W=j.parts[G],D=W.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,W,m);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 m=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&(d.button=0,f.preventDefault()),d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.sourceEvents.mousemove=f},d.mousedown=function(f){var m=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x?(d.button=0,f.preventDefault()):d.button=f.button,d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mousedownPosition.x=d.position.x,d.mousedownPosition.y=d.position.y,d.sourceEvents.mousedown=f},d.mouseup=function(f){var m=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&f.preventDefault(),d.button=-1,d.absolute.x=m.x,d.absolute.y=m.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mouseupPosition.x=d.position.x,d.mouseupPosition.y=d.position.y,d.sourceEvents.mouseup=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 m=d.getBoundingClientRect(),x=document.documentElement||document.body.parentNode||document.body,b=window.pageXOffset!==void 0?window.pageXOffset:x.scrollLeft,p=window.pageYOffset!==void 0?window.pageYOffset:x.scrollTop,y=c.changedTouches,E,T;return y?(E=y[0].pageX-m.left-b,T=y[0].pageY-m.top-p):(E=c.pageX-m.left-b,T=c.pageY-m.top-p),{x:E/(d.clientWidth/(d.width||d.clientWidth)*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,m=s.versionParse(d.version).number;f>m?(l.warn("Plugin.register:",s.toString(d),"was upgraded to",s.toString(c)),s._registry[c.name]=c):f<m?l.warn("Plugin.register:",s.toString(d),"can not be downgraded to",s.toString(c)):c!==d&&l.warn("Plugin.register:",s.toString(c),"is already registered to different plugin object")}else s._registry[c.name]=c;return c},s.resolve=function(c){return s._registry[s.dependencyParse(c).name]},s.toString=function(c){return typeof c=="string"?c:(c.name||"anonymous")+"@"+(c.version||c.range||"0.0.0")},s.isPlugin=function(c){return c&&c.name&&c.version&&c.install},s.isUsed=function(c,d){return c.used.indexOf(d)>-1},s.isFor=function(c,d){var 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),m=l.topologicalSort(f),x=[],b=0;b<m.length;b+=1)if(m[b]!==c.name){var p=s.resolve(m[b]);if(!p){x.push("❌ "+m[b]);continue}s.isUsed(c,p.name)||(s.isFor(p,c)||(l.warn("Plugin.use:",s.toString(p),"is for",p.for,"but installed on",s.toString(c)+"."),p._warned=!0),p.install?p.install(c):(l.warn("Plugin.use:",s.toString(p),"does not specify an install function."),p._warned=!0),p._warned?(x.push("🔶 "+s.toString(p)),delete p._warned):x.push("✅ "+s.toString(p)),c.used.push(p.name))}x.length>0&&l.info(x.join(" "))},s.dependencies=function(c,d){var f=s.dependencyParse(c),m=f.name;if(d=d||{},!(m in d)){c=s.resolve(c)||c,d[m]=l.map(c.uses||[],function(b){s.isPlugin(b)&&s.register(b);var p=s.dependencyParse(b),y=s.resolve(b);return y&&!s.versionSatisfies(y.version,p.range)?(l.warn("Plugin.dependencies:",s.toString(y),"does not satisfy",s.toString(p),"used by",s.toString(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),p.name});for(var x=0;x<d[m].length;x+=1)s.dependencies(d[m][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),m=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:m,minor:x,patch:b,parts:[m,x,b],prerelease:f[7],number:m*1e8+x*1e4+b}},s.versionSatisfies=function(c,d){d=d||"*";var f=s.versionParse(d),m=s.versionParse(c);if(f.isRange){if(f.operator==="*"||c==="*")return!0;if(f.operator===">")return m.number>f.number;if(f.operator===">=")return m.number>=f.number;if(f.operator==="~")return m.major===f.major&&m.minor===f.minor&&m.patch>=f.patch;if(f.operator==="^")return f.major>0?m.major===f.major&&m.number>=f.number:f.minor>0?m.minor===f.minor&&m.patch>=f.patch:m.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),m=o(5),x=o(6),b=o(10),p=o(0),y=o(4);(function(){s.create=function(E){E=E||{};var T={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},w=p.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=p.now(),M=E.world,N=E.detector,L=E.pairs,A=E.timing,C=A.timestamp,I;T=typeof T<"u"?T:p._baseDelta,T*=A.timeScale,A.timestamp+=T,A.lastDelta=T;var R={timestamp:A.timestamp,delta:T};m.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&&m.trigger(E,"collisionStart",{pairs:L.collisionStart});var B=p.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&&m.trigger(E,"collisionActive",{pairs:L.collisionActive}),L.collisionEnd.length>0&&m.trigger(E,"collisionEnd",{pairs:L.collisionEnd}),s._bodiesClearForces(j),m.trigger(E,"afterUpdate",R),E.timing.lastElapsed=p.now()-w,E},s.merge=function(E,T){if(p.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=p.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 m,x,b,p=f.length;for(m=0;m<p;m++)x=f[m],x.isActive&&(b=x.activeContacts.length,x.collision.parentA.totalContacts+=b,x.collision.parentB.totalContacts+=b)},s.solvePosition=function(f,m,x){var b,p,y,E,T,w,M,N,L=s._positionDampen*(x||1),A=c.clamp(m/c._baseDelta,0,1),C=f.length;for(b=0;b<C;b++)p=f[b],!(!p.isActive||p.isSensor)&&(y=p.collision,E=y.parentA,T=y.parentB,w=y.normal,p.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++)p=f[b],!(!p.isActive||p.isSensor)&&(y=p.collision,E=y.parentA,T=y.parentB,w=y.normal,N=p.separation-p.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 m=s._positionWarming,x=f.length,b=l.translate,p=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),p(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*=m,T.y*=m)}}},s.preSolveVelocity=function(f){var m=f.length,x,b;for(x=0;x<m;x++){var p=f[x];if(!(!p.isActive||p.isSensor)){var y=p.activeContacts,E=y.length,T=p.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,m){var x=m/c._baseDelta,b=x*x,p=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,F=R.normal.y,z=R.tangent.x,H=R.tangent.y,G=I.activeContacts,W=G.length,ae=1/W,V=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<W;C++){var te=G[C],U=te.vertex,ie=U.x-j.position.x,K=U.y-j.position.y,$=U.x-D.position.x,J=U.y-D.position.y,se=P.x-K*j.angularVelocity,ke=P.y+ie*j.angularVelocity,Pe=B.x-J*D.angularVelocity,Be=B.y+$*D.angularVelocity,ze=se-Pe,St=ke-Be,pt=Q*ze+F*St,ye=z*ze+H*St,Ke=I.separation+pt,Ot=Math.min(Ke,1);Ot=Ke<0?0:Ot;var Bt=Ot*Y;ye<-Bt||ye>Bt?(L=ye>0?ye:-ye,N=I.friction*(ye>0?1:-1)*p,N<-L?N=-L:N>L&&(N=L)):(N=ye,L=w);var zt=ie*F-K*Q,ht=$*F-J*Q,ln=ae/(V+j.inverseInertia*zt*zt+D.inverseInertia*ht*ht),Rt=(1+I.restitution)*pt*ln;if(N*=ln,pt<y)te.normalImpulse=0;else{var xe=te.normalImpulse;te.normalImpulse+=Rt,te.normalImpulse>0&&(te.normalImpulse=0),Rt=te.normalImpulse-xe}if(ye<-E||ye>E)te.tangentImpulse=0;else{var Fe=te.tangentImpulse;te.tangentImpulse+=N,te.tangentImpulse<-L&&(te.tangentImpulse=-L),te.tangentImpulse>L&&(te.tangentImpulse=L),N=te.tangentImpulse-Fe}var je=Q*Rt+z*N,me=F*Rt+H*N;j.isStatic||j.isSleeping||(j.positionPrev.x+=je*j.inverseMass,j.positionPrev.y+=me*j.inverseMass,j.anglePrev+=(ie*me-K*je)*j.inverseInertia),D.isStatic||D.isSleeping||(D.positionPrev.x-=je*D.inverseMass,D.positionPrev.y-=me*D.inverseMass,D.anglePrev-=($*me-J*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,m){var x=d.list,b=x.length,p=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,m),L.confirmedActive=!0):(L=l.create(M,m),p[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,m),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 p[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),m=o(12),x=d.deprecated;(function(){s.stack=function(b,p,y,E,T,w,M){for(var N=l.create({label:"Stack"}),L=b,A=p,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,p,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*p,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,p,y,E,T){var w=b.bodies,M,N,L,A,C;for(M=0;M<y;M++){for(N=1;N<p;N++)L=w[N-1+M*p],A=w[N+M*p],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T)));if(M>0)for(N=0;N<p;N++)L=w[N+(M-1)*p],A=w[N+M*p],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T))),E&&N>0&&(C=w[N-1+(M-1)*p],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T)))),E&&N<p-1&&(C=w[N+1+(M-1)*p],l.addConstraint(b,c.create(d.extend({bodyA:C,bodyB:A},T))))}return b.label+=" Mesh",b},s.pyramid=function(b,p,y,E,T,w,M){return s.stack(b,p,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,p,y,E,T){for(var w=l.create({label:"Newtons Cradle"}),M=0;M<y;M++){var N=1.9,L=m.circle(b+M*(E*N),p+T,E,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),A=c.create({pointA:{x:b+M*(E*N),y:p},bodyB:L});l.addBody(w,L),l.addConstraint(w,A)}return w},x(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(b,p,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=m.rectangle(b,p,y,E,{collisionFilter:{group:w},chamfer:{radius:E*.5},density:2e-4}),R=m.circle(b+N,p+A,T,{collisionFilter:{group:w},friction:.8}),j=m.circle(b+L,p+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,p,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,p,y,E,T,w,function(I,R){return m.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 m={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return c.extend(m,f)},s.update=function(f,m,x,b){var p,y,E,T=x.world,w=f.buckets,M,N,L=!1;for(p=0;p<m.length;p++){var A=m[p];if(!(A.isSleeping&&!b)&&!(T.bounds&&(A.bounds.max.x<T.bounds.min.x||A.bounds.min.x>T.bounds.max.x||A.bounds.max.y<T.bounds.min.y||A.bounds.min.y>T.bounds.max.y))){var C=s._getRegion(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,m){var x=Math.min(f.startCol,m.startCol),b=Math.max(f.endCol,m.endCol),p=Math.min(f.startRow,m.startRow),y=Math.max(f.endRow,m.endRow);return s._createRegion(x,b,p,y)},s._getRegion=function(f,m){var x=m.bounds,b=Math.floor(x.min.x/f.bucketWidth),p=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,p,y,E)},s._createRegion=function(f,m,x,b){return{id:f+","+m+","+x+","+b,startCol:f,endCol:m,startRow:x,endRow:b}},s._getBucketId=function(f,m){return"C"+f+"R"+m},s._createBucket=function(f,m){var x=f[m]=[];return x},s._bucketAddBody=function(f,m,x){var b=f.pairs,p=l.id,y=m.length,E;for(E=0;E<y;E++){var T=m[E];if(!(x.id===T.id||x.isStatic&&T.isStatic)){var w=p(x,T),M=b[w];M?M[2]+=1:b[w]=[x,T,1]}}m.push(x)},s._bucketRemoveBody=function(f,m,x){var b=f.pairs,p=l.id,y;m.splice(c.indexOf(m,x),1);var E=m.length;for(y=0;y<E;y++){var T=b[p(x,m[y])];T&&(T[2]-=1)}},s._createActivePairsList=function(f){var m,x=f.pairs,b=c.keys(x),p=b.length,y=[],E;for(E=0;E<p;E++)m=x[b[E]],m[2]>0?y.push(m):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),m=o(13),x=o(10),b=o(6),p=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(),p.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=p.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)&&m.canCollide(N.collisionFilter,E.collisionFilter))for(var A=N.parts.length>1?1:0;A<N.parts.length;A++){var C=N.parts[A];if(l.contains(C.vertices,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),m=o(3);(function(){s.collides=function(x,b){for(var p=[],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){p.push(R);break}}}}return p},s.ray=function(x,b,p,y){y=y||1e-100;for(var E=l.angle(b,p),T=l.magnitude(l.sub(b,p)),w=(p.x+b.x)*.5,M=(p.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,p){for(var y=[],E=0;E<x.length;E++){var T=x[E],w=d.overlaps(T.bounds,b);(w&&!p||!w&&p)&&y.push(T)}return y},s.point=function(x,b){for(var p=[],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)&&m.contains(w.vertices,b)){p.push(E);break}}}return p}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(0),d=o(6),f=o(1),m=o(5),x=o(2),b=o(14);(function(){var p,y;typeof window<"u"&&(p=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(A){window.setTimeout(function(){A(c.now())},1e3/60)},y=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),s._goodFps=30,s._goodDelta=1e3/60,s.create=function(A){var C={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",hasBounds:!!A.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},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=p(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 F=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,W=G/H,ae=F/z,V=1,Y=1;ae>W?Y=ae/W:V=W/ae,A.options.hasBounds=!0,A.bounds.min.x=j.min.x,A.bounds.max.x=j.min.x+F*V,A.bounds.min.y=j.min.y,A.bounds.max.y=j.min.y+z*Y,R&&(A.bounds.min.x+=F*.5-F*V*.5,A.bounds.max.x+=F*.5-F*V*.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,F=d.allBodies(j),z=d.allConstraints(j),H=B.wireframes?B.wireframeBackground:B.background,G=[],W=[],ae,V={timestamp:R.timing.timestamp};if(m.trigger(A,"beforeRender",V),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(ae=0;ae<F.length;ae++){var Y=F[ae];f.overlaps(Y.bounds,A.bounds)&&G.push(Y)}for(ae=0;ae<z.length;ae++){var te=z[ae],U=te.bodyA,ie=te.bodyB,K=te.pointA,$=te.pointB;U&&(K=x.add(U.position,te.pointA)),ie&&($=x.add(ie.position,te.pointB)),!(!K||!$)&&(f.contains(A.bounds,K)||f.contains(A.bounds,$))&&W.push(te)}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 W=z,G=F,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(W,P),B.hasBounds&&s.endViewTransform(A),m.trigger(A,"afterRender",V),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,F=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(F,z,B*5.5,Q),C.font="12px Arial",C.textBaseline="top",C.textAlign="right";for(var W in G){var ae=G[W];C.fillStyle="#aaa",C.fillText(W,F+B,z+8),C.fillStyle="#eee",C.fillText(ae,F+B,z+26),F+=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,F=I.timing.lastDelta,z=T(j),H=T(D),G=T(B),W=T(Q),ae=T(P),V=ae/z||0,Y=1e3/z||0,te=4,U=12,ie=60,K=34,$=10,J=69;C.fillStyle="#0e0f19",C.fillRect(0,50,U*4+ie*5+22,K),s.status(C,$,J,ie,te,j.length,Math.round(Y)+" fps",Y/s._goodFps,function(se){return j[se]/z-1}),s.status(C,$+U+ie,J,ie,te,B.length,F.toFixed(2)+" dt",s._goodDelta/F,function(se){return B[se]/G-1}),s.status(C,$+(U+ie)*2,J,ie,te,Q.length,W.toFixed(2)+" ut",1-W/s._goodFps,function(se){return Q[se]/W-1}),s.status(C,$+(U+ie)*3,J,ie,te,D.length,H.toFixed(2)+" rt",1-H/s._goodFps,function(se){return D[se]/H-1}),s.status(C,$+(U+ie)*4,J,ie,te,P.length,V.toFixed(2)+" x",V*V*V,function(se){return(P[se]/j[se]/V||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 F=0;F<R;F+=1)A.lineTo(C+F,I+7-(F<D?j*c.clamp(.4*Q(F),-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 F=x.sub(Q,B),z=x.perp(x.normalise(F)),H=Math.ceil(c.clamp(j.length/5,12,20)),G,W=1;W<H;W+=1)G=W%2===0?1:-1,I.lineTo(B.x+F.x*(W/H)+z.x*G*4,B.y+F.y*(W/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,F;for(Q=0;Q<C.length;Q++)if(P=C[Q],!!P.render.visible){for(F=P.parts.length>1?1:0;F<P.parts.length;F++)if(B=P.parts[F],!!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,F;for(R.beginPath(),B=0;B<C.length;B++)if(D=C[B],!!D.render.visible)for(F=D.parts.length>1?1:0;F<D.parts.length;F++){for(P=D.parts[F],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 F=B[Q];R.rect(F.bounds.min.x,F.bounds.min.y,F.bounds.max.x-F.bounds.min.x,F.bounds.max.y-F.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 F=C[P],z=F.parts;if(F.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 F=D.activeContacts[Q],z=F.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,F;for(R.beginPath(),F=0;F<C.length;F++)if(D=C[F],!!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,F=B/R.options.height;C.scale(1/Q,1/F),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,m;if(typeof window<"u"&&(f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,m=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!f){var x;f=function(b){x=setTimeout(function(){b(d.now())},1e3/60)},m=function(){clearTimeout(x)}}s.create=function(b){var p={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},y=d.extend(p,b);return y.delta=y.delta||1e3/y.fps,y.deltaMin=y.deltaMin||1e3/y.fps,y.deltaMax=y.deltaMax||1e3/(y.fps*.5),y.fps=1e3/y.delta,y},s.run=function(b,p){return typeof b.positionIterations<"u"&&(p=b,b=s.create()),(function y(E){b.frameRequestId=f(y),E&&b.enabled&&s.tick(b,p,E)})(),b},s.tick=function(b,p,y){var E=p.timing,T;b.isFixed?T=b.delta:(T=y-b.timePrev||b.delta,b.timePrev=y,b.deltaHistory.push(T),b.deltaHistory=b.deltaHistory.slice(-b.deltaSampleSize),T=Math.min.apply(null,b.deltaHistory),T=T<b.deltaMin?b.deltaMin:T,T=T>b.deltaMax?b.deltaMax:T,b.delta=T);var 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(p,T),l.trigger(b,"afterUpdate",w),l.trigger(b,"afterTick",w)},s.stop=function(b){m(b.frameRequestId)},s.start=function(b,p){s.run(b,p)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(8),c=o(0),d=c.deprecated;(function(){s.collides=function(f,m){return l.collides(f,m)},d(s,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,i,o){var s={};n.exports=s,o(1);var l=o(0);(function(){s.pathToVertices=function(c,d){typeof window<"u"&&!("SVGPathSeg"in window)&&l.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var f,m,x,b,p,y,E,T,w,M,N=[],L,A,C=0,I=0,R=0;d=d||15;var j=function(P,B,Q){var F=Q%2===1&&Q>1;if(!w||P!=w.x||B!=w.y){w&&F?(L=w.x,A=w.y):(L=0,A=0);var z={x:L+P,y:A+B};(F||!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),p=y[M],p!=T){for(;E.length&&E[0]!=p;)D(E.shift());T=p}switch(p.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":b=c.getPointAtLength(C),j(b.x,b.y,0);break}C+=d}for(f=0,m=E.length;f<m;++f)D(E[f]);return N},s._svgPathToAbsolute=function(c){for(var d,f,m,x,b,p,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&&(m=E+N.x1),"x2"in N&&(b=E+N.x2),"y1"in N&&(x=T+N.y1),"y2"in N&&(p=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,m,x,b,p),M);break;case"s":y.replaceItem(c.createSVGPathSegCurvetoCubicSmoothAbs(E,T,b,p),M);break;case"q":y.replaceItem(c.createSVGPathSegCurvetoQuadraticAbs(E,T,m,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})()})])})})(Cc)),Cc.exports}var pN=mN();const DE=Ml(pN);{const e=DE.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const gN=6,Ca=28,ti=.92,Jh=1.12,xN=34;function fy(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<gN?"click":"drag"}function bN(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 yN(e,t){return e*Math.exp(-t/90)}function vN(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 EN=4e-5,TN=5e-4;function SN(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function kN(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 LE(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,wN=.9,hy=.7,AN=.09,CN=2.2,NN=2,em=Ca*2.45,_N=.006,tm=22,nm=.06;function MN(e){var Q;const t=e.ballRadius??Ca,n=kN(e.weather??"clear"),{Engine:i,Bodies:o,Body:s,Composite:l,Constraint:c,Events:d}=DE,f=i.create();f.gravity.y=1,f.positionIterations=8,f.velocityIterations=4;const m=e.nodes.map(F=>{var W,ae;const z=((W=F.spawn)==null?void 0:W.x)??F.x,H=((ae=F.spawn)==null?void 0:ae.y)??F.y,G=o.circle(z,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:F.isExam?.0016:.001,inertia:1/0,isStatic:!!F.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:F.id,body:G,layoutX:F.x,layoutY:F.y,isExam:!!F.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const F of m){l.add(f.world,F.body);const z=(Q=e.nodes.find(H=>H.id===F.nodeId))==null?void 0:Q.spawn;z&&(z.vx!==void 0||z.vy!==void 0)&&s.setVelocity(F.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}},p=(F,z)=>({x:Math.min(e.width-t,Math.max(t,F)),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=F=>({x:F.body.position.x,y:F.body.position.y+t*ti}),E=[];function T(F,z,H,G,W){return"body"in F?c.create({bodyA:F.body,pointA:F.offset,bodyB:z,pointB:H,length:G,stiffness:W,damping:.05}):c.create({pointA:F.point,bodyB:z,pointB:H,length:G,stiffness:W,damping:.05})}function w(F,z,H,G){const W={x:H.body.position.x,y:H.body.position.y+t*ti},ae=W.x-F.x,V=W.y-F.y,Y=Math.max(60,Math.hypot(ae,V)),te=Math.max(5,Math.min(14,Math.round(Y/xN))),U=Y*Jh/te,ie=[];let K=z?{body:z,offset:{x:F.x-z.position.x,y:F.y-z.position.y}}:{point:F},$=!0;for(let J=1;J<te;J++){const se=J/te,ke=Math.sin(Math.PI*se)*Y*(Jh-1)*.85,Pe=o.circle(F.x+ae*se,F.y+V*se+ke,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});ie.push(Pe),l.add(f.world,Pe),l.add(f.world,T(K,Pe,void 0,U,$?hy:wN)),$=!1,K={body:Pe,offset:{x:0,y:0}}}l.add(f.world,T(K,H.body,{x:0,y:t*ti},U,hy)),E.push({from:G,to:H.nodeId,restLen:Y*Jh,particles:ie})}const M=m[0],N=M?{x:e.anchorKnotX??M.layoutX,y:qc}:{x:e.width/2,y:qc};M&&w(N,null,M,"__anchor");for(let F=0;F<m.length-1;F++){const z=m[F],H=m[F+1];w(y(z),z.body,H,z.nodeId)}const L=m[m.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 F of m){let z=0;for(const G of E)if(G.from===F.nodeId||G.to===F.nodeId)for(const W of G.particles)z+=W.mass*.5;const H=Math.min(.25,z/F.body.mass);C.set(F.nodeId,(1+H)*(.96+LE(F.nodeId)*.08))}let I=0,R=1;d.on(f,"beforeUpdate",()=>{const F=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 m){const H=z.body.mass,G=f.gravity.y*f.gravity.scale,W=SN(z.body.position.x,z.body.position.y,F)*n.wind*EN*H+R*I*TN*H;let ae=-H*G*(C.get(z.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(ae+=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:W,y:ae})}});const j=[],D=(F,z,H,G)=>{if(F.snow<=nm)return;const W=Math.max(1,Math.min(G,Math.round(F.snow*G)+1));for(let ae=0;ae<W;ae++){const V=-(.35+Math.random()*1.9),Y=t*(.55+Math.random()*.45);j.push({x:F.body.position.x+Math.cos(V)*Y,y:F.body.position.y+Math.sin(V)*Y,vx:F.body.velocity.x*.75+z.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:F.body.velocity.y*.75+z.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}F.snow=Math.max(nm*.5,F.snow-W*(.03+Math.min(.07,H*.005))),j.length>96&&j.splice(0,j.length-96)},P=[];d.on(f,"collisionStart",F=>{var z;for(const H of F.pairs){const{bodyA:G,bodyB:W}=H,ae=m.find($=>$.body===G),V=m.find($=>$.body===W);if(!ae&&!V)continue;const Y={x:G.velocity.x-W.velocity.x,y:G.velocity.y-W.velocity.y},te=Math.hypot(Y.x,Y.y);if(te<CN)continue;const U=H.collision.normal,ie=(z=H.collision.supports)==null?void 0:z[0];P.push(ie?{x:ie.x,y:ie.y,speed:te}:{x:(G.position.x+W.position.x)/2,y:(G.position.y+W.position.y)/2,speed:te}),P.length>64&&P.shift();const K=Math.min(.32,te*.028);ae&&K>ae.squash&&(ae.squash=K,ae.squashAngle=Math.atan2(U.y,U.x)),V&&K>V.squash&&(V.squash=K,V.squashAngle=Math.atan2(-U.y,-U.x)),ae&&D(ae,{x:U.x,y:U.y},te,5),V&&D(V,{x:-U.x,y:-U.y},te,5)}}),d.on(f,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const F of m)F.snow=Math.min(1,F.snow+n.snowRate)});let B=null;return{balls:m,links:E,anchor:N,nextKnot:A,ball(F){return m.find(z=>z.nodeId===F)},step(F){i.update(f,Math.min(33,Math.max(8,F)));for(let z=0;z<m.length;z++){const H=m[z];for(let G=z+1;G<m.length;G++){const W=m[G],ae=W.body.position.x-H.body.position.x,V=W.body.position.y-H.body.position.y,Y=ae*ae+V*V;if(Y>=em*em||Y<.01)continue;const te=Math.sqrt(Y),U=(te-2*t)/(em-2*t),ie=U<=0?1:U>=1?0:1-U,$=Math.hypot(H.body.velocity.x-W.body.velocity.x,H.body.velocity.y-W.body.velocity.y)<1.2?_N*ie*ie:0,J=ae/te,se=V/te;H.body.isStatic||s.applyForce(H.body,H.body.position,{x:-J*$*H.body.mass,y:-se*$*H.body.mass}),W.body.isStatic||s.applyForce(W.body,W.body.position,{x:J*$*W.body.mass,y:se*$*W.body.mass}),H.field=Math.max(H.field,ie),W.field=Math.max(W.field,ie)}}for(const z of m)z.field*=.88;for(const z of m){if(z.body.isStatic)continue;const H=z.body.velocity,G=Math.hypot(H.x,H.y);G>tm&&s.setVelocity(z.body,{x:H.x/G*tm,y:H.y/G*tm})}for(let z=0;z<m.length;z++){const H=m[z];for(let G=z+1;G<m.length;G++){const W=m[G];let ae=W.body.position.x-H.body.position.x,V=W.body.position.y-H.body.position.y,Y=Math.hypot(ae,V);if(Y>=t*2)continue;Y<.01&&(ae=1,V=0,Y=1);const te=t*2-Y+.05,U=ae/Y,ie=V/Y;H.body.isStatic&&W.body.isStatic||(H.body.isStatic?s.setPosition(W.body,{x:W.body.position.x+U*te,y:W.body.position.y+ie*te}):W.body.isStatic?s.setPosition(H.body,{x:H.body.position.x-U*te,y:H.body.position.y-ie*te}):(s.setPosition(H.body,{x:H.body.position.x-U*te/2,y:H.body.position.y-ie*te/2}),s.setPosition(W.body,{x:W.body.position.x+U*te/2,y:W.body.position.y+ie*te/2})))}}for(const z of m){const H=Math.hypot(z.body.velocity.x,z.body.velocity.y);z.snow>nm&&H>NN&&D(z,{x:z.body.velocity.x/H,y:z.body.velocity.y/H},H,2)}for(const z of m){if(z.body.isStatic)continue;const H=z.body.position.x,G=z.body.position.y,W=Math.min(e.width-t,Math.max(t,H)),ae=Math.min(e.height-t,Math.max(t,G));(W!==H||ae!==G)&&(s.setPosition(z.body,{x:W,y:ae}),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(F,z,H){this.endDrag();const G=this.ball(F);if(!G)return;const W=c.create({pointA:p(z,H),bodyB:G.body,length:0,stiffness:AN,damping:.12});l.add(f.world,W),B={constraint:W,nodeId:F}},moveDrag(F,z){if(!B)return;const H=p(F,z);B.constraint.pointA=H},endDrag(){B&&(l.remove(f.world,B.constraint),B=null)},isDragging(){return B!==null},drainImpacts(){const F=P.slice();return P.length=0,F},drainFlakes(){const F=j.slice();return j.length=0,F},dispose(){this.endDrag(),d.off(f,"beforeUpdate"),d.off(f,"afterUpdate"),d.off(f,"collisionStart"),l.clear(f.world,!1),i.clear(f)}}}const qc=-12;function sc(e,t,n=20){return t<=n*2?t/2:n+LE(e)*(t-n*2)}function RN(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,dd=(e,t,n)=>e<t?t:e>n?n:e,El=e=>e<0?0:e>1?1:e*e*(3-2*e);function Cr(e,t,n){return[Ar(e[0],t[0],n),Ar(e[1],t[1],n),Ar(e[2],t[2],n)]}const am=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 fd(){return[{t:0,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]},{t:.12,top:[30,32,72],mid:[78,56,104],hor:[158,100,116]},{t:.22,top:[124,156,214],mid:[232,152,120],hor:[250,196,128]},{t:.36,top:[80,142,196],mid:[132,186,226],hor:[188,214,232]},{t:.5,top:[60,120,178],mid:[108,168,212],hor:[168,200,226]},{t:.62,top:[120,132,152],mid:[150,150,160],hor:[180,178,182]},{t:.74,top:[70,60,88],mid:[108,78,110],hor:[180,110,100]},{t:.86,top:[40,30,60],mid:[88,44,76],hor:[168,72,72]},{t:1,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]}]}function hd(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const im=()=>hd(fd(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),oc=()=>hd(fd(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),rm=()=>hd(fd(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),my=()=>hd(fd(),e=>{const t=(e[0]+e[1]+e[2])/3;return[t*.7+e[0]*.1,t*.7+e[1]*.1,t*.95+e[2]*.15]}),sm={far:[28,50,36],near:[56,110,52],snowy:!1},lc={far:[20,48,30],near:[34,82,40],snowy:!1},om={far:[54,36,24],near:[128,78,36],snowy:!1},py={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),El((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),El((t-.74)/.1))),dd(n,0,1)}}const OE={"spring|clear":{season:"spring",weather:"clear",sky:im(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:sm},"spring|cloudy":{season:"spring",weather:"cloudy",sky:im(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:sm},"spring|rain":{season:"spring",weather:"rain",sky:im(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:sm},"summer|clear":{season:"summer",weather:"clear",sky:oc(),cloudCover:aa(.1),particles:"none",lightning:!1,fogAlpha:0,ground:lc},"summer|cloudy":{season:"summer",weather:"cloudy",sky:oc(),cloudCover:aa(.5),particles:"none",lightning:!1,fogAlpha:0,ground:lc},"summer|rain":{season:"summer",weather:"rain",sky:oc(),cloudCover:aa(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:lc},"summer|storm":{season:"summer",weather:"storm",sky:oc(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:lc},"autumn|clear":{season:"autumn",weather:"clear",sky:rm(),cloudCover:aa(.15),particles:"none",lightning:!1,fogAlpha:0,ground:om,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:rm(),cloudCover:aa(.55),particles:"none",lightning:!1,fogAlpha:0,ground:om},"autumn|storm":{season:"autumn",weather:"storm",sky:rm(),cloudCover:aa(1),particles:"rain",lightning:!0,fogAlpha:0,ground:om},"winter|clear":{season:"winter",weather:"clear",sky:my(),cloudCover:aa(.2),particles:"none",lightning:!1,fogAlpha:0,ground:py,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:my(),cloudCover:aa(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:py}},gy=Object.keys(OE);function DN(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 LN(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return gy[DN(t)%gy.length]}function ON(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const i=t[n],o=t[Math.min(n+1,t.length-1)],s=El(dd((e-i.t)/(o.t-i.t||1),0,1));return{top:Cr(i.top,o.top,s),mid:Cr(i.mid,o.mid,s),hor:Cr(i.hor,o.hor,s)}}function IN(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 jN(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 IE(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 xy(e,t){const n=IE(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 PN(){const e=IE(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 BN(e,t,n,i){const o=e.createLinearGradient(0,0,0,i);o.addColorStop(0,am(t.top)),o.addColorStop(.55,am(t.mid)),o.addColorStop(1,am(t.hor)),e.fillStyle=o,e.fillRect(0,0,n,i)}function zN(e,t,n,i,o,s){let l=0;if(t<.22?l=El(1-t/.22):t>.8&&(l=El((t-.8)/.2)),!(l<=.01))for(const c of n){const d=.55+.45*Math.sin(s*c.sp+c.tw),f=l*d;if(f<.02)continue;e.fillStyle=`rgba(255,248,228,${f})`;const m=c.big?c.r*1.8:c.r;e.beginPath(),e.arc(c.x*i,c.y*o,m,0,Math.PI*2),e.fill(),c.big&&(e.fillStyle=`rgba(255,240,210,${f*.35})`,e.fillRect(c.x*i-m*4,c.y*o-.4,m*8,.8),e.fillRect(c.x*i-.4,c.y*o-m*4,.8,m*8))}}function UN(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],m=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(m,.9)),e.fillStyle=d,e.beginPath(),e.arc(i,o,l,0,Math.PI*2),e.fill()}function HN(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,m]of c)e.beginPath(),e.arc(n+d,i+f,m,0,Math.PI*2),e.fill()}function FN(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,m]of c)e.beginPath(),e.arc(d*l,f*l*1.1+l*.45,l*m*1.05,0,Math.PI*2),e.fill();e.fillStyle=Is(o,s);for(const[d,f,m]of c)e.beginPath(),e.arc(d*l,f*l,l*m,0,Math.PI*2),e.fill();e.restore()}function VN(e,t,n,i,o,s,l,c,d){const f=l(t);if(f<.02)return;const m=Cr(c.hor,[255,255,255],.35),x=Cr(c.mid,[20,20,30],.45),b=d?x:m;for(let p=0;p<n.length;p++){const y=n[p],E=(y.x+s*y.speed)%1.2-.1,T=y.y+Math.sin(s*1e-4+y.seed)*y.drift;p/n.length<f&&FN(e,E*i,T*o,y.s,b,dd(f*.92,0,.92))}}const ws=[];let xr=[];const tl=[];let br=[];const uc=[],Xo=[];let nl=[];function qN(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,m=n-Math.sqrt(Math.max(0,i*i-i*c*(i*c))),x=n-i-l,b=(m+x)/2;e.save(),e.beginPath(),e.moveTo(d,m),e.bezierCurveTo(d,b,t-i*.3,x,t,x),e.bezierCurveTo(t+i*.3,x,f,b,f,m),e.quadraticCurveTo(t,n-i*.78,d,m),e.closePath();const p=e.createLinearGradient(0,x,0,m);p.addColorStop(0,"rgba(255,255,255,0.98)"),p.addColorStop(.65,"rgba(245,250,255,0.95)"),p.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=p,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(d,m),e.quadraticCurveTo(t,n-i*.78,f,m),e.stroke(),e.restore()}function lm(e,t,n,i,o){const s=Math.sin(i),l=Math.cos(i);return{x:e+Math.sin(o)*s*n,y:t-l*n}}function YN(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 GN(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 jE(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 XN(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),p=c.prog-c.len*((x+1)/d),y=lm(t,n,i,b,c.theta),E=lm(t,n,i,p,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=lm(t,n,i,c.prog,c.theta),m=e.createRadialGradient(f.x-1.2,f.y-1.2,0,f.x,f.y,c.thick*1.3);m.addColorStop(0,"rgba(255,255,255,0.85)"),m.addColorStop(.4,"rgba(180,215,240,0.5)"),m.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=m,e.beginPath(),e.arc(f.x,f.y,c.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function KN(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,qN(e,s.x,s.y,s.r,l)}else if(n.particles==="rain"){if(YN(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(XN(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 m=0;m<f;m++){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)}jE(e,tl[o])}}}function $N(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 QN(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 WN(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,by=0;function ZN(e,t,n,i,o){if(o>by&&(Es=1,by=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 JN(e,t,n,i){const o=e.getContext("2d");if(!o)return()=>{};const s=o,l=n;let c=0,d=0,f=1,m=xy(1,1);const x=PN();let b=[],p=[],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),m=xy(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"&&p.length===0)for(let D=0;D<120;D++)p.push({x:Math.random(),y:Math.random(),r:.8+Math.random()*1.6,v:.5+Math.random()*.8,phase:Math.random()*Math.PI*2})}function L(){const j=t.scrollHeight-t.clientHeight;y=j>0?dd(t.scrollTop/j,0,1):0}function A(j){if(!T)return;const D=y,P=M?0:(j-w)/1e3,B=ON(D,i.sky);BN(s,B,c,d),zN(s,D,m,c,d,P),HN(s,jN(D,c,d,.92,.08)),UN(s,IN(D,c,d,.16,.88),i.sunTint),VN(s,D,x,c,d,j,i.cloudCover,B,i.weather==="storm"),i.particles==="rain"&&$N(s,c,d,b,i.weather==="storm"),i.particles==="snow"&&QN(s,c,d,p,j),i.fogAlpha>0&&WN(s,c,d,i.fogAlpha,B),i.lightning&&ZN(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 e5(e,t,n,i,o,s){const l=()=>{ws.length=0,nl.length=0,xr.length=0,tl.length=0,br.length=0,uc.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 m=0,x=0,b=1,p=0,y=!0;function E(){const M=t.getBoundingClientRect();b=Math.min(window.devicePixelRatio||1,2),m=Math.max(1,M.width),x=Math.max(1,M.height),e.width=Math.floor(m*b),e.height=Math.floor(x*b),e.style.width=m+"px",e.style.height=x+"px",f.setTransform(b,0,0,b,0,0)}function T(M){if(!y)return;f.clearRect(0,0,m,x);const N=i();if(KN(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++)uc.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)})}uc.length>0&&jE(f,uc)}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();GN(f,Xo)}p=requestAnimationFrame(T)}const w=new ResizeObserver(E);return w.observe(t),E(),p=requestAnimationFrame(T),()=>{y=!1,cancelAnimationFrame(p),w.disconnect(),l()}}const f0=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 f0)i(n)}function yy(e){return f0.add(e),()=>{f0.delete(e)}}function t5(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 PE="(prefers-reduced-motion: reduce)";function n5(e){const t=window.matchMedia(PE);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function a5(){return window.matchMedia(PE).matches}function i5(){return!1}function BE(){return _.useSyncExternalStore(n5,a5,i5)}function r5(e){const t=Ye(),[n,i]=_.useState("import"),[o,s]=_.useState("study"),l=_.useRef(null),c=_.useRef(null),d=Math.round(e.overallMastery*100),m=!BE(),x=_.useRef([]),b=_.useRef(P=>{x.current.push(...P),x.current.length>64&&x.current.splice(0,x.current.length-64)}).current,p=_.useRef([]),y=_.useRef(new Map),E=_.useRef(P=>{p.current.push(...P),p.current.length>96&&p.current.splice(0,p.current.length-96)}).current,T=e.sections.filter(P=>(P.world??"study")===o),w=e.sections.some(P=>P.world==="practice"),[M,N]=_.useState(null);_.useEffect(()=>{N(LN(e.courseId))},[e.courseId]);const L=M?OE[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(),F=B.getBoundingClientRect();(F.top<Q.top+60||F.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 F;const P=D.current,B={};let Q=!1;for(const z of e.tree){const H=((F=e.progressMap[z.id])==null?void 0:F.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]),g.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&&g.jsxs(g.Fragment,{children:[g.jsx(o5,{scrollRef:c,navRef:l,preset:L}),g.jsx(l5,{scrollRef:c,navRef:l,preset:L,getImpacts:()=>x.current.splice(0),getFlakes:()=>p.current.splice(0),orbSnowRef:y})]}),g.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:[g.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:[g.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:[g.jsx(rp,{className:"w-3 h-3"})," ",t("map.tab.map")]}),g.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:[g.jsx(Rl,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&g.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:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.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&&g.jsx(m5,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&g.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:g.jsx(kE,{className:"w-3 h-3"})})]}),g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:g.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,d)}%`}})}),g.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[d,"%"]})]}),g.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[g.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:[g.jsx(sp,{className:"w-3 h-3 text-white/50"}),g.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),g.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:[g.jsx(ii,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),g.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&g.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),w&&g.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[g.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:[g.jsx(ii,{className:"w-3 h-3"})," ",t("map.world.study")]}),g.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:[g.jsx(up,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),g.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:g.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[g.jsx("div",{className:"w-1/2 h-full relative",children:g.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:g.jsxs("div",{className:`map-sky-content ${L?`env-${L.season} env-${L.weather}`:""}`,children:[e.streaming&&g.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:[g.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?g.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):g.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:[g.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),g.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),g.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),g.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):T.length===0?g.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(o==="practice"?"map.empty.practice":"map.generating")}):g.jsx("div",{className:"space-y-6 pt-2",children:T.map((P,B)=>g.jsx(u5,{section:P,sectionIndex:B,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:m,physicsWeather:(L==null?void 0:L.weather)??"clear",scrollRef:c,navRef:l,onImpacts:b,onFlakes:E,orbSnowRef:y},P.id))})]})})}),g.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:g.jsx(s5,{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&&g.jsx(nN,{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&&g.jsx(cd,{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 s5({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:i,onCoursesChanged:o}){const s=Ye(),[l,c]=_.useState("url"),[d,f]=_.useState(!1),[m,x]=_.useState(""),[b,p]=_.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,F]=_.useState([]),[,z]=_.useState(0),H=_.useRef(null);_.useEffect(()=>{const K=fe.on("import:progress",J=>{F(se=>{const ke=/\d+\/\d+/.test(J),Pe=se[se.length-1];if(ke&&Pe&&Pe.status==="working"){const ze=[...se];return ze[ze.length-1]={...Pe,msg:J},ze}const Be=se.map(ze=>ze.status==="working"?{...ze,status:"done"}:ze);return Be.push({msg:J,status:"working",ts:Date.now()}),Be})}),$=setInterval(()=>z(J=>J+1),1e3);return()=>{K(),clearInterval($)}},[]),_.useEffect(()=>fe.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?(F([]),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(!(!m.trim()||N)){C(null),R(null),F([]);try{await fe.importGithub(m.trim()),L(!0)}catch(K){C(K instanceof Error?`${K.message}${s("import.error.network")}`:String(K))}}},W=async()=>{if(!(!E.trim()||!w.trim()||N)){L(!0),C(null),R(null);try{const K=await fe.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)}}},ae=async()=>{if(N)return;if(C(null),R(null),F([]),!Yo){const $=b.trim();if(!$){C(s("import.folder.pathRequired"));return}try{await fe.importLocalFolder($)&&L(!0)}catch(J){C(J instanceof Error?J.message:String(J))}return}await fe.importLocalFolder()&&L(!0)},V=async()=>{var $;if(N)return;if(C(null),R(null),F([]),!Yo){($=y.current)==null||$.click();return}await fe.importPack().catch(J=>(C(J instanceof Error?J.message:String(J)),null))&&L(!0)},Y=async K=>{if(!(!K||N)){C(null),R(null),F([]);try{const $=await K.text();await fe.importPack({fileName:K.name,content:$})&&L(!0)}catch($){C($ instanceof Error?$.message:String($))}}},te=async K=>{if(!N){C(null),F([]);try{await fe.importResume(K),L(!0)}catch($){C($ instanceof Error?$.message:String($))}}},U=async K=>{try{const $=await fe.exportPack(K);$!=null&&$.content&&$.fileName?(ie($.fileName,$.content),R(s("import.pack.exported",{path:$.fileName}))):$!=null&&$.path&&R(s("import.pack.exported",{path:$.path}))}catch($){C($ instanceof Error?$.message:String($))}},ie=(K,$)=>{const J=new Blob([$],{type:"application/json"}),se=URL.createObjectURL(J),ke=document.createElement("a");ke.href=se,ke.download=K,ke.click(),setTimeout(()=>URL.revokeObjectURL(se),5e3)};return g.jsxs(g.Fragment,{children:[e.length===0?g.jsxs("div",{className:"text-center py-10",children:[g.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),g.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:s("import.empty")})]}):g.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(K=>{const $=K.id===t;return g.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:[g.jsx("button",{onClick:()=>n(K.id),className:"w-full text-left p-3",children:g.jsxs("div",{className:"flex items-start justify-between gap-2",children:[g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:`text-body font-bold truncate ${$?"text-brand":"text-white/90"}`,children:K.title}),g.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:K.repoName})]}),$&&g.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:g.jsx(Fn,{className:"w-3 h-3 text-white"})})]})}),g.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:[g.jsxs("button",{onClick:J=>{J.stopPropagation(),C(null),R(null),fe.exportPack(K.id).then(se=>{se!=null&&se.content&&se.fileName?(ie(se.fileName,se.content),R(s("import.pack.exported",{path:se.fileName}))):se!=null&&se.path&&R(s("import.pack.exported",{path:se.path}))}).catch(se=>{C(se instanceof Error?se.message:String(se))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[g.jsx(oy,{className:"w-2.5 h-2.5"})," ",s("import.export")]}),g.jsxs("button",{onClick:J=>{J.stopPropagation();const se=J.currentTarget.getBoundingClientRect();i(K.id,K.title,se)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[g.jsx(kE,{className:"w-2.5 h-2.5"})," ",s("import.delete")]})]})]},K.id)})}),g.jsxs("div",{className:e.length>0?"mt-6":"",children:[g.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:[g.jsx(ud,{className:`w-4 h-4 transition-transform ${d?"rotate-45":""}`})," ",s("import.cta")]}),d&&g.jsxs("div",{className:"mt-3 space-y-3",children:[N?g.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[g.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),g.jsx("span",{className:"text-body font-bold text-white/90",children:s("import.progress.title")}),g.jsx("button",{onClick:()=>{fe.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:s("import.progress.cancel")})]}),g.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:s("import.progress.note")}),(l==="url"?m.trim():l==="markdown"&&w.trim())?g.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:l==="url"?m.trim():w.trim()}):null,g.jsx("div",{ref:H,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:Q.length===0?g.jsx("div",{className:"text-caption text-white/50 py-1",children:s("import.progress.starting")}):Q.map((K,$)=>g.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[K.status==="done"?g.jsx(Fn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):g.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"}),g.jsxs("span",{className:K.status==="done"?"text-white/40":"text-white/90",children:[K.msg,K.status==="working"&&g.jsxs("span",{className:"text-white/35 ml-1",children:["(",s("import.progress.elapsed",{s:Math.floor((Date.now()-K.ts)/1e3)}),")"]})]})]},$))})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"@container flex gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:s("import.tab.url"),icon:SC},{k:"markdown",label:s("import.tab.md"),icon:Rl},{k:"folder",label:s("import.tab.folder"),icon:xC},{k:"pack",label:s("import.tab.pack"),icon:oy}].map(({k:K,label:$,icon:J})=>g.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:[g.jsx(J,{className:"w-3 h-3 shrink-0"}),g.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4.4cqi, 0.875rem)"},children:$})]},K))}),l==="url"?g.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[g.jsx("input",{type:"text",value:m,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"}),g.jsx("button",{onClick:G,disabled:!m.trim()||N,"data-testid":"import-url-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.url")})]}):l==="markdown"?g.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[g.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"}),g.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"}),g.jsx("button",{onClick:W,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"?g.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[g.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.folder.desc")}),!Yo&&g.jsx("input",{type:"text",value:b,onChange:K=>p(K.target.value),placeholder:s("import.folder.pathPlaceholder"),"data-testid":"import-folder-path",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),g.jsx("button",{onClick:ae,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")})]}):g.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[g.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.pack.desc")}),!Yo&&g.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=""}}),g.jsx("button",{onClick:V,disabled:N,"data-testid":"import-pack-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.pack")})]})]}),A&&g.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&&g.jsx("button",{onClick:()=>void te(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&&g.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[g.jsx(Fn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(P==null?void 0:P.packable)&&g.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 o5({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:JN(o,s,l,n)},[e,t,n]),g.jsx("canvas",{ref:i,className:"map-sky-canvas","aria-hidden":"true"})}function l5({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 m=null,x=null;const b=()=>{m=null,x=null},p=new MutationObserver(b);p.observe(f,{childList:!0,subtree:!0}),window.addEventListener("resize",b);const E=e5(c,d,n,()=>{var M,N;m||(m=Array.from(f.querySelectorAll(".lesson-bubble")));const T=x??d.getBoundingClientRect();x=T;const w=[];for(const L of m){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(),p.disconnect(),window.removeEventListener("resize",b)}},[e,t,n,i,o]),g.jsx("canvas",{ref:l,className:"map-orb-weather-canvas","aria-hidden":"true"})}function u5({section:e,sectionIndex:t,tree:n,progressMap:i,selectedNodeId:o,dueNodeIds:s,onJumpNode:l,physics:c,physicsWeather:d,scrollRef:f,navRef:m,onImpacts:x,onFlakes:b,orbSnowRef:p}){const y=n.filter(K=>K.parentId===e.id).sort((K,$)=>K.orderIdx-$.orderIdx),E=y.filter(K=>K.type==="lesson"),T=E.length>0&&E.every(K=>{var $;return((($=i[K.id])==null?void 0:$.mastery)??0)>=CE}),w=_.useRef(null),[M,N]=_.useState(268);_.useEffect(()=>{if(!w.current)return;const K=()=>{var se;const J=((se=w.current)==null?void 0:se.clientWidth)??268;N(J>0?J:268)};K();const $=new ResizeObserver(K);return $.observe(w.current),()=>$.disconnect()},[]);const L=dN(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(","),F=y.map(K=>{var $;return(K.type==="exam"?!T:((($=i[K.id])==null?void 0:$.status)??"locked")==="locked")?1:0}).join("");_.useEffect(()=>{var xe,Fe;if(!c||y.length===0||M<=0)return;const K=w.current,$=f.current;if(!K||!$)return;let J;const se=y[y.length-1];if((se==null?void 0:se.type)==="exam"){const je=(Fe=(xe=K.closest("section"))==null?void 0:xe.nextElementSibling)==null?void 0:Fe.querySelector(".map-signpost");je&&(J={x:sc(`${e.id}:next`,M),y:je.getBoundingClientRect().top-K.getBoundingClientRect().top})}const ke=MN({nodes:L.nodes.map((je,me)=>{const Se=y[me];return{id:Se.id,x:je.x,y:je.y,isExam:Se.type==="exam",locked:z(Se),spawn:(()=>{const De=j.current.get(Se.id);return De?RN(De,D.current,M):void 0})()}}),width:M,height:L.height+40,weather:d,anchorKnotX:sc(`${e.id}:knot`,M),nextKnot:J});R.current=ke;const Pe=K.querySelector("[data-next-knot]");Pe&&(ke.nextKnot?(Pe.setAttribute("cx",String(ke.nextKnot.x)),Pe.setAttribute("cy",String(ke.nextKnot.y))):Pe.setAttribute("opacity","0"));const Be=K.querySelector("[data-exam-rope]");Be&&!ke.nextKnot&&Be.setAttribute("opacity","0");const ze=new Map;for(const je of K.querySelectorAll("[data-node-id]"))je.dataset.nodeId&&ze.set(je.dataset.nodeId,je);const St=Array.from(K.querySelectorAll("[data-rope]")),pt=Array.from(K.querySelectorAll("[data-pulse]")),ye=Array.from(K.querySelectorAll("[data-field]"));let Ke=!0;const Ot=new IntersectionObserver(je=>{for(const me of je)Ke=me.isIntersecting},{root:$,rootMargin:"200px 0px 200px 0px"});Ot.observe(K);const Bt=520,zt=[];let ht=0,ln=performance.now();const Rt=je=>{var $e;ht=requestAnimationFrame(Rt);const me=Math.min(50,je-ln);if(ln=je,!Ke)return;ke.step(me);for(const Ne of ke.balls){const et=ze.get(Ne.nodeId);et&&(et.style.transform=vN(Ne.body.position.x-Ne.layoutX,Ne.body.position.y-Ne.layoutY,Ne.squash,Ne.squashAngle)),Ne.squash=yN(Ne.squash,me),($e=p.current)==null||$e.set(Ne.nodeId,Ne.snow)}const Se=Ne=>{if(Ne==="__anchor")return ke.anchor;if(Ne==="__next")return ke.nextKnot??ke.anchor;const et=ke.ball(Ne);if(et)return{x:et.body.position.x,y:et.body.position.y+Ca*ti};const Je=y.findIndex(an=>an.id===Ne),Qe=Je>=0?L.nodes[Je]:void 0;return Qe?{x:Qe.x,y:Qe.y+Ca*ti}:{x:0,y:0}};for(let Ne=0;Ne<ke.links.length&&Ne<St.length;Ne++){const et=ke.links[Ne],Je=[Se(et.from)];for(const Qe of et.particles)Je.push({x:Qe.position.x,y:Qe.position.y});Je.push(Se(et.to)),St[Ne].setAttribute("d",bN(Je))}for(let Ne=0;Ne<ke.balls.length&&Ne<ye.length;Ne++){const et=ke.balls[Ne],Je=ye[Ne];et.field>.03?(Je.setAttribute("cx",String(et.body.position.x)),Je.setAttribute("cy",String(et.body.position.y)),Je.setAttribute("r",String(Ca+4+et.field*5)),Je.setAttribute("opacity",String((.3*et.field).toFixed(3)))):Je.setAttribute("opacity","0")}const De=ke.drainImpacts();for(const Ne of De)zt.push({x:Ne.x,y:Ne.y,t0:je,s:Math.min(1,Ne.speed/14)});for(let Ne=zt.length-1;Ne>=0;Ne--)je-zt[Ne].t0>Bt&&zt.splice(Ne,1);for(let Ne=0;Ne<pt.length;Ne++){const et=zt[Ne],Je=pt[Ne];if(!et){Je.setAttribute("opacity","0");continue}const Qe=(je-et.t0)/Bt;Je.setAttribute("cx",String(et.x)),Je.setAttribute("cy",String(et.y)),Je.setAttribute("r",String(6+Qe*(14+et.s*14))),Je.setAttribute("opacity",String(.55*(1-Qe))),Je.setAttribute("stroke-width",String(2+et.s*1.5))}const Me=ke.drainFlakes();if((De.length>0||Me.length>0)&&m.current){const Ne=K.getBoundingClientRect(),et=m.current.getBoundingClientRect(),Je=Qe=>({x:Qe.x+Ne.left-et.left,y:Qe.y+Ne.top-et.top});De.length>0&&x(De.map(Qe=>({...Je(Qe),speed:Qe.speed}))),Me.length>0&&b(Me.map(Qe=>({...Je(Qe),vx:Qe.vx,vy:Qe.vy,amount:Qe.amount})))}};return ht=requestAnimationFrame(Rt),()=>{cancelAnimationFrame(ht),Ot.disconnect();for(const je of ke.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,ke.dispose(),R.current=null;for(const je of ze.values())je.style.transform=""}},[c,M,Q,F,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(ke=>ke.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,J=R.current;if(!$||!J||K.pointerId!==$.id)return;const se=w.current;if(!se||(!$.dragging&&fy($.track,K.clientX,K.clientY)==="drag"&&($.dragging=!0,K.currentTarget.style.zIndex="40",J.beginDrag($.nodeId,K.clientX-se.getBoundingClientRect().left,K.clientY-se.getBoundingClientRect().top)),!$.dragging))return;const ke=se.getBoundingClientRect();J.moveDrag(K.clientX-ke.left,K.clientY-ke.top)},W=K=>{var J;const $=P.current;if(!(!$||K.pointerId!==$.id)){if((J=R.current)==null||J.endDrag(),K.currentTarget.style.zIndex="",fy($.track,K.clientX,K.clientY)==="drag")B.current=Date.now()+300;else{const se=y.find(ke=>ke.id===$.nodeId);se&&Date.now()>=B.current&&!z(se)&&l(se.id)}P.current=null}},ae=K=>{const $=y[K],J=$?i[$.id]:void 0,se=(J==null?void 0:J.status)==="mastered"||(J==null?void 0:J.status)==="in_progress"||(J==null?void 0:J.status)==="available";return{stroke:se?"var(--brand)":"var(--ink-faint)",strokeWidth:se?4:2.5,strokeOpacity:se?.6:.5,strokeDasharray:se?"none":"3 7"}},V=L.nodes[0]?{x:sc(`${e.id}:knot`,M),y:qc}:{x:M/2,y:qc},Y=y[y.length-1],te=(Y==null?void 0:Y.type)==="exam",U=L.nodes[L.nodes.length-1],ie=te&&U?{x:sc(`${e.id}:next`,M),y:A+24}:void 0;return g.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[g.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[g.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}),g.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})]}),g.jsxs("div",{ref:w,className:"relative",style:{minHeight:A},children:[g.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:A,overflow:"visible"},children:c?g.jsxs(g.Fragment,{children:[L.nodes[0]&&g.jsx("circle",{cx:V.x,cy:V.y,r:3.5,fill:"#ffc800",opacity:.9}),L.nodes[0]&&g.jsx("path",{"data-rope":0,d:`M ${V.x} ${V.y} L ${L.nodes[0].x} ${L.nodes[0].y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ae(0)}),L.segments.map((K,$)=>g.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:ae(K.index)},K.index)),ie&&U&&g.jsxs(g.Fragment,{children:[g.jsx("path",{"data-rope":L.segments.length+1,"data-exam-rope":!0,d:`M ${ie.x} ${ie.y} L ${U.x} ${U.y+Ca*ti}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:ae(y.length-1)}),g.jsx("circle",{"data-next-knot":!0,cx:ie.x,cy:ie.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(K,$)=>g.jsx("circle",{"data-pulse":$,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},$)),y.map((K,$)=>g.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 $=c5(y[K.index],i);return g.jsx("path",{d:fN(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 J=L.nodes[$];if(!J)return null;const se=d0(K.id),ke=`${se%40/10}s`,Pe=`${5+se%30/10}s`;return g.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:J.x-C/2,top:J.y-I/2+10,width:C,...c?{touchAction:"pan-y"}:{"--bob-delay":ke,"--bob-duration":Pe}},onPointerDown:c?Be=>H(Be,K.id):void 0,onPointerMove:c?G:void 0,onPointerUp:c?W:void 0,onPointerCancel:c?W:void 0,children:g.jsx(d5,{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 c5(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 d5({lesson:e,progress:t,isSelected:n,isDue:i,chapterLessonsMastered:o,onClick:s}){const l=Ye(),c=(t==null?void 0:t.status)??"locked",d=(t==null?void 0:t.crownLevel)??0,f=e.type==="exam",m=Math.min(3,d),x=f?!o:c==="locked",b=f&&x,p=!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 g.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[g.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":h5(d>0):f5(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:[p&&g.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[g.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),g.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?g.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):g.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?g.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):c==="mastered"?g.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):c==="in_progress"?g.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}):g.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),i&&!x&&!f&&g.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&&g.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(E=>g.jsx("span",{className:`text-caption ${E<m?"text-gold":"text-white/25"}`,children:"★"},E))}),n&&g.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 f5(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 h5(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function m5({available:e,current:t,onChange:n}){const i=Ye(),[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 g.jsxs("div",{className:"relative shrink-0",children:[g.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:[g.jsx(yC,{className:"w-3 h-3"}),c]}),o&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),g.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:[g.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=>g.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 p5=500,hr=8;function g5(){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]),m=_.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",m,{passive:!0}),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseover",f),document.removeEventListener("mouseout",m)}),[d,f,m]),_.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()}))},p5)},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 p,y,E;if(n.mode==="rect"&&n.rect){const T=n.rect;p=T.left+T.width/2-o.w/2,y=T.top-o.h-6,E="none",y<hr&&(y=T.bottom+6)}else p=n.x,y=n.y-6,E="translate(0, -100%)";return p=Math.min(Math.max(p,hr),Math.max(hr,x-o.w-hr)),y=Math.min(Math.max(y,hr),Math.max(hr,b-o.h-hr)),cp.createPortal(g.jsx("div",{ref:l,style:{position:"fixed",left:p,top:y,transform:E,zIndex:99999,pointerEvents:"none",visibility:o.w?"visible":"hidden",background:"rgb(var(--surface-0-rgb) / 0.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:"var(--ink)",border:"1px solid rgb(var(--border-rgb) / 0.5)",fontSize:"0.875rem",fontWeight:600,lineHeight:1.4,padding:"4px 10px",borderRadius:"8px",maxWidth:"260px",wordBreak:"break-word",boxShadow:"0 4px 12px rgb(var(--shadow-rgb) / 0.15)",whiteSpace:"normal"},children:e}),document.body)}function vy(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 zE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const x5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y5={};function Ey(e,t){return(y5.jsx?b5:x5).test(e)}const v5=/[ \t\n\f\r]/g;function E5(e){return typeof e=="object"?e.type==="text"?Ty(e.value):!1:Ty(e)}function Ty(e){return e.replace(v5,"")===""}class Ll{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ll.prototype.normal={};Ll.prototype.property={};Ll.prototype.space=void 0;function UE(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Ll(n,i,t)}function Tl(e){return e.toLowerCase()}class 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 T5=0;const Ge=Ir(),Wt=Ir(),h0=Ir(),Ce=Ir(),wt=Ir(),_r=Ir(),Hn=Ir();function Ir(){return 2**++T5}const m0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:Wt,commaOrSpaceSeparated:Hn,commaSeparated:_r,number:Ce,overloadedBoolean:h0,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),um=Object.keys(m0);class hp extends Dn{constructor(t,n,i,o){let s=-1;if(super(t,n),Sy(this,"space",o),typeof i=="number")for(;++s<um.length;){const l=um[s];Sy(this,um[s],(i&m0[l])===m0[l])}}}hp.prototype.defined=!0;function Sy(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 hp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Tl(i)]=i,n[Tl(s.attribute)]=i}return new Ll(t,n,e.space)}const HE=Hs({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:wt,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:Ce,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:wt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Wt,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 FE(e,t){return t in e?e[t]:t}function VE(e,t){return FE(e,t.toLowerCase())}const S5=Hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_r,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alpha:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:wt,autoFocus:Ge,autoPlay:Ge,blocking:wt,capture:null,charSet:null,checked:Ge,cite:null,className:wt,closedBy:null,colorSpace:null,cols:Ce,colSpan:Ce,command:null,commandFor:null,content:null,contentEditable:Wt,controls:Ge,controlsList:wt,coords:Ce|_r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:h0,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:wt,height:Ce,hidden:h0,high:Ce,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:wt,itemRef:wt,itemScope:Ge,itemType:wt,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:wt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:wt,required:Ge,reversed:Ge,rows:Ce,rowSpan:Ce,sandbox:wt,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:Wt,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:Wt,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,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:Wt,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:wt,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:VE}),k5=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:wt,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:wt,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:FE}),qE=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()}}),YE=Hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VE}),GE=Hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),w5={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"},A5=/[A-Z]/g,ky=/-[a-z]/g,C5=/^data[-\w.:]+$/i;function md(e,t){const n=Tl(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"&&C5.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(ky,_5);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!ky.test(s)){let l=s.replace(A5,N5);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=hp}return new o(i,t)}function N5(e){return"-"+e.toLowerCase()}function _5(e){return e.charAt(1).toUpperCase()}const Ol=UE([HE,S5,qE,YE,GE],"html"),Hi=UE([HE,k5,qE,YE,GE],"svg");function wy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function XE(e){return e.join(" ").trim()}var Ts={},cm,Ay;function M5(){if(Ay)return cm;Ay=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=`
510
- `,f="/",m="*",x="",b="comment",p="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(F){var z=F.match(t);z&&(M+=z.length);var H=F.lastIndexOf(d);N=~H?F.length-H:N+F.length}function A(){var F={line:M,column:N};return function(z){return z.position=new C(F),j(),z}}function C(F){this.start=F,this.end={line:M,column:N},this.source=w.source}C.prototype.content=T;function I(F){var z=new Error(w.source+":"+M+":"+N+": "+F);if(z.reason=F,z.filename=w.source,z.line=M,z.column=N,z.source=T,!w.silent)throw z}function R(F){var z=F.exec(T);if(z){var H=z[0];return L(H),T=T.slice(H.length),z}}function j(){R(n)}function D(F){var z;for(F=F||[];z=P();)z!==!1&&F.push(z);return F}function P(){var F=A();if(!(f!=T.charAt(0)||m!=T.charAt(1))){for(var z=2;x!=T.charAt(z)&&(m!=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,F({type:b,comment:H})}}function B(){var F=A(),z=R(i);if(z){if(P(),!R(o))return I("property missing ':'");var H=R(s),G=F({type:p,property:E(z[0].replace(e,x)),value:H?E(H[0].replace(e,x)):x});return R(l),G}}function Q(){var F=[];D(F);for(var z;z=B();)z!==!1&&(F.push(z),D(F));return F}return j(),Q()}function E(T){return T?T.replace(c,x):x}return cm=y,cm}var Cy;function R5(){if(Cy)return Ts;Cy=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(M5());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:m}=d;c?o(f,m,d):m&&(s=s||{},s[f]=m)}),s}return Ts}var Ko={},Ny;function D5(){if(Ny)return Ko;Ny=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,m){return m.toUpperCase()},c=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),s(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,c):f=f.replace(i,c),f.replace(t,l))};return Ko.camelCase=d,Ko}var $o,_y;function L5(){if(_y)return $o;_y=1;var e=$o&&$o.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(R5()),n=D5();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,$o=i,$o}var O5=L5();const I5=Ml(O5),pd=KE("end"),Da=KE("start");function KE(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=pd(e);if(t&&n)return{start:t,end:n}}function sl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?My(e.position):"start"in e||"end"in e?My(e):"line"in e||"column"in e?p0(e):""}function p0(e){return Ry(e&&e.line)+":"+Ry(e&&e.column)}function My(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function Ry(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=sl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}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 mp={}.hasOwnProperty,j5=new Map,P5=/[A-Z]/g,B5=new Set(["table","tbody","thead","tfoot","tr"]),z5=new Set(["td","th"]),QE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function U5(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=K5(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=X5(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hi:Ol,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=WE(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function WE(e,t,n){if(t.type==="element")return H5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return F5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q5(e,t,n);if(t.type==="mdxjsEsm")return V5(e,t);if(t.type==="root")return Y5(e,t,n);if(t.type==="text")return G5(e,t)}function H5(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=JE(e,t.tagName,!1),l=$5(e,t);let c=gp(e,t);return B5.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!E5(d):!0})),ZE(e,l,s,t),pp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function F5(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Sl(e,t.position)}function V5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Sl(e,t.position)}function q5(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:JE(e,t.name,!0),l=Q5(e,t),c=gp(e,t);return ZE(e,l,s,t),pp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function Y5(e,t,n){const i={};return pp(i,gp(e,t)),e.create(t,e.Fragment,i,n)}function G5(e,t){return t.value}function ZE(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function pp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function X5(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 K5(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 $5(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&mp.call(t.properties,o)){const s=W5(e,o,t.properties[o]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&z5.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 Q5(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Sl(e,t.position);else{const o=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else Sl(e,t.position);else s=i.value===null?!0:i.value;n[o]=s}return n}function gp(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:j5;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=WE(e,s,l);c!==void 0&&n.push(c)}return n}function W5(e,t,n){const i=md(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?zE(n):XE(n)),i.property==="style"){let o=typeof n=="object"?n:Z5(e,String(n));return e.stylePropertyNameCase==="css"&&(o=J5(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?w5[i.property]||i.property:i.attribute,n]}}function Z5(e,t){try{return I5(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=QE+"#cannot-parse-style-attribute",o}}function JE(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=Ey(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=Ey(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return mp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Sl(e)}function Sl(e,t){const n=new 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=QE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function J5(e){const t={};let n;for(n in e)mp.call(e,n)&&(t[e_(n)]=e[n]);return t}function e_(e){let t=e.replace(P5,t_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function t_(e){return"-"+e.toLowerCase()}const dm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},n_={};function xp(e,t){const n=n_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return eT(e,i,o)}function eT(e,t,n){if(a_(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 Dy(e.children,t,n)}return Array.isArray(e)?Dy(e,t,n):""}function Dy(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=eT(e[o],t,n);return i.join("")}function a_(e){return!!(e&&typeof e=="object")}const Ly=document.createElement("i");function bp(e){const t="&"+e+";";Ly.innerHTML=t;const n=Ly.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 Oy={}.hasOwnProperty;function tT(e){const t={};let n=-1;for(;++n<e.length;)i_(t,e[n]);return t}function i_(e,t){let n;for(n in t){const o=(Oy.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){Oy.call(o,l)||(o[l]=[]);const c=s[l];r_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function r_(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 nT(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]/),s_=Fi(/[#-'*+\--9=?A-Z^-~]/);function Yc(e){return e!==null&&(e<32||e===127)}const g0=Fi(/\d/),o_=Fi(/[\dA-Fa-f]/),l_=Fi(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function Nt(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const gd=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 ut(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return it(d)?(e.enter(n),c(d)):t(d)}function c(d){return it(d)&&s++<o?(e.consume(d),c):(e.exit(n),t(d))}}const u_={tokenize:c_};function c_(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"),ut(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 Ve(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const d_={tokenize:f_},Iy={tokenize:h_};function f_(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(Iy,m,x)(N)}function m(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(Iy,p,y)(N)}function p(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 Ve(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 h_(e,t,n){return ut(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||Nt(e)||Lr(e))return 1;if(gd(e))return 2}function xd(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const x0={name:"attention",resolveAll:m_,tokenize:p_};function m_(e,t){let n=-1,i,o,s,l,c,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[i][1].end},b={...e[n][1].start};jy(x,-d),jy(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,xd(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?(m=2,f=ia(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Vn(e,i-1,n-i+3,f),n=i+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function p_(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"),m=js(d),x=!m||m===2&&o||n.includes(d),b=!o||o===2&&m||n.includes(i);return f._open=!!(s===42?x:x&&(o||!b)),f._close=!!(s===42?b:b&&(m||!x)),t(d)}}function jy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const g_={name:"autolink",tokenize:x_};function x_(e,t,n){let i=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return vn(p)?(e.consume(p),l):p===64?n(p):f(p)}function l(p){return p===43||p===45||p===46||gn(p)?(i=1,c(p)):f(p)}function c(p){return p===58?(e.consume(p),i=0,d):(p===43||p===45||p===46||gn(p))&&i++<32?(e.consume(p),c):(i=0,f(p))}function d(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Yc(p)?n(p):(e.consume(p),d)}function f(p){return p===64?(e.consume(p),m):s_(p)?(e.consume(p),f):n(p)}function m(p){return gn(p)?x(p):n(p)}function x(p){return p===46?(e.consume(p),i=0,m):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):b(p)}function b(p){if((p===45||gn(p))&&i++<63){const y=p===45?b:x;return e.consume(p),y}return n(p)}}const Il={partial:!0,tokenize:b_};function b_(e,t,n){return i;function i(s){return it(s)?ut(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ve(s)?t(s):n(s)}}const aT={continuation:{tokenize:v_},exit:E_,name:"blockQuote",tokenize:y_};function y_(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 it(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function v_(e,t,n){const i=this;return o;function o(l){return it(l)?ut(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(aT,t,n)(l)}}function E_(e){e.exit("blockQuote")}const iT={name:"characterEscape",tokenize:T_};function T_(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 l_(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const rT={name:"characterReference",tokenize:S_};function S_(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,m(x))}function f(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=o_,m):(e.enter("characterReferenceValue"),s=7,l=g0,m(x))}function m(x){if(x===59&&o){const b=e.exit("characterReferenceValue");return l===gn&&!bp(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),m):n(x)}}const Py={partial:!0,tokenize:w_},By={concrete:!0,name:"codeFenced",tokenize:k_};function k_(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"),m(C)}function m(C){return C===c?(l++,e.consume(C),m):l<3?n(C):(e.exit("codeFencedFenceSequence"),it(C)?ut(e,x,"whitespace")(C):x(C))}function x(C){return C===null||Ve(C)?(e.exit("codeFencedFence"),i.interrupt?t(C):e.check(Py,E,L)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===null||Ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(C)):it(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,p,"whitespace")(C)):C===96&&C===c?n(C):(e.consume(C),b)}function p(C){return C===null||Ve(C)?x(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||Ve(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&&it(C)?ut(e,M,"linePrefix",s+1)(C):M(C)}function M(C){return C===null||Ve(C)?e.check(Py,E,L)(C):(e.enter("codeFlowValue"),N(C))}function N(C){return C===null||Ve(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"),it(z)?ut(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"),it(z)?ut(C,F,"whitespace")(z):F(z)):R(z)}function F(z){return z===null||Ve(z)?(C.exit("codeFencedFence"),I(z)):R(z)}}}function w_(e,t,n){const i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const fm={name:"codeIndented",tokenize:C_},A_={partial:!0,tokenize:N_};function C_(e,t,n){const i=this;return o;function o(f){return e.enter("codeIndented"),ut(e,s,"linePrefix",5)(f)}function s(f){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ve(f)?e.attempt(A_,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ve(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function N_(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Ve(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ut(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):Ve(l)?o(l):n(l)}}const __={name:"codeText",previous:R_,resolve:M_,tokenize:D_};function M_(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 R_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function D_(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,m(x)):Ve(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||Ve(x)?(e.exit("codeTextData"),d(x)):(e.consume(x),f)}function m(x){return x===96?(e.consume(x),o++,m):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(s.type="codeTextData",f(x))}}class L_{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&&Qo(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),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(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);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(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 sT(e){const t={};let n=-1,i,o,s,l,c,d,f;const m=new L_(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,O_(m,n)),n=t[n],f=!0);else if(i[1]._container){for(s=n,o=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(i[1].end={...m.get(o)[1].start},c=m.slice(o,n),c.unshift(i),m.splice(o,n-o+1,c))}}return Vn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function O_(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 m,x,b=-1,p=n,y=0,E=0;const T=[E];for(;p;){for(;e.get(++o)[1]!==p;);s.push(o),p._tokenizer||(m=i.sliceStream(p),p.next||m.push(null),x&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=p,p=p.next}for(p=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(E=b+1,T.push(E),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):T.pop(),b=T.length;b--;){const 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 I_={resolve:P_,tokenize:B_},j_={partial:!0,tokenize:z_};function P_(e){return sT(e),e}function B_(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):Ve(c)?e.check(j_,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 z_(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ut(e,s,"linePrefix")}function s(l){if(l===null||Ve(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 oT(e,t,n,i,o,s,l,c,d){const f=d||Number.POSITIVE_INFINITY;let m=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||Yc(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"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(c),b(w)):w===null||w===60||Ve(w)?n(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function E(w){return!m&&(w===null||w===41||Nt(w))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(w)):m<f&&w===40?(e.consume(w),m++,E):w===41?(e.consume(w),m--,E):w===null||w===32||w===40||Yc(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 lT(e,t,n,i,o,s){const l=this;let c=0,d;return f;function f(p){return e.enter(i),e.enter(o),e.consume(p),e.exit(o),e.enter(s),m}function m(p){return c>999||p===null||p===91||p===93&&!d||p===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(s),e.enter(o),e.consume(p),e.exit(o),e.exit(i),t):Ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),x(p))}function x(p){return p===null||p===91||p===93||Ve(p)||c++>999?(e.exit("chunkString"),m(p)):(e.consume(p),d||(d=!it(p)),p===92?b:x)}function b(p){return p===91||p===92||p===93?(e.consume(p),c++,x):x(p)}}function uT(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):Ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ut(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||Ve(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?x:m)}function x(b){return b===l||b===92?(e.consume(b),m):m(b)}}function ol(e,t){let n;return i;function i(o){return Ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):it(o)?ut(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const U_={name:"definition",tokenize:F_},H_={partial:!0,tokenize:V_};function F_(e,t,n){const i=this;let o;return s;function s(p){return e.enter("definition"),l(p)}function l(p){return lT.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function c(p){return o=xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),d):n(p)}function d(p){return Nt(p)?ol(e,f)(p):f(p)}function f(p){return oT(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function m(p){return e.attempt(H_,x,x)(p)}function x(p){return it(p)?ut(e,b,"whitespace")(p):b(p)}function b(p){return p===null||Ve(p)?(e.exit("definition"),i.parser.defined.push(o),t(p)):n(p)}}function V_(e,t,n){return i;function i(c){return Nt(c)?ol(e,o)(c):n(c)}function o(c){return uT(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return it(c)?ut(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ve(c)?t(c):n(c)}}const q_={name:"hardBreakEscape",tokenize:Y_};function Y_(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ve(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const G_={name:"headingAtx",resolve:X_,tokenize:K_};function X_(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 K_(e,t,n){let i=0;return o;function o(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(e.consume(m),l):m===null||Nt(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ve(m)?(e.exit("atxHeading"),t(m)):it(m)?ut(e,c,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function f(m){return m===null||m===35||Nt(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),f)}}const $_=["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"],zy=["pre","script","style","textarea"],Q_={concrete:!0,name:"htmlFlow",resolveTo:J_,tokenize:e4},W_={partial:!0,tokenize:n4},Z_={partial:!0,tokenize:t4};function J_(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 e4(e,t,n){const i=this;let o,s,l,c,d;return f;function f(U){return m(U)}function m(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:V):vn(U)?(e.consume(U),l=String.fromCharCode(U),T):n(U)}function b(U){return U===45?(e.consume(U),o=2,p):U===91?(e.consume(U),o=5,c=0,y):vn(U)?(e.consume(U),o=4,i.interrupt?t:V):n(U)}function p(U){return U===45?(e.consume(U),i.interrupt?t:V):n(U)}function y(U){const ie="CDATA[";return U===ie.charCodeAt(c++)?(e.consume(U),c===ie.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||Nt(U)){const ie=U===47,K=l.toLowerCase();return!ie&&!s&&zy.includes(K)?(o=1,i.interrupt?t(U):B(U)):$_.includes(l.toLowerCase())?(o=6,ie?(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 it(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):it(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):it(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):it(U)?(e.consume(U),C):R(U)}function I(U){return U===d?(e.consume(U),d=null,j):U===null||Ve(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||Nt(U)?A(U):(e.consume(U),R)}function j(U){return U===47||U===62||it(U)?N(U):n(U)}function D(U){return U===62?(e.consume(U),P):n(U)}function P(U){return U===null||Ve(U)?B(U):it(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),V):U===93&&o===5?(e.consume(U),ae):Ve(U)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(W_,te,Q)(U)):U===null||Ve(U)?(e.exit("htmlFlowData"),Q(U)):(e.consume(U),B)}function Q(U){return e.check(Z_,F,te)(U)}function F(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),z}function z(U){return U===null||Ve(U)?Q(U):(e.enter("htmlFlowData"),B(U))}function H(U){return U===45?(e.consume(U),V):B(U)}function G(U){return U===47?(e.consume(U),l="",W):B(U)}function W(U){if(U===62){const ie=l.toLowerCase();return zy.includes(ie)?(e.consume(U),Y):B(U)}return vn(U)&&l.length<8?(e.consume(U),l+=String.fromCharCode(U),W):B(U)}function ae(U){return U===93?(e.consume(U),V):B(U)}function V(U){return U===62?(e.consume(U),Y):U===45&&o===2?(e.consume(U),V):B(U)}function Y(U){return U===null||Ve(U)?(e.exit("htmlFlowData"),te(U)):(e.consume(U),Y)}function te(U){return e.exit("htmlFlow"),t(U)}}function t4(e,t,n){const i=this;return o;function o(l){return Ve(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 n4(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Il,t,n)}}const a4={name:"htmlText",tokenize:i4};function i4(e,t,n){const i=this;let o,s,l;return c;function c(V){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(V),d}function d(V){return V===33?(e.consume(V),f):V===47?(e.consume(V),A):V===63?(e.consume(V),N):vn(V)?(e.consume(V),R):n(V)}function f(V){return V===45?(e.consume(V),m):V===91?(e.consume(V),s=0,y):vn(V)?(e.consume(V),M):n(V)}function m(V){return V===45?(e.consume(V),p):n(V)}function x(V){return V===null?n(V):V===45?(e.consume(V),b):Ve(V)?(l=x,G(V)):(e.consume(V),x)}function b(V){return V===45?(e.consume(V),p):x(V)}function p(V){return V===62?H(V):V===45?b(V):x(V)}function y(V){const Y="CDATA[";return V===Y.charCodeAt(s++)?(e.consume(V),s===Y.length?E:y):n(V)}function E(V){return V===null?n(V):V===93?(e.consume(V),T):Ve(V)?(l=E,G(V)):(e.consume(V),E)}function T(V){return V===93?(e.consume(V),w):E(V)}function w(V){return V===62?H(V):V===93?(e.consume(V),w):E(V)}function M(V){return V===null||V===62?H(V):Ve(V)?(l=M,G(V)):(e.consume(V),M)}function N(V){return V===null?n(V):V===63?(e.consume(V),L):Ve(V)?(l=N,G(V)):(e.consume(V),N)}function L(V){return V===62?H(V):N(V)}function A(V){return vn(V)?(e.consume(V),C):n(V)}function C(V){return V===45||gn(V)?(e.consume(V),C):I(V)}function I(V){return Ve(V)?(l=I,G(V)):it(V)?(e.consume(V),I):H(V)}function R(V){return V===45||gn(V)?(e.consume(V),R):V===47||V===62||Nt(V)?j(V):n(V)}function j(V){return V===47?(e.consume(V),H):V===58||V===95||vn(V)?(e.consume(V),D):Ve(V)?(l=j,G(V)):it(V)?(e.consume(V),j):H(V)}function D(V){return V===45||V===46||V===58||V===95||gn(V)?(e.consume(V),D):P(V)}function P(V){return V===61?(e.consume(V),B):Ve(V)?(l=P,G(V)):it(V)?(e.consume(V),P):j(V)}function B(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(e.consume(V),o=V,Q):Ve(V)?(l=B,G(V)):it(V)?(e.consume(V),B):(e.consume(V),F)}function Q(V){return V===o?(e.consume(V),o=void 0,z):V===null?n(V):Ve(V)?(l=Q,G(V)):(e.consume(V),Q)}function F(V){return V===null||V===34||V===39||V===60||V===61||V===96?n(V):V===47||V===62||Nt(V)?j(V):(e.consume(V),F)}function z(V){return V===47||V===62||Nt(V)?j(V):n(V)}function H(V){return V===62?(e.consume(V),e.exit("htmlTextData"),e.exit("htmlText"),t):n(V)}function G(V){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),W}function W(V){return it(V)?ut(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):ae(V)}function ae(V){return e.enter("htmlTextData"),l(V)}}const yp={name:"labelEnd",resolveAll:l4,resolveTo:u4,tokenize:c4},r4={tokenize:d4},s4={tokenize:f4},o4={tokenize:h4};function l4(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 u4(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}},m={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",m,t]]),c=ia(c,xd(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=ia(c,[["exit",m,t],e[l-2],e[l-1],["exit",f,t]]),c=ia(c,e.slice(l+1)),c=ia(c,[["exit",d,t]]),Vn(e,s,e.length,c),e}function c4(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(r4,m,l?m:x)(b):b===91?e.attempt(s4,m,l?f:x)(b):l?m(b):x(b)}function f(b){return e.attempt(o4,m,x)(b)}function m(b){return t(b)}function x(b){return s._balanced=!0,n(b)}}function d4(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 Nt(x)?ol(e,s)(x):s(x)}function s(x){return x===41?m(x):oT(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Nt(x)?ol(e,d)(x):m(x)}function c(x){return n(x)}function d(x){return x===34||x===39||x===40?uT(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):m(x)}function f(x){return Nt(x)?ol(e,m)(x):m(x)}function m(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function f4(e,t,n){const i=this;return o;function o(c){return lT.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 h4(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 m4={name:"labelStartImage",resolveAll:yp.resolveAll,tokenize:p4};function p4(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 g4={name:"labelStartLink",resolveAll:yp.resolveAll,tokenize:x4};function x4(e,t,n){const i=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const hm={name:"lineEnding",tokenize:b4};function b4(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:y4};function y4(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||Ve(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),i++,d):(e.exit("thematicBreakSequence"),it(f)?ut(e,c,"whitespace")(f):c(f))}}const Rn={continuation:{tokenize:S4},exit:w4,name:"list",tokenize:T4},v4={partial:!0,tokenize:A4},E4={partial:!0,tokenize:k4};function T4(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(p){const y=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:g0(p)){if(i.containerState.type||(i.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Nc,n,f)(p):f(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(p)}return n(p)}function d(p){return g0(p)&&++l<10?(e.consume(p),d):(!i.interrupt||l<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),f(p)):n(p)}function f(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(Il,i.interrupt?n:m,e.attempt(v4,b,x))}function m(p){return i.containerState.initialBlankLine=!0,s++,b(p)}function x(p){return it(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),b):n(p)}function b(p){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function S4(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Il,o,s);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ut(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!it(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(E4,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,ut(e,e.attempt(Rn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function k4(e,t,n){const i=this;return ut(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 w4(e){e.exit(this.containerState.type)}function A4(e,t,n){const i=this;return ut(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!it(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Uy={name:"setextUnderline",resolveTo:C4,tokenize:N4};function C4(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 N4(e,t,n){const i=this;let o;return s;function s(f){let m=i.events.length,x;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){x=i.events[m][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"),it(f)?ut(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ve(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const _4={tokenize:M4};function M4(e){const t=this,n=e.attempt(Il,i,e.attempt(this.parser.constructs.flowInitial,o,ut(e,e.attempt(this.parser.constructs.flow,o,e.attempt(I_,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 R4={resolveAll:dT()},D4=cT("string"),L4=cT("text");function cT(e){return{resolveAll:dT(e==="text"?O4:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,l,c);return l;function l(m){return f(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const x=o[m];let b=-1;if(x)for(;++b<x.length;){const p=x[b];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function dT(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 O4(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 I4={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:aT},j4={91:U_},P4={[-2]:fm,[-1]:fm,32:fm},B4={35:G_,42:Nc,45:[Uy,Nc],60:Q_,61:Uy,95:Nc,96:By,126:By},z4={38:rT,92:iT},U4={[-5]:hm,[-4]:hm,[-3]:hm,33:m4,38:rT,42:x0,60:[g_,a4],91:g4,92:[q_,iT],93:yp,95:x0,96:__},H4={null:[x0,R4]},F4={null:[42,95]},V4={null:[]},q4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F4,contentInitial:j4,disable:V4,document:I4,flow:B4,flowInitial:P4,insideSpan:H4,string:z4,text:U4},Symbol.toStringTag,{value:"Module"}));function Y4(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:p,write:x};let m=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=xd(s,f.events,f),f.events)}function b(P,B){return X4(p(P),B)}function p(P){return G4(l,P)}function y(){const{_bufferIndex:P,_index:B,line:Q,column:F,offset:z}=i;return{_bufferIndex:P,_index:B,line:Q,column:F,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){m=m(P)}function M(P){Ve(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(F,z,H){let G,W,ae,V;return Array.isArray(F)?te(F):"tokenize"in F?te([F]):Y(F);function Y($){return J;function J(se){const ke=se!==null&&$[se],Pe=se!==null&&$.null,Be=[...Array.isArray(ke)?ke:ke?[ke]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return te(Be)(se)}}function te($){return G=$,W=0,$.length===0?H:U($[W])}function U($){return J;function J(se){return V=j(),ae=$,$.partial||(f.currentConstruct=$),$.name&&f.parser.constructs.disable.null.includes($.name)?K():$.tokenize.call(B?Object.assign(Object.create(f),B):f,d,ie,K)(se)}}function ie($){return P(ae,V),z}function K($){return V.restore(),++W<G.length?U(G[W]):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,F=f.events.length,z=Array.from(c);return{from:F,restore:H};function H(){i=P,f.previous=B,f.currentConstruct=Q,f.events.length=F,c=z,D()}}function D(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function G4(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 X4(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=`
511
- `;break}case-3:{l=`\r
512
- `;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 K4(e){const i={constructs:tT([q4,...(e||{}).extensions||[]]),content:o(u_),defined:[],document:o(d_),flow:o(_4),lazy:{},string:o(D4),text:o(L4)};return i;function o(s){return l;function l(c){return Y4(i,s,c)}}}function $4(e){for(;!sT(e););return e}const Hy=/[\0\t\n\r]/g;function Q4(){let e=1,t="",n=!0,i;return o;function o(s,l,c){const d=[];let f,m,x,b,p;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(Hy.lastIndex=x,f=Hy.exec(s),b=f&&f.index!==void 0?f.index:s.length,p=s.charCodeAt(b),!f){t=s.slice(x);break}if(p===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),p){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}x=b+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const W4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z4(e){return e.replace(W4,J4)}function J4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return nT(n.slice(s?2:1),s?16:10)}return bp(n)||e}const fT={}.hasOwnProperty;function e6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),t6(n)($4(K4(n).document().write(Q4()(e,t,!0))))}function t6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(zt),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(ye),blockQuote:s(Pe),characterEscape:j,characterReference:j,codeFenced:s(Be),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Be,l),codeText:s(ze,l),codeTextData:j,data:j,codeFlowValue:j,definition:s(St),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(pt),hardBreakEscape:s(Ke),hardBreakTrailing:s(Ke),htmlFlow:s(Ot,l),htmlFlowData:j,htmlText:s(Ot,l),htmlTextData:j,image:s(Bt),label:l,link:s(zt),listItem:s(ln),listItemValue:b,listOrdered:s(ht,x),listUnordered:s(ht),paragraph:s(Rt),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ye),strong:s(xe),thematicBreak:s(je)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:ke,autolinkProtocol:se,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:$,characterReference:J,codeFenced:d(T),codeFencedFence:E,codeFencedFenceInfo:p,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(F),htmlTextData:D,image:d(G),label:ae,labelText:W,lineEnding:P,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ie,resourceDestinationString:V,resourceTitleString:Y,resource:te,setextHeading:d(R),setextHeadingLineSequence:I,setextHeadingText:C,strong:d(),thematicBreak:d()}};hT(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(me){let Se={type:"root",children:[]};const De={stack:[Se],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:m,data:n},Me=[];let $e=-1;for(;++$e<me.length;)if(me[$e][1].type==="listOrdered"||me[$e][1].type==="listUnordered")if(me[$e][0]==="enter")Me.push($e);else{const Ne=Me.pop();$e=o(me,Ne,$e)}for($e=-1;++$e<me.length;){const Ne=t[me[$e][0]];fT.call(Ne,me[$e][1].type)&&Ne[me[$e][1].type].call(Object.assign({sliceSerialize:me[$e][2].sliceSerialize},De),me[$e][1])}if(De.tokenStack.length>0){const Ne=De.tokenStack[De.tokenStack.length-1];(Ne[1]||Fy).call(De,void 0,Ne[0])}for(Se.position={start:Di(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:Di(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)Se=t.transforms[$e](Se)||Se;return Se}function o(me,Se,De){let Me=Se-1,$e=-1,Ne=!1,et,Je,Qe,an;for(;++Me<=De;){const gt=me[Me];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?$e++:$e--,an=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(et&&!an&&!$e&&!Qe&&(Qe=Me),an=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:an=void 0}if(!$e&&gt[0]==="enter"&&gt[1].type==="listItemPrefix"||$e===-1&&gt[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(et){let Yn=Me;for(Je=void 0;Yn--;){const ot=me[Yn];if(ot[1].type==="lineEnding"||ot[1].type==="lineEndingBlank"){if(ot[0]==="exit")continue;Je&&(me[Je][1].type="lineEndingBlank",Ne=!0),ot[1].type="lineEnding",Je=Yn}else if(!(ot[1].type==="linePrefix"||ot[1].type==="blockQuotePrefix"||ot[1].type==="blockQuotePrefixWhitespace"||ot[1].type==="blockQuoteMarker"||ot[1].type==="listItemIndent"))break}Qe&&(!Je||Qe<Je)&&(et._spread=!0),et.end=Object.assign({},Je?me[Je][1].start:gt[1].end),me.splice(Je||Me,0,["exit",et,gt[2]]),Me++,De++}if(gt[1].type==="listItemPrefix"){const Yn={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};et=Yn,me.splice(Me,0,["enter",Yn,gt[2]]),Me++,De++,Qe=void 0,an=!0}}}return me[Se][1]._spread=Ne,De}function s(me,Se){return De;function De(Me){c.call(this,me(Me),Me),Se&&Se.call(this,Me)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(me,Se,De){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([Se,De||void 0]),me.position={start:Di(Se.start),end:void 0}}function d(me){return Se;function Se(De){me&&me.call(this,De),f.call(this,De)}}function f(me,Se){const De=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==me.type&&(Se?Se.call(this,me,Me[0]):(Me[1]||Fy).call(this,me,Me[0]));else throw new Error("Cannot close `"+me.type+"` ("+sl({start:me.start,end:me.end})+"): it’s not open");De.position.end=Di(me.end)}function m(){return xp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(me){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function p(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=me}function y(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=me}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/(\r?\n|\r)$/g,"")}function M(me){const Se=this.resume(),De=this.stack[this.stack.length-1];De.label=Se,De.identifier=xa(this.sliceSerialize(me)).toLowerCase()}function N(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function L(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function A(me){const Se=this.stack[this.stack.length-1];if(!Se.depth){const De=this.sliceSerialize(me).length;Se.depth=De}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function I(me){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function j(me){const De=this.stack[this.stack.length-1].children;let Me=De[De.length-1];(!Me||Me.type!=="text")&&(Me=Fe(),Me.position={start:Di(me.start),end:void 0},De.push(Me)),this.stack.push(Me)}function D(me){const Se=this.stack.pop();Se.value+=this.sliceSerialize(me),Se.position.end=Di(me.end)}function P(me){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Se.children[Se.children.length-1];De.position.end=Di(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(j.call(this,me),D.call(this,me))}function B(){this.data.atHardBreak=!0}function Q(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function F(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function z(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function H(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function G(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function W(me){const Se=this.sliceSerialize(me),De=this.stack[this.stack.length-2];De.label=Z4(Se),De.identifier=xa(Se).toLowerCase()}function ae(){const me=this.stack[this.stack.length-1],Se=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Me=me.children;De.children=Me}else De.alt=Se}function V(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function Y(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function te(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function ie(me){const Se=this.resume(),De=this.stack[this.stack.length-1];De.label=Se,De.identifier=xa(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function K(me){this.data.characterReferenceType=me.type}function $(me){const Se=this.sliceSerialize(me),De=this.data.characterReferenceType;let Me;De?(Me=nT(Se,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=bp(Se);const $e=this.stack[this.stack.length-1];$e.value+=Me}function J(me){const Se=this.stack.pop();Se.position.end=Di(me.end)}function se(me){D.call(this,me);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(me)}function ke(me){D.call(this,me);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(me)}function Pe(){return{type:"blockquote",children:[]}}function Be(){return{type:"code",lang:null,meta:null,value:""}}function ze(){return{type:"inlineCode",value:""}}function St(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pt(){return{type:"emphasis",children:[]}}function ye(){return{type:"heading",depth:0,children:[]}}function Ke(){return{type:"break"}}function Ot(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function zt(){return{type:"link",title:null,url:"",children:[]}}function ht(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function ln(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function Rt(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function je(){return{type:"thematicBreak"}}}function Di(e){return{line:e.line,column:e.column,offset:e.offset}}function hT(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?hT(e,i):n6(e,i)}}function n6(e,t){let n;for(n in t)if(fT.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 Fy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is still open")}function a6(e){const t=this;t.parser=n;function n(i){return e6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function i6(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 r6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
513
- `}]}function s6(e,t){const n=t.value?t.value+`
514
- `:"",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 o6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u6(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 c6(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 d6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mT(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 f6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return mT(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 h6(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 m6(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 p6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return mT(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 g6(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 x6(e,t,n){const i=e.all(t),o=n?b6(n):pT(t),s={},l=[];if(typeof t.checked=="boolean"){const m=i[0];let x;m&&m.type==="element"&&m.tagName==="p"?x=m:(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 m=i[c];(o||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
515
- `}),m.type==="element"&&m.tagName==="p"&&!o?l.push(...m.children):l.push(m)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
516
- `});const f={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,f),e.applyData(t,f)}function b6(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=pT(n[i])}return t}function pT(e){const t=e.spread;return t??e.children.length>1}function y6(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 v6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function T6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Da(t.children[1]),d=pd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function k6(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={},p=l?l[d]:void 0;p&&(b.align=p);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 m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function w6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Vy=9,qy=32;function A6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const s=[];for(;i;)s.push(Yy(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return s.push(Yy(t.slice(o),o>0,!1)),s.join("")}function Yy(e,t,n){let i=0,o=e.length;if(t){let s=e.codePointAt(i);for(;s===Vy||s===qy;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(o-1);for(;s===Vy||s===qy;)o--,s=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function C6(e,t){const n={type:"text",value:A6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function N6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _6={blockquote:i6,break:r6,code:s6,delete:o6,emphasis:l6,footnoteReference:u6,heading:c6,html:d6,imageReference:f6,image:h6,inlineCode:m6,linkReference:p6,link:g6,listItem:x6,list:y6,paragraph:v6,root:E6,strong:T6,table:S6,tableCell:w6,tableRow:k6,text:C6,thematicBreak:N6,toml:cc,yaml:cc,definition:cc,footnoteDefinition:cc};function cc(){}const gT=-1,bd=0,ll=1,Gc=2,vp=3,Ep=4,Tp=5,Sp=6,xT=7,bT=8,yT=typeof self=="object"?self:globalThis,Gy=(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 yT[e](t)},M6=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),i=o=>{if(e.has(o))return e.get(o);const[s,l]=t[o];switch(s){case bd:case gT:return n(l,o);case ll:{const c=n([],o);for(const d of l)c.push(i(d));return c}case Gc:{const c=n({},o);for(const[d,f]of l)c[i(d)]=i(f);return c}case vp:return n(new Date(l),o);case Ep:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Tp:{const c=n(new Map,o);for(const[d,f]of l)c.set(i(d),i(f));return c}case Sp:{const c=n(new Set,o);for(const d of l)c.add(i(d));return c}case xT:{const{name:c,message:d}=l;return n(typeof yT[c]=="function"?Gy(c,d):new Error(d),o)}case bT: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(Gy(s,l),o)};return i},Xy=e=>M6(new Map,e)(0),yr="",{toString:R6}={},{keys:D6}=Object,Wo=e=>{const t=typeof e;if(t!=="object"||!e)return[bd,t];const n=R6.call(e).slice(8,-1);switch(n){case"Array":return[ll,yr];case"Object":return[Gc,yr];case"Date":return[vp,yr];case"RegExp":return[Ep,yr];case"Map":return[Tp,yr];case"Set":return[Sp,yr];case"DataView":return[ll,n]}return n.includes("Array")?[ll,n]:e instanceof Error?[xT,e.name||"Error"]:[Gc,n]},dc=([e,t])=>e===bd&&(t==="function"||t==="symbol"),L6=(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 bd:{let m=l;switch(d){case"bigint":c=bT,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return o([gT],l)}return o([c,m],l)}case ll:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const m=[],x=o([c,m],l);for(const b of l)m.push(s(b));return x}case Gc:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const m=[],x=o([c,m],l);for(const b of D6(l))(e||!dc(Wo(l[b])))&&m.push([s(b),s(l[b])]);return x}case vp:return o([c,isNaN(l.getTime())?yr:l.toISOString()],l);case Ep:{const{source:m,flags:x}=l;return o([c,{source:m,flags:x}],l)}case Tp:{const m=[],x=o([c,m],l);for(const[b,p]of l)(e||!(dc(Wo(b))||dc(Wo(p))))&&m.push([s(b),s(p)]);return x}case Sp:{const m=[],x=o([c,m],l);for(const b of l)(e||!dc(Wo(b)))&&m.push(s(b));return x}}const{message:f}=l;return o([c,{name:d,message:f}],l)};return s},Ky=(e,{json:t,lossy:n}={})=>{const i=[];return L6(!(t||n),!!t,new Map,i)(e),i},Or=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xy(Ky(e,t)):structuredClone(e):(e,t)=>Xy(Ky(e,t));function O6(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 I6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function j6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||O6,i=e.options.footnoteBackLabel||I6,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 m=e.all(f),x=String(f.identifier).toUpperCase(),b=Fs(x.toLowerCase());let p=0;const y=[],E=e.footnoteCounts.get(x);for(;E!==void 0&&++p<=E;){y.length>0&&y.push({type:"text",value:" "});let M=typeof n=="string"?n:n(d,p);typeof M=="string"&&(M={type:"text",value:M}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,p),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const M=T.children[T.children.length-1];M&&M.type==="text"?M.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else m.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!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:`
517
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
518
- `}]}}const yd=(function(e){if(e==null)return U6;if(typeof e=="function")return vd(e);if(typeof e=="object")return Array.isArray(e)?P6(e):B6(e);if(typeof e=="string")return z6(e);throw new Error("Expected function, string, or object as test")});function P6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=yd(e[n]);return vd(i);function i(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function B6(e){const t=e;return vd(n);function n(i){const o=i;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function z6(e){return vd(t);function t(n){return n&&n.type===e}}function vd(e){return t;function t(n,i,o){return!!(H6(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function U6(){return!0}function H6(e){return e!==null&&typeof e=="object"&&"type"in e}const vT=[],F6=!0,b0=!1,V6="skip";function ET(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const s=yd(o),l=i?-1:1;c(e,void 0,[])();function c(d,f,m){const x=d&&typeof d=="object"?d:{};if(typeof x.type=="string"){const p=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(p?"<"+p+">":""))+")"})}return b;function b(){let p=vT,y,E,T;if((!t||s(d,f,m[m.length-1]||void 0))&&(p=q6(n(d,m)),p[0]===b0))return p;if("children"in d&&d.children){const w=d;if(w.children&&p[0]!==V6)for(E=(i?w.children.length:-1)+l,T=m.concat(w);E>-1&&E<w.children.length;){const M=w.children[E];if(y=c(M,E,T)(),y[0]===b0)return y;E=typeof y[1]=="number"?y[1]:E+l}}return p}}}function q6(e){return Array.isArray(e)?e:typeof e=="number"?[F6,e]:e==null?vT:[e]}function Ed(e,t,n,i){let o,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,o=n):(s=t,l=n,o=i),ET(e,s,c,o);function c(d,f){const m=f[f.length-1],x=m?m.children.indexOf(d):void 0;return l(d,x,m)}}const y0={}.hasOwnProperty,Y6={};function G6(e,t){const n=t||Y6,i=new Map,o=new Map,s=new Map,l={..._6,...n.handlers},c={all:f,applyData:K6,definitionById:i,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:X6,wrap:Q6};return Ed(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const x=m.type==="definition"?i:o,b=String(m.identifier).toUpperCase();x.has(b)||x.set(b,m)}}),c;function d(m,x){const b=m.type,p=c.handlers[b];if(y0.call(c.handlers,b)&&p)return p(c,m,x);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in m){const{children:E,...T}=m,w=Or(T);return w.children=c.all(m),w}return Or(m)}return(c.options.unknownHandler||$6)(c,m,x)}function f(m){const x=[];if("children"in m){const b=m.children;let p=-1;for(;++p<b.length;){const y=c.one(b[p],m);if(y){if(p&&b[p-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=$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 X6(e,t){e.position&&(t.position=$E(e))}function K6(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 $6(e,t){const n=t.data||{},i="value"in t&&!(y0.call(n,"hProperties")||y0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Q6(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
519
- `});++i<e.length;)i&&n.push({type:"text",value:`
520
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
521
- `}),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 Qy(e,t){const n=G6(e,t),i=n.one(e,void 0),o=j6(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
522
- `},o),s}function W6(e,t){return e&&"run"in e?async function(n,i){const o=Qy(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Qy(n,{file:i,...e||t})}}function Wy(e){if(e)throw e}var mm,Zy;function Z6(){if(Zy)return mm;Zy=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 m=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!x)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},c=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(i)return i(f,m).value}else return;return f[m]};return mm=function d(){var f,m,x,b,p,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(m in f)x=c(E,m),b=c(f,m),E!==b&&(M&&b&&(s(b)||(p=o(b)))?(p?(p=!1,y=x&&o(x)?x:[]):y=x&&s(x)?x:{},l(E,{name:m,newValue:d(M,y,b)})):typeof b<"u"&&l(E,{name:m,newValue:b}));return E},mm}var J6=Z6();const pm=Ml(J6);function v0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function eM(){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 m=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,m?tM(m,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 tM(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 m=f;if(c&&n)throw m;return o(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,o):d instanceof Error?o(d):s(d))}function o(l,...c){n||(n=!0,t(l,...c))}function s(l){o(null,l)}}const wa={basename:nM,dirname:aM,extname:iM,join:rM,sep:"/"};function nM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jl(e);let n=0,i=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else l<0&&(s=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function aM(e){if(jl(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function iM(e){jl(e);let t=e.length,n=-1,i=0,o=-1,s=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function rM(...e){let t=-1,n;for(;++t<e.length;)jl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":sM(n)}function sM(e){jl(e);const t=e.codePointAt(0)===47;let n=oM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function oM(e,t){let n="",i=0,o=-1,s=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||s===1))if(o!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,s=0;continue}}else if(n.length>0){n="",i=0,o=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const lM={cwd:uM};function uM(){return"/"}function E0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cM(e){if(typeof e=="string")e=new URL(e);else if(!E0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dM(e)}function dM(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const gm=["history","path","basename","stem","extname","dirname"];class TT{constructor(t){let n;t?E0(t)?n={path:t}:typeof t=="string"||fM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":lM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<gm.length;){const s=gm[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)gm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?wa.basename(this.path):void 0}set basename(t){bm(t,"basename"),xm(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){Jy(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(xm(t,"extname"),Jy(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){E0(t)&&(t=cM(t)),bm(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){bm(t,"stem"),xm(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 xm(e,t){if(e&&e.includes(wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wa.sep+"`")}function bm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Jy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function fM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hM=(function(e){const i=this.constructor.prototype,o=i[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),mM={}.hasOwnProperty;class kp extends hM{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=eM()}copy(){const t=new kp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(pm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Em("data",this.frozen),this.namespace[t]=n,this):mM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Em("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=fc(t),i=this.parser||this.Parser;return ym("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ym("process",this.parser||this.Parser),vm("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,l){const c=fc(t),d=i.parse(c);i.run(d,c,function(m,x,b){if(m||!x||!b)return f(m);const p=x,y=i.stringify(p,b);xM(y)?b.value=y:b.result=y,f(m,b)});function f(m,x){m||!x?l(m):s?s(x):n(void 0,x)}}}processSync(t){let n=!1,i;return this.freeze(),ym("processSync",this.parser||this.Parser),vm("processSync",this.compiler||this.Compiler),this.process(t,o),tv("processSync","process",n),i;function o(s,l){n=!0,Wy(s),i=l}}run(t,n,i){ev(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=fc(n);o.run(t,d,f);function f(m,x,b){const p=x||t;m?c(m):l?l(p):i(void 0,p,b)}}}runSync(t,n){let i=!1,o;return this.run(t,n,s),tv("runSync","run",i),o;function s(l,c){Wy(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=fc(n),o=this.compiler||this.Compiler;return vm("stringify",o),ev(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(Em("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...x]=f;d(m,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=pm(!0,o.settings,f.settings))}function c(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const x=f[m];s(x)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let x=-1,b=-1;for(;++x<i.length;)if(i[x][0]===f){b=x;break}if(b===-1)i.push([f,...m]);else if(m.length>0){let[p,...y]=m;const E=i[b][1];v0(E)&&v0(p)&&(p=pm(!0,E,p)),i[b]=[f,p,...y]}}}}const pM=new kp().freeze();function ym(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Em(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ev(e){if(!v0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fc(e){return gM(e)?e:new TT(e)}function gM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xM(e){return typeof e=="string"||bM(e)}function bM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nv=[],av={allowDangerousHtml:!0},vM=/^(https?|ircs?|mailto|xmpp)$/i,EM=[{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 ST(e){const t=TM(e),n=SM(e);return kM(t.runSync(t.parse(n),n),e)}function TM(e){const t=e.rehypePlugins||nv,n=e.remarkPlugins||nv,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...av}:av;return pM().use(a6).use(n).use(W6,i).use(t)}function SM(e){const t=e.children||"",n=new TT;return typeof t=="string"&&(n.value=t),n}function kM(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||wM;for(const m of EM)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+yM+m.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ed(e,f),U5(e,{Fragment:g.Fragment,components:o,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(m,x,b){if(m.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:m.value},x;if(m.type==="element"){let p;for(p in dm)if(Object.hasOwn(dm,p)&&Object.hasOwn(m.properties,p)){const y=m.properties[p],E=dm[p];(E===null||E.includes(m.tagName))&&(m.properties[p]=d(String(y||""),p,m))}}if(m.type==="element"){let p=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!p&&i&&typeof x=="number"&&(p=!i(m,x,b)),p&&b&&typeof x=="number")return c&&m.children?b.children.splice(x,1,...m.children):b.children.splice(x,1),x}}}function wM(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||vM.test(e.slice(0,t))?e:""}function iv(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 AM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function CM(e,t,n){const o=yd((n||{}).ignore||[]),s=NM(t);let l=-1;for(;++l<s.length;)ET(e,"text",c);function c(f,m){let x=-1,b;for(;++x<m.length;){const p=m[x],y=b?b.children:void 0;if(o(p,y?y.indexOf(p):void 0,b))return;b=p}if(b)return d(f,m)}function d(f,m){const x=m[m.length-1],b=s[l][0],p=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:[...m,f]};let C=p(...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 NM(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([_M(o[0]),MM(o[1])])}return t}function _M(e){return typeof e=="string"?new RegExp(AM(e),"g"):e}function MM(e){return typeof e=="function"?e:function(){return e}}const Tm="phrasing",Sm=["autolink","link","image","label"];function RM(){return{transforms:[BM],enter:{literalAutolink:LM,literalAutolinkEmail:km,literalAutolinkHttp:km,literalAutolinkWww:km},exit:{literalAutolink:PM,literalAutolinkEmail:jM,literalAutolinkHttp:OM,literalAutolinkWww:IM}}}function DM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Tm,notInConstruct:Sm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Tm,notInConstruct:Sm},{character:":",before:"[ps]",after:"\\/",inConstruct:Tm,notInConstruct:Sm}]}}function LM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function km(e){this.config.enter.autolinkProtocol.call(this,e)}function OM(e){this.config.exit.autolinkProtocol.call(this,e)}function IM(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 jM(e){this.config.exit.autolinkEmail.call(this,e)}function PM(e){this.exit(e)}function BM(e){CM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),UM]],{ignore:["link","linkReference"]})}function zM(e,t,n,i,o){let s="";if(!kT(o)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!HM(n)))return!1;const l=FM(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 UM(e,t,n,i){return!kT(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function HM(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 FM(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=iv(e,"(");let s=iv(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 kT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||gd(n))&&(!t||n!==47)}wT.peek=WM;function VM(){this.buffer()}function qM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YM(){this.buffer()}function GM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function XM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function KM(e){this.exit(e)}function $M(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 QM(e){this.exit(e)}function WM(){return"["}function wT(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 ZM(){return{enter:{gfmFootnoteCallString:VM,gfmFootnoteCall:qM,gfmFootnoteDefinitionLabelString:YM,gfmFootnoteDefinition:GM},exit:{gfmFootnoteCallString:XM,gfmFootnoteCall:KM,gfmFootnoteDefinitionLabelString:$M,gfmFootnoteDefinition:QM}}}function JM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wT},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"),m=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
523
- `:" ")+s.indentLines(s.containerFlow(i,c.current()),t?AT:eR))),f(),d}}function eR(e,t,n){return t===0?e:AT(e,t,n)}function AT(e,t,n){return(n?"":" ")+e}const tR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CT.peek=sR;function nR(){return{canContainEols:["delete"],enter:{strikethrough:iR},exit:{strikethrough:rR}}}function aR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tR}],handlers:{delete:CT}}}function iR(e){this.enter({type:"delete",children:[]},e)}function rR(e){this.exit(e)}function CT(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 sR(){return"~"}function oR(e){return e.length}function lR(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||oR,s=[],l=[],c=[],d=[];let f=0,m=-1;for(;++m<e.length;){const E=[],T=[];let w=-1;for(e[m].length>f&&(f=e[m].length);++w<e[m].length;){const M=uR(e[m][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[m]=E,c[m]=T}let x=-1;if(typeof i=="object"&&"length"in i)for(;++x<f;)s[x]=rv(i[x]);else{const E=rv(i);for(;++x<f;)s[x]=E}x=-1;const b=[],p=[];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),p[x]=M),b[x]=N}l.splice(1,0,b),c.splice(1,0,p),m=-1;const y=[];for(;++m<l.length;){const E=l[m],T=c[m];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(`
524
- `)}function uR(e){return e==null?"":String(e)}function rv(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 sv={}.hasOwnProperty;function NT(e,t){const n=t||{};function i(o,...s){let l=i.invalid;const c=i.handlers;if(o&&sv.call(o,e)){const d=String(o[e]);l=sv.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 cR(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()),dR);return o(),l}function dR(e,t,n){return">"+(n?"":" ")+e}function fR(e,t){return ov(e,t.inConstruct,!0)&&!ov(e,t.notInConstruct,!1)}function ov(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 lv(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
525
- `&&fR(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
526
- `}function hR(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 mR(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 pR(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 gR(e,t,n,i){const o=pR(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(mR(e,n)){const x=n.enter("codeIndented"),b=n.indentLines(s,xR);return x(),b}const c=n.createTracker(i),d=o.repeat(Math.max(hR(s,o)+1,3)),f=n.enter("codeFenced");let m=c.move(d);if(e.lang){const x=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
527
- `,encode:["`"],...c.current()})),x()}return m+=c.move(`
528
- `),s&&(m+=c.move(s+`
529
- `)),m+=c.move(d),f(),m}function xR(e,t,n){return(n?"":" ")+e}function wp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function bR(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let 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?" ":`
530
- `,...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 yR(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 kl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xc(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}}_T.peek=vR;function _T(e,t,n,i){const o=yR(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),m=Xc(i.before.charCodeAt(i.before.length-1),f,o);m.inside&&(d=kl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Xc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+kl(x));const p=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+p}function vR(e,t,n){return n.options.emphasis||"*"}function ER(e,t){let n=!1;return Ed(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,b0}),!!((!e.depth||e.depth<3)&&xp(e)&&(t.options.setext||n))}function TR(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(ER(e,n)){const m=n.enter("headingSetext"),x=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
531
- `,after:`
532
- `});return x(),m(),b+`
533
- `+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
534
- `))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
535
- `,...s.current()});return/^[\t ]/.test(f)&&(f=kl(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}MT.peek=SR;function MT(e){return e.value||""}function SR(){return"<"}RT.peek=kR;function RT(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let 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 kR(){return"!"}DT.peek=wR;function DT(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 m=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function wR(){return"!"}LT.peek=AR;function LT(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 AR(){return"`"}function OT(e,t){const n=xp(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))}IT.peek=CR;function IT(e,t,n,i){const o=wp(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(OT(e,n)){const m=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=m,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 CR(e,t,n){return OT(e,n)?"<":"["}jT.peek=NR;function jT(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 m=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function NR(){return"["}function Ap(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 _R(e){const t=Ap(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 MR(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 PT(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 RR(e,t,n,i){const o=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?MR(n):Ap(n);const c=e.ordered?l==="."?")":".":_R(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),PT(n)===l&&m){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 DR(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 LR(e,t,n,i){const o=DR(n);let s=n.bulletCurrent||Ap(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()),m);return d(),f;function m(x,b,p){return b?(p?"":" ".repeat(l))+x:(p?s:s+" ".repeat(l-s.length))+x}}function OR(e,t,n,i){const o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}const IR=yd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function jR(e,t,n,i){return(e.children.some(function(l){return IR(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function PR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BT.peek=BR;function BT(e,t,n,i){const o=PR(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),m=Xc(i.before.charCodeAt(i.before.length-1),f,o);m.inside&&(d=kl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Xc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+kl(x));const p=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+p}function BR(e,t,n){return n.options.strong||"*"}function zR(e,t,n,i){return n.safe(e.value,i)}function UR(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 HR(e,t,n){const i=(PT(n)+(n.options.ruleSpaces?" ":"")).repeat(UR(n));return n.options.ruleSpaces?i.slice(0,-1):i}const zT={blockquote:cR,break:lv,code:gR,definition:bR,emphasis:_T,hardBreak:lv,heading:TR,html:MT,image:RT,imageReference:DT,inlineCode:LT,link:IT,linkReference:jT,list:RR,listItem:LR,paragraph:OR,root:jR,strong:BT,text:zR,thematicBreak:HR};function FR(){return{enter:{table:VR,tableData:uv,tableHeader:uv,tableRow:YR},exit:{codeText:GR,table:qR,tableData:wm,tableHeader:wm,tableRow:wm}}}function VR(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 qR(e){this.exit(e),this.data.inTable=void 0}function YR(e){this.enter({type:"tableRow",children:[]},e)}function wm(e){this.exit(e)}function uv(e){this.enter({type:"tableCell",children:[]},e)}function GR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,XR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function XR(e,t){return t==="|"?t:e}function KR(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
536
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(p,y,E,T){return f(m(p,E,T),p.align)}function c(p,y,E,T){const w=x(p,E,T),M=f([w]);return M.slice(0,M.indexOf(`
537
- `))}function d(p,y,E,T){const w=E.enter("tableCell"),M=E.enter("phrasing"),N=E.containerPhrasing(p,{...T,before:s,after:s});return M(),w(),N}function f(p,y){return lR(p,{align:y,alignDelimiters:i,padding:n,stringLength:o})}function m(p,y,E){const T=p.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(p,y,E){const T=p.children;let w=-1;const M=[],N=y.enter("tableRow");for(;++w<T.length;)M[w]=d(T[w],p,y,E);return N(),M}function b(p,y,E){let T=zT.inlineCode(p,y,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function $R(){return{exit:{taskListCheckValueChecked:cv,taskListCheckValueUnchecked:cv,paragraph:WR}}}function QR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZR}}}function cv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WR(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 ZR(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=zT.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+l}}function JR(){return[RM(),ZM(),nR(),FR(),$R()]}function eD(e){return{extensions:[DM(),JM(e),aR(),KR(e),QR()]}}const tD={tokenize:oD,partial:!0},UT={tokenize:lD,partial:!0},HT={tokenize:uD,partial:!0},FT={tokenize:cD,partial:!0},nD={tokenize:dD,partial:!0},VT={name:"wwwAutolink",tokenize:rD,previous:YT},qT={name:"protocolAutolink",tokenize:sD,previous:GT},si={name:"emailAutolink",tokenize:iD,previous:XT},La={};function aD(){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,qT];La[104]=[si,qT];La[87]=[si,VT];La[119]=[si,VT];function iD(e,t,n){const i=this;let o,s;return l;function l(x){return!T0(x)||!XT.call(i,i.previous)||Cp(i.events)?n(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(x))}function c(x){return T0(x)?(e.consume(x),c):x===64?(e.consume(x),d):n(x)}function d(x){return x===46?e.check(nD,m,f)(x):x===45||x===95||gn(x)?(s=!0,e.consume(x),d):m(x)}function f(x){return e.consume(x),o=!0,d}function m(x){return s&&o&&vn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(x)):n(x)}}function rD(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!YT.call(i,i.previous)||Cp(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tD,e.attempt(UT,e.attempt(HT,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function sD(e,t,n){const i=this;let o="",s=!1;return l;function l(x){return(x===72||x===104)&&GT.call(i,i.previous)&&!Cp(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||Yc(x)||Nt(x)||Lr(x)||gd(x)?n(x):e.attempt(UT,e.attempt(HT,m),n)(x)}function m(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(x)}}function oD(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 lD(e,t,n){let i,o,s;return l;function l(f){return f===46||f===95?e.check(FT,d,c)(f):f===null||Nt(f)||Lr(f)||f!==45&&gd(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 uD(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(FT,t,s)(l):l===null||Nt(l)||Lr(l)?t(l):(e.consume(l),o)}function s(l){return l===41&&i++,e.consume(l),o}}function cD(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||Nt(c)||Lr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Nt(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 dD(e,t,n){return i;function i(s){return e.consume(s),o}function o(s){return gn(s)?n(s):t(s)}}function YT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Nt(e)}function GT(e){return!vn(e)}function XT(e){return!(e===47||T0(e))}function T0(e){return e===43||e===45||e===46||e===95||gn(e)}function Cp(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 fD={tokenize:vD,partial:!0};function hD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xD,continuation:{tokenize:bD},exit:yD}},text:{91:{name:"gfmFootnoteCall",tokenize:gD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mD,resolveTo:pD}}}}function mD(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 pD(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 gD(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||Nt(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 Nt(x)||(l=!0),s++,e.consume(x),x===92?m:f}function m(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}}function xD(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",m):n(y)}function m(y){if(l>999||y===93&&!c||y===null||y===91||Nt(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 Nt(y)||(c=!0),l++,e.consume(y),y===92?x:m}function x(y){return y===91||y===92||y===93?(e.consume(y),l++,m):m(y)}function b(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),o.includes(s)||o.push(s),ut(e,p,"gfmFootnoteDefinitionWhitespace")):n(y)}function p(y){return t(y)}}function bD(e,t,n){return e.check(Il,t,e.attempt(fD,t,n))}function yD(e){e.exit("gfmFootnoteDefinition")}function vD(e,t,n){const i=this;return ut(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 ED(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 m={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",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",x,c]],p=c.parser.constructs.insideSpan.null;p&&Vn(b,b.length,0,xd(p,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",m,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,m=this.events;let x=0;return b;function b(y){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(y):(l.enter("strikethroughSequenceTemporary"),p(y))}function p(y){const E=js(f);if(y===126)return x>1?d(y):(l.consume(y),x++,p);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 TD{constructor(){this.map=[]}add(t,n,i){SD(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 SD(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 kD(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 wD(){return{flow:{null:{name:"table",tokenize:AD,resolveAll:CD}}}}function AD(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 F=i.events[P][1].type;if(F==="lineEnding"||F==="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),m(D)}function m(D){return D===null?n(D):Ve(D)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),p):n(D):it(D)?ut(e,m,"whitespace")(D):(s+=1,l&&(l=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),x(D)))}function x(D){return D===null||D===124||Nt(D)?(e.exit("data"),m(D)):(e.consume(D),D===92?b:x)}function b(D){return D===92||D===124?(e.consume(D),x):x(D)}function p(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,it(D)?ut(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 it(D)?ut(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||Ve(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 it(D)?ut(e,L,"whitespace")(D):L(D)}function L(D){return D===124?y(D):D===null||Ve(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||Ve(D)?(e.exit("tableRow"),t(D)):it(D)?ut(e,I,"whitespace")(D):(e.enter("data"),R(D))}function R(D){return D===null||D===124||Nt(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 CD(e,t){let n=-1,i=!0,o=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,m,x;const b=new TD;for(;++n<e.length;){const p=e[n],y=p[1];p[0]==="enter"?y.type==="tableHead"?(c=!1,d!==0&&(dv(b,t,d,f,m),m=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,m={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",m,t]])),o=y.type==="tableDelimiterRow"?2:m?3:1):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],x=hc(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=hc(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=hc(b,t,s,o,n,x)):l[1]!==0&&(x=hc(b,t,l,o,n,x)),o=0):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&dv(b,t,d,f,m),b.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=kD(t.events,n))}return e}function hc(e,t,n,i,o,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},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]),m=As(t.events,n[3]),x={type:c,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",x,t]]),i!==2){const b=t.events[n[2]],p=t.events[n[3]];if(b[1].end=Object.assign({},p[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,E=n[3]-n[2]-1;e.add(y,E,[])}}e.add(n[3]+1,0,[["exit",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 dv(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 ND={name:"tasklistCheck",tokenize:MD};function _D(){return{text:{91:ND}}}function MD(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 Nt(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 Ve(d)?t(d):it(d)?e.check({tokenize:RD},t,n)(d):n(d)}}function RD(e,t,n){return ut(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function DD(e){return tT([aD(),hD(),ED(e),wD(),_D()])}const LD={};function KT(e){const t=this,n=e||LD,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(DD(n)),s.push(JR()),l.push(eD(n))}const fv=/[#.]/g;function OD(e,t){const n=e||"",i={};let o=0,s,l;for(;o<n.length;){fv.lastIndex=o;const c=fv.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?BD(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=OD(s,t);const f=d.tagName.toLowerCase(),m=i?i.get(f):void 0;if(d.tagName=m||f,ID(l))c.unshift(l);else for(const[x,b]of Object.entries(l))jD(e,d.properties,x,b)}for(const f of c)S0(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function ID(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 jD(e,t,n,i){const o=md(e,n);let s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?o.spaceSeparated?s=wy(i):o.commaSeparated?s=vy(i):o.commaOrSpaceSeparated?s=wy(vy(i).join(" ")):s=hv(o,o.property,i):Array.isArray(i)?s=[...i]:s=o.property==="style"?PD(i):String(i);if(Array.isArray(s)){const l=[];for(const c of s)l.push(hv(o,o.property,c));s=l}o.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[o.property]=s}}function S0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)S0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?S0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function hv(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Tl(n)===Tl(t)))return!0}return n}function PD(e){const t=[];for(const[n,i]of Object.entries(e))t.push([n,i].join(": "));return t.join("; ")}function BD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const zD=["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"],UD=$T(Ol,"div"),HD=$T(Hi,"g",zD);function FD(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=mv(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=mv(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 mv(e,t){const n=e.indexOf("\r",t),i=e.indexOf(`
538
- `,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/"},QT={}.hasOwnProperty,VD=Object.prototype;function qD(e,t){const n=t||{};return Np({file:n.file||void 0,location:!1,schema:n.space==="svg"?Hi:Ol,verbose:n.verbose||!1},e)}function Np(e,t){let n;switch(t.nodeName){case"#comment":{const i=t;return n={type:"comment",value:i.data},_c(e,i,n),n}case"#document":case"#document-fragment":{const i=t,o="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(n={type:"root",children:WT(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const s=String(e.file),l=FD(s),c=l.toPoint(0),d=l.toPoint(s.length);n.position={start:c,end:d}}return n}case"#documentType":{const i=t;return n={type:"doctype"},_c(e,i,n),n}case"#text":{const i=t;return n={type:"text",value:i.value},_c(e,i,n),n}default:return n=YD(e,t),n}}function WT(e,t){let n=-1;const i=[];for(;++n<t.length;){const o=Np(e,t[n]);i.push(o)}return i}function YD(e,t){const n=e.schema;e.schema=t.namespaceURI===Er.svg?Hi:Ol;let i=-1;const o={};for(;++i<t.attrs.length;){const c=t.attrs[i],d=(c.prefix?c.prefix+":":"")+c.name;QT.call(VD,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?HD:UD)(t.tagName,o,WT(e,t.childNodes));if(_c(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Ns(d.startTag),m=d&&d.endTag&&Ns(d.endTag),x=Np(e,c.content);f&&m&&e.file&&(x.position={start:f.end,end:m.start}),l.content=x}return e.schema=n,l}function _c(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const i=GD(e,n,t.sourceCodeLocation);i&&(e.location=!0,n.position=i)}}function GD(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)QT.call(n.attrs,l)&&(s[md(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=pv({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=pv({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function pv(e){return e.line&&e.column?e:void 0}const XD={},KD={}.hasOwnProperty,ZT=NT("type",{handlers:{root:QD,element:t8,text:JD,comment:e8,doctype:ZD}});function $D(e,t){const i=(t||XD).space;return ZT(e,i==="svg"?Hi:Ol)}function QD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=_p(e.children,n,t),Vs(e,n),n}function WD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=_p(e.children,n,t),Vs(e,n),n}function ZD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Vs(e,t),t}function JD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Vs(e,t),t}function e8(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Vs(e,t),t}function t8(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"&&KD.call(e.properties,s)){const d=n8(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=_p(e.children,c,i),Vs(e,c),e.tagName==="template"&&e.content&&(c.content=WD(e.content,i)),c}function n8(e,t,n){const i=md(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&i.boolean)return;Array.isArray(n)&&(n=i.commaSeparated?zE(n):XE(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 _p(e,t,n){let i=-1;const o=[];if(e)for(;++i<e.length;){const s=ZT(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 a8=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],i8=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]),Lt="�";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 JT(e){return e>=55296&&e<=57343}function r8(e){return e>=56320&&e<=57343}function s8(e,t){return(e-55296)*1024+9216+t}function eS(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function tS(e){return e>=64976&&e<=65007||i8.has(e)}var ge;(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"})(ge||(ge={}));const o8=65536;class l8{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=o8,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(r8(n))return this.pos++,this._addGap(),s8(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,X.EOF;return this._err(ge.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,JT(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){eS(t)?this._err(ge.controlCharacterInInputStream):tS(t)&&this._err(ge.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var tt;(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"})(tt||(tt={}));function nS(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 u8=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))),c8=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 d8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=c8.get(e))!==null&&t!==void 0?t:e}var on;(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"})(on||(on={}));const f8=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 k0(e){return e>=on.ZERO&&e<=on.NINE}function h8(e){return e>=on.UPPER_A&&e<=on.UPPER_F||e>=on.LOWER_A&&e<=on.LOWER_F}function m8(e){return e>=on.UPPER_A&&e<=on.UPPER_Z||e>=on.LOWER_A&&e<=on.LOWER_Z||k0(e)}function p8(e){return e===on.EQUALS||m8(e)}var sn;(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"})(sn||(sn={}));var ni;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ni||(ni={}));class g8{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ni.Strict}startEntity(t){this.decodeMode=t,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case sn.EntityStart:return t.charCodeAt(n)===on.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(t,n));case sn.NumericStart:return this.stateNumericStart(t,n);case sn.NumericDecimal:return this.stateNumericDecimal(t,n);case sn.NumericHex:return this.stateNumericHex(t,n);case sn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|f8)===on.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=sn.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(k0(o)||h8(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(k0(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===on.SEMI)this.consumed+=1;else if(this.decodeMode===ni.Strict)return 0;return this.emitCodePoint(d8(this.result),this.consumed),this.errors&&(t!==on.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=x8(i,o,this.treeIndex+Math.max(1,s),l),this.treeIndex<0)return this.result===0||this.decodeMode===ni.Attribute&&(s===0||p8(l))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Pi.VALUE_LENGTH)>>14,s!==0){if(l===on.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 sn.NamedEntity:return this.result!==0&&(this.decodeMode!==ni.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function x8(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 ue;(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"})(ue||(ue={}));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 b8=new Map([[ue.A,k.A],[ue.ADDRESS,k.ADDRESS],[ue.ANNOTATION_XML,k.ANNOTATION_XML],[ue.APPLET,k.APPLET],[ue.AREA,k.AREA],[ue.ARTICLE,k.ARTICLE],[ue.ASIDE,k.ASIDE],[ue.B,k.B],[ue.BASE,k.BASE],[ue.BASEFONT,k.BASEFONT],[ue.BGSOUND,k.BGSOUND],[ue.BIG,k.BIG],[ue.BLOCKQUOTE,k.BLOCKQUOTE],[ue.BODY,k.BODY],[ue.BR,k.BR],[ue.BUTTON,k.BUTTON],[ue.CAPTION,k.CAPTION],[ue.CENTER,k.CENTER],[ue.CODE,k.CODE],[ue.COL,k.COL],[ue.COLGROUP,k.COLGROUP],[ue.DD,k.DD],[ue.DESC,k.DESC],[ue.DETAILS,k.DETAILS],[ue.DIALOG,k.DIALOG],[ue.DIR,k.DIR],[ue.DIV,k.DIV],[ue.DL,k.DL],[ue.DT,k.DT],[ue.EM,k.EM],[ue.EMBED,k.EMBED],[ue.FIELDSET,k.FIELDSET],[ue.FIGCAPTION,k.FIGCAPTION],[ue.FIGURE,k.FIGURE],[ue.FONT,k.FONT],[ue.FOOTER,k.FOOTER],[ue.FOREIGN_OBJECT,k.FOREIGN_OBJECT],[ue.FORM,k.FORM],[ue.FRAME,k.FRAME],[ue.FRAMESET,k.FRAMESET],[ue.H1,k.H1],[ue.H2,k.H2],[ue.H3,k.H3],[ue.H4,k.H4],[ue.H5,k.H5],[ue.H6,k.H6],[ue.HEAD,k.HEAD],[ue.HEADER,k.HEADER],[ue.HGROUP,k.HGROUP],[ue.HR,k.HR],[ue.HTML,k.HTML],[ue.I,k.I],[ue.IMG,k.IMG],[ue.IMAGE,k.IMAGE],[ue.INPUT,k.INPUT],[ue.IFRAME,k.IFRAME],[ue.KEYGEN,k.KEYGEN],[ue.LABEL,k.LABEL],[ue.LI,k.LI],[ue.LINK,k.LINK],[ue.LISTING,k.LISTING],[ue.MAIN,k.MAIN],[ue.MALIGNMARK,k.MALIGNMARK],[ue.MARQUEE,k.MARQUEE],[ue.MATH,k.MATH],[ue.MENU,k.MENU],[ue.META,k.META],[ue.MGLYPH,k.MGLYPH],[ue.MI,k.MI],[ue.MO,k.MO],[ue.MN,k.MN],[ue.MS,k.MS],[ue.MTEXT,k.MTEXT],[ue.NAV,k.NAV],[ue.NOBR,k.NOBR],[ue.NOFRAMES,k.NOFRAMES],[ue.NOEMBED,k.NOEMBED],[ue.NOSCRIPT,k.NOSCRIPT],[ue.OBJECT,k.OBJECT],[ue.OL,k.OL],[ue.OPTGROUP,k.OPTGROUP],[ue.OPTION,k.OPTION],[ue.P,k.P],[ue.PARAM,k.PARAM],[ue.PLAINTEXT,k.PLAINTEXT],[ue.PRE,k.PRE],[ue.RB,k.RB],[ue.RP,k.RP],[ue.RT,k.RT],[ue.RTC,k.RTC],[ue.RUBY,k.RUBY],[ue.S,k.S],[ue.SCRIPT,k.SCRIPT],[ue.SEARCH,k.SEARCH],[ue.SECTION,k.SECTION],[ue.SELECT,k.SELECT],[ue.SOURCE,k.SOURCE],[ue.SMALL,k.SMALL],[ue.SPAN,k.SPAN],[ue.STRIKE,k.STRIKE],[ue.STRONG,k.STRONG],[ue.STYLE,k.STYLE],[ue.SUB,k.SUB],[ue.SUMMARY,k.SUMMARY],[ue.SUP,k.SUP],[ue.TABLE,k.TABLE],[ue.TBODY,k.TBODY],[ue.TEMPLATE,k.TEMPLATE],[ue.TEXTAREA,k.TEXTAREA],[ue.TFOOT,k.TFOOT],[ue.TD,k.TD],[ue.TH,k.TH],[ue.THEAD,k.THEAD],[ue.TITLE,k.TITLE],[ue.TR,k.TR],[ue.TRACK,k.TRACK],[ue.TT,k.TT],[ue.U,k.U],[ue.UL,k.UL],[ue.SVG,k.SVG],[ue.VAR,k.VAR],[ue.WBR,k.WBR],[ue.XMP,k.XMP]]);function qs(e){var t;return(t=b8.get(e))!==null&&t!==void 0?t:k.UNKNOWN}const Ae=k,y8={[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},w0=new Set([Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6]);ue.STYLE,ue.SCRIPT,ue.XMP,ue.IFRAME,ue.NOEMBED,ue.NOFRAMES,ue.PLAINTEXT;var Z;(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"})(Z||(Z={}));const Gt={DATA:Z.DATA,RCDATA:Z.RCDATA,RAWTEXT:Z.RAWTEXT,SCRIPT_DATA:Z.SCRIPT_DATA,PLAINTEXT:Z.PLAINTEXT,CDATA_SECTION:Z.CDATA_SECTION};function v8(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 E8(e){return e>=X.LATIN_SMALL_A&&e<=X.LATIN_SMALL_Z}function Li(e){return E8(e)||al(e)}function gv(e){return Li(e)||v8(e)}function mc(e){return e+32}function aS(e){return e===X.SPACE||e===X.LINE_FEED||e===X.TABULATION||e===X.FORM_FEED}function xv(e){return aS(e)||e===X.SOLIDUS||e===X.GREATER_THAN_SIGN}function T8(e){return e===X.NULL?ge.nullCharacterReference:e>1114111?ge.characterReferenceOutsideUnicodeRange:JT(e)?ge.surrogateCharacterReference:tS(e)?ge.noncharacterCharacterReference:eS(e)||e===X.CARRIAGE_RETURN?ge.controlCharacterReference:null}class S8{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=Z.DATA,this.returnState=Z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new l8(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new g8(u8,(i,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ge.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ge.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const o=T8(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:tt.START_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:tt.END_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:tt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:tt.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(nS(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(ge.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===tt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ge.endTagWithAttributes),t.selfClosing&&this._err(ge.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 tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case tt.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:tt.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=aS(t)?tt.WHITESPACE_CHARACTER:t===X.NULL?tt.NULL_CHARACTER:tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ni.Attribute:ni.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Z.DATA:{this._stateData(t);break}case Z.RCDATA:{this._stateRcdata(t);break}case Z.RAWTEXT:{this._stateRawtext(t);break}case Z.SCRIPT_DATA:{this._stateScriptData(t);break}case Z.PLAINTEXT:{this._statePlaintext(t);break}case Z.TAG_OPEN:{this._stateTagOpen(t);break}case Z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Z.TAG_NAME:{this._stateTagName(t);break}case Z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Z.COMMENT_START:{this._stateCommentStart(t);break}case Z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Z.COMMENT:{this._stateComment(t);break}case Z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Z.COMMENT_END:{this._stateCommentEnd(t);break}case Z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Z.DOCTYPE:{this._stateDoctype(t);break}case Z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Z.CDATA_SECTION:{this._stateCdataSection(t);break}case Z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=Z.TAG_OPEN;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ge.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=Z.RCDATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case X.LESS_THAN_SIGN:{this.state=Z.RAWTEXT_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Li(t))this._createStartTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case X.EXCLAMATION_MARK:{this.state=Z.MARKUP_DECLARATION_OPEN;break}case X.SOLIDUS:{this.state=Z.END_TAG_OPEN;break}case X.QUESTION_MARK:{this._err(ge.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t);break}case X.EOF:{this._err(ge.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ge.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Li(t))this._createEndTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case X.GREATER_THAN_SIGN:{this._err(ge.missingEndTagName),this.state=Z.DATA;break}case X.EOF:{this._err(ge.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ge.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Z.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=Z.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this.state=Z.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.tagName+=Lt;break}case X.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(al(t)?mc(t):t)}}_stateRcdataLessThanSign(t){t===X.SOLIDUS?this.state=Z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Li(t)?(this.state=Z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=Z.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=Z.BEFORE_ATTRIBUTE_NAME,!1;case X.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Z.SELF_CLOSING_START_TAG,!1;case X.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===X.SOLIDUS?this.state=Z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Li(t)?(this.state=Z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case X.SOLIDUS:{this.state=Z.SCRIPT_DATA_END_TAG_OPEN;break}case X.EXCLAMATION_MARK:{this.state=Z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Li(t)?(this.state=Z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===X.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===X.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case X.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===X.SOLIDUS?this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Li(t)?(this._emitChars("<"),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Li(t)?(this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Mn.SCRIPT,!1)&&xv(this.preprocessor.peek(Mn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case X.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.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=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case X.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===X.SOLIDUS?(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Mn.SCRIPT,!1)&&xv(this.preprocessor.peek(Mn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Z.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=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._err(ge.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Z.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=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._leaveAttrName(),this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:{this._err(ge.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.name+=Lt;break}default:this.currentAttr.name+=String.fromCodePoint(al(t)?mc(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=Z.SELF_CLOSING_START_TAG;break}case X.EQUALS_SIGN:{this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Z.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=Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this.state=Z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingAttributeValue),this.state=Z.DATA,this.emitCurrentTagToken();break}default:this.state=Z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case X.QUOTATION_MARK:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case X.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case X.APOSTROPHE:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case X.EOF:{this._err(ge.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=Z.BEFORE_ATTRIBUTE_NAME;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:case X.EQUALS_SIGN:case X.GRAVE_ACCENT:{this._err(ge.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case X.EOF:{this._err(ge.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=Z.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this._leaveAttrValue(),this.state=Z.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._err(ge.missingWhitespaceBetweenAttributes),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case X.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Z.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._err(ge.unexpectedSolidusInTag),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case X.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.data+=Lt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Mn.DASH_DASH,!0)?(this._createCommentToken(Mn.DASH_DASH.length+1),this.state=Z.COMMENT_START):this._consumeSequenceIfMatch(Mn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Mn.DOCTYPE.length+1),this.state=Z.DOCTYPE):this._consumeSequenceIfMatch(Mn.CDATA_START,!0)?this.inForeignNode?this.state=Z.CDATA_SECTION:(this._err(ge.cdataInHtmlContent),this._createCommentToken(Mn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ge.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case X.HYPHEN_MINUS:{this.state=Z.COMMENT_START_DASH;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptClosingOfEmptyComment),this.state=Z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptClosingOfEmptyComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=Z.COMMENT_END_DASH;break}case X.LESS_THAN_SIGN:{n.data+="<",this.state=Z.COMMENT_LESS_THAN_SIGN;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.data+=Lt;break}case X.EOF:{this._err(ge.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=Z.COMMENT_LESS_THAN_SIGN_BANG;break}case X.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===X.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===X.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==X.GREATER_THAN_SIGN&&t!==X.EOF&&this._err(ge.nestedComment),this.state=Z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case X.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case X.EXCLAMATION_MARK:{this.state=Z.COMMENT_END_BANG;break}case X.HYPHEN_MINUS:{n.data+="-";break}case X.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{n.data+="--!",this.state=Z.COMMENT_END_DASH;break}case X.GREATER_THAN_SIGN:{this._err(ge.incorrectlyClosedComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case X.EOF:{this._err(ge.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingWhitespaceBeforeDoctypeName),this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(al(t))this._createDoctypeToken(String.fromCharCode(mc(t))),this.state=Z.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(ge.unexpectedNullCharacter),this._createDoctypeToken(Lt),this.state=Z.DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.EOF:{this._err(ge.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=Z.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=Z.AFTER_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.name+=Lt;break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(al(t)?mc(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=Z.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Mn.PUBLIC,!1)?this.state=Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Mn.SYSTEM,!1)?this.state=Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ge.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Z.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=Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(ge.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ge.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.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=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.publicId+=Lt;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.EOF:{this._err(ge.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=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.publicId+=Lt;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.EOF:{this._err(ge.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=Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case X.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.QUOTATION_MARK:{this._err(ge.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ge.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.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=Z.DATA;break}case X.QUOTATION_MARK:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.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=Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(ge.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ge.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.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=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.systemId+=Lt;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.EOF:{this._err(ge.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=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(ge.unexpectedNullCharacter),n.systemId+=Lt;break}case X.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.EOF:{this._err(ge.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=Z.DATA;break}case X.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case X.NULL:{this._err(ge.unexpectedNullCharacter);break}case X.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case X.RIGHT_SQUARE_BRACKET:{this.state=Z.CDATA_SECTION_BRACKET;break}case X.EOF:{this._err(ge.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===X.RIGHT_SQUARE_BRACKET?this.state=Z.CDATA_SECTION_END:(this._emitChars("]"),this.state=Z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case X.GREATER_THAN_SIGN:{this.state=Z.DATA;break}case X.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Z.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()&&gv(this.preprocessor.peek(1))?Z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){gv(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===X.SEMICOLON&&this._err(ge.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const iS=new Set([k.DD,k.DT,k.LI,k.OPTGROUP,k.OPTION,k.P,k.RB,k.RP,k.RT,k.RTC]),bv=new Set([...iS,k.CAPTION,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]),Kc=new Set([k.APPLET,k.CAPTION,k.HTML,k.MARQUEE,k.OBJECT,k.TABLE,k.TD,k.TEMPLATE,k.TH]),k8=new Set([...Kc,k.OL,k.UL]),w8=new Set([...Kc,k.BUTTON]),yv=new Set([k.ANNOTATION_XML,k.MI,k.MN,k.MO,k.MS,k.MTEXT]),vv=new Set([k.DESC,k.FOREIGN_OBJECT,k.TITLE]),A8=new Set([k.TR,k.TEMPLATE,k.HTML]),C8=new Set([k.TBODY,k.TFOOT,k.THEAD,k.TEMPLATE,k.HTML]),N8=new Set([k.TABLE,k.TEMPLATE,k.HTML]),_8=new Set([k.TD,k.TH]);class M8{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(w0,we.HTML)}popUntilTableCellPopped(){this.popUntilPopped(_8,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(N8,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(C8,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(A8,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(vv.has(o))return!1;break}case we.MATHML:{if(yv.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Kc)}hasInListItemScope(t){return this.hasInDynamicScope(t,k8)}hasInButtonScope(t){return this.hasInDynamicScope(t,w8)}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(w0.has(n))return!0;if(Kc.has(n))return!1;break}case we.SVG:{if(vv.has(n))return!1;break}case we.MATHML:{if(yv.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&&iS.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&bv.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&bv.has(this.currentTagId);)this.pop()}}const Am=3;var Na;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Na||(Na={}));const Ev={type:Na.Marker};class R8{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 m=this.treeAdapter.getAttrList(f);m.length===o&&i.push({idx:c,attrs:m})}}return i}_ensureNoahArkCondition(t){if(this.entries.length<Am)return;const n=this.treeAdapter.getAttrList(t),i=this._getNoahArkConditionCandidates(t,n);if(i.length<Am)return;const o=new Map(n.map(l=>[l.name,l.value]));let s=0;for(let l=0;l<i.length;l++){const c=i[l];c.attrs.every(d=>o.get(d.name)===d.value)&&(s+=1,s>=Am&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Ev)}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(Ev);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}}},rS="html",D8="about:legacy-compat",L8="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",sS=["+//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//"],O8=[...sS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],I8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),oS=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],j8=[...oS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Tv(e,t){return t.some(n=>e.startsWith(n))}function P8(e){return e.name===rS&&e.publicId===null&&(e.systemId===null||e.systemId===D8)}function B8(e){if(e.name!==rS)return ra.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===L8)return ra.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),I8.has(n))return ra.QUIRKS;let i=t===null?O8:sS;if(Tv(n,i))return ra.QUIRKS;if(i=t===null?oS:j8,Tv(n,i))return ra.LIMITED_QUIRKS}return ra.NO_QUIRKS}const Sv={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},z8="definitionurl",U8="definitionURL",H8=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])),F8=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}]]),V8=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])),q8=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 Y8(e){const t=e.tagID;return t===k.FONT&&e.attrs.some(({name:i})=>i===Mr.COLOR||i===Mr.SIZE||i===Mr.FACE)||q8.has(t)}function lS(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===z8){e.attrs[t].name=U8;break}}function uS(e){for(let t=0;t<e.attrs.length;t++){const n=H8.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Mp(e){for(let t=0;t<e.attrs.length;t++){const n=F8.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 G8(e){const t=V8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=qs(e.tagName))}function X8(e,t){return t===we.MATHML&&(e===k.MI||e===k.MO||e===k.MN||e===k.MS||e===k.MTEXT)}function K8(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===Sv.TEXT_HTML||o===Sv.APPLICATION_XML}}return t===we.SVG&&(e===k.FOREIGN_OBJECT||e===k.DESC||e===k.TITLE)}function $8(e,t,n,i){return(!i||i===we.HTML)&&K8(e,t,n)||(!i||i===we.MATHML)&&X8(e,t)}const Q8="hidden",W8=8,Z8=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 J8={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},cS=new Set([k.TABLE,k.TBODY,k.TFOOT,k.THEAD,k.TR]),kv={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Oi,onParseError:null};class wv{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={...kv,...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 S8(this.options,this),this.activeFormattingElements=new R8(this.treeAdapter),this.fragmentContextID=i?qs(this.treeAdapter.getTagName(i)):k.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new M8(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={...kv,...n};t??(t=i.treeAdapter.createElement(ue.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:J8,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)===ue.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(ue.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:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,o=this.treeAdapter.getTagName(t),s=n.type===tt.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)===ue.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 tt.CHARACTER:{this.onCharacter(t);break}case tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case tt.COMMENT:{this.onComment(t);break}case tt.DOCTYPE:{this.onDoctype(t);break}case tt.START_TAG:{this._processStartTag(t);break}case tt.END_TAG:{this.onEndTag(t);break}case tt.EOF:{this.onEof(t);break}case tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const o=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return $8(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 cS.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 y8[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_O(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:{fS(this,t);break}case ee.TEXT:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_TABLE_TEXT:{bS(this,t);break}case ee.IN_COLUMN_GROUP:{$c(this,t);break}case ee.AFTER_BODY:{Qc(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){NO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.TEXT:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_COLUMN_GROUP:{$c(this,t);break}case ee.AFTER_BODY:{Qc(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){A0(this,t);return}switch(this.insertionMode){case ee.INITIAL:case ee.BEFORE_HTML:case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:case ee.IN_TEMPLATE:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:{A0(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.AFTER_BODY:{sL(this,t);break}case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{oL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ee.INITIAL:{lL(this,t);break}case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:{this._err(t,ge.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,ge.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?MO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{uL(this,t);break}case ee.BEFORE_HEAD:{dL(this,t);break}case ee.IN_HEAD:{ya(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{mL(this,t);break}case ee.AFTER_HEAD:{gL(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:{fO(this,t);break}case ee.IN_COLUMN_GROUP:{Lp(this,t);break}case ee.IN_TABLE_BODY:{kd(this,t);break}case ee.IN_ROW:{wd(this,t);break}case ee.IN_CELL:{pO(this,t);break}case ee.IN_SELECT:{ES(this,t);break}case ee.IN_SELECT_IN_TABLE:{xO(this,t);break}case ee.IN_TEMPLATE:{yO(this,t);break}case ee.AFTER_BODY:{EO(this,t);break}case ee.IN_FRAMESET:{TO(this,t);break}case ee.AFTER_FRAMESET:{kO(this,t);break}case ee.AFTER_AFTER_BODY:{AO(this,t);break}case ee.AFTER_AFTER_FRAMESET:{CO(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?RO(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{cL(this,t);break}case ee.BEFORE_HEAD:{fL(this,t);break}case ee.IN_HEAD:{hL(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{pL(this,t);break}case ee.AFTER_HEAD:{xL(this,t);break}case ee.IN_BODY:{Sd(this,t);break}case ee.TEXT:{nO(this,t);break}case ee.IN_TABLE:{wl(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.IN_CAPTION:{hO(this,t);break}case ee.IN_COLUMN_GROUP:{mO(this,t);break}case ee.IN_TABLE_BODY:{C0(this,t);break}case ee.IN_ROW:{vS(this,t);break}case ee.IN_CELL:{gO(this,t);break}case ee.IN_SELECT:{TS(this,t);break}case ee.IN_SELECT_IN_TABLE:{bO(this,t);break}case ee.IN_TEMPLATE:{vO(this,t);break}case ee.AFTER_BODY:{kS(this,t);break}case ee.IN_FRAMESET:{SO(this,t);break}case ee.AFTER_FRAMESET:{wO(this,t);break}case ee.AFTER_AFTER_BODY:{Mc(this,t);break}}}onEof(t){switch(this.insertionMode){case ee.INITIAL:{Zo(this,t);break}case ee.BEFORE_HTML:{ul(this,t);break}case ee.BEFORE_HEAD:{cl(this,t);break}case ee.IN_HEAD:{dl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{fl(this,t);break}case ee.AFTER_HEAD:{hl(this,t);break}case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{gS(this,t);break}case ee.TEXT:{aO(this,t);break}case ee.IN_TABLE_TEXT:{Jo(this,t);break}case ee.IN_TEMPLATE:{SS(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:{Dp(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:{dS(this,t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Cm(this,t);break}case ee.IN_TABLE_TEXT:{xS(this,t);break}}}}function eL(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):pS(e,t),n}function tL(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 nL(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>=Z8;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=aL(e,c),i===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(l,i),i=l)}return i}function aL(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 iL(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 rL(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 Rp(e,t){for(let n=0;n<W8;n++){const i=eL(e,t);if(!i)break;const o=tL(e,i);if(!o)break;e.activeFormattingElements.bookmark=i;const s=nL(e,o,i.element),l=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(s),l&&iL(e,l,s),rL(e,o,i)}}function A0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function sL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function oL(e,t){e._appendCommentNode(t,e.document)}function Dp(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 lL(e,t){e._setDocumentType(t);const n=t.forceQuirks?ra.QUIRKS:B8(t);P8(t)||e._err(t,ge.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ee.BEFORE_HTML}function Zo(e,t){e._err(t,ge.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ra.QUIRKS),e.insertionMode=ee.BEFORE_HTML,e._processToken(t)}function uL(e,t){t.tagID===k.HTML?(e._insertElement(t,we.HTML),e.insertionMode=ee.BEFORE_HEAD):ul(e,t)}function cL(e,t){const n=t.tagID;(n===k.HTML||n===k.HEAD||n===k.BODY||n===k.BR)&&ul(e,t)}function ul(e,t){e._insertFakeRootElement(),e.insertionMode=ee.BEFORE_HEAD,e._processToken(t)}function dL(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:cl(e,t)}}function fL(e,t){const n=t.tagID;n===k.HEAD||n===k.BODY||n===k.HTML||n===k.BR?cl(e,t):e._err(t,ge.endTagWithoutMatchingOpenElement)}function cl(e,t){e._insertFakeElement(ue.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,ge.misplacedStartTagForHeadElement);break}default:dl(e,t)}}function hL(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:{dl(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function jr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==k.TEMPLATE&&e._err(t,ge.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ge.endTagWithoutMatchingOpenElement)}function dl(e,t){e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD,e._processToken(t)}function mL(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,ge.nestedNoscriptInHead);break}default:fl(e,t)}}function pL(e,t){switch(t.tagID){case k.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ee.IN_HEAD;break}case k.BR:{fl(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function fl(e,t){const n=t.type===tt.EOF?ge.openElementsLeftAfterEof:ge.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ee.IN_HEAD,e._processToken(t)}function gL(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,ge.abandonedHeadElementChild),e.openElements.push(e.headElement,k.HEAD),ya(e,t),e.openElements.remove(e.headElement);break}case k.HEAD:{e._err(t,ge.misplacedStartTagForHeadElement);break}default:hl(e,t)}}function xL(e,t){switch(t.tagID){case k.BODY:case k.HTML:case k.BR:{hl(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function hl(e,t){e._insertFakeElement(ue.BODY,k.BODY),e.insertionMode=ee.IN_BODY,Td(e,t)}function Td(e,t){switch(t.type){case tt.CHARACTER:{fS(e,t);break}case tt.WHITESPACE_CHARACTER:{dS(e,t);break}case tt.COMMENT:{A0(e,t);break}case tt.START_TAG:{bn(e,t);break}case tt.END_TAG:{Sd(e,t);break}case tt.EOF:{gS(e,t);break}}}function dS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function fS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function yL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function vL(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 EL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function TL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&w0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function SL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function kL(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 wL(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 AL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Gt.PLAINTEXT}function CL(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 NL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ue.A);n&&(Rp(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 _L(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ML(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(k.NOBR)&&(Rp(e,t),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.insertMarker(),e.framesetOk=!1}function DL(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 hS(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function mS(e){const t=nS(e,Mr.TYPE);return t!=null&&t.toLowerCase()===Q8}function LL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),mS(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function OL(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function IL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jL(e,t){t.tagName=ue.IMG,t.tagID=k.IMG,hS(e,t)}function PL(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 BL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function zL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function Av(e,t){e._switchToTextParsing(t,Gt.RAWTEXT)}function UL(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 HL(e,t){e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function FL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function VL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(k.RTC),e._insertElement(t,we.HTML)}function qL(e,t){e._reconstructActiveFormattingElements(),lS(t),Mp(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function YL(e,t){e._reconstructActiveFormattingElements(),uS(t),Mp(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function Cv(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:{_L(e,t);break}case k.A:{NL(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{TL(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:{EL(e,t);break}case k.LI:case k.DD:case k.DT:{wL(e,t);break}case k.BR:case k.IMG:case k.WBR:case k.AREA:case k.EMBED:case k.KEYGEN:{hS(e,t);break}case k.HR:{IL(e,t);break}case k.RB:case k.RTC:{FL(e,t);break}case k.RT:case k.RP:{VL(e,t);break}case k.PRE:case k.LISTING:{SL(e,t);break}case k.XMP:{BL(e,t);break}case k.SVG:{YL(e,t);break}case k.HTML:{bL(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:{yL(e,t);break}case k.FORM:{kL(e,t);break}case k.NOBR:{ML(e,t);break}case k.MATH:{qL(e,t);break}case k.TABLE:{DL(e,t);break}case k.INPUT:{LL(e,t);break}case k.PARAM:case k.TRACK:case k.SOURCE:{OL(e,t);break}case k.IMAGE:{jL(e,t);break}case k.BUTTON:{CL(e,t);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{RL(e,t);break}case k.IFRAME:{zL(e,t);break}case k.SELECT:{UL(e,t);break}case k.OPTION:case k.OPTGROUP:{HL(e,t);break}case k.NOEMBED:case k.NOFRAMES:{Av(e,t);break}case k.FRAMESET:{vL(e,t);break}case k.TEXTAREA:{PL(e,t);break}case k.NOSCRIPT:{e.options.scriptingEnabled?Av(e,t):Cv(e,t);break}case k.PLAINTEXT:{AL(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:Cv(e,t)}}function GL(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 XL(e,t){e.openElements.hasInScope(k.BODY)&&(e.insertionMode=ee.AFTER_BODY,kS(e,t))}function KL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function $L(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 QL(e){e.openElements.hasInButtonScope(k.P)||e._insertFakeElement(ue.P,k.P),e._closePElement()}function WL(e){e.openElements.hasInListItemScope(k.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(k.LI),e.openElements.popUntilTagNamePopped(k.LI))}function ZL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function eO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function tO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ue.BR,k.BR),e.openElements.pop(),e.framesetOk=!1}function pS(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 Sd(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:{Rp(e,t);break}case k.P:{QL(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:{KL(e,t);break}case k.LI:{WL(e);break}case k.DD:case k.DT:{ZL(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{JL(e);break}case k.BR:{tO(e);break}case k.BODY:{GL(e,t);break}case k.HTML:{XL(e,t);break}case k.FORM:{$L(e);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{eO(e,t);break}case k.TEMPLATE:{jr(e,t);break}default:pS(e,t)}}function gS(e,t){e.tmplInsertionModeStack.length>0?SS(e,t):Dp(e,t)}function nO(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 aO(e,t){e._err(t,ge.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Cm(e,t){if(e.openElements.currentTagId!==void 0&&cS.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 tt.CHARACTER:{bS(e,t);break}case tt.WHITESPACE_CHARACTER:{xS(e,t);break}}else Pl(e,t)}function iO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_CAPTION}function rO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_COLUMN_GROUP}function sO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ue.COLGROUP,k.COLGROUP),e.insertionMode=ee.IN_COLUMN_GROUP,Lp(e,t)}function oO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=ee.IN_TABLE_BODY}function lO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ue.TBODY,k.TBODY),e.insertionMode=ee.IN_TABLE_BODY,kd(e,t)}function uO(e,t){e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function cO(e,t){mS(t)?e._appendElement(t,we.HTML):Pl(e,t),t.ackSelfClosing=!0}function dO(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:{lO(e,t);break}case k.STYLE:case k.SCRIPT:case k.TEMPLATE:{ya(e,t);break}case k.COL:{sO(e,t);break}case k.FORM:{dO(e,t);break}case k.TABLE:{uO(e,t);break}case k.TBODY:case k.TFOOT:case k.THEAD:{oO(e,t);break}case k.INPUT:{cO(e,t);break}case k.CAPTION:{iO(e,t);break}case k.COLGROUP:{rO(e,t);break}default:Pl(e,t)}}function wl(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:Pl(e,t)}}function Pl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Td(e,t),e.fosterParentingEnabled=n}function xS(e,t){e.pendingCharacterTokens.push(t)}function bS(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++)Pl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const yS=new Set([k.CAPTION,k.COL,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]);function fO(e,t){const n=t.tagID;yS.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 hO(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&&wl(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:Sd(e,t)}}function Lp(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 mO(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 kd(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(ue.TR,k.TR),e.insertionMode=ee.IN_ROW,wd(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 C0(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,wl(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:wl(e,t)}}function wd(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,kd(e,t));break}default:Ps(e,t)}}function vS(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,C0(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,C0(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:wl(e,t)}}function pO(e,t){const n=t.tagID;yS.has(n)?(e.openElements.hasInTableScope(k.TD)||e.openElements.hasInTableScope(k.TH))&&(e._closeTableCell(),wd(e,t)):bn(e,t)}function gO(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(),vS(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:break;default:Sd(e,t)}}function ES(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 TS(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 xO(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)):ES(e,t)}function bO(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)):TS(e,t)}function yO(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,Lp(e,t);break}case k.TR:{e.tmplInsertionModeStack[0]=ee.IN_TABLE_BODY,e.insertionMode=ee.IN_TABLE_BODY,kd(e,t);break}case k.TD:case k.TH:{e.tmplInsertionModeStack[0]=ee.IN_ROW,e.insertionMode=ee.IN_ROW,wd(e,t);break}default:e.tmplInsertionModeStack[0]=ee.IN_BODY,e.insertionMode=ee.IN_BODY,bn(e,t)}}function vO(e,t){t.tagID===k.TEMPLATE&&jr(e,t)}function SS(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Dp(e,t)}function EO(e,t){t.tagID===k.HTML?bn(e,t):Qc(e,t)}function kS(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 Qc(e,t)}function Qc(e,t){e.insertionMode=ee.IN_BODY,Td(e,t)}function TO(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 SO(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 kO(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function wO(e,t){t.tagID===k.HTML&&(e.insertionMode=ee.AFTER_AFTER_FRAMESET)}function AO(e,t){t.tagID===k.HTML?bn(e,t):Mc(e,t)}function Mc(e,t){e.insertionMode=ee.IN_BODY,Td(e,t)}function CO(e,t){switch(t.tagID){case k.HTML:{bn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function NO(e,t){t.chars=Lt,e._insertCharacters(t)}function _O(e,t){e._insertCharacters(t),e.framesetOk=!1}function wS(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 MO(e,t){if(Y8(t))wS(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===we.MATHML?lS(t):i===we.SVG&&(G8(t),uS(t)),Mp(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function RO(e,t){if(t.tagID===k.P||t.tagID===k.BR){wS(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}}}ue.AREA,ue.BASE,ue.BASEFONT,ue.BGSOUND,ue.BR,ue.COL,ue.EMBED,ue.FRAME,ue.HR,ue.IMG,ue.INPUT,ue.KEYGEN,ue.LINK,ue.META,ue.PARAM,ue.SOURCE,ue.TRACK,ue.WBR;const DO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,LO=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Nv={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function AS(e,t){const n=VO(e),i=NT("type",{handlers:{root:OO,element:IO,text:jO,comment:NS,doctype:PO,raw:zO},unknown:UO}),o={parser:n?new wv(Nv):wv.getFragmentParser(void 0,Nv),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=qD(s,{file:o.options.file});return o.stitches&&Ed(l,"comment",function(c,d,f){const m=c;if(m.value.stitch&&f&&d!==void 0){const x=f.children;return x[d]=m.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function CS(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function OO(e,t){CS(e.children,t)}function IO(e,t){HO(e,t),CS(e.children,t),FO(e,t)}function jO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:tt.CHARACTER,chars:e.value,location:Bl(e)};Ys(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function PO(e,t){const n={type:tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bl(e)};Ys(t,Da(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function BO(e,t){t.stitches=!0;const n=qO(e);if("children"in e&&"children"in n){const i=AS({type:"root",children:e.children},t.options);n.children=i.children}NS({type:"comment",value:{stitch:n}},t)}function NS(e,t){const n=e.value,i={type:tt.COMMENT,data:n,location:Bl(e)};Ys(t,Da(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function zO(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,_S(t,Da(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(DO,"&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 UO(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))BO(n,t);else{let i="";throw LO.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){_S(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 _S(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 HO(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=$D({...e,children:[]},{space:o===Er.svg?"svg":"html"}),l={type:tt.START_TAG,tagName:n,tagID:qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Bl(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function FO(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&a8.includes(n)||t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ys(t,pd(e));const i={type:tt.END_TAG,tagName:n,tagID:qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bl(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Gt.RCDATA||t.parser.tokenizer.state===Gt.RAWTEXT||t.parser.tokenizer.state===Gt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Gt.DATA)}function VO(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Bl(e){const t=Da(e)||{line:void 0,column:void 0,offset:void 0},n=pd(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function qO(e){return"children"in e?Or({...e,children:[]}):Or(e)}function MS(e){return function(t,n){return AS(t,{...e,file:n})}}const pr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ml={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...pr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...pr],h2:[["className","sr-only"]],img:[...pr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...pr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...pr],table:[...pr],ul:[...pr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ji={}.hasOwnProperty;function YO(e,t){let n={type:"root",children:[]};const i={schema:t?{...ml,...t}:ml,stack:[]},o=RS(i,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function RS(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return GO(e,n);case"doctype":return XO(e,n);case"element":return KO(e,n);case"root":return $O(e,n);case"text":return QO(e,n)}}}function GO(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 zl(s,t),s}}function XO(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return zl(n,t),n}}function KO(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const i=DS(e,t.children),o=WO(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 zl(l,t),l}function $O(e,t){const i={type:"root",children:DS(e,t.children)};return zl(i,t),i}function QO(e,t){const i={type:"text",value:typeof t.value=="string"?t.value:""};return zl(i,t),i}function DS(e,t){const n=[];if(Array.isArray(t)){const i=t;let o=-1;for(;++o<i.length;){const s=RS(e,i[o]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function WO(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 m=c[f];let x=_v(e,Mv(s,f),f,m);x==null&&(x=_v(e,Mv(l,f),f,m)),x!=null&&(d[f]=x)}if(o&&ji.call(o,n)){const m=o[n];for(f in m)ji.call(m,f)&&!ji.call(d,f)&&(d[f]=m[f])}return d}function _v(e,t,n,i){return t?Array.isArray(i)?ZO(e,t,n,i):LS(e,t,n,i):void 0}function ZO(e,t,n,i){let o=-1;const s=[];for(;++o<i.length;){const l=LS(e,t,n,i[o]);(typeof l=="number"||typeof l=="string")&&s.push(l)}return s}function LS(e,t,n,i){if(!(typeof i!="boolean"&&typeof i!="number"&&typeof i!="string")&&JO(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 JO(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 m=i[f];if(s===m.length&&o.slice(0,m.length)===m)return!0}return!1}function zl(e,t){const n=$E(t);t.data&&(e.data=Or(t.data)),n&&(e.position=n)}function Mv(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 OS(e){return function(t){return YO(t,e)}}var fE;const IS={...ml,protocols:{...ml.protocols,src:[...((fE=ml.protocols)==null?void 0:fE.src)??["http","https","mailto"],"data"]}};function eI({retry:e}){const t=Ye();return g.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[g.jsx(ri,{className:"w-4 h-4 shrink-0 mt-0.5"}),g.jsxs("span",{children:[t("error.renderFailed")," ",g.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class tI extends _.Component{constructor(){super(...arguments);qh(this,"state",{error:null});qh(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary caught]",n,i.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.retry):g.jsx(eI,{error:this.state.error,retry:this.retry}):this.props.children}}function nI({nodeId:e,onRated:t}){const n=Ye(),[i,o]=_.useState(!1),[s,l]=_.useState(!1),c=async d=>{if(!(i||s)){o(!0);try{await fe.recordReview(e,d),l(!0),t==null||t(),Nr(d>=4?"correct":"wrong")}catch{}finally{o(!1)}}};return s?g.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):g.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[g.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),g.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[g.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:[g.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),g.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),g.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:[g.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),g.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),g.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:[g.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),g.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function Wc(e){const t=[];let n="";const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(s){const l=s.parentElement;if(!l)return NodeFilter.FILTER_REJECT;const c=l.tagName;return c==="SCRIPT"||c==="STYLE"||l.closest("mark.lookatstudy-underline")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let o;for(;o=i.nextNode();){const s=o,l=s.textContent??"",c=n.length;n+=l,t.push({node:s,start:c,end:n.length})}return{text:n,nodes:t}}function jS(e,t){const n=Rv(e.startContainer,e.startOffset,t,"start"),i=Rv(e.endContainer,e.endOffset,t,"end");return n==null||i==null||i<=n?null:{start:n,end:i}}function Rv(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 m=PS(c[f],n);if(m!=null)return m}const d=n.nodes[n.nodes.length-1];return d?d.end:null}else{for(let f=t;f>=0;f--){const m=BS(c[f],n);if(m!=null)return m}const d=n.nodes[0];return d?d.start:null}}return null}function PS(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=PS(n,t);if(i!=null)return i}return null}function BS(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=BS(i,t);o!=null&&(n=o)}return n}return null}function aI(e,t,n){var c,d,f,m;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,((m=s.textContent)==null?void 0:m.length)??0)),x}catch{return null}}function zS(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(s=>{const l=s.parentNode;if(l){for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}),e.normalize();const n=new Map;if(t.length===0)return n;const i=Wc(e),o=[];for(const s of t){const l=iI(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=aI(i,s.start,s.end);if(!l)continue;const c=rI(l,s.noteId);c&&n.set(s.noteId,c)}return n}function iI(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 rI(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 m=document.createElement("mark");m.className="lookatstudy-underline",m.dataset.noteId=t,m.style.cssText=n,(i=f.parentNode)==null||i.insertBefore(m,f),m.appendChild(f),c||(c=m)}return c}catch{return null}}function US(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 HS(e,t,n){const o=e.top+e.height/2;return e.right+8+n<=t?{left:e.right+8,top:o,transform:"translate(0, -50%)"}:e.left-8-n>=0?{left:e.left-8,top:o,transform:"translate(-100%, -50%)"}:{left:e.left,top:e.bottom+8,transform:"translate(0, 0)"}}function Ad({title:e,onClose:t,children:n}){const i=Ye(),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]),cp.createPortal(g.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:[g.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:s=>s.stopPropagation(),children:[g.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),g.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[g.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:i("artifact.viewer.hint")}),g.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:g.jsx(la,{className:"w-5 h-5"})})]})]}),g.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:g.jsx("div",{ref:o,className:"h-full w-full",onClick:s=>s.stopPropagation(),children:n})})]}),document.body)}function sI(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 oI(e,t,n,i,o=24){const s=sI(e,t,n,i,o);return{scale:s,x:(n-e*s)/2,y:(i-t*s)/2}}function lI(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 uI(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(lI(e,l,n,i),o.contentW,o.contentH,o.viewW,o.viewH)}const Dv=.05,Lv=4,pc=1.25;function Ul({children:e,grid:t=!0,testid:n}){const i=Ye(),o=_.useRef(null),s=_.useRef(null),[l,c]=_.useState({x:0,y:0,scale:1}),[d,f]=_.useState(null),[m,x]=_.useState(!1),b=_.useRef("mouse"),p=_.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:Dv,max:Lv,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(oI(R.contentW,R.contentH,R.viewW,R.viewH)),p.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(F=>uI(F,R,B,Q,P)),p.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,F]=[...D.pointers.values()];D.pinchBase={dist:Math.hypot(Q.x-F.x,Q.y-F.y),factorAcc:1},D.lastMid={x:(Q.x+F.x)/2,y:(Q.y+F.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()],F=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=F/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,W=T();c(ae=>il({...ae,x:ae.x+H,y:ae.y+G},W.contentW,W.contentH,W.viewW,W.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 F=T();c(z=>il({...z,x:z.x+B,y:z.y+Q},F.contentW,F.contentH,F.viewW,F.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();p.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)),p.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?pc:1/pc,R.clientX-j.left,R.clientY-j.top)},[M]),I=_.useCallback(()=>{if(b.current!=="mouse")return;const R=T();p.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)),p.current=!1):w()},[T,w]);return g.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:[g.jsx("div",{ref:s,className:`absolute top-0 left-0 canvas-stage-gesture ${m?"":"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out"}`,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`,transformOrigin:"0 0"},children:e}),g.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:[g.jsx("button",{onClick:()=>M(1/pc),disabled:l.scale<=Dv+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:g.jsx(NC,{className:"w-4 h-4"})}),g.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),"%"]}),g.jsx("button",{onClick:()=>M(pc),disabled:l.scale>=Lv-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:g.jsx(ud,{className:"w-4 h-4"})}),g.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:g.jsx(Dl,{className:"w-4 h-4"})})]}),g.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 cI(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 m of e)if(d+=ga(m),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 m of d){if(ga(f+m+"…")>Ss)break;f+=m}return f+"…"};return[ga(s)>Ss?c(s):s,ga(l)>Ss?c(l):l]}function dI(e,t){const n=cI(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 fI=28,hI=52,Ov=34;function FS(e,t){var B,Q,F;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])),m=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((W,ae)=>(f.get(W)??0)-(f.get(ae)??0)))b.has(G)||(b.set(G,(b.get(H)??0)+1),m.set(G,H),x.get(H).push(G),z.push(G))}}let p=0;for(const z of b.values())p=Math.max(p,z);const y=e.filter(z=>!b.has(z.id)).map(z=>z.id);for(const z of y)b.set(z,p+1),m.set(z,d),x.get(d).push(z);for(const z of b.values())p=Math.max(p,z);const E=new Map,T=z=>{const H=E.get(z);if(H!=null)return H;const G=x.get(z)??[],W=G.length===0?1:G.reduce((ae,V)=>ae+T(V),0);return E.set(z,W),W};d&&T(d);const w=new Map,M=(z,H,G)=>{const W=x.get(z)??[];if(W.length===0)return;const ae=W.reduce((Y,te)=>Y+(E.get(te)??1),0);let V=H;for(const Y of W){const te=(E.get(Y)??1)/ae*G;w.set(Y,V+te/2),M(Y,V,te),V+=te}};d&&M(d,-Math.PI/2,Math.PI*2);const N=new Map;for(const z of e)N.set(z.id,dI(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<=p;z++){const H=L.get(z)??[];if(H.length===0){A.set(z,A.get(z-1)??0);continue}const W=H.reduce((K,$)=>{var J;return K+(((J=N.get($))==null?void 0:J.width)??0)+Ov},0)/(Math.PI*2),ae=H.map(K=>({id:K,a:w.get(K)??0})).sort((K,$)=>K.a-$.a);let V=0;if(ae.length>1)for(let K=0;K<ae.length;K++){const $=ae[K],J=ae[(K+1)%ae.length];let se=J.a-$.a;if(K===ae.length-1&&(se+=Math.PI*2),se<=.01)continue;const ke=((((Q=N.get($.id))==null?void 0:Q.width)??0)+(((F=N.get(J.id))==null?void 0:F.width)??0))/2+Ov;V=Math.max(V,ke/(2*Math.sin(Math.min(Math.PI,se)/2)))}const Y=A.get(z-1)??0,te=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})),ie=H.length===1?60:0;A.set(z,Math.max(Y+te+U+hI,W,V+ie))}const C=new Map;for(const z of e){const H=b.get(z.id)??0,G=A.get(H)??0,W=H===0?0:w.get(z.id)??0;C.set(z.id,{id:z.id,center:{x:G*Math.cos(W),y:G*Math.sin(W)},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+fI)),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 W=Iv(H,G.center),ae=Iv(G,H.center),V={x:(W.x+ae.x)/2,y:(W.y+ae.y)/2},Y=ae.x-W.x,te=ae.y-W.y,U=Math.hypot(Y,te)||1,ie=Math.min(34,Math.max(10,U*.16)),K={x:V.x+te/U*ie,y:V.y-Y/U*ie};let $={x:(W.x+2*K.x+ae.x)/4,y:(W.y+2*K.y+ae.y)/4};if(z.label){const J=ga(z.label,12)+14;for(const se of P)if(Math.hypot($.x-se.pt.x,$.y-se.pt.y)<(J+se.w)/2+6){$={x:$.x+te/U*22,y:$.y-Y/U*22};break}P.push({pt:$,w:J})}D.push({edge:z,d:`M ${W.x.toFixed(1)} ${W.y.toFixed(1)} Q ${K.x.toFixed(1)} ${K.y.toFixed(1)} ${ae.x.toFixed(1)} ${ae.y.toFixed(1)}`,labelPt:$})}return{nodes:C,edges:D,rootId:d,width:Math.ceil(R),height:Math.ceil(R)}}function Iv(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 mI(e){return{width:ga(e,12)+16,height:19}}const gc=.4,Nm=2.5,xc=.2;function jv({data:e}){const t=_.useMemo(()=>FS(e.nodes,e.edges),[e.nodes,e.edges]);return g.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[g.jsx("defs",{children:g.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:g.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?mI(n.label):null;return g.jsxs("g",{children:[g.jsx("path",{d:i,className:"fill-none stroke-ink-faint/70",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),n.label&&l&&g.jsxs("g",{children:[g.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}),g.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 g.jsxs("g",{children:[g.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)=>g.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 VS({data:e,variant:t="card"}){const n=e,i=Ye(),o=_.useMemo(()=>FS(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(gc,+w.toFixed(2)))};E();const T=new ResizeObserver(E);return T.observe(y),()=>T.disconnect()},[o.width]);const m=_.useCallback(()=>l(y=>Math.min(Nm,+(y+xc).toFixed(2))),[]),x=_.useCallback(()=>l(y=>Math.max(gc,+(y-xc).toFixed(2))),[]),b=_.useCallback(()=>l(1),[]),p=_.useCallback(y=>{if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const E=y.deltaY>0?-xc:xc;l(T=>Math.min(Nm,Math.max(gc,+(T+E).toFixed(2))))},[]);return t==="canvas"?g.jsx("div",{"data-testid":"conceptmap-canvas-content",children:g.jsx(jv,{data:n})}):g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[g.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[g.jsx(op,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),g.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[g.jsx("button",{onClick:x,disabled:s<=gc,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomOut"),children:"−"}),g.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),"%"]}),g.jsx("button",{onClick:m,disabled:s>=Nm,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomIn"),children:"+"})]}),g.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:g.jsx(Dl,{className:"w-3.5 h-3.5"})})]})]}),g.jsx("div",{ref:f,onClick:()=>d(!0),onWheel:p,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:g.jsx("div",{style:{width:o.width*s,height:o.height*s,margin:"0 auto"},children:g.jsx("div",{style:{transform:`scale(${s})`,transformOrigin:"top left",width:o.width,height:o.height},children:g.jsx(jv,{data:n})})})}),g.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:g.jsx("span",{children:i("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&g.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[g.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),g.jsx("span",{children:n.warnings.join("; ")})]}),c&&g.jsx(Ad,{title:n.title,onClose:()=>d(!1),children:g.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:g.jsx(Ul,{testid:"conceptmap-modal-stage",children:g.jsx(VS,{data:e,variant:"canvas"})})})})]})}function pI(e,t){const{correct:n,total:i}=e,o=i>0&&n===i,s=i>0&&n<i,l=t!=null&&t>=$C,c=t!=null&&t>=QC;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 gI="ls-quiz-progress:";function xI(e){const t=e.questions.map(i=>`${i.prompt}|${(i.options??[]).join("/")}#${i.answer??""}`).join(`
539
- `);let n=2166136261;for(let i=0;i<t.length;i++)n^=t.charCodeAt(i),n=Math.imul(n,16777619);return`${gI}${(n>>>0).toString(36)}`}function bI(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 yI(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const vI={"explain-wrong":{icon:fC,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:Ac,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:r0,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:ai,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:a0,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function EI({data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o}){const s=e,l=Ye(),c=_.useMemo(()=>xI(s),[s]),d=_.useMemo(()=>bI(c),[c]),[f,m]=_.useState((d==null?void 0:d.current)??0),[x,b]=_.useState(null),[p,y]=_.useState(!1),[E,T]=_.useState((d==null?void 0:d.score)??{correct:0,total:0}),w=_.useRef([]);_.useEffect(()=>{yI(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 g.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[g.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),g.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),M?g.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:l("quiz.hook.sent")}):g.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?pI(E,n??null):[];return g.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[g.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),g.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),g.jsx("div",{className:"text-label text-ink-muted mt-1",children:E.correct===E.total?l("quiz.allCorrectHint"):l("quiz.tryAgainHint")}),j.length>0&&g.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[g.jsx("div",{className:"text-label text-ink-muted",children:l("quiz.action.nextPrompt")}),j.map((D,P)=>{const B=vI[D.id],Q=B.icon;return g.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:[g.jsx(Q,{className:"w-4 h-4"}),l(B.labelKey)]},D.id)})]})]})}const L=s.questions[f],A=p&&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]})),m(R=>R+1),b(null),y(!1)};return g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[g.jsxs("div",{className:"flex items-center justify-between mb-3",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ip,{className:"w-4 h-4 text-brand"}),g.jsx("span",{className:"text-label font-bold text-brand",children:l("quiz.questionProgress",{cur:f+1,total:s.questions.length})})]}),g.jsx("span",{className:"text-label text-ink-muted",children:l("quiz.answeredCorrect",{n:E.correct})})]}),g.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:L.prompt}),g.jsx("div",{className:"space-y-2 mb-3",children:L.options.map((R,j)=>{const D=x===j,P=p&&j===L.answer,B=p&&D&&!P;return g.jsxs("button",{onClick:()=>!p&&b(j),disabled:p,"data-testid":`quiz-option-${j}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${P?"border-brand bg-brand/10 text-brand animate-answer-correct":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)]"} ${p?"cursor-default":"cursor-pointer"}`,children:[g.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+j)}),R,P&&g.jsx("span",{className:"float-right",children:g.jsx(Fn,{className:"w-4 h-4 inline-block"})}),B&&g.jsx("span",{className:"float-right",children:g.jsx(la,{className:"w-4 h-4 inline-block"})})]},j)})}),p&&g.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:[g.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[A?g.jsx(Fn,{className:"w-4 h-4"}):g.jsx(la,{className:"w-4 h-4"}),g.jsx("span",{children:l(A?"quiz.correct":"quiz.wrong")})]}),g.jsx("div",{className:"text-ink-muted",children:L.explanation})]}),p?g.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")}):g.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&&g.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[g.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),g.jsx("span",{children:s.warnings.join("; ")})]})]})}function qS({data:e,variant:t="card"}){const n=e,i=Ye(),[o,s]=_.useState(!1),l=g.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[g.jsx("thead",{children:g.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((c,d)=>g.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))})}),g.jsx("tbody",{children:n.rows.map((c,d)=>g.jsx("tr",{className:d%2===0?"bg-surface-0/40":"",children:c.map((f,m)=>g.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${m===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:m===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:f},m))},d))})]});return t==="canvas"?g.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:l}):g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx(SE,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),g.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:g.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),g.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&&g.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[g.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),g.jsx("span",{children:n.warnings.join("; ")})]}),o&&g.jsx(Ad,{title:n.title,onClose:()=>s(!1),children:g.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:g.jsx(Ul,{testid:"comparetable-modal-stage",children:g.jsx("div",{className:"p-2 surface-card",children:g.jsx(qS,{data:e,variant:"canvas"})})})})})]})}let Rc=null;function TI(){return Rc||(Rc=Uc(()=>import("./mermaid.core-DtRZ8QZA.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:SI(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),Rc}function SI(){const e=(n,i)=>{if(typeof document>"u")return i;const o=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return o?`rgb(${o})`:i};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:e("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:e("--border-rgb","rgb(37 38 41)"),primaryTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:e("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:e("--ink-rgb","rgb(245 245 250)"),tertiaryColor:e("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:e("--ink-rgb","rgb(245 245 250)"),lineColor:e("--ink-faint-rgb","rgb(117 117 126)"),textColor:e("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:e("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:e("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:e("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:e("--border-rgb","rgb(37 38 41)"),mainBkg:e("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:e("--ink-rgb","rgb(245 245 250)"),arrowheadColor:e("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:e("--surface-3-rgb","rgb(42 43 46)"),actorBorder:e("--border-rgb","rgb(37 38 41)"),actorTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:e("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:e("--border-rgb","rgb(37 38 41)"),signalColor:e("--ink-rgb","rgb(245 245 250)"),signalTextColor:e("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:e("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:e("--border-rgb","rgb(37 38 41)"),labelTextColor:e("--ink-rgb","rgb(245 245 250)"),loopTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:e("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{Rc=null});async function kI(e,t){const n=await TI();try{await n.parse(t)}catch(o){throw new Error(`mermaid 语法校验失败: ${o instanceof Error?o.message:String(o)}`)}const{svg:i}=await n.render(e,t);if(i.includes('aria-roledescription="error"')||i.includes('class="error-text"')||i.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return i}const _m=.3,Mm=3,bc=.2;function YS({data:e,variant:t="card"}){const n=e,i=Ye(),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[m,x]=_.useState(null),[b,p]=_.useState(1),[y,E]=_.useState(!1);_.useEffect(()=>{let C=!1;return c({status:"loading"}),x(null),kI(`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(()=>p(C=>Math.min(Mm,+(C+bc).toFixed(2))),[]),M=_.useCallback(()=>p(C=>Math.max(_m,+(C-bc).toFixed(2))),[]),N=_.useCallback(()=>p(1),[]),L=_.useCallback(C=>{if(!C.ctrlKey&&!C.metaKey)return;C.preventDefault();const I=C.deltaY>0?-bc:bc;p(R=>Math.min(Mm,Math.max(_m,+(R+I).toFixed(2))))},[]),A=l.status==="rendered"?g.jsx("div",{ref:C=>{var I;if(C&&!m){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:(m==null?void 0:m.width)??void 0,height:(m==null?void 0:m.height)??void 0},dangerouslySetInnerHTML:{__html:l.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?g.jsx("div",{"data-testid":"mermaid-canvas-content",children:A}):g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[g.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[g.jsx(YC,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),g.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})]}),g.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.status==="rendered"&&g.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[g.jsx("button",{onClick:M,disabled:b<=_m,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),g.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),"%"]}),g.jsx("button",{onClick:w,disabled:b>=Mm,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:i("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),l.status==="rendered"&&g.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:g.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),g.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 ↗"})]}),g.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"&&g.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),g.jsx("span",{children:i("artifact.mermaid.rendering")})]}),l.status==="rendered"&&g.jsx("div",{style:{width:m?m.width*b:"auto",height:m?m.height*b:"auto",margin:"0 auto"},children:g.jsx("div",{style:{transform:`scale(${b})`,transformOrigin:"top left"},children:A})}),l.status==="error"&&g.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[g.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[g.jsx(ri,{className:"w-4 h-4 shrink-0"}),g.jsx("span",{children:i("artifact.mermaid.renderFailed")})]}),g.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}),g.jsx("div",{className:"text-caption text-ink-muted mt-2",children:i("artifact.mermaid.errorPrefix",{msg:l.message})})]})]}),l.status==="rendered"&&g.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:g.jsx("span",{children:i("artifact.mermaid.hint")})}),y&&l.status==="rendered"&&g.jsx(Ad,{title:n.title,onClose:()=>E(!1),children:g.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:g.jsx(Ul,{testid:"mermaid-modal-stage",children:g.jsx(YS,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&g.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[g.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),g.jsx("span",{children:n.warnings.join("; ")})]})]})}function GS({data:e,variant:t="card"}){const n=e,i=Ye(),[o,s]=_.useState(null),[l,c]=_.useState(!1),d=_.useRef([]),f=_.useRef([]),m=n.code.split(`
540
- `),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"})}},p=E=>g.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:g.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:g.jsx("code",{children:m.map((T,w)=>{const M=w+1;return g.jsxs("div",{ref:N=>{E.current[w]=N},className:`flex ${x(M)?"bg-brand/15":""}`,children:[g.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}),g.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:T||" "})]},w)})})})}),y=g.jsxs("div",{className:"space-y-2",children:[g.jsx("div",{className:"text-caption font-bold text-ink-muted",children:i("artifact.codewalk.sectionLabel")}),n.annotations.map((E,T)=>g.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:[g.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})}),g.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:E.note})]},T))]});return t==="canvas"?g.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:p(f)}):g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx(gE,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),g.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})]}),g.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:g.jsx(Dl,{className:"w-3.5 h-3.5"})})]}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[g.jsx("div",{onClick:()=>{l||c(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:p(d)}),y]}),n.warnings&&n.warnings.length>0&&g.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[g.jsx(ri,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),g.jsx("span",{children:n.warnings.join("; ")})]}),l&&g.jsx(Ad,{title:n.title,onClose:()=>c(!1),children:g.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:g.jsx(Ul,{testid:"codewalk-modal-stage",children:g.jsx(GS,{data:e,variant:"canvas"})})})})]})}function wI({data:e,onPickAction:t}){const n=e,i=Ye(),[o,s]=_.useState(null),l=c=>{o||(s(c.id),t==null||t(`${i("guess.pickedPrefix")}${c.label}`))};return g.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[g.jsx(pC,{className:"w-4 h-4 text-accent"}),g.jsx("span",{className:"text-label font-bold text-accent",children:i("guess.header")})]}),g.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),g.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 g.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:[g.jsx("span",{children:c.label}),d&&g.jsx(Fn,{className:"w-4 h-4 shrink-0"})]},c.id)})}),o&&g.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&&g.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Op({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o,variant:s="card"}){const l=e;if(!l||!l.artifactType)return g.jsx(Pv,{data:e});switch(l.artifactType){case"concept_map":return g.jsx(VS,{data:e,variant:s});case"quiz":return g.jsx(EI,{data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o});case"compare_table":return g.jsx(qS,{data:e,variant:s});case"diagram":return g.jsx(YS,{data:e,variant:s});case"code_walkthrough":return g.jsx(GS,{data:e,variant:s});case"guess":return g.jsx(wI,{data:e,onPickAction:i});default:return g.jsx(Pv,{data:e})}}function Pv({data:e}){var n;const t=Ye();return g.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[g.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[g.jsx(TE,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),g.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 XS(){const[e,t]=_.useState(null),[n,i]=_.useState(null),[o,s]=_.useState(null),[l,c]=_.useState(!1),d=_.useRef(null),f=_.useRef([]),m=_.useRef(!1),x=_.useRef([]),b=_.useRef(0),p=_.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&&p.current>=b.current&&!m.current&&(E.current=null,t(null),i(null))},[]),M=_.useCallback(()=>{const C=d.current,I=f.current.shift();if(!C||!I){m.current=!1,w();return}m.current=!0;const R=C.createBufferSource();R.buffer=I,R.connect(C.destination),R.onended=()=>{p.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=[],m.current=!1,b.current=0,p.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,p.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),m.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 KS=_.createContext(null);let AI=0;const CI={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},NI={default:null,success:g.jsx(ai,{className:"w-4 h-4 text-brand shrink-0"}),error:g.jsx(i0,{className:"w-4 h-4 text-warning shrink-0"}),warning:g.jsx(ri,{className:"w-4 h-4 text-review shrink-0"}),info:g.jsx(TC,{className:"w-4 h-4 text-accent shrink-0"})};function _I({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=++AI,f=(c==null?void 0:c.severity)??"default",m=(c==null?void 0:c.duration)??CI[f],x={id:d,message:l,action:c==null?void 0:c.action,duration:m,severity:f,exiting:!1};n(b=>[...b,x]),window.setTimeout(()=>o(d),m)},[o]);return g.jsxs(KS.Provider,{value:{show:s},children:[e,g.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=>g.jsx(MI,{item:l,onAction:()=>{l.action.onClick(),o(l.id)},onDismiss:()=>o(l.id),onExitDone:()=>i(l.id)},l.id))})]})}function MI({item:e,onAction:t,onDismiss:n,onExitDone:i}){const o=Ye(),s=NI[e.severity];return g.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,g.jsx("span",{className:"flex-1",children:e.message}),e.action&&g.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}),g.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:g.jsx(la,{className:"w-3.5 h-3.5"})})]})}function Ip(){const e=_.useContext(KS);return e||{show:()=>{}}}const RI={concept_map:op,quiz:ip,compare_table:SE,diagram:bC,code_walkthrough:gE},DI=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function LI(e,t){return DI.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function OI({selectedNode:e,items:t,loading:n,forceTab:i,canvasArtifact:o,isReviewing:s,onReviewDone:l,onUserTabChange:c,onRemove:d,onTogglePin:f,onRecordQuizResult:m,onSaveContentNote:x,onUpdateNoteComment:b,onJumpToSource:p,onQuoteToChat:y,locale:E}){var I;const T=Ye(),[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]),g.jsxs("div",{className:"h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[g.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:g.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[g.jsx(Om,{label:T("notebook.tab.explain"),icon:ii,active:N==="content",onClick:()=>L("content"),testid:"tab-content"}),g.jsx(Om,{label:T("notebook.tab.notes"),icon:_C,active:N==="notes",onClick:()=>L("notes"),testid:"tab-notes",badge:A.length>0?String(A.length):void 0}),g.jsx(Om,{label:T("notebook.tab.board"),icon:Wh,active:N==="board",onClick:()=>L("board"),testid:"tab-board"})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:C,role:"tabpanel",children:N==="board"?g.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:o?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[g.jsx(Wh,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("span",{className:"text-label font-bold text-ink truncate",children:((I=o.output)==null?void 0:I.title)??o.toolName})]}),g.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:g.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:g.jsx(Ul,{testid:"board-canvas-stage",children:g.jsx(Op,{data:o.output,variant:"canvas"})})})})]}):g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[g.jsx(Wh,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),g.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:T("notebook.board.empty")})]})}):g.jsx(g.Fragment,{children:g.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:N==="content"?g.jsx(II,{selectedNode:e,contentNotes:A.filter(R=>R.artifactType==="user_note"&&R.sourceAnchor),onQuoteToChat:y,onSaveContentNote:x,locale:E,isReviewing:s,onReviewDone:l}):g.jsx(jI,{items:A,loading:n,selectedNode:e,onRemove:d,onTogglePin:f,onRecordQuizResult:m,onUpdateNoteComment:b,onJumpToSource:p})})})},N)]})}function II({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:i,locale:o,isReviewing:s,onReviewDone:l}){const c=Ye(),d=Ip(),f=XS();_.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 m=_.useRef(f.stop);m.current=f.stop;const x=e?`content-${e.id}`:null;_.useEffect(()=>()=>{m.current()},[x]);const[b,p]=_.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){p(null),w(!1);return}let P=!1;return E(!0),w(!1),fe.getNodeContent(e.id,o??void 0).then(B=>{P||p(B)}).catch(()=>{P||(p(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 fe.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 F=JSON.parse(Q.sourceAnchor);if(F.type==="content"){const z=JSON.parse(Q.data).text??"";z&&P.push({noteId:Q.id,text:z,surrounding:F.surroundingText})}}catch{}const B=setTimeout(()=>{I.current&&zS(I.current,P)},80);return()=>clearTimeout(B)},[b,t]),_.useEffect(()=>{const P=B=>{var z;const Q=B.detail;if(!Q)return;const F=(z=I.current)==null?void 0:z.querySelector(`mark[data-note-id="${Q}"]`);F&&US(F)};return window.addEventListener("lookatstudy-jump-to-note",P),()=>window.removeEventListener("lookatstudy-jump-to-note",P)},[]);const R=_.useCallback(()=>{var te;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||!((te=C.current)!=null&&te.contains(Q.commonAncestorContainer))){A(null);return}const F=Q.getBoundingClientRect(),z=C.current.getBoundingClientRect(),H=I.current;let G=null;if(H&&H.contains(Q.commonAncestorContainer)){const U=Wc(H);G=jS(Q,U)}const W=H?Wc(H).text:B,ae=G?G.start:W.indexOf(B),V=ae>=0?W.slice(Math.max(0,ae-30),ae+B.length+30):B,Y=HS({left:F.left-z.left,top:F.top-z.top,right:F.right-z.left,bottom:F.bottom-z.top,width:F.width,height:F.height},z.width,n?150:100);A({x:Y.left,y:Y.top,transform:Y.transform,text:B,surrounding:V,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,F;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),(F=window.getSelection())==null||F.removeAllRanges()},[L,i,e]);return e?g.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:C,onMouseUp:R,children:[g.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")}),g.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[g.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title}),!y&&!T&&b&&g.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?g.jsx(lp,{className:"w-4 h-4"}):g.jsx(wE,{className:"w-4 h-4"})})]}),y?g.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),c("notebook.content.loading")]}):T?g.jsxs("div",{className:"text-body text-warning",children:[c("notebook.content.load_failed"),g.jsx("button",{className:"underline ml-1",onClick:()=>{w(!1),E(!0),fe.getNodeContent(e.id,o??void 0).then(p).catch(()=>w(!0)).finally(()=>E(!1))},children:c("notebook.content.retry")})]}):b?g.jsx(tI,{fallback:(P,B)=>g.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[g.jsx("div",{className:"text-body text-warning mb-2",children:c("notebook.content.render_failed")}),g.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?`
541
- `+c("notebook.content.truncated"):""]}),g.jsx("div",{className:"flex gap-2 mt-2",children:g.jsx("button",{className:"text-caption underline text-accent",onClick:B,children:c("notebook.content.retry_render")})})]}),children:g.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:g.jsx(ST,{remarkPlugins:[KT],rehypePlugins:[MS,[OS,IS]],urlTransform:P=>P,components:{a({children:P,...B}){return g.jsx("a",{...B,target:"_blank",rel:"noopener noreferrer",children:P})},img({src:P,alt:B,...Q}){return g.jsx(PI,{src:P,alt:B,assets:M,...Q})},table({children:P}){return g.jsx("div",{className:"overflow-x-auto my-4",children:g.jsx("table",{children:P})})}},children:b})})},`${e.id}-${o??"orig"}`):g.jsx("div",{className:"text-body text-ink-muted",children:c("notebook.content.empty")}),M.length>0&&g.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[g.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[g.jsx(EC,{className:"w-3.5 h-3.5"}),g.jsx("span",{children:c("notebook.images.heading",{n:M.length})})]}),g.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:M.map(P=>g.jsx(BI,{asset:P},P.id))})]}),L&&g.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&&g.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:[g.jsx(EE,{className:"w-3 h-3"}),c("notebook.quote.ask")]}),g.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:[g.jsx(vl,{className:"w-3.5 h-3.5"}),c("notebook.quote.add_note")]})]}),e.sourcePath&&g.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})}),g.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:[g.jsx(Hc,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),g.jsx("span",{children:c("notebook.quote.hint")})]}),s&&e&&g.jsx(nI,{nodeId:e.id,onRated:l})]}):g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[g.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),g.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:c("notebook.empty.select_node")})]})}function jI({items:e,loading:t,selectedNode:n,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c}){const d=Ye();if(!n)return g.jsx(Bv,{message:d("notebook.empty.notes.title"),icon:"📓"});if(t)return g.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[g.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)),m=e.filter(E=>E.artifactType==="user_note"),x=e.filter(E=>E.artifactType==="quiz"),b=e.length,p=x.filter(E=>E.lastResult==="correct").length,y=x.filter(E=>E.lastResult==="wrong").length;return b===0?g.jsx(Bv,{message:d("notebook.empty.no_notes_message"),icon:"🧩"}):g.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[g.jsx(Rm,{title:d("notebook.zone.understand"),icon:g.jsx(op,{className:"w-4 h-4"}),subtitle:d("notebook.zone.understand.subtitle"),count:f.length,testid:"zone-understand",defaultOpen:!1,children:f.length===0?g.jsx(Dm,{hint:d("notebook.zone.understand.empty_hint")}):f.map(E=>g.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),g.jsx(Rm,{title:d("notebook.zone.note"),icon:g.jsx(vl,{className:"w-4 h-4"}),subtitle:d("notebook.zone.note.subtitle"),count:m.length,testid:"zone-note",defaultOpen:!1,children:m.length===0?g.jsx(Dm,{hint:d("notebook.zone.note.empty_hint")}):m.map(E=>g.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),g.jsx(Rm,{title:d("notebook.zone.practice"),icon:g.jsx(ip,{className:"w-4 h-4"}),subtitle:x.length>0?d("notebook.zone.practice.subtitle_stats",{total:x.length,correct:p,wrong:y}):d("notebook.zone.practice.subtitle_empty"),count:x.length,testid:"zone-practice",defaultOpen:!1,children:x.length===0?g.jsx(Dm,{hint:d("notebook.zone.practice.empty_hint")}):x.map(E=>g.jsx(Lm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))})]})}function Rm({title:e,icon:t,subtitle:n,count:i,testid:o,defaultOpen:s=!0,children:l}){const[c,d]=_.useState(s),f=_.useRef(!0),m=_.useRef(i);return _.useEffect(()=>{if(f.current){f.current=!1,m.current=i;return}i>m.current&&d(!0),m.current=i},[i]),g.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":o,children:[g.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:[g.jsx(ap,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${c?"":"-rotate-90"}`}),g.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),g.jsx("span",{className:"text-body font-bold text-ink",children:e}),g.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:i}),g.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),g.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:c?"1fr":"0fr"},children:g.jsx("div",{className:"overflow-hidden",children:g.jsx("div",{className:"p-3 space-y-3",children:l})})})]})}function Dm({hint:e}){return g.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Lm({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:i,onUpdateNoteComment:o,onJumpToSource:s}){const l=Ye(),[c,d]=_.useState(!1),[f,m]=_.useState(e.notes??""),x=_.useCallback((N,L,A)=>{e.nodeId&&fe.recordQuizAnswer(e.nodeId,A).catch(()=>{}),i(e.id,A)},[e.nodeId,e.id,i]),b=e.artifactType==="user_note";let p="",y=null;if(b){try{p=JSON.parse(e.data).text??""}catch{p=e.title??""}try{e.sourceAnchor&&(y=JSON.parse(e.sourceAnchor))}catch{y=null}}let E=null;if(!b)try{E=JSON.parse(e.data)}catch{E=null}const T=new Date(e.createdAt),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=()=>{m(N??""),d(!0)},A=()=>{m(N??""),d(!1)},C=()=>{o==null||o(e.id,f),d(!1)};return g.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:g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx(OC,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:p}),o&&c?g.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[g.jsx("textarea",{value:f,onChange:I=>m(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)}`}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.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:[g.jsx(Fn,{className:"w-3 h-3"})," ",l("notebook.action.save")]}),g.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:[g.jsx(la,{className:"w-3 h-3"})," ",l("notebook.action.cancel")]})]})]}):N?g.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[g.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:N}),o&&g.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:[g.jsx(vl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.edit_comment")]})]}):o?g.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:[g.jsx(vl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.add_comment")]}):null,y&&s&&g.jsx("button",{onClick:()=>s(y,p,e.id),className:"mt-2 inline-flex items-center gap-1 text-caption text-accent hover:underline font-bold","data-testid":`note-source-${e.id.slice(0,8)}`,children:y.type==="content"?g.jsxs(g.Fragment,{children:[g.jsx(ii,{className:"w-3 h-3"}),l("notebook.source.jump_content")]}):g.jsxs(g.Fragment,{children:[g.jsx(EE,{className:"w-3 h-3"}),l("notebook.source.jump_chat")]})}),g.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[g.jsx("span",{className:"text-caption text-ink-muted",children:w}),g.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:g.jsx(s0,{className:"w-3 h-3"})})]})]})]})})}const M=RI[e.artifactType]??TE;return g.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:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:g.jsx(M,{className:"w-4 h-4"})}),g.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??LI(l,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&g.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?g.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[g.jsx(ly,{className:"w-2.5 h-2.5"}),l("notebook.note.pinned")]}):null,g.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:g.jsx(ly,{className:"w-3 h-3"})}),g.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:g.jsx(s0,{className:"w-3 h-3"})})]}),g.jsx("div",{className:"text-label",children:E?g.jsx(Op,{data:E,onQuizAnswered:x}):g.jsx("div",{className:"text-ink-muted",children:l("notebook.artifact.broken")})}),g.jsx("div",{className:"text-caption text-ink-muted mt-2",children:w})]})}function Bv({message:e,icon:t}){return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[g.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),g.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Om({label:e,icon:t,active:n,onClick:i,testid:o,badge:s}){return g.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:[g.jsx(t,{className:"w-3 h-3"}),g.jsx("span",{children:e}),s&&g.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 PI({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(m=>{var x;return(x=m.sourcePath)==null?void 0:x.endsWith(f)})??n.find(m=>m.filename===f)??null},[l,n]);if(_.useEffect(()=>{if(!c){s(null);return}let f=!1;return fe.getAssetDataUrl(c.id).then(m=>{f||s(m)}),()=>{f=!0}},[c]),!l)return null;const d=o??l;return g.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 BI({asset:e}){const t=Ye(),[n,i]=_.useState(null),[o,s]=_.useState(!1);return _.useEffect(()=>{let l=!1;return fe.getAssetDataUrl(e.id).then(c=>{l||i(c)}),()=>{l=!0}},[e.id]),g.jsxs(g.Fragment,{children:[g.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?g.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):g.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),o&&n&&g.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>s(!1),children:[g.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"}),g.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:g.jsx(la,{className:"w-6 h-6"})})]})]})}function zI(e){const[t,n]=_.useState([]),[i,o]=_.useState(!0),s=_.useCallback(async()=>{if(!e){n([]),o(!1);return}try{const y=await fe.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 fe.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 fe.canvasSaveUserNote({...y,courseId:e});return n(T=>[E,...T]),E}catch{return null}},[e]),d=_.useCallback(async(y,E)=>{try{const T=await fe.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 fe.canvasUpdateUserNoteComment(y,E);return T&&n(w=>w.map(M=>M.id===y?T:M)),T}catch{return null}},[]),m=_.useCallback(async y=>{try{await fe.canvasDelete(y),n(E=>E.filter(T=>T.id!==y))}catch{}},[]),x=_.useCallback(async y=>{try{const E=await fe.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]),p=_.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:m,togglePin:x,byNode:b,byZone:p}}const zv={small:16,medium:17,large:18},Uv="lookatstudy-font-size",UI="medium";function HI(){const[e,t]=_.useState(()=>{if(typeof localStorage<"u"){const i=localStorage.getItem(Uv);if(i&&i in zv)return i}return UI});_.useEffect(()=>{document.documentElement.style.fontSize=`${zv[e]}px`,localStorage.setItem(Uv,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 Im=new Map;function FI({ref_:e,onOpen:t}){const n=Ye(),[i,o]=_.useState(e.previewUrl??(e.file?Im.get(e.file)??null:null));return _.useEffect(()=>{if(i||!e.file)return;let s=!1;return(async()=>{const l=Im.get(e.file);if(l){s||o(l);return}const c=await fe.getAttachmentDataUrl(e.file);c&&!s&&(Im.set(e.file,c),o(c))})(),()=>{s=!0}},[e.file,i]),i?g.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:g.jsx("img",{src:i,alt:e.name,className:"w-full h-full object-cover"})}):g.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 VI({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]),g.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:[g.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),g.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:g.jsx(la,{className:"w-4 h-4"})})]})}function qI({parts:e}){const t=Ye(),[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 g.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[s.length>0&&g.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((c,d)=>g.jsx(FI,{ref_:c,onOpen:f=>i({src:f,name:c.name})},c.file??c.previewUrl??`${c.name}:${d}`))}),l.length>0&&g.jsx("div",{className:"flex gap-1.5 flex-wrap",children:l.map((c,d)=>g.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:[g.jsx(Rl,{className:"w-3 h-3 shrink-0"}),g.jsx("span",{className:"truncate max-w-[12rem]",children:c.name})]},`${c.name}:${d}`))}),n&&g.jsx(VI,{src:n.src,name:n.name,onClose:()=>i(null)})]})}function YI({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:i,summary:o,onStartLearning:s,agentReady:l=!0,onGotoSettings:c,hasNode:d=!0,selectedNodeId:f,threadId:m,onSaveChatNote:x,chatNotes:b,onPickQuizAction:p,onQuizCompleted:y,cardMode:E=!1}){const T=Ye(),w=Ip(),M=XS();_.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,W,ae)=>{f&&fe.recordQuizAnswer(f,ae,G.kc).catch(()=>{})},[f]),[L,A]=_.useState(null);_.useEffect(()=>{if(!f){A(null);return}let G=!1;const W=()=>fe.getProgress(f).then(V=>{G||A((V==null?void 0:V.mastery)??null)}).catch(()=>{});W();const ae=fe.on("state:changed",V=>{V==="mastery"&&W()});return()=>{G=!0,ae()}},[f]);const C=_.useRef(null),I=_.useRef(!0),[R,j]=_.useState(!1);_.useEffect(()=>{const G=W=>{const ae=W.detail;if(!(ae!=null&&ae.msgId))return;const V=document.querySelector(`[data-msg-id="${ae.msgId}"]`);V&&(V.scrollIntoView({behavior:"smooth",block:"center"}),V.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>V.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",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 W=new Map;for(const ae of b)try{const V=JSON.parse(ae.sourceAnchor);if(V.type==="chat"&&V.msgId){const Y=JSON.parse(ae.data).text??"";if(Y){const te=W.get(V.msgId)??[];te.push({noteId:ae.id,text:Y}),W.set(V.msgId,te)}}}catch{}for(const[ae,V]of W){const Y=C.current.querySelector(`[data-msg-id="${ae}"]`);Y&&zS(Y,V)}},150);return()=>clearTimeout(G)},[e,b,t]),_.useEffect(()=>{const G=W=>{var Y;const ae=W.detail;if(!ae)return;const V=(Y=C.current)==null?void 0:Y.querySelector(`mark[data-note-id="${ae}"]`);V&&US(V)};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||!m)return;const G=window.getSelection(),W=(G==null?void 0:G.toString().trim())??"";if(W.length<2||W.length>500){P(null);return}const ae=G==null?void 0:G.getRangeAt(0);if(!ae){P(null);return}const V=C.current;if(!(V!=null&&V.contains(ae.commonAncestorContainer))){P(null);return}let Y=ae.commonAncestorContainer,te=null;for(;Y&&Y!==V;){if(Y instanceof HTMLElement&&Y.dataset.msgId){te=Y;break}Y=Y.parentNode}if(!te){P(null);return}const U=te.dataset.msgId,ie=Wc(te),K=jS(ae,ie),$=ae.getBoundingClientRect(),J=V.getBoundingClientRect(),se=HS({left:$.left-J.left,top:$.top-J.top,right:$.right-J.left,bottom:$.bottom-J.top,width:$.width,height:$.height},J.width,110);P({x:se.left,y:se.top,transform:se.transform,text:W,msgId:U,startOffset:K==null?void 0:K.start,endOffset:K==null?void 0:K.end})},[x,m]);_.useEffect(()=>{let G=null,W=null;const ae=()=>{G&&clearTimeout(G),G=setTimeout(()=>{var Y;(((Y=window.getSelection())==null?void 0:Y.toString().trim().length)??0)>=2?(W&&(clearTimeout(W),W=null),B()):W||(W=setTimeout(()=>P(te=>te&&null),250))},250)};return document.addEventListener("selectionchange",ae),()=>{document.removeEventListener("selectionchange",ae),G&&clearTimeout(G),W&&clearTimeout(W)}},[B]);const Q=_.useCallback(()=>{var W;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),(W=window.getSelection())==null||W.removeAllRanges()},[D,x]),F=_.useCallback(()=>{const G=C.current;if(!G)return;const W=G.scrollHeight-G.scrollTop-G.clientHeight<80;I.current=W,j(ae=>ae===!W?ae:!W)},[]);_.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 g.jsxs("div",{className:"relative flex-1 min-h-0",children:[g.jsxs("div",{ref:C,onScroll:F,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&&g.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:d?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-center mb-4",children:[g.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),g.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.greeting")}),g.jsx("div",{className:"text-ink-muted text-label",children:T("chat.empty.overview")})]}),o?g.jsxs("div",{className:"surface-card p-4 mb-4",children:[g.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:T("chat.empty.summary.title")}),g.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:o})]}):g.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:g.jsx("div",{className:"text-body text-ink-muted",children:T("chat.empty.summary.none")})}),l?g.jsx(g.Fragment,{children:s&&g.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:[g.jsx(IC,{className:"w-4 h-4"}),g.jsx("span",{children:T("chat.empty.start")})]})}):g.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[g.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.keyless.title")}),g.jsx("div",{className:"text-label text-ink-muted mb-3",children:T("chat.empty.keyless.desc")}),g.jsxs("button",{onClick:c,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[g.jsx(Fc,{className:"w-4 h-4"}),g.jsx("span",{children:T("chat.empty.keyless.btn")})]})]})]}):g.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[g.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),g.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.no_node.title")}),g.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:T("chat.empty.no_node.desc")})]})}),e.map(G=>g.jsx("div",{className:E?"":"contents",children:g.jsx("div",{className:E&&G.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:g.jsx(GI,{msg:G,onApplyProposal:n,onRejectProposal:i,onQuizAnswered:N,quizMastery:L,onPickAction:p,onQuizCompleted:y,speakingMessageId:M.speakingMessageId,speakingSentence:M.speakingSentence,onSpeak:M.speak})})},G.id)),t&&g.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),R&&e.length>0&&g.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:[g.jsx(ap,{className:"w-5 h-5"}),t&&g.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&&g.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:[g.jsx(vl,{className:"w-3 h-3"})," ",T("chat.note.add")]})]})}function Hv(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 GI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l,speakingMessageId:c,speakingSentence:d,onSpeak:f}){const m=Ye();if(e.role==="user")return g.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:g.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[g.jsx(qI,{parts:e.parts}),g.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((p,y)=>p.type==="text"?g.jsx("span",{children:p.text},y):null)})]})});const x=e.parts.map(p=>p.type==="text"?p.text:"").join("").trim(),b=c===e.id;return g.jsxs("div",{className:"msg-enter","data-testid":"msg-assistant","data-msg-id":e.id,children:[g.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((p,y)=>g.jsx(XI,{part:p,msgId:e.id,toolCallIdx:y,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l},y))}),f&&x&&g.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[g.jsx("button",{onClick:()=>f(e.id,x),"data-testid":b?"speech-stop-btn":"speech-speak-btn","aria-label":m(b?"chat.speech.stop":"chat.speech.speak"),title:m(b?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${b?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:b?g.jsx(lp,{className:"w-3.5 h-3.5"}):g.jsx(wE,{className:"w-4 h-4"})}),b&&d&&d.total>0&&g.jsx("span",{className:"text-caption text-ink-muted",children:m("chat.speech.progress").replace("{n}",String(d.index+1)).replace("{total}",String(d.total))})]})]})}function XI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d}){if(e.type==="text")return g.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:g.jsx(ST,{remarkPlugins:[KT],rehypePlugins:[MS,[OS,IS]],urlTransform:p=>p,components:QI,children:e.text})});if(e.type==="reasoning")return g.jsx(KI,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:f,state:m,output:x,error:b}=e;return g.jsx($I,{toolName:f,state:m,output:x,error:b,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d})}function KI({text:e}){const t=Ye(),[n,i]=_.useState(!1);return g.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[g.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:[g.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),g.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&g.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 $I({toolName:e,state:t,output:n,error:i,msgId:o,toolCallIdx:s,onApplyProposal:l,onRejectProposal:c,onQuizAnswered:d,quizMastery:f,onPickAction:m,onQuizCompleted:x}){const b=Ye(),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"?g.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:[g.jsx(ai,{className:"w-4 h-4 text-gold shrink-0"}),g.jsx("span",{className:"text-body font-bold text-ink",children:b("chat.proposal.applied")})]}):w==="rejected"?g.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:[g.jsx(hC,{className:"w-4 h-4 text-ink-muted shrink-0"}),g.jsx("span",{className:"text-body text-ink-muted",children:b("chat.proposal.rejected")})]}):g.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[g.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),g.jsxs("div",{className:"pl-4 pr-3 py-3",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:g.jsx(vE,{className:"w-4 h-4"})}),g.jsx("span",{className:"text-lead font-bold text-ink",children:b("chat.proposal.mastered.title")})]}),y.message&&g.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:y.message}),g.jsx("div",{className:"text-caption text-ink-muted mb-3",children:b("chat.proposal.mastered.hint")}),g.jsxs("div",{className:"flex gap-2",children:[g.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:[g.jsx(Fn,{className:"w-3.5 h-3.5 inline"}),b("chat.proposal.confirm")]}),g.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 g.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${w}`,"data-tool":e,children:g.jsx(Op,{data:n,onQuizAnswered:d,quizMastery:f,onPickAction:m,onQuizCompleted:x})})}const T=ZI(e,b);return g.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"?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),g.jsxs("span",{className:"text-ink-muted",children:[T,"…"]})]}):t==="output-error"?g.jsxs(g.Fragment,{children:[g.jsx(Ds,{className:"w-3.5 h-3.5 text-warning shrink-0"}),g.jsxs("span",{className:"text-warning",children:[T,": ",i]})]}):g.jsxs(g.Fragment,{children:[g.jsx(up,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),g.jsx("span",{className:"text-ink-muted",children:T})]})})}const QI={pre({children:e,...t}){return g.jsx(WI,{...t,children:e})},a({children:e,...t}){return g.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return g.jsx("div",{className:"overflow-x-auto my-4",children:g.jsx("table",{children:e})})}};function WI({children:e,...t}){const n=Ye(),[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 m=l.children,x=typeof m=="string"?m:Array.isArray(m)?m.join(""):"";(b=navigator.clipboard)==null||b.writeText(x).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})};return g.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[g.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:[g.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:d||"code"}),g.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?g.jsxs(g.Fragment,{children:[g.jsx(Fn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):g.jsxs(g.Fragment,{children:[g.jsx(mC,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),g.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function ZI(e,t){return{get_node_info:t("chat.tool.get_node_info"),record_answer:t("chat.tool.record_answer"),mark_mastered:t("chat.tool.mark_mastered"),show_concept_map:t("chat.tool.show_concept_map"),generate_quiz:t("chat.tool.generate_quiz"),compare_table:t("chat.tool.compare_table"),draw_diagram:t("chat.tool.draw_diagram"),show_code_walkthrough:t("chat.tool.show_code_walkthrough")}[e]??e}const pl={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},JI=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 Fv(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function ej(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(Fv(e))?n>pl.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:JI.has(Fv(e))?n>pl.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function tj(e,t){const n=e.length,i=n*2,o=new ArrayBuffer(44+i),s=new DataView(o),l=(d,f)=>{for(let m=0;m<f.length;m++)s.setUint8(d+m,f.charCodeAt(m))};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 nj(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 aj(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,m=!1;return{feed(x,b){l==null&&(l=b);const p=f==null?0:Math.max(0,b-f);if(f=b,!s)return"listening";if(x>=t)c+=p,c>=n&&(m=!0,d=b);else if(m&&d!=null&&b-d>=i)return"auto-stop";return b-l>=o?"auto-stop":"listening"}}}const jm=16e3,ij=400;function rj(e,t={}){const[n,i]=_.useState(!1),[o,s]=_.useState(!1),[l,c]=_.useState(0),[d,f]=_.useState(null),[m,x]=_.useState(null),b=_.useRef(null),p=_.useRef(null),y=_.useRef(null),E=_.useRef([]),T=_.useRef(0),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(null),R=_.useRef(!1),j=_.useRef(!1),D=_.useCallback(()=>{var H,G,W;w.current=!1,(H=y.current)==null||H.disconnect(),y.current=null,(G=p.current)==null||G.getTracks().forEach(ae=>ae.stop()),p.current=null,(W=b.current)==null||W.close().catch(()=>{}),b.current=null,E.current=[],T.current=0,M.current=null,c(0)},[]),P=_.useCallback(()=>{const H=E.current;E.current=[];let G=0;for(const Y of H)G+=Y.length;if(D(),i(!1),G===0)return;const W=new Float32Array(G);let ae=0;for(const Y of H)W.set(Y,ae),ae+=Y.length;const V=tj(W,jm);s(!0),x(null),window.api.asrTranscribe(V,A.current.locale).then(Y=>{Y.ok?Y.text&&L.current(Y.text):x(Y.reason)}).catch(()=>x("asr-failed")).finally(()=>s(!1))},[D]),B=_.useCallback(()=>{w.current&&P()},[P]),Q=_.useCallback(()=>{if(w.current){B();return}f(null),R.current=!0,(async()=>{var H;try{if(((H=navigator.mediaDevices)==null?void 0:H.getUserMedia)==null){f("mic-unavailable");return}const G=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),W=window.AudioContext??window.webkitAudioContext;let ae;try{ae=new W({sampleRate:jm})}catch{ae=new W}b.current=ae,p.current=G,w.current=!0,M.current=aj({autoStop:A.current.autoStop!==!1});const V=ae.createMediaStreamSource(G),Y=ae.createScriptProcessor(4096,1,1);y.current=Y;const te=ae.sampleRate/jm;Y.onaudioprocess=ie=>{var Pe;if(!w.current)return;const K=ie.inputBuffer.getChannelData(0),$=te===1?new Float32Array(K):nj(K,te);E.current.push($),T.current+=$.length;let J=0;for(let Be=0;Be<$.length;Be++)J+=$[Be]*$[Be];const se=Math.sqrt(J/$.length);N.current=N.current*.7+se*.3,c(Math.min(1,N.current*8)),((Pe=M.current)==null?void 0:Pe.feed(se,performance.now()))==="auto-stop"&&w.current&&P()},V.connect(Y);const U=ae.createGain();U.gain.value=0,Y.connect(U),U.connect(ae.destination),i(!0),j.current&&(j.current=!1,P())}catch(G){D(),i(!1),f(G instanceof Error?G.message:String(G))}finally{R.current=!1}})()},[B,D,P]),F=_.useCallback(()=>{C.current||(C.current=!0,I.current=window.setTimeout(()=>{I.current=null,w.current||Q()},ij))},[Q]),z=_.useCallback(()=>{if(C.current){if(C.current=!1,I.current!=null){window.clearTimeout(I.current),I.current=null,w.current?B():Q();return}w.current?B():R.current&&(j.current=!0)}},[Q,B]);return _.useEffect(()=>()=>{I.current!=null&&window.clearTimeout(I.current),w.current&&D()},[D]),{listening:n,transcribing:o,level:l,startError:d,transcribeError:m,clearTranscribeError:()=>x(null),start:Q,stop:B,press:F,release:z}}function sj({onGotoSettings:e}){var E;const t=Ye(),[n,i]=_.useState(!1),[o,s]=_.useState(null),[l,c]=_.useState(""),[d,f]=_.useState(""),m=_.useRef(null),x=_.useCallback(async()=>{var T,w;try{const[M,N,L,A]=await Promise.all([fe.getProviderPresets(),fe.listCustomProviders(),fe.getSetting("active_provider"),fe.getSetting("active_model")]),C=L??"glm",I=await Promise.all(M.map(async B=>await fe.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,F)=>{for(const z of F)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=m.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 fe.setSetting("active_provider",T.providerId),await fe.setSetting("active_model",T.modelId),c(T.providerId),f(T.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},p=((E=o==null?void 0:o.find(T=>T.providerId===l&&T.modelId===d))==null?void 0:E.modelLabel)??d??t("model.picker.label"),y=[];for(const T of o??[]){const w=y[y.length-1];w&&w.label===T.providerLabel?w.rows.push(T):y.push({label:T.providerLabel,rows:[T]})}return g.jsxs("div",{ref:m,className:"relative","data-testid":"composer-model",children:[g.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:[g.jsx("span",{className:"truncate",children:p}),g.jsx(pE,{className:`w-3 h-3 shrink-0 transition-transform ${n?"":"rotate-180"}`})]}),n&&g.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&&g.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),y.map(T=>g.jsxs("div",{role:"group","aria-label":T.label,children:[g.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 g.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:[g.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 ${M?"opacity-100":"opacity-0"}`}),g.jsx("span",{className:"flex-1 truncate text-label",children:w.modelLabel}),w.vision&&g.jsx(gC,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${w.providerId}:${w.modelId}`)})]},T.label)),g.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:g.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:[g.jsx(BC,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const N0=5.5,Vv=2*Math.PI*N0,ks=["system","node","learner","history","draft"],qv={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function oj({info:e,historyTokens:t,draftTokens:n}){const i=Ye(),[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)},p=y=>{y.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",p),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",p)}},[o]),!e)return null;const c={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},d=ks.reduce((b,p)=>b+c[p],0),f=XC(d,e.contextWindow),m=f!==null&&f>=85,x=KC(ks.map(b=>c[b]),f??0);return g.jsxs("span",{ref:l,className:"relative inline-flex items-center","data-testid":"composer-context",children:[g.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 ${m?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[g.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[g.jsx("circle",{cx:"7",cy:"7",r:N0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),g.jsx("circle",{cx:"7",cy:"7",r:N0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${Vv*(f??100)/100} ${Vv}`,transform:"rotate(-90 7 7)"})]}),f!==null?g.jsxs("span",{children:[f,"%"]}):g.jsxs("span",{children:["~",vs(d)]})]}),o&&e.contextWindow!==null&&g.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:[g.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[g.jsx("span",{className:"text-label font-bold text-ink-strong",children:i("context.label")}),g.jsxs("span",{className:`text-caption ${m?"text-warning":"text-ink-muted"}`,children:[i("context.approx")," ",vs(d)," / ",vs(e.contextWindow)]})]}),g.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?g.jsx("div",{className:qv[b],style:{width:`${x[ks.indexOf(b)]}%`}},b):null)}),g.jsx("dl",{className:"space-y-1",children:ks.map(b=>g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[g.jsx("span",{className:`w-2 h-2 rounded-sm ${qv[b]}`,"aria-hidden":!0}),i(`context.${b}`)]}),g.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",vs(c[b])]})]},b))})]})]})}const _0={glm:{fast:e=>{e.thinking={type:"disabled"},e.reasoning_effort="low"},deep:e=>{e.thinking={type:"enabled"}}},qwen:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}},siliconcloud:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}}};function lj(e,t,n){if(e==="openai"||e in _0)return e;const i=(t??"").toLowerCase(),o=(n??"").toLowerCase();return i.includes("bigmodel.cn")||i.includes("z.ai")||o.startsWith("glm")?"glm":i.includes("dashscope")||o.startsWith("qwen")?"qwen":i.includes("siliconflow")?"siliconcloud":e}function uj(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in _0?!0:lj(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in _0}const Pm=[{value:"",labelKey:"effort.auto.label",descKey:"effort.auto.desc"},{value:"fast",labelKey:"effort.fast.label",descKey:"effort.fast.desc"},{value:"deep",labelKey:"effort.deep.label",descKey:"effort.deep.desc"}];function cj(){const e=Ye(),[t,n]=_.useState(!1),[i,o]=_.useState(""),[s,l]=_.useState(!0),c=_.useRef(null),d=_.useRef(null),[f,m]=_.useState("right"),[x,b]=_.useState(0),p=_.useRef(0),[y,E]=_.useState(0);_.useLayoutEffect(()=>{if(!t){E(0),p.current=0,b(0);return}const N=d.current;if(!N)return;const L=N.getBoundingClientRect(),A=L.left-p.current,C=L.right-p.current,I=window.innerWidth;if(y===0){if(A<8&&C<=I-8){m("left"),E(1);return}if(C>I-8&&A>=8){m("right"),E(1);return}E(1)}const R=Math.min(0,I-8-C)+Math.max(0,8-A);R!==p.current&&(p.current=R,b(R))},[t,y]);const T=_.useCallback(async()=>{var N;try{const[L,A,C,I,R]=await Promise.all([fe.getSetting("active_provider"),fe.getSetting("reasoning_effort"),fe.getProviderPresets(),fe.listCustomProviders(),fe.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(uj(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 fe.setSetting("reasoning_effort",N)}catch{o(i)}}},M=Pm.find(N=>N.value===i)??Pm[0];return g.jsxs("div",{ref:c,className:"relative","data-testid":"composer-effort",children:[g.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:[g.jsx(uC,{className:"w-3 h-3 shrink-0"}),g.jsx("span",{className:"truncate",children:e(M.labelKey)}),g.jsx(pE,{className:`w-3 h-3 shrink-0 transition-transform ${t?"":"rotate-180"}`})]}),t&&g.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:Pm.map(N=>{const L=N.value===i;return g.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:[g.jsx(Fn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${L?"opacity-100":"opacity-0"}`}),g.jsxs("span",{className:"flex-1",children:[g.jsx("span",{className:"block text-label font-bold",children:e(N.labelKey)}),g.jsx("span",{className:"block text-caption text-ink-faint",children:e(N.descKey)})]})]},N.value||"auto")})})]})}const dj={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},fj={direct:ii,guide:xE,practice:vC},hj={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},mj=["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 Yv=0;function pj({nodeId:e,agentReady:t,streaming:n,souls:i,activeSoul:o,starterPrompts:s,onPickSoul:l,onSend:c,onStop:d,onLogFriction:f,onGotoSettings:m,insertText:x,historyTokens:b}){const p=Ye(),y=ME(),[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),Q=_.useRef(!1);_.useEffect(()=>{fe.getSetting("asr_auto_stop").then(se=>B(se!=="0"));const J=()=>{fe.getSetting("asr_auto_send").then(se=>{Q.current=se==="1"})};return J(),window.addEventListener("llm-config-changed",J),()=>window.removeEventListener("llm-config-changed",J)},[]);const F=rj(J=>{const se=W.current,ke=se.trim()?`${se} ${J}`:J;Q.current?(W.current="",T(""),ae(ke)):(W.current=ke,T(ke))},{locale:y,autoStop:P});_.useEffect(()=>{const J=F.startError??F.transcribeError;if(!J)return;L(p(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")),F.clearTranscribeError()},[F.startError,F.transcribeError,F,p]),_.useEffect(()=>{x&&T(J=>J.trim()?`${J}
542
-
543
- ${x}`:x)},[x]),_.useEffect(()=>{if(!e){C(null);return}let J=!1;(async()=>{try{const ke=await fe.getContextUsage(e,y);J||C(ke)}catch{J||C(null)}})();const se=()=>{fe.getContextUsage(e,y).then(ke=>{J||C(ke)}).catch(()=>{})};return window.addEventListener("llm-config-changed",se),()=>{J=!0,window.removeEventListener("llm-config-changed",se)}},[e,y]),_.useEffect(()=>{if(!N)return;const J=setTimeout(()=>L(null),3e3);return()=>clearTimeout(J)},[N]);const z=_.useRef(new Set);_.useEffect(()=>()=>{for(const J of z.current)URL.revokeObjectURL(J)},[]);const H=_.useCallback(J=>{M(se=>{const ke=se.find(Pe=>Pe.id===J);return ke!=null&&ke.previewUrl&&(URL.revokeObjectURL(ke.previewUrl),z.current.delete(ke.previewUrl)),se.filter(Pe=>Pe.id!==J)})},[]),G=_.useCallback(async J=>{if(J.length===0)return;const se=pl.maxPerMessage-w.length;if(se<=0){L(p("chat.attach.tooMany",{n:pl.maxPerMessage}));return}const ke=J.length>se?J.slice(0,se):J;J.length>se&&L(p("chat.attach.tooMany",{n:pl.maxPerMessage}));const Pe=[],Be=[];for(const ze of ke){const St=ej(ze.name,ze.type,ze.size);if(!St.ok){L(St.reason==="unsupported"?p("chat.attach.unsupported",{name:ze.name}):St.reason==="tooLargeImage"?p("chat.attach.tooLargeImage",{name:ze.name}):p("chat.attach.tooLargeText",{name:ze.name}));continue}if(St.kind==="image"){if((A==null?void 0:A.visionCapable)===!1){L(p("chat.attach.visionUnsupported"));continue}const pt=await new Promise(Ke=>{const Ot=new FileReader;Ot.onload=()=>{const Bt=Ot.result;Ke(typeof Bt=="string"?Bt.slice(Bt.indexOf(",")+1):null)},Ot.onerror=()=>Ke(null),Ot.readAsDataURL(ze)});if(pt===null)continue;const ye=URL.createObjectURL(ze);Be.push(ye),Pe.push({id:++Yv,kind:"image",name:ze.name,mime:ze.type||"image/png",size:ze.size,previewUrl:ye,base64:pt})}else try{const pt=await ze.text();Pe.push({id:++Yv,kind:"text",name:ze.name,mime:ze.type||"text/plain",size:ze.size,text:pt})}catch{}}if(Pe.length>0){for(const ze of Be)z.current.add(ze);M(ze=>[...ze,...Pe])}else for(const ze of Be)URL.revokeObjectURL(ze)},[w.length,A==null?void 0:A.visionCapable,p]),W=_.useRef("");_.useEffect(()=>{W.current=E},[E]);const ae=J=>{const se=J.trim();if(n||!e||!se&&w.length===0)return;const ke=se||dp("chat.attach.imageOnlyText"),Pe=w.map(Be=>({kind:Be.kind,name:Be.name,mime:Be.mime,size:Be.size,data:Be.kind==="image"?Be.base64??"":Be.text??"",...Be.kind==="image"&&Be.previewUrl?{previewUrl:Be.previewUrl}:{}}));c(ke,void 0,Pe.length>0?Pe:void 0),T(""),M([])},V=()=>ae(E),Y=J=>{n||(c(J.message,J.label),J.frictionCategory&&(f==null||f(J.frictionCategory,null)))},te=J=>{const se=Array.from(J.clipboardData.files??[]);se.length>0&&(J.preventDefault(),G(se))},U=J=>{J.dataTransfer.types.includes("Files")&&(J.preventDefault(),D.current+=1,R(!0))},ie=J=>{J.dataTransfer.types.includes("Files")&&(D.current=Math.max(0,D.current-1),D.current===0&&R(!1))},K=J=>{J.dataTransfer.types.includes("Files")&&(J.preventDefault(),D.current=0,R(!1),G(Array.from(J.dataTransfer.files??[])))},$=_.useMemo(()=>AE(E),[E]);return t?g.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[s.length>0&&e&&g.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:s.map((J,se)=>g.jsx("button",{onClick:()=>Y(J),disabled:n,"data-testid":`starter-prompt-${se}`,"data-tooltip":J.hint??J.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:J.label},se))}),g.jsxs("div",{className:`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:U,onDragOver:J=>{J.dataTransfer.types.includes("Files")&&J.preventDefault()},onDragLeave:ie,onDrop:K,"data-testid":"composer-card",children:[i.length>0&&g.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[g.jsx("span",{className:"text-body text-ink-faint shrink-0",children:p("chat.soul.label")}),i.map(J=>{const se=o===J.name,ke=fj[J.name]??xE,Pe=p(hj[J.name]??"soul.direct.desc");return g.jsxs("button",{onClick:()=>l(J.name),"data-testid":`soul-pill-${J.name}`,"data-tooltip":Pe,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${se?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[g.jsx(ke,{className:"w-3.5 h-3.5"}),g.jsx("span",{children:p(dj[J.name]??"soul.direct")})]},J.id)})]}),w.length>0&&g.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(J=>J.kind==="image")&&g.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[g.jsx(PC,{className:"w-3.5 h-3.5 shrink-0"}),g.jsx("span",{children:p("chat.attach.bridgeChip",{model:A.visionBridgeModel})})]}),w.map(J=>J.kind==="image"?g.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[g.jsx("img",{src:J.previewUrl,alt:J.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),g.jsx("button",{type:"button",onClick:()=>H(J.id),"aria-label":p("chat.attach.remove",{name:J.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:g.jsx(la,{className:"w-3 h-3"})})]},J.id):g.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:[g.jsx(Rl,{className:"w-3 h-3 shrink-0 text-ink-faint"}),g.jsx("span",{className:"truncate max-w-[10rem]",children:J.name}),g.jsx("button",{type:"button",onClick:()=>H(J.id),"aria-label":p("chat.attach.remove",{name:J.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:g.jsx(la,{className:"w-2.5 h-2.5"})})]},J.id))]}),N&&g.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:N}),g.jsxs("div",{className:"flex gap-2 items-end",children:[g.jsx("textarea",{value:E,onChange:J=>T(J.target.value),onKeyDown:J=>{J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),V())},onPaste:te,placeholder:p(e?"chat.input.placeholder":"chat.input.no_node"),disabled:n||!e,rows:2,"data-testid":"chat-input",className:"flex-1 bg-transparent text-ink-strong text-body rounded-lg px-1 py-1 resize-none focus:outline-none disabled:opacity-40 placeholder:text-ink-faint"}),n?g.jsx("button",{onClick:d,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:p("chat.stop"),"aria-label":p("chat.stop"),children:g.jsx(lp,{className:"w-3.5 h-3.5 fill-current"})}):g.jsx("button",{onClick:V,disabled:n||!E.trim()&&w.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:p("chat.send"),"aria-label":p("chat.send"),children:g.jsx(oC,{className:"w-4 h-4"})})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[g.jsxs("button",{type:"button",onPointerDown:J=>{J.preventDefault(),F.press()},onPointerUp:()=>F.release(),onPointerLeave:()=>F.release(),onClick:J=>{J.detail===0&&(F.listening?F.stop():F.start())},disabled:F.transcribing,"data-tooltip":F.listening?p("chat.speech.dictation_stop"):F.transcribing?p("chat.speech.transcribing"):p("chat.speech.dictation_ptt"),"aria-label":F.listening?p("chat.speech.dictation_stop"):p("chat.speech.dictation_ptt"),"data-testid":F.listening?"composer-mic-active":F.transcribing?"composer-mic-busy":"composer-mic",className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors disabled:opacity-50 ${F.listening?"text-warning":"text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06]"}`,children:[F.transcribing?g.jsx(kC,{className:"w-3.5 h-3.5 animate-spin"}):g.jsx(CC,{className:`w-3.5 h-3.5 ${F.listening?"animate-pulse":""}`}),F.listening&&g.jsx("span",{className:"w-10 h-1 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":"asr-level",children:g.jsx("span",{className:"block h-full bg-warning transition-[width] duration-100",style:{width:`${Math.round(Math.min(1,F.level)*100)}%`}})}),F.transcribing&&g.jsx("span",{className:"max-w-24 truncate",children:p("chat.speech.transcribing")})]}),g.jsx("button",{type:"button",onClick:()=>{var J;return(J=j.current)==null?void 0:J.click()},"data-tooltip":p("chat.attach.add"),"aria-label":p("chat.attach.add"),"data-testid":"composer-attach",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:g.jsx(DC,{className:"w-3 h-3"})}),g.jsx("input",{ref:j,type:"file",multiple:!0,accept:mj,className:"hidden",onChange:J=>{G(Array.from(J.target.files??[])),J.target.value=""}}),g.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[g.jsx(cj,{}),g.jsx(oj,{info:A,historyTokens:b,draftTokens:$}),g.jsx(sj,{onGotoSettings:m})]})]})]})]}):g.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:g.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[g.jsx("span",{children:p("chat.no_key.short")}),g.jsx("button",{onClick:m,className:"text-brand hover:underline font-bold",children:p("chat.no_key.cta")})]})})}function Bm(e){return e.length>=200||e.includes("```")?90:60}function gj(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 xj(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 Gv(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 bj(e,t){const n=xj(gj(t)),i=Gv(e.length,n),o={};for(const s of e)o[s.id]=Gv(Math.max(1,s.optionCount),n);return{questionOrder:i,optionPerms:o}}function yj(e,t){const n=e[t];return String(n??t)}function vj({stars:e}){return g.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>g.jsx(FC,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function Ej({examNode:e,locale:t,onExamCompleted:n,onSessionChange:i,paused:o}){const s=Ye(),[l,c]=_.useState("loading"),[d,f]=_.useState(null),[m,x]=_.useState([]),[b,p]=_.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),F=b?m[b.questionOrder[y]]??null:null,z=F&&b?b.optionPerms[F.id]??[]:[],H=(F==null?void 0:F.options)??[],G=z.length===H.length?z:H.map((U,ie)=>ie);_.useEffect(()=>{let U=!1;return c("loading"),A(""),N(null),f(null),(async()=>{try{const ie=await fe.examGetStatus(e.id);if(U)return;f(ie),x(ie.exercises),ie.status==="generating"?c("generating"):ie.status==="failed"?(A(ie.error??s("exam.errorEmpty")),c("failed")):ie.status==="ready"?ie.latestAttempt&&ie.latestAttempt.finishedAt?(N({correctCount:ie.latestAttempt.correctCount,totalCount:ie.latestAttempt.totalCount,stars:ie.latestAttempt.stars,bestStars:ie.bestStars,terminated:ie.latestAttempt.terminated,perQuestion:ie.latestAttempt.perQuestion??[]}),c("result")):c("ready"):(c("generating"),fe.examPrepare(e.id,t??null).catch(()=>{}))}catch(ie){U||(A(ie instanceof Error?ie.message:String(ie)),c("failed"))}})(),()=>{U=!0}},[e.id]),_.useEffect(()=>fe.on("exam:status",ie=>{ie.nodeId===e.id&&(ie.status==="ready"?fe.examGetStatus(e.id).then(K=>{f(K),x(K.exercises),c($=>$==="generating"?K.latestAttempt?"result":"ready":$)}).catch(()=>{}):ie.status==="failed"?(A(ie.error??s("exam.errorEmpty")),c("failed")):(f(K=>K&&{...K,...ie}),c(K=>K==="loading"?"generating":K)))}),[e.id]);const W=_.useCallback(async()=>{var U;try{const ie=await fe.examStartAttempt(e.id),K=bj(ie.exercises.map($=>{var J;return{id:$.id,optionCount:((J=$.options)==null?void 0:J.length)??0}}),ie.attemptId);x(ie.exercises),P.current=ie.attemptId,p(K),D.current={},E(0),w(null),N(null),B.current=null,c("answering"),I(Bm(((U=ie.exercises[K.questionOrder[0]])==null?void 0:U.prompt)??""))}catch(ie){A(ie instanceof Error?ie.message:String(ie)),c("failed")}},[e.id]),ae=_.useCallback(()=>{j(null),N(null),c("generating"),f(U=>U&&{...U,status:"generating",done:0,total:0}),fe.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]),V=g.jsxs(g.Fragment,{children:[g.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:[g.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.regenerate")]}),R&&g.jsx(cd,{anchorRect:R,message:s("exam.regenerate.confirmMsg"),confirmLabel:s("exam.regenerate"),onConfirm:ae,onCancel:()=>j(null)})]});_.useEffect(()=>{var U;l!=="answering"||!F||B.current!==F.id&&(I(Bm(F.prompt)),w(null),(U=Q.current)==null||U.scrollTo({top:0}))},[y,l]),_.useEffect(()=>{if(l!=="answering"||o)return;const U=setInterval(()=>{I(ie=>ie>0?ie-1:0)},1e3);return()=>clearInterval(U)},[l,o]);const Y=_.useCallback(U=>{const ie=F;if(!ie||l!=="answering"||B.current===ie.id)return;B.current=ie.id;const K=U===null?"":yj(G,U),$={...D.current,[ie.id]:K};D.current=$,P.current&&fe.examRecordAnswer(e.id,P.current,ie.id,K).catch(()=>{}),y+1<m.length?E(y+1):(c("submitting"),(async()=>{try{const J=await fe.examSubmitAttempt(e.id,P.current,$);N({correctCount:J.correctCount,totalCount:J.totalCount,stars:J.stars,bestStars:J.bestStars,terminated:J.terminated,perQuestion:J.perQuestion}),c("result"),n==null||n(),J.stars>=1&&Nr("exam-pass")}catch(J){A(J instanceof Error?J.message:String(J)),c("failed")}})())},[F,l,G,y,m.length,e.id,n]),te=_.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 fe.examSubmitAttempt(e.id,P.current,D.current,{terminated:!0}),n==null||n()}catch{}},ie=l==="answering"||l==="submitting";return i==null||i(ie?{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 g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[g.jsx(Ls,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),g.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),g.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,ie=(d==null?void 0:d.total)??0,K=ie>0?Math.round(U/ie*100):0;return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[g.jsx(Ls,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),g.jsx("div",{className:"text-title font-bold text-ink mb-2",children:s("exam.generating.title")}),g.jsx("div",{className:"text-body text-ink-muted mb-4",children:s("exam.generating.stage")}),g.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:g.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,K)}%`}})}),g.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:ie>0?s("exam.generating.kcProgress",{done:U,total:ie}):s("exam.generating.preparing")}),g.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:s("exam.generating.canLeave")})]})}if(l==="failed")return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[g.jsx(i0,{className:"w-10 h-10 text-warning mb-3"}),g.jsx("div",{className:"text-body font-bold text-ink mb-1",children:s("exam.errorTitle")}),g.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:L||s("exam.errorEmpty")}),g.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{c("generating"),fe.examPrepare(e.id,t??null).catch(()=>{})},children:[g.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.failed.retry")]})]});if(l==="ready"&&d){const U=d.exercises.reduce((K,$)=>K+Bm($.prompt),0),ie=Math.max(1,Math.round(U/60));return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[g.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:g.jsx(Ls,{className:"w-7 h-7 text-brand"})}),g.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:s("exam.ready.title")}),g.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),g.jsx("div",{className:"text-label text-ink-muted mb-8",children:s("exam.ready.meta",{q:d.questionCount,kc:d.kcCount,min:ie})}),g.jsxs("div",{className:"flex flex-col items-center gap-3",children:[g.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:W,"data-testid":"exam-start-btn",children:[s("exam.start"),g.jsx(a0,{className:"w-4 h-4 inline ml-1"})]}),V]})]})}if(l==="answering"||l==="submitting"){if(!F)return null;const U=C<=10;return g.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[g.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[g.jsxs("div",{className:"flex items-center justify-between mb-3",children:[g.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:s("exam.q.progress",{i:y+1,n:m.length})}),g.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:[g.jsx(VC,{className:"w-3.5 h-3.5"}),Math.floor(C/60),":",String(C%60).padStart(2,"0")]})]}),g.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:g.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${y/m.length*100}%`}})})]}),g.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:[F.kcTitle&&g.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:[g.jsx(Hc,{className:"w-3 h-3"}),F.kcTitle]}),g.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:F.prompt}),g.jsx("div",{className:"flex flex-col gap-2.5",children:G.map((ie,K)=>g.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:g.jsx("span",{className:"text-body break-words",children:H[ie]})},ie))}),g.jsx("div",{className:"mt-6 flex justify-end",children:l==="submitting"?g.jsx("div",{className:"text-body text-ink-muted",children:s("exam.submitting")}):g.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:T===null,onClick:te,"data-testid":"exam-next-btn",children:[y+1<m.length?s("exam.q.next"):s("exam.q.submit"),g.jsx(a0,{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,ie=new Map;for(const $ of M.perQuestion){const J=$.kcTitle??"";if(!J)continue;const se=ie.get(J)??{correct:0,total:0};se.total++,$.correct&&se.correct++,ie.set(J,se)}const K=new Map(m.map($=>[$.id,$]));return g.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[g.jsxs("div",{className:"flex flex-col items-center mb-6",children:[g.jsx(vj,{stars:M.stars}),g.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:s("exam.result.score",{correct:M.correctCount,total:M.totalCount})}),g.jsx("div",{className:"text-body text-ink-muted mt-1",children:s("exam.result.accuracy",{pct:U})}),g.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[g.jsx("span",{children:s("exam.result.best",{stars:M.bestStars})}),d&&d.attemptCount>1&&g.jsx("span",{children:s("exam.result.attempts",{n:d.attemptCount})})]})]}),M.terminated&&g.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[g.jsx(i0,{className:"w-4 h-4 text-warning shrink-0"}),g.jsx("span",{className:"text-body text-ink",children:s("exam.terminated.banner")})]}),ie.size>0&&g.jsxs("div",{className:"mb-8",children:[g.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.kcBreakdown")}),g.jsx("div",{className:"flex flex-col gap-2",children:[...ie.entries()].map(([$,J])=>{const ke=(J.total>0?J.correct/J.total:0)<.6;return g.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx(Hc,{className:"w-3.5 h-3.5 text-accent shrink-0"}),g.jsx("span",{className:"text-body text-ink truncate",children:$})]}),g.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[ke&&g.jsx("span",{className:"text-caption text-warning",children:s("exam.result.weakKc")}),g.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[J.correct,"/",J.total]})]})]},$)})})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.review")}),g.jsx("div",{className:"flex flex-col gap-2",children:M.perQuestion.map(($,J)=>{const se=K.get($.exerciseId),ke=$.options??(se==null?void 0:se.options)??null,Pe=$.prompt??(se==null?void 0:se.prompt)??`#${J+1}`,Be=ze=>ke&&ze!==""&&ke[Number(ze)]!==void 0?ke[Number(ze)]:ze;return g.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:g.jsxs("div",{className:"flex items-start gap-2",children:[$.correct?g.jsx(Fn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):g.jsx(la,{className:`w-4 h-4 shrink-0 mt-0.5 ${$.answered?"text-warning":"text-ink-muted"}`}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-body text-ink mb-1",children:Pe}),g.jsx("div",{className:"text-caption text-ink-muted",children:$.answered?$.correct?g.jsx("span",{className:"text-brand",children:s("exam.result.correctLabel")}):g.jsxs(g.Fragment,{children:[s("exam.result.yourAnswer"),":",Be($.userAnswer),g.jsx("span",{className:"mx-1",children:"·"}),s("exam.result.correctAnswer"),":",Be($.correctAnswer)]}):s("exam.result.unanswered")}),$.explanation&&g.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:$.explanation})]})]})},$.exerciseId)})})]}),g.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[g.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:W,"data-testid":"exam-retry-btn",children:[g.jsx(Ac,{className:"w-3.5 h-3.5 inline"}),s("exam.retryExam")]}),V]})]})}return null}const Tj=[{id:"explain_simple",icon:Hc,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:Rl,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:rp,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:cC,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:vE,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:Ls,labelKey:"command.exam_mode",group:"command.group.mode"}],Sj=["command.group.node","command.group.mode","command.group.nav"];function kj({onClose:e,onPick:t,hasNode:n}){const i=Ye(),[o,s]=_.useState(""),[l,c]=_.useState(0),d=_.useRef(null),f=_.useRef(null);_.useEffect(()=>{var p;(p=d.current)==null||p.focus()},[]),Us(f,!0);const x=Tj.filter(p=>i(p.labelKey).toLowerCase().includes(o.toLowerCase())).filter(p=>!p.requiresNode||n),b=p=>{p.key==="ArrowDown"?(p.preventDefault(),c(y=>Math.min(y+1,x.length-1))):p.key==="ArrowUp"?(p.preventDefault(),c(y=>Math.max(y-1,0))):p.key==="Enter"&&x[l]&&(p.preventDefault(),t(x[l].id))};return g.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[g.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),g.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:[g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[g.jsx(sp,{className:"w-4 h-4 text-ink-faint"}),g.jsx("input",{ref:d,value:o,onChange:p=>{s(p.target.value),c(0)},onKeyDown:b,placeholder:i("command.placeholder"),className:"flex-1 bg-transparent text-body text-ink-strong placeholder:text-ink-faint focus:outline-none","data-testid":"command-input"}),g.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),g.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:x.length===0?g.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:i(n?"command.empty.node":"command.empty.nonode")}):Sj.map(p=>{const y=x.filter(E=>E.group===p);return y.length===0?null:g.jsxs("div",{children:[g.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:i(p)}),y.map(E=>{const T=x.indexOf(E),w=E.icon;return g.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:[g.jsx(w,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),g.jsx("span",{className:"text-body font-medium flex-1",children:i(E.labelKey)})]},E.id)})]},p)})}),g.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[g.jsx("span",{children:i("command.footer.hint")}),g.jsx("span",{children:i("command.footer.keys")})]})]})]})}const $S="lookatstudy-theme",Xv="auto",QS="(prefers-color-scheme: dark)";function zm(){return typeof window>"u"||window.matchMedia(QS).matches?"dark":"light"}function wj(){if(typeof localStorage>"u")return Xv;const e=localStorage.getItem($S);return e==="auto"||e==="light"||e==="dark"?e:Xv}function Um(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function Aj(){const[e,t]=_.useState(()=>wj()),[n,i]=_.useState(()=>e==="auto"?zm():e),o=_.useCallback(s=>{t(s),localStorage.setItem($S,s);const l=s==="auto"?zm():s;i(l),Um(l)},[]);return _.useEffect(()=>{if(e!=="auto")return;const s=window.matchMedia(QS),l=c=>{const d=c.matches?"dark":"light";i(d),Um(d)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),_.useEffect(()=>{const s=e==="auto"?zm():e;i(s),Um(s)},[e]),{mode:e,resolved:n,setMode:o}}const nn="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 Pt(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function Cj(){const e=Ye(),[t,n]=_.useState([]),[i,o]=_.useState([]),[s,l]=_.useState("glm"),[c,d]=_.useState(""),[f,m]=_.useState(""),[x,b]=_.useState(null),[p,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,F]=_.useState(""),[z,H]=_.useState(!1),[G,W]=_.useState(null),[ae,V]=_.useState([]),[Y,te]=_.useState(!1),[U,ie]=_.useState(null),[K,$]=_.useState(null),[J,se]=_.useState(""),[ke,Pe]=_.useState(!1),Be=Aj(),ze=async()=>{te(!0),ie(null);try{const xe=await fe.discoverModels();xe.ok&&xe.models?V(xe.models):ie(xe.error||e("settings.discover_failed"))}catch(xe){ie(xe instanceof Error?xe.message:String(xe))}finally{te(!1)}},St=_.useCallback(async()=>{try{const[xe,Fe,je,me]=await Promise.all([fe.getProviderPresets(),fe.listCustomProviders(),fe.getSetting("active_provider"),fe.getSetting("active_model")]);n(xe),o(Fe);const Se=je??"glm";if(l(Se),Se.startsWith("custom-")){const De=Fe.find(Me=>Me.id===Se);b(De!=null&&De.hasApiKey?e("settings.key.configured"):null)}else{const De=xe.find(Me=>Me.id===Se);if(De){const Me=await fe.getSetting(De.apiKeySetting);b(Me?`${Me.slice(0,4)}…${Me.slice(-4)}`:null)}}if(Se.startsWith("custom-")){const De=Fe.find(Me=>Me.id===Se);d(me??(De==null?void 0:De.defaultModel)??"")}else{const De=xe.find(Me=>Me.id===Se);d(me??(De==null?void 0:De.defaultModel)??"")}}catch(xe){console.error("[SettingsView] load() failed:",xe)}},[e]);_.useEffect(()=>{St()},[St]);const pt=async xe=>{l(xe),T(null),m("");const Fe=t.find(je=>je.id===xe);if(Fe){const je=await fe.getSetting(Fe.apiKeySetting);b(je?`${je.slice(0,4)}…${je.slice(-4)}`:null),d(c||Fe.defaultModel)}},ye=async()=>{M(!1);try{if(await fe.setSetting("active_provider",s),await fe.setSetting("active_model",c),f.trim()){const xe=t.find(Fe=>Fe.id===s);xe&&(await fe.setSetting(xe.apiKeySetting,f.trim()),b(`${f.trim().slice(0,4)}…${f.trim().slice(-4)}`),m(""))}M(!0),setTimeout(()=>M(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},Ke=async()=>{y(!0),T(null);try{const xe=await fe.testLlmConnection();T(xe)}catch(xe){T({ok:!1,detail:xe instanceof Error?xe.message:String(xe),errorKind:"unknown"})}finally{y(!1)}},Ot=async()=>{if(!(!j.trim()||!Q.trim()||z)){H(!0),W(null);try{const xe=await fe.testCustomProvider({label:A||e("settings.custom.test_label"),protocol:I,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:Q.trim()});W({ok:xe.ok,detail:xe.detail})}catch(xe){W({ok:!1,detail:xe instanceof Error?xe.message:String(xe)})}finally{H(!1)}}},Bt=async()=>{if(!(!A.trim()||!j.trim()||!Q.trim()))try{const xe=await fe.createCustomProvider({label:A.trim(),protocol:I,baseUrl:j.trim(),apiKey:P.trim()||void 0,defaultModel:Q.trim()});await fe.setSetting("active_provider",xe.id),await fe.setSetting("active_model",xe.defaultModel),l(xe.id),d(xe.defaultModel),C(""),D(""),B(""),F(""),R("openai-compatible"),W(null),L(!1),await St(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},zt=async xe=>{try{await fe.deleteCustomProvider(xe),s===xe&&(await fe.setSetting("active_provider","glm"),l("glm")),await St()}catch{}},ht=s.startsWith("custom-")?i.find(xe=>xe.id===s):null;_.useEffect(()=>{if(!ht)return;const xe=ht.models.find(Fe=>Fe.id===c);se(xe!=null&&xe.contextWindow?String(xe.contextWindow):"")},[ht,c]);const ln=async()=>{var Se,De;if(!ht)return;const xe=J.trim().replace(/[,\s_]/g,""),Fe=/^(\d+)([km]?)$/i.exec(xe);if(xe!==""&&!Fe)return;const je=((Se=Fe==null?void 0:Fe[2])==null?void 0:Se.toLowerCase())==="k"?1e3:((De=Fe==null?void 0:Fe[2])==null?void 0:De.toLowerCase())==="m"?1e6:1,me=xe===""||!Fe?null:Math.max(1,Math.round(parseInt(Fe[1],10)*je));Pe(!0);try{const Me=ht.models.map($e=>$e.id===c?{...$e,contextWindow:me}:$e);await fe.updateCustomProvider(ht.id,{models:Me}),await St(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{Pe(!1)}},Rt=s.startsWith("custom-")?null:t.find(xe=>xe.id===s);return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[g.jsxs("section",{children:[g.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),g.jsxs("div",{className:"surface-card overflow-hidden",children:[g.jsxs("div",{className:Pt(!1),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),g.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(xe=>g.jsx("button",{onClick:()=>pt(xe.id),"data-testid":`provider-card-${xe.id}`,"aria-pressed":s===xe.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${s===xe.id?Sr:Tr}`,children:xe.label},xe.id)),i.map(xe=>g.jsxs("button",{onClick:()=>pt(xe.id),"data-testid":`provider-card-${xe.id}`,"aria-pressed":s===xe.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${s===xe.id?Sr:Tr}`,children:[g.jsx(up,{className:"w-3.5 h-3.5","aria-hidden":"true"}),xe.label]},xe.id)),g.jsxs("button",{onClick:()=>L(xe=>!xe),"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:[g.jsx(ud,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),N&&g.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:[g.jsx("div",{className:"text-label font-bold text-ink-strong",children:e("settings.custom.form_title")}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("input",{type:"text",value:A,onChange:xe=>C(xe.target.value),placeholder:e("settings.custom.label_ph"),"data-testid":"custom-label",className:`${nn} flex-1 px-2.5 py-1.5`}),g.jsxs("select",{value:I,onChange:xe=>R(xe.target.value),"data-testid":"custom-protocol",className:`${nn} px-2 py-1.5`,children:[g.jsx("option",{value:"openai-compatible",children:e("settings.proto.openai")}),g.jsx("option",{value:"anthropic",children:"Anthropic"}),g.jsx("option",{value:"google",children:"Google"})]})]}),g.jsx("input",{type:"text",value:j,onChange:xe=>D(xe.target.value),placeholder:e("settings.custom.baseurl_ph"),"data-testid":"custom-baseurl",className:`${nn} w-full px-2.5 py-1.5 font-mono`}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("input",{type:"text",value:Q,onChange:xe=>F(xe.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"custom-model",className:`${nn} flex-1 px-2.5 py-1.5 font-mono`}),g.jsx("input",{type:"password",value:P,onChange:xe=>B(xe.target.value),placeholder:e("settings.custom.apikey_ph"),"data-testid":"custom-apikey",className:`${nn} flex-1 px-2.5 py-1.5`})]}),G&&g.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?g.jsx(ai,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):g.jsx(Ds,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),g.jsx("span",{className:"break-words",children:G.detail})]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("button",{onClick:Ot,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")}),g.jsx("button",{onClick:Bt,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")}),g.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-")&&g.jsx("div",{className:Pt(!0),children:g.jsx("button",{onClick:xe=>{const Fe=xe.currentTarget.getBoundingClientRect(),je=i.find(me=>me.id===s);je&&$({id:je.id,label:je.label,rect:Fe})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),Rt&&g.jsxs(g.Fragment,{children:[Rt.baseUrl&&g.jsxs("div",{className:Pt(!0),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),g.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:Rt.baseUrl})]}),g.jsxs("div",{className:Pt(!0),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),g.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[g.jsxs("select",{value:c,onChange:xe=>d(xe.target.value),"data-testid":"model-select",className:`${nn} flex-1 px-2.5 py-1.5`,children:[Rt.models.map(xe=>g.jsx("option",{value:xe.id,children:xe.id},xe.id)),s==="openrouter"&&ae.map(xe=>g.jsx("option",{value:xe.id,children:xe.id},xe.id))]}),s==="openrouter"&&g.jsxs("button",{onClick:ze,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:[g.jsx(jC,{className:`w-3.5 h-3.5 ${Y?"animate-spin":""}`,"aria-hidden":"true"}),e(Y?"settings.discovering":"settings.refresh")]})]})]}),U&&g.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:U})]}),g.jsx("div",{className:Pt(!0),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),g.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[x&&g.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[g.jsx(ai,{className:"w-3.5 h-3.5","aria-hidden":"true"}),x]}),g.jsx("input",{type:"password",value:f,onChange:xe=>m(xe.target.value),placeholder:e(x?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${nn} flex-1 px-2.5 py-1.5`}),g.jsx("a",{href:Rt.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),g.jsx("div",{className:Pt(!0),children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("button",{onClick:Ke,disabled:p,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(p?"settings.testing":"settings.test")}),E&&g.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?g.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):g.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]}),ht&&!Rt&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:Pt(!0),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),g.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:ht.baseUrl})]}),g.jsx("div",{className:Pt(!0),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),ht.models.length>1?g.jsx("select",{value:c,onChange:xe=>d(xe.target.value),"data-testid":"model-select-custom",className:`${nn} flex-1 px-2.5 py-1.5`,children:ht.models.map(xe=>g.jsx("option",{value:xe.id,children:xe.id},xe.id))}):g.jsx("input",{type:"text",value:c,onChange:xe=>d(xe.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${nn} flex-1 px-2.5 py-1.5 font-mono`})]})}),g.jsxs("div",{className:Pt(!0),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("input",{type:"text",inputMode:"numeric",value:J,onChange:xe=>se(xe.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${nn} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),g.jsx("button",{onClick:ln,disabled:ke,"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")})]}),g.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),g.jsx("div",{className:Pt(!0),children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("button",{onClick:Ke,disabled:p,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(p?"settings.testing":"settings.test")}),E&&g.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?g.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):g.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]})]})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),g.jsx("div",{className:"surface-card overflow-hidden",children:g.jsx(_j,{activeProvider:s,activeModel:c,presets:t,customProviders:i})})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),g.jsx("div",{className:"surface-card overflow-hidden",children:g.jsx(Mj,{})})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.speech.title")}),g.jsx("div",{className:"surface-card overflow-hidden",children:g.jsx(Lj,{})})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),g.jsxs("div",{className:"surface-card overflow-hidden",children:[g.jsxs("div",{className:Pt(!1),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),g.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:xe,label:Fe})=>g.jsx("button",{onClick:()=>Be.setMode(xe),"data-testid":`theme-${xe}`,"aria-pressed":Be.mode===xe,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Be.mode===xe?Sr:Tr}`,children:Fe},xe))}),g.jsx("p",{className:"text-label text-ink-muted mt-2",children:Be.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${Be.resolved}`)}):null})]}),g.jsxs("div",{className:Pt(!0),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),g.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(xe=>g.jsx("button",{onClick:()=>WC(xe),"data-testid":`lang-${xe}`,"aria-pressed":Os()===xe,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Os()===xe?Sr:Tr}`,children:xe==="zh-CN"?"中文":"English"},xe))})]}),g.jsxs("div",{className:Pt(!0),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),g.jsx(Nj,{})]})]})]})]}),g.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:[g.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),g.jsxs("button",{onClick:ye,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[w&&g.jsx(Fn,{className:"w-4 h-4","aria-hidden":"true"}),e(w?"settings.saved_text":"settings.footer.save")]})]}),K&&g.jsx(cd,{anchorRect:K.rect,message:e("settings.delete_custom_confirm",{name:K.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{zt(K.id),$(null)},onCancel:()=>$(null)})]})}function Nj(){const[e,t]=_.useState("en"),[n,i]=_.useState(!1);_.useEffect(()=>{fe.getSetting("pref_lang").then(l=>{l&&t(l),i(!0)})},[]);const o=async l=>{t(l),await fe.setSetting("pref_lang",l)},s=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?g.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:s.map(l=>g.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 _j({activeProvider:e,activeModel:t,presets:n,customProviders:i}){const o=Ye(),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[f,m]=_.useState(""),[x,b]=_.useState("");_.useEffect(()=>{Promise.all([fe.getSetting("flag_multimodal_import"),fe.getSetting("vision_provider_override"),fe.getSetting("vision_model_override")]).then(([C,I,R])=>{l(C==="true"),m(I??""),b(R??""),d(!0)})},[]);const p=async()=>{const C=!s;l(C),await fe.setSetting("flag_multimodal_import",String(C))},y=async()=>{await fe.setSetting("vision_provider_override",f),await fe.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 fe.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?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[g.jsx(WS,{checked:s,onChange:p,label:o("settings.multimodal.toggle"),testid:"multimodal-toggle"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"text-body font-medium text-ink-strong",children:o("settings.multimodal.toggle")}),g.jsx("div",{className:"text-label text-ink-muted",children:o("settings.multimodal.toggle.desc")})]})]}),g.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[g.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[g.jsx("div",{className:"font-medium mb-1",children:o("settings.multimodal.current_model",{model:t||o("settings.multimodal.not_selected")})}),g.jsx("div",{children:e.startsWith("custom-")?o("settings.multimodal.hint_custom"):o("settings.multimodal.hint_preset")})]}),g.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[g.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:o("settings.multimodal.override_title")}),g.jsx("div",{className:"text-caption text-ink-muted mb-2",children:o("settings.multimodal.override_bridge_hint")}),g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsxs("select",{value:f,onChange:C=>{m(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:`${nn} w-full px-3 py-2`,children:[g.jsx("option",{value:"",children:o("settings.multimodal.no_override")}),g.jsx("optgroup",{label:o("settings.multimodal.group_preset"),children:n.map(C=>g.jsx("option",{value:C.id,children:C.label},C.id))}),i.length>0&&g.jsx("optgroup",{label:o("settings.multimodal.group_custom"),children:i.map(C=>g.jsx("option",{value:C.id,children:C.label},C.id))})]}),f&&g.jsxs(g.Fragment,{children:[((L==null?void 0:L.models.length)??0)>0?g.jsx("select",{value:x,onChange:C=>b(C.target.value),className:`${nn} w-full px-3 py-2`,children:L.models.map(C=>g.jsxs("option",{value:C.id,children:[C.label,(C.capabilities??[]).includes("vision")?` · ${o("settings.multimodal.vision_capable")}`:""]},C.id))}):g.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:`${nn} w-full px-3 py-2`}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-start",children:[g.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")}),g.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&&g.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${w.ok?"text-brand":"text-warning"}`,children:[w.ok?g.jsx(ai,{className:"w-4 h-4","aria-hidden":"true"}):g.jsx(Ds,{className:"w-4 h-4","aria-hidden":"true"}),w.detail]})]})]})]})]})]})]}):null}function Mj(){const e=Ye(),[t,n]=_.useState(!1),[i,o]=_.useState(!1);_.useEffect(()=>{fe.getSetting("flag_memory_system").then(l=>{n(l==="true"),o(!0)})},[]);const s=async()=>{const l=!t;n(l),await fe.setSetting("flag_memory_system",String(l))};return i?g.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[g.jsx(WS,{checked:t,onChange:s,label:e("settings.memory.toggle"),testid:"memory-toggle"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),g.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function WS({checked:e,onChange:t,label:n,testid:i}){return g.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:g.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 Rj=[{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(女)"}],Dj=[{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 Lj(){const e=Ye(),[t,n]=_.useState([]),[i,o]=_.useState(null),[s,l]=_.useState(null),[c,d]=_.useState(null),[f,m]=_.useState(null),[x,b]=_.useState("edge"),[p,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,F]=_.useState(""),[z,H]=_.useState(""),[G,W]=_.useState(!1),[ae,V]=_.useState(!1),[Y,te]=_.useState(!0),[U,ie]=_.useState(!1);_.useEffect(()=>{Promise.all([fe.getSetting("tts_engine"),fe.getSetting("tts_voice_edge"),fe.getSetting("azure_tts_voice"),fe.getSetting("tts_sid_local"),fe.getSetting("tts_speed"),fe.getSetting("azure_tts_region"),fe.getSetting("azure_tts_api_key"),fe.getSetting("asr_engine"),fe.getSetting("azure_stt_region"),fe.getSetting("azure_stt_api_key"),fe.getSetting("groq_api_key"),fe.getSetting("asr_auto_stop"),fe.getSetting("asr_auto_send")]).then(([ye,Ke,Ot,Bt,zt,ht,ln,Rt,xe,Fe,je,me,Se])=>{(ye==="azure"||ye==="local")&&b(ye),Ke&&y(Ke),Ot&&T(Ot),Bt&&M(Bt),zt&&L(zt),ht&&R(ht),ln&&(D(!0),C("")),(Rt==="groq"||Rt==="azure")&&B(Rt),xe&&H(xe),Fe&&(W(!0),F("")),V(!!je),te(me!=="0"),ie(Se==="1")})},[]);const K=ye=>{b(ye),fe.setSetting("tts_engine",ye)},$=ye=>{B(ye),fe.setSetting("asr_engine",ye)},J=_.useCallback(()=>{window.api.getSpeechModelStatus().then(ye=>n(ye)).catch(()=>{})},[]);_.useEffect(()=>(J(),window.api.on("speech:modelProgress",Ke=>{d({id:Ke.id,pct:Math.floor(Ke.progress*100),label:Ke.currentFile?Ke.currentFile.split("/").pop()??"":""})})),[J]);const se=ye=>{l(null),o(ye),d({id:ye,pct:0,label:""}),window.api.ensureSpeechModel(ye).then(()=>{o(null),d(null),J()}).catch(Ke=>{o(null),d(null),l(Ke instanceof Error?Ke.message:String(Ke)),J()})},ke=ye=>{o(ye),m(null),window.api.deleteSpeechModel(ye).then(J).catch(Ke=>l(Ke instanceof Error?Ke.message:String(Ke))).finally(()=>o(null))},Pe=ye=>e(ye==="tts-kokoro"?"settings.speech.model.tts":ye==="asr-whisper-turbo"?"settings.speech.model.asr_turbo":ye==="asr-whisper-small"?"settings.speech.model.asr_small":"settings.speech.model.asr"),Be=ye=>ye.startsWith("asr-whisper")?e("settings.speech.license_mit"):e("settings.speech.license"),ze=ye=>e(ye==="ready"?"settings.speech.state.ready":ye==="error"?"settings.speech.state.error":"settings.speech.state.absent"),St=x==="azure"?E:p,pt=ye=>{x==="azure"?(T(ye),fe.setSetting("azure_tts_voice",ye)):(y(ye),fe.setSetting("tts_voice_edge",ye))};return g.jsxs("div",{className:"p-4 space-y-3","data-testid":"settings-speech",children:[g.jsx("p",{className:"text-label text-ink-muted",children:e("settings.speech.desc")}),g.jsxs("div",{className:Pt(!1),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.tts_engine")}),g.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:ye,label:Ke})=>g.jsx("button",{onClick:()=>K(ye),"data-testid":`tts-engine-${ye}`,"aria-pressed":x===ye,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${x===ye?Sr:Tr}`,children:Ke},ye))}),g.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"&&g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.voice")}),g.jsx("select",{value:St,onChange:ye=>pt(ye.target.value),"data-testid":"tts-voice-select",className:`${nn} flex-1 px-2.5 py-1.5`,children:Rj.map(ye=>g.jsx("option",{value:ye.id,children:ye.label},ye.id))})]})}),x==="local"&&g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.voice")}),g.jsx("select",{value:w,onChange:ye=>{M(ye.target.value),fe.setSetting("tts_sid_local",ye.target.value)},"data-testid":"tts-sid-select",className:`${nn} flex-1 px-2.5 py-1.5`,children:Dj.map(ye=>g.jsx("option",{value:ye.sid,children:ye.label},ye.sid))})]})}),g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.speed")}),g.jsx("input",{type:"range",min:.5,max:2,step:.05,value:Number(N),onChange:ye=>L(ye.target.value),onPointerUp:()=>void fe.setSetting("tts_speed",N),onKeyUp:()=>void fe.setSetting("tts_speed",N),"data-testid":"tts-speed-range",className:"flex-1 accent-brand"}),g.jsxs("span",{className:"text-label text-ink-muted w-10 text-right","data-testid":"tts-speed-value",children:[Number(N).toFixed(2),"×"]})]})}),x==="azure"&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_key")}),g.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[j&&A===""&&g.jsx("span",{className:"text-label text-brand shrink-0",children:"✓"}),g.jsx("input",{type:"password",value:A,onChange:ye=>C(ye.target.value),onBlur:()=>{A.trim()&&(fe.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:`${nn} flex-1 px-2.5 py-1.5`})]})]})}),g.jsx("div",{className:Pt(!0),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_region")}),g.jsx("input",{type:"text",value:I,onChange:ye=>R(ye.target.value),onBlur:()=>void fe.setSetting("azure_tts_region",I.trim()),placeholder:"eastus","data-testid":"azure-tts-region-input",className:`${nn} flex-1 px-2.5 py-1.5`})]})})]}),g.jsxs("div",{className:Pt(!1),children:[g.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.asr_engine")}),g.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:ye,label:Ke})=>g.jsx("button",{onClick:()=>$(ye),"data-testid":`asr-engine-${ye}`,"aria-pressed":P===ye,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${P===ye?Sr:Tr}`,children:Ke},ye))}),g.jsx("p",{className:"text-label text-ink-muted mt-2",children:e(P==="local"?"settings.speech.asr_engine.local_note":P==="groq"?ae?"settings.speech.asr_engine.groq_ready":"settings.speech.asr_engine.groq_note":"settings.speech.asr_engine.azure_note")})]}),P==="azure"&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_key")}),g.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[G&&Q===""&&g.jsx("span",{className:"text-label text-brand shrink-0",children:"✓"}),g.jsx("input",{type:"password",value:Q,onChange:ye=>F(ye.target.value),onBlur:()=>{Q.trim()&&(fe.setSetting("azure_stt_api_key",Q.trim()),W(!0),F(""))},placeholder:e(G?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"azure-stt-key-input",className:`${nn} flex-1 px-2.5 py-1.5`})]})]})}),g.jsx("div",{className:Pt(!1),children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.azure_region")}),g.jsx("input",{type:"text",value:z,onChange:ye=>H(ye.target.value),onBlur:()=>void fe.setSetting("azure_stt_region",z.trim()),placeholder:"eastus","data-testid":"azure-stt-region-input",className:`${nn} flex-1 px-2.5 py-1.5`})]})})]}),g.jsxs("div",{className:Pt(!1),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("div",{className:"text-label font-medium text-ink-strong",children:e("settings.speech.asr_auto_stop")}),g.jsx("button",{onClick:()=>{const ye=!Y;te(ye),fe.setSetting("asr_auto_stop",ye?"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:g.jsx("span",{className:`absolute top-0.5 w-5 h-5 rounded-full bg-white shadow transition-all ${Y?"left-[18px]":"left-0.5"}`})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 mt-1",children:[g.jsx("div",{className:"text-label font-medium text-ink-strong",children:e("settings.speech.asr_auto_send")}),g.jsx("button",{onClick:()=>{const ye=!U;ie(ye),fe.setSetting("asr_auto_send",ye?"1":"0")},role:"switch","aria-checked":U,"data-testid":"asr-auto-send-toggle",className:`relative w-10 h-6 rounded-full transition-colors ${U?"bg-brand":"bg-ink/[0.15]"}`,children:g.jsx("span",{className:`absolute top-0.5 w-5 h-5 rounded-full bg-white shadow transition-all ${U?"left-[18px]":"left-0.5"}`})})]}),g.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_ux_note")})]}),s&&g.jsx("div",{className:"text-label text-warning break-all",role:"alert",children:s==="engine-unavailable"?e("chat.speech.engine_unavailable"):s}),t.filter(ye=>ye.id!=="tts-kokoro"||x==="local").map(ye=>g.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:Pe(ye.id)}),g.jsxs("div",{className:"text-caption text-ink-muted",children:[ze(ye.state)," · ",Be(ye.id)]}),i===ye.id&&(c==null?void 0:c.id)===ye.id&&g.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${ye.id}`,children:g.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${c.pct}%`}})}),i===ye.id&&(c==null?void 0:c.id)===ye.id&&g.jsxs("div",{className:"text-caption text-ink-muted mt-0.5","data-testid":`speech-dl-pct-${ye.id}`,children:[c.pct,"% ",c.label]})]}),ye.state==="ready"?f===ye.id?g.jsxs("div",{className:"flex gap-1.5",children:[g.jsx("button",{onClick:()=>ke(ye.id),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-warning text-white","data-testid":`speech-del-confirm-${ye.id}`,children:e("action.confirm")}),g.jsx("button",{onClick:()=>m(null),className:"px-3 py-1.5 rounded-xl text-label font-bold bg-ink/[0.08] text-ink",children:e("action.cancel")})]}):g.jsx("button",{onClick:()=>m(ye.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-${ye.id}`,children:e("settings.speech.delete")}):g.jsx("button",{onClick:()=>se(ye.id),disabled:i!==null,className:"btn-3d-brand px-3 py-1.5 text-label","data-testid":`speech-dl-${ye.id}`,children:i===ye.id?`${(c==null?void 0:c.pct)??0}%`:e("settings.speech.download")})]},ye.id))]})}function Oj(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 Ij=0;const yc=()=>`msg-v2-${++Ij}`;function jj(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 Pj(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 p=await fe.threadGetMessages(e);if(b)return;i(p.map(y=>{const E=jj(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(()=>fe.on("chat:part",p=>{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=yc(),M=[...T,{id:w,role:"assistant",parts:[]}])}const L=w;return M.map(A=>A.id===L?{...A,parts:Oj(A.parts,p)}:A)})}),[]),_.useEffect(()=>fe.on("chat:done",(p,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(()=>fe.on("chat:error",p=>{s(!1),l.current=null,i(y=>[...y,{id:yc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${p}`}]}])}),[]);const c=_.useCallback(async(b,p,y,E)=>{const T=p??e;if(!T||o||!b.trim())return;const w=b.trim(),M={id:yc(),role:"user",parts:[...(E??[]).map(N=>({type:"attachment",attachment:{kind:N.kind,name:N.name,mime:N.mime,size:N.size,...N.previewUrl?{previewUrl:N.previewUrl}:{}}})),{type:"text",text:w}],...y?{displayText:y}:{}};i(N=>[...N,M]),s(!0),l.current=null;try{await fe.agentChatThread(T,w,y,t??null,E)}catch(N){s(!1),i(L=>[...L,{id:yc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${N instanceof Error?N.message:String(N)}`}]}])}},[e,o,t]),d=_.useCallback(async()=>{if(!(!e||!o)){try{await fe.abortAgentChatThread(e)}catch{}s(!1),l.current=null}},[e,o]),f=_.useCallback(()=>{i([])},[]);_.useEffect(()=>{const b=p=>{const y=p.detail;if(typeof y!="string")return;const T={explain_simple:{msg:"用大白话给我讲讲这一节的核心概念",labelKey:"command.explain_simple"},quiz_3:{msg:"出 3 道练习题考考我",labelKey:"command.quiz_3"},compare_prev:{msg:"把这一节和上一节做个对比表",labelKey:"command.compare_prev"},concept_map:{msg:"画个概念图帮我理清这一节的知识结构",labelKey:"command.concept_map"},socratic:{msg:"切换到苏格拉底模式,用提问引导我思考",labelKey:"command.socratic"},exam_mode:{msg:"切换到考试冲刺模式,出有难度的题",labelKey:"command.exam_mode"}}[y];T&&c(T.msg,void 0,dp(T.labelKey))};return window.addEventListener("lookatstudy-command",b),()=>window.removeEventListener("lookatstudy-command",b)},[c]);const m=_.useCallback((b,p,y)=>{i(E=>E.map(T=>{if(T.id!==b)return T;const w=[...T.parts],M=w[p];return M&&M.type==="tool-call"&&(w[p]={...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:m,setMessagesForNode:x}}const vc=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function Bj(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function zj(e,t){const n=e.detail.map((o,s)=>o.correct?t("quiz.hook.lineOk",{n:s+1,prompt:vc(o.prompt)}):t("quiz.hook.lineWrong",{n:s+1,prompt:vc(o.prompt),chosen:vc(o.chosen,30),answer:vc(o.answerText,30)})),i=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:i,correct:e.correct,total:e.total})+(n.length?`
544
- `+n.join(`
545
- `):"")}function Uj(e,t){const[n,i]=_.useState([]),[o,s]=_.useState(null),l=_.useCallback(async()=>{if(!e||!t){i([]),s(null);return}try{const E=(await fe.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 fe.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 fe.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 fe.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]),m=_.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]),p=n.find(y=>y.id===o)??null;return{threads:n,activeId:o,activeThread:p,setActiveId:s,reload:l,create:c,update:d,remove:f,removeWithUndo:m,restore:x,ensureThreadForSend:b}}function Hj({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:i,onCreate:o,onRename:s,onArchive:l,onDelete:c}){const d=Ye(),[f,m]=_.useState(null),[x,b]=_.useState(null),[p,y]=_.useState(null),[E,T]=_.useState(""),[w,M]=_.useState(null),N=_.useRef(null);_.useEffect(()=>{const I=R=>{N.current&&!N.current.contains(R.target)&&(m(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}),m(f===R?null:R)},A=I=>{y(I.id),T(I.title??""),m(null),b(null)},C=()=>{p&&E.trim()&&s(p,E.trim()),y(null)};return e.length===0?g.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:[g.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),g.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??d("thread.empty.no_node")}),g.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:d("thread.empty.hint")})]}):g.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[g.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=p===I.id;return g.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:[g.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?g.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"}):g.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&&g.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:g.jsx(Fc,{className:"w-3 h-3"})})]},I.id)}),g.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:g.jsx(ud,{className:"w-3.5 h-3.5"})})]}),f&&x&&(()=>{const I=e.find(R=>R.id===f);return I?g.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:[g.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:[g.jsx(HC,{className:"w-3 h-3"}),d("thread.menu.rename")]}),g.jsxs("button",{onClick:()=>{l(I.id),m(null),b(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[g.jsx(sC,{className:"w-3 h-3"}),d("thread.menu.archive")]}),g.jsxs("button",{onClick:R=>{const j=R.currentTarget.getBoundingClientRect();M({id:I.id,title:I.title??d("toast.threadDefault"),rect:j}),m(null),b(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-warning hover:bg-warning/10 transition-colors",children:[g.jsx(s0,{className:"w-3 h-3"}),d("action.delete")]})]}):null})(),w&&g.jsx(cd,{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 Fj=1240,Vj=920;function qj(e){return e>=Fj?1:e>=Vj?2:3}function Yj(e){return e==="rail"?"rail":"notebook"}function Gj(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 Xj(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function Kj(){return qj(typeof window>"u"?$j:window.innerWidth)}const $j=99999;function Qj(){return _.useSyncExternalStore(Xj,Kj,()=>1)}const jp=_.createContext({});function Pp(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wj=typeof window<"u",Zc=Wj?_.useLayoutEffect:_.useEffect,Cd=_.createContext(null);function Bp(e,t){e.indexOf(t)===-1&&e.push(t)}function Jc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ra=(e,t,n)=>n>t?t:n<e?e:n;let Nd=()=>{};const zi={},ZS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),JS=e=>typeof e=="object"&&e!==null,ek=e=>/^0[^.\s]+$/u.test(e);function tk(e){let t;return()=>(t===void 0&&(t=e()),t)}const oa=e=>e,Hl=(...e)=>e.reduce((t,n)=>i=>n(t(i))),Al=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class zp{constructor(){this.subscriptions=[]}add(t){return Bp(this.subscriptions,t),()=>Jc(this.subscriptions,t)}notify(t,n,i){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,i);else for(let s=0;s<o;s++){const l=this.subscriptions[s];l&&l(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,sa=e=>e/1e3,nk=(e,t)=>t?e*(1e3/t):0,ak=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Zj=1e-7,Jj=12;function e9(e,t,n,i,o){let s,l,c=0;do l=t+(n-t)/2,s=ak(l,i,o)-e,s>0?n=l:t=l;while(Math.abs(s)>Zj&&++c<Jj);return l}function Fl(e,t,n,i){if(e===t&&n===i)return oa;const o=s=>e9(s,0,1,e,n);return s=>s===0||s===1?s:ak(o(s),t,i)}const ik=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rk=e=>t=>1-e(1-t),sk=Fl(.33,1.53,.69,.99),Up=rk(sk),ok=ik(Up),lk=e=>e>=1?1:(e*=2)<1?.5*Up(e):.5*(2-Math.pow(2,-10*(e-1))),Hp=e=>1-Math.sin(Math.acos(e)),uk=rk(Hp),ck=ik(Hp),t9=Fl(.42,0,1,1),n9=Fl(0,0,.58,1),dk=Fl(.42,0,.58,1),a9=e=>Array.isArray(e)&&typeof e[0]!="number",fk=e=>Array.isArray(e)&&typeof e[0]=="number",i9={linear:oa,easeIn:t9,easeInOut:dk,easeOut:n9,circIn:Hp,circInOut:ck,circOut:uk,backIn:Up,backInOut:ok,backOut:sk,anticipate:lk},r9=e=>typeof e=="string",Kv=e=>{if(fk(e)){Nd(e.length===4);const[t,n,i,o]=e;return Fl(t,n,i,o)}else if(r9(e))return i9[e];return e},Ec=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function s9(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,m=!1,x=!1)=>{const p=x&&i?t:n;return m&&s.add(f),p.add(f),f},cancel:f=>{n.delete(f),s.delete(f)},process:f=>{if(l=f,i){o=!0;return}i=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),i=!1,o&&(o=!1,d.process(f))}};return d}const o9=40;function hk(e,t){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=Ec.reduce((N,L)=>(N[L]=s9(s),N),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:m,update:x,preRender:b,render:p,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,o9),1)),o.timestamp=L,o.isProcessing=!0,c.process(o),d.process(o),f.process(o),m.process(o),x.process(o),b.process(o),p.process(o),y.process(o),o.isProcessing=!1,n&&t&&(i=!1,e(E))},T=()=>{n=!0,i=!0,o.isProcessing||e(E)};return{schedule:Ec.reduce((N,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<Ec.length;L++)l[Ec[L]].cancel(N)},state:o,steps:l}}const{schedule:Ct,cancel:Ui,state:hn,steps:Hm}=hk(typeof requestAnimationFrame<"u"?requestAnimationFrame:oa,!0);let Dc;function l9(){Dc=void 0}const En={now:()=>(Dc===void 0&&En.set(hn.isProcessing||zi.useManualTiming?hn.timestamp:performance.now()),Dc),set:e=>{Dc=e,queueMicrotask(l9)}},mk=e=>t=>typeof t=="string"&&t.startsWith(e),pk=mk("--"),u9=mk("var(--"),Fp=e=>u9(e)?c9.test(e.split("/*")[0].trim()):!1,c9=/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},Cl={...Gs,transform:e=>Ra(0,1,e)},Tc={...Gs,default:1},gl=e=>Math.round(e*1e5)/1e5,Vp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function d9(e){return e==null}const f9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qp=(e,t)=>n=>!!(typeof n=="string"&&f9.test(n)&&n.startsWith(e)||t&&!d9(n)&&Object.prototype.hasOwnProperty.call(n,t)),gk=(e,t,n)=>i=>{if(typeof i!="string")return i;const[o,s,l,c]=i.match(Vp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},h9=e=>Ra(0,255,e),Fm={...Gs,transform:e=>Math.round(h9(e))},kr={test:qp("rgb","red"),parse:gk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Fm.transform(e)+", "+Fm.transform(t)+", "+Fm.transform(n)+", "+gl(Cl.transform(i))+")"};function m9(e){let t="",n="",i="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}}const M0={test:qp("#"),parse:m9,transform:kr.transform},Vl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ei=Vl("deg"),Ma=Vl("%"),Oe=Vl("px"),p9=Vl("vh"),g9=Vl("vw"),Qv={...Ma,parse:e=>Ma.parse(e)/100,transform:e=>Ma.transform(e*100)},_s={test:qp("hsl","hue"),parse:gk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Ma.transform(gl(t))+", "+Ma.transform(gl(n))+", "+gl(Cl.transform(i))+")"},Zt={test:e=>kr.test(e)||M0.test(e)||_s.test(e),parse:e=>kr.test(e)?kr.parse(e):_s.test(e)?_s.parse(e):M0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?kr.transform(e):_s.transform(e),getAnimatableNone:e=>{const t=Zt.parse(e);return t.alpha=0,Zt.transform(t)}},x9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function b9(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vp))==null?void 0:t.length)||0)+(((n=e.match(x9))==null?void 0:n.length)||0)>0}const xk="number",bk="color",y9="var",v9="var(",Wv="${}",E9=/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(E9,d=>(Zt.test(d)?(i.color.push(s),o.push(bk),n.push(Zt.parse(d))):d.startsWith(v9)?(i.var.push(s),o.push(y9),n.push(d)):(i.number.push(s),o.push(xk),n.push(parseFloat(d))),++s,Wv)).split(Wv);return{values:n,split:c,indexes:i,types:o}}function T9(e){return Bs(e).values}function yk({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===xk?o+=gl(i[s]):l===bk?o+=Zt.transform(i[s]):o+=i[s]}return o}}function S9(e){return yk(Bs(e))}const k9=e=>typeof e=="number"?0:Zt.test(e)?Zt.getAnimatableNone(e):e,w9=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:k9(e);function A9(e){const t=Bs(e);return yk(t)(t.values.map((i,o)=>w9(i,t.split[o])))}const ba={test:b9,parse:T9,createTransformer:S9,getAnimatableNone:A9};function Vm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function C9({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let o=0,s=0,l=0;if(!t)o=s=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;o=Vm(d,c,e+1/3),s=Vm(d,c,e),l=Vm(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:i}}function ed(e,t){return n=>n>0?t:e}const At=(e,t,n)=>e+(t-e)*n,qm=(e,t,n)=>{const i=e*e,o=n*(t*t-i)+i;return o<0?0:Math.sqrt(o)},N9=[M0,kr,_s],_9=e=>N9.find(t=>t.test(e));function Zv(e){const t=_9(e);if(!t)return!1;let n=t.parse(e);return t===_s&&(n=C9(n)),n}const Jv=(e,t)=>{const n=Zv(e),i=Zv(t);if(!n||!i)return ed(e,t);const o={...n};return s=>(o.red=qm(n.red,i.red,s),o.green=qm(n.green,i.green,s),o.blue=qm(n.blue,i.blue,s),o.alpha=At(n.alpha,i.alpha,s),kr.transform(o))},R0=new Set(["none","hidden"]);function M9(e,t){return R0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function R9(e,t){return n=>At(e,t,n)}function Yp(e){return typeof e=="number"?R9:typeof e=="string"?Fp(e)?ed:Zt.test(e)?Jv:O9:Array.isArray(e)?vk:typeof e=="object"?Zt.test(e)?Jv:D9:ed}function vk(e,t){const n=[...e],i=n.length,o=e.map((s,l)=>Yp(s)(s,t[l]));return s=>{for(let l=0;l<i;l++)n[l]=o[l](s);return n}}function D9(e,t){const n={...e,...t},i={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(i[o]=Yp(e[o])(e[o],t[o]));return o=>{for(const s in i)n[s]=i[s](o);return n}}function L9(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 O9=(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?R0.has(e)&&!o.values.length||R0.has(t)&&!i.values.length?M9(e,t):Hl(vk(L9(i,o),o.values),n):ed(e,t)};function Ek(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?At(e,t,n):Yp(e)(e,t)}const I9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ct.update(t,n),stop:()=>Ui(t),now:()=>hn.isProcessing?hn.timestamp:En.now()}},Tk=(e,t,n=10)=>{let i="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)i+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},td=2e4;function Gp(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<td;)t+=n,i=e.next(t);return t>=td?1/0:t}function j9(e,t=100,n){const i=n({...e,keyframes:[0,t]}),o=Math.min(Gp(i),td);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 D0(e,t){return e*Math.sqrt(1-t*t)}const P9=12;function B9(e,t,n){let i=n;for(let o=1;o<P9;o++)i=i-e(i)/t(i);return i}const Ym=.001;function z9({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 m=f*l,x=m*e,b=m-n,p=D0(f,l),y=Math.exp(-x);return Ym-b/p*y},s=f=>{const x=f*l*e,b=x*n+n,p=Math.pow(l,2)*Math.pow(f,2)*e,y=Math.exp(-x),E=D0(Math.pow(f,2),l);return(-o(f)+Ym>0?-1:1)*((b-p)*y)/E}):(o=f=>{const m=Math.exp(-f*e),x=(f-n)*e+1;return-Ym+m*x},s=f=>{const m=Math.exp(-f*e),x=(n-f)*(e*e);return m*x});const c=5/e,d=B9(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 U9=["duration","bounce"],H9=["stiffness","damping","mass"];function e2(e,t){return t.some(n=>e[n]!==void 0)}function F9(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!e2(e,H9)&&e2(e,U9))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=z9({...e,velocity:0});t={...t,...n,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function nd(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:m,duration:x,velocity:b,isResolvedFromDuration:p}=F9({...n,velocity:-sa(n.velocity||0)}),y=b||0,E=f/(2*Math.sqrt(d*m)),T=l-s,w=sa(Math.sqrt(d/m)),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=D0(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=F=>{const z=Math.exp(-E*w*F),H=Math.min(D*F,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=F=>{const z=Math.exp(-E*w*F),H=Math.min(D*F,300);return z*(B*Math.sinh(H)+Q*Math.cosh(H))}}const j={calculatedDuration:p&&x||null,velocity:D=>qn(L(D)),next:D=>{if(!p&&E<1){const B=Math.exp(-E*w*D),Q=Math.sin(A*D),F=Math.cos(A*D),z=l-B*(C*Q+T*F),H=qn(B*(I*Q+R*F));return c.done=Math.abs(H)<=i&&Math.abs(l-z)<=o,c.value=c.done?l:z,c}const P=N(D);if(p)c.done=D>=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(Gp(j),td),P=Tk(B=>j.next(D*B).value,D,30);return D+"ms "+P},toTransition:()=>{}};return j}nd.applyToOptions=e=>{const t=j9(e,100,nd);return e.ease=t.ease,e.duration=qn(t.duration),e.type="keyframes",e};const V9=5;function Sk(e,t,n){const i=Math.max(t-V9,0);return nk(n-e(i),t-i)}function L0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:m}){const x=e[0],b={done:!1,value:x},p=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=>{p(b.value)&&(A=R,C=nd({keyframes:[b.value,y(b.value)],velocity:Sk(N,R,b.value),damping:o,stiffness:s,restDelta:f,restSpeed:m}))};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 q9(e,t,n){const i=[],o=n||zi.mix||Ek,s=e.length-1;for(let l=0;l<s;l++){let c=o(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||oa:t;c=Hl(d,c)}i.push(c)}return i}function Y9(e,t,{clamp:n=!0,ease:i,mixer:o}={}){const s=e.length;if(Nd(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=q9(t,i,o),d=c.length,f=m=>{if(l&&m<e[0])return t[0];let x=0;if(d>1)for(;x<e.length-2&&!(m<e[x+1]);x++);const b=Al(e[x],e[x+1],m);return c[x](b)};return n?m=>f(Ra(e[0],e[s-1],m)):f}function G9(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const o=Al(0,t,i);e.push(At(n,1,o))}}function X9(e){const t=[0];return G9(t,e.length-1),t}function K9(e,t){return e.map(n=>n*t)}function $9(e,t){return e.map(()=>t||dk).splice(0,e.length-1)}function xl({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const o=a9(i)?i.map(Kv):Kv(i),s={done:!1,value:t[0]},l=K9(n&&n.length===t.length?n:X9(t),e),c=Y9(l,t,{ease:Array.isArray(o)?o:$9(t,o)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const Q9=e=>e!==null;function _d(e,{repeat:t,repeatType:n="loop"},i,o=1){const s=e.filter(Q9),c=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||i===void 0?s[c]:i}const W9={decay:L0,inertia:L0,tween:xl,keyframes:xl,spring:nd};function kk(e){typeof e.type=="string"&&(e.type=W9[e.type])}class Xp{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 Z9=e=>e/100;class ad extends Xp{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;kk(t);const{type:n=xl,repeat:i=0,repeatDelay:o=0,repeatType:s,velocity:l=0}=t;let{keyframes:c}=t;const d=n||xl;d!==xl&&typeof c[0]!="number"&&(this.mixKeyframes=Hl(Z9,Ek(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=Gp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+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:m,repeat:x,repeatType:b,repeatDelay:p,type:y,onUpdate:E,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const 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,p&&(D-=p/c)):b==="mirror"&&(L=l)),N=Ra(0,1,D)*c}let A;M?(this.delayState.value=m[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!==L0&&(A.value=_d(m,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 Sk(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=I9,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 J9(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const wr=e=>e*180/Math.PI,O0=e=>{const t=wr(Math.atan2(e[1],e[0]));return I0(t)},eP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:O0,rotateZ:O0,skewX:e=>wr(Math.atan(e[1])),skewY:e=>wr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},I0=e=>(e=e%360,e<0&&(e+=360),e),t2=O0,n2=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),a2=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),tP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:n2,scaleY:a2,scale:e=>(n2(e)+a2(e))/2,rotateX:e=>I0(wr(Math.atan2(e[6],e[5]))),rotateY:e=>I0(wr(Math.atan2(-e[2],e[0]))),rotateZ:t2,rotate:t2,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 j0(e){return e.includes("scale")?1:0}function P0(e,t){if(!e||e==="none")return j0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=tP,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=eP,o=c}if(!o)return j0(t);const s=i[t],l=o[1].split(",").map(aP);return typeof s=="function"?s(l):l[s]}const nP=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return P0(n,t)};function aP(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"]),i2=e=>e===Gs||e===Oe,iP=new Set(["x","y","z"]),rP=Xs.filter(e=>!iP.has(e));function sP(e){const t=[];return rP.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Bi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>P0(t,"x"),y:(e,{transform:t})=>P0(t,"y")};Bi.translateX=Bi.x;Bi.translateY=Bi.y;const Rr=new Set;let B0=!1,z0=!1,U0=!1;function wk(){if(z0){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=sP(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)})}z0=!1,B0=!1,Rr.forEach(e=>e.complete(U0)),Rr.clear()}function Ak(){Rr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(z0=!0)})}function oP(){U0=!0,Ak(),wk(),U0=!1}class Kp{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),B0||(B0=!0,Ct.read(Ak),Ct.resolveKeyframes(wk))):(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])}J9(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 lP=e=>e.startsWith("--");function Ck(e,t,n){lP(t)?e.style.setProperty(t,n):e.style[t]=n}const uP={};function Nk(e,t){const n=tk(e);return()=>uP[t]??n()}const cP=Nk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),_k=Nk(()=>{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})`,r2={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 Mk(e,t){if(e)return typeof e=="function"?_k()?Tk(e,t):"ease-out":fk(e)?rl(e):Array.isArray(e)?e.map(n=>Mk(n,t)||r2.easeOut):r2[e]}function dP(e,t,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const m={[t]:n};d&&(m.offset=d);const x=Mk(c,o);Array.isArray(x)&&(m.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(m,b)}function Rk(e){return typeof e=="function"&&"applyToOptions"in e}function fP({type:e,...t}){return Rk(e)&&_k()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Dk extends Xp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=l,this.options=t,Nd(typeof t.type!="string");const f=fP(t);this.animation=dP(n,i,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=_d(o,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Ck(n,i,m),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,i,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(i=this.animation).commitStyles)==null||o.call(i))}get duration(){var n,i;const t=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return sa(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sa(t)}get time(){return sa(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&cP()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),oa):o(this)}}const Lk={anticipate:lk,backInOut:ok,circInOut:ck};function hP(e){return e in Lk}function mP(e){typeof e.ease=="string"&&hP(e.ease)&&(e.ease=Lk[e.ease])}const Gm=10;class pP extends Dk{constructor(t){mP(t),kk(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:o,element:s,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new ad({...l,autoplay:!1}),d=Math.max(Gm,En.now()-this.startTime),f=Ra(0,Gm,d-Gm),m=c.sample(d).value,{name:x}=this.options;s&&x&&Ck(s,x,m),n.setWithVelocity(c.sample(Math.max(0,d-f)).value,m,f),c.stop()}}const s2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ba.test(e)||e==="0")&&!e.startsWith("url("));function gP(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 xP(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=s2(o,t),c=s2(s,t);return!l||!c?!1:gP(e)||(n==="spring"||Rk(n))&&i}function H0(e){e.duration=0,e.type="keyframes"}const Ok=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),bP=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yP(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&bP.test(e[t]))return!0;return!1}const vP=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),EP=tk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function TP(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:m}=t.owner.getProps();return EP()&&n&&(Ok.has(n)||vP.has(n)&&yP(c))&&(n!=="transform"||!m)&&!f&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}const SP=40;class kP extends Xp{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:m,...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:m,...x},p=(m==null?void 0:m.KeyframeResolver)||Kp;this.keyframeResolver=new p(c,(E,T,w)=>this.onKeyframesResolved(E,T,b,!w),d,f,m),(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:m}=i;this.resolvedAt=En.now();let x=!0;xP(t,s,l,c)||(x=!1,(zi.instantAnimations||!d)&&(m==null||m(_d(t,i,n))),t[0]=t[t.length-1],H0(i),i.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>SP?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},y=x&&!f&&TP(p),E=(M=(w=p.motionValue)==null?void 0:w.owner)==null?void 0:M.current;let T;if(y)try{T=new pP({...p,element:E})}catch{T=new ad(p)}else T=new ad(p);T.finished.then(()=>{this.notifyFinished()}).catch(oa),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),oP()),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 Ik(e,t,n,i=0,o=1){const s=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*i;return typeof n=="function"?n(s,l):o===1?s*i:c-s*i}const o2=30,wP=e=>!isNaN(parseFloat(e));class AP{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=wP(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 zp);const i=this.events[t].add(n);return t==="change"?()=>{i(),Ct.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>o2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,o2);return nk(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 AP(e,t)}function jk(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?jk(n,e):n}const CP={type:"spring",stiffness:500,damping:25,restSpeed:10},NP=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_P={type:"keyframes",duration:.8},MP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RP=(e,{keyframes:t})=>t.length>2?_P:Ks.has(e)?e.startsWith("scale")?NP(t[1]):CP:MP,DP=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function LP(e){for(const t in e)if(!DP.has(t))return!0;return!1}const Qp=(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 m={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};LP(c)||Object.assign(m,RP(e,m)),m.duration&&(m.duration=qn(m.duration)),m.repeatDelay&&(m.repeatDelay=qn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let x=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(H0(m),m.delay===0&&(x=!0)),(zi.instantAnimations||zi.skipAnimations||o!=null&&o.shouldSkipAnimations||c.skipAnimations)&&(x=!0,H0(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,x&&!s&&t.get()!==void 0){const b=_d(m.keyframes,c);if(b!==void 0){Ct.update(()=>{m.onUpdate(b),m.onComplete()});return}}return c.isSync?new ad(m):new kP(m)},OP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function IP(e){const t=OP.exec(e);if(!t)return[,];const[,n,i,o]=t;return[`--${n??i}`,o]}function Pk(e,t,n=1){const[i,o]=IP(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const l=s.trim();return ZS(l)?parseFloat(l):l}return Fp(o)?Pk(o,t,n+1):o}function l2(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Wp(e,t,n,i){if(typeof t=="function"){const[o,s]=l2(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]=l2(i);t=t(n!==void 0?n:e.custom,o,s)}return t}function Dr(e,t,n){const i=e.getProps();return Wp(i,t,n!==void 0?n:i.custom,e)}const Bk=new Set(["width","height","top","left","right","bottom",...Xs]),F0=e=>Array.isArray(e);function jP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zs(n))}function PP(e){return F0(e)?e[e.length-1]||0:e}function BP(e,t){const n=Dr(e,t);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const l in s){const c=PP(s[l]);jP(e,l,c)}}const mn=e=>!!(e&&e.getVelocity);function zP(e){return!!(mn(e)&&e.add)}function V0(e,t){const n=e.getValue("willChange");if(zP(n))return n.add(t);if(!n&&zi.WillChange){const i=new zi.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Zp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const UP="framerAppearId",zk="data-"+Zp(UP);function Uk(e){return e.props[zk]}function HP({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Hk(e,t,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();s=s?jk(s,d):d;const f=s==null?void 0:s.reduceMotion,m=s==null?void 0:s.skipAnimations;i&&(s=i);const x=[],b=o&&e.animationState&&e.animationState.getState()[o],p=s==null?void 0:s.path;p&&p.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&&HP(b,y))continue;const w={delay:n,...$p(s||{},y)};m&&(w.skipAnimations=!0);const M=E.get();if(M!==void 0&&!E.isAnimating()&&!Array.isArray(T)&&T===M&&!w.velocity){Ct.update(()=>E.set(T));continue}let N=!1;if(window.MotionHandoffAnimation){const C=Uk(e);if(C){const I=window.MotionHandoffAnimation(C,y,Ct);I!==null&&(w.startTime=I,N=!0)}}V0(e,y);const L=f??e.shouldReduceMotion;E.start(Qp(y,E,T,L&&Bk.has(y)?{type:!1}:w,e,N));const A=E.animation;A&&x.push(A)}if(l){const y=()=>Ct.update(()=>{l&&BP(e,l)});x.length?Promise.all(x).then(y):y()}return x}function q0(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(Hk(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:m=0,staggerChildren:x,staggerDirection:b}=o;return FP(e,t,f,m,x,b,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[f,m]=c==="beforeChildren"?[s,l]:[l,s];return f().then(()=>m())}else return Promise.all([s(),l(n.delay)])}function FP(e,t,n=0,i=0,o=0,s=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(q0(d,t,{...l,delay:n+(typeof i=="function"?0:i)+Ik(e.variantChildren,d,i,o,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function VP(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const o=t.map(s=>q0(e,s,n));i=Promise.all(o)}else if(typeof t=="string")i=q0(e,t,n);else{const o=typeof t=="function"?Dr(e,t,n.custom):t;i=Promise.all(Hk(e,o,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const qP={test:e=>e==="auto",parse:e=>e},Fk=e=>t=>t.test(e),Vk=[Gs,Oe,Ma,ei,g9,p9,qP],u2=e=>Vk.find(Fk(e));function YP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ek(e):!0}const GP=new Set(["brightness","contrast","saturate","opacity"]);function XP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Vp)||[];if(!i)return e;const o=n.replace(i,"");let s=GP.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+o+")"}const KP=/\b([a-z-]*)\(.*?\)/gu,Y0={...ba,getAnimatableNone:e=>{const t=e.match(KP);return t?t.map(XP).join(" "):e}},G0={...ba,getAnimatableNone:e=>{const t=ba.parse(e);return ba.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},c2={...Gs,transform:Math.round},$P={rotate:ei,pathRotation:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:Tc,scaleX:Tc,scaleY:Tc,scaleZ:Tc,skew:ei,skewX:ei,skewY:ei,distance:Oe,translateX:Oe,translateY:Oe,translateZ:Oe,x:Oe,y:Oe,z:Oe,perspective:Oe,transformPerspective:Oe,opacity:Cl,originX:Qv,originY:Qv,originZ:Oe},id={borderWidth:Oe,borderTopWidth:Oe,borderRightWidth:Oe,borderBottomWidth:Oe,borderLeftWidth:Oe,borderRadius:Oe,borderTopLeftRadius:Oe,borderTopRightRadius:Oe,borderBottomRightRadius:Oe,borderBottomLeftRadius:Oe,width:Oe,maxWidth:Oe,height:Oe,maxHeight:Oe,top:Oe,right:Oe,bottom:Oe,left:Oe,inset:Oe,insetBlock:Oe,insetBlockStart:Oe,insetBlockEnd:Oe,insetInline:Oe,insetInlineStart:Oe,insetInlineEnd:Oe,padding:Oe,paddingTop:Oe,paddingRight:Oe,paddingBottom:Oe,paddingLeft:Oe,paddingBlock:Oe,paddingBlockStart:Oe,paddingBlockEnd:Oe,paddingInline:Oe,paddingInlineStart:Oe,paddingInlineEnd:Oe,margin:Oe,marginTop:Oe,marginRight:Oe,marginBottom:Oe,marginLeft:Oe,marginBlock:Oe,marginBlockStart:Oe,marginBlockEnd:Oe,marginInline:Oe,marginInlineStart:Oe,marginInlineEnd:Oe,fontSize:Oe,backgroundPositionX:Oe,backgroundPositionY:Oe,...$P,zIndex:c2,fillOpacity:Cl,strokeOpacity:Cl,numOctaves:c2},QP={...id,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:Y0,WebkitFilter:Y0,mask:G0,WebkitMask:G0},qk=e=>QP[e],WP=new Set([Y0,G0]);function Yk(e,t){let n=qk(e);return WP.has(n)||(n=ba),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ZP=new Set(["auto","none","0"]);function JP(e,t,n){let i=0,o;for(;i<e.length&&!o;){const s=e[i];typeof s=="string"&&!ZP.has(s)&&Bs(s).values.length&&(o=e[i]),i++}if(o&&n)for(const s of t)e[s]=Yk(n,o)}class e7 extends Kp{constructor(t,n,i,o,s){super(t,n,i,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let x=t[m];if(typeof x=="string"&&(x=x.trim(),Fp(x))){const b=Pk(x,n.current);b!==void 0&&(t[m]=b),m===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!Bk.has(i)||t.length!==2)return;const[o,s]=t,l=u2(o),c=u2(s),d=$v(o),f=$v(s);if(d!==f&&Bi[i]){this.needsMeasurement=!0;return}if(l!==c)if(i2(l)&&i2(c))for(let m=0;m<t.length;m++){const x=t[m];typeof x=="string"&&(t[m]=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||YP(t[o]))&&i.push(o);i.length&&JP(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 Jp=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Gk(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const o=(n==null?void 0:n[e])??i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(i=>i!=null)}const X0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Lc(e){return JS(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:eg}=hk(queueMicrotask,!1),pa={x:!1,y:!1};function Xk(){return pa.x||pa.y}function t7(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 Kk(e,t){const n=Gk(e),i=new AbortController,o={passive:!0,...t,signal:i.signal};return[n,o,()=>i.abort()]}function n7(e){return!(e.pointerType==="touch"||Xk())}function a7(e,t,n={}){const[i,o,s]=Kk(e,n);return i.forEach(l=>{let c=!1,d=!1,f;const m=()=>{l.removeEventListener("pointerleave",y)},x=T=>{f&&(f(T),f=void 0),m()},b=T=>{c=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),d&&(d=!1,x(T))},p=()=>{c=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},y=T=>{if(T.pointerType!=="touch"){if(c){d=!0;return}x(T)}},E=T=>{if(!n7(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",p,o)}),s}const $k=(e,t)=>t?e===t?!0:$k(e,t.parentElement):!1,tg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,i7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function r7(e){return i7.has(e.tagName)||e.isContentEditable===!0}const s7=new Set(["INPUT","SELECT","TEXTAREA"]);function o7(e){return s7.has(e.tagName)||e.isContentEditable===!0}const Oc=new WeakSet;function d2(e){return t=>{t.key==="Enter"&&e(t)}}function Xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const l7=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=d2(()=>{if(Oc.has(n))return;Xm(n,"down");const o=d2(()=>{Xm(n,"up")}),s=()=>Xm(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function f2(e){return tg(e)&&!Xk()}const h2=new WeakSet;function u7(e,t,n={}){const[i,o,s]=Kk(e,n),l=c=>{const d=c.currentTarget;if(!f2(c)||h2.has(c))return;Oc.add(d),n.stopPropagation&&h2.add(c);const f=t(d,c),m={...o,capture:!0},x=(y,E)=>{window.removeEventListener("pointerup",b,m),window.removeEventListener("pointercancel",p,m),Oc.has(d)&&Oc.delete(d),f2(y)&&typeof f=="function"&&f(y,{success:E})},b=y=>{x(y,d===window||d===document||n.useGlobalTarget||$k(d,y.target))},p=y=>{x(y,!1)};window.addEventListener("pointerup",b,m),window.addEventListener("pointercancel",p,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),Lc(c)&&(c.addEventListener("focus",f=>l7(f,o)),!r7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function ng(e){return JS(e)&&"ownerSVGElement"in e}const Ic=new WeakMap;let Ii;const Qk=(e,t,n)=>(i,o)=>o&&o[0]?o[0][e+"Size"]:ng(i)&&"getBBox"in i?i.getBBox()[t]:i[n],c7=Qk("inline","width","offsetWidth"),d7=Qk("block","height","offsetHeight");function f7({target:e,borderBoxSize:t}){var n;(n=Ic.get(e))==null||n.forEach(i=>{i(e,{get width(){return c7(e,t)},get height(){return d7(e,t)}})})}function h7(e){e.forEach(f7)}function m7(){typeof ResizeObserver>"u"||(Ii=new ResizeObserver(h7))}function p7(e,t){Ii||m7();const n=Gk(e);return n.forEach(i=>{let o=Ic.get(i);o||(o=new Set,Ic.set(i,o)),o.add(t),Ii==null||Ii.observe(i)}),()=>{n.forEach(i=>{const o=Ic.get(i);o==null||o.delete(t),o!=null&&o.size||Ii==null||Ii.unobserve(i)})}}const jc=new Set;let Ms;function g7(){Ms=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jc.forEach(t=>t(e))},window.addEventListener("resize",Ms)}function x7(e){return jc.add(e),Ms||g7(),()=>{jc.delete(e),!jc.size&&typeof Ms=="function"&&(window.removeEventListener("resize",Ms),Ms=void 0)}}function m2(e,t){return typeof e=="function"?x7(e):p7(e,t)}function b7(e){return ng(e)&&e.tagName==="svg"}const y7=[...Vk,Zt,ba],v7=e=>y7.find(Fk(e)),p2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rs=()=>({x:p2(),y:p2()}),g2=()=>({min:0,max:0}),tn=()=>({x:g2(),y:g2()}),E7=new WeakMap;function Md(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nl(e){return typeof e=="string"||Array.isArray(e)}const ag=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ig=["initial",...ag];function Rd(e){return Md(e.animate)||ig.some(t=>Nl(e[t]))}function Wk(e){return!!(Rd(e)||e.variants)}function T7(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 K0={current:null},Zk={current:!1},S7=typeof window<"u";function k7(){if(Zk.current=!0,!!S7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>K0.current=e.matches;e.addEventListener("change",t),t()}else K0.current=!1}const x2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rd={};function Jk(e){rd=e}function w7(){return rd}class A7{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=Kp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=En.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=Rd(n),this.isVariantNode=Wk(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in b){const y=b[p];f[p]!==void 0&&mn(y)&&y.set(f[p])}}mount(t){var n,i;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,E7.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:(Zk.current||k7(),this.shouldReduceMotion=K0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),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&&Ok.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:f,duration:m}=n.accelerate,x=new Dk({element:this.current,name:t,keyframes:c,times:d,ease:f,duration:qn(m)}),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&&Ct.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rd){const n=rd[t];if(!n)continue;const{isEnabled:i,Feature:o}=n;if(!this.features[t]&&o&&i(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tn()}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<x2.length;i++){const o=x2[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=T7(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"&&(ZS(i)||ek(i))?i=parseFloat(i):!v7(i)&&ba.test(n)&&(i=Yk(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=Wp(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 zp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){eg.render(this.render)}}class ew extends A7{constructor(){super(...arguments),this.KeyframeResolver=e7}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 tw({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function C7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function N7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Km(e){return e===void 0||e===1}function $0({scale:e,scaleX:t,scaleY:n}){return!Km(e)||!Km(t)||!Km(n)}function vr(e){return $0(e)||nw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function nw(e){return b2(e.x)||b2(e.y)}function b2(e){return e&&e!=="0%"}function sd(e,t,n){const i=e-n,o=t*i;return n+o}function y2(e,t,n,i,o){return o!==void 0&&(e=sd(e,o,i)),sd(e,n,i)+t}function Q0(e,t=0,n=1,i,o){e.min=y2(e.min,t,n,i,o),e.max=y2(e.max,t,n,i,o)}function aw(e,{x:t,y:n}){Q0(e.x,t.translate,t.scale,t.originPoint),Q0(e.y,n.translate,n.scale,n.originPoint)}const v2=.999999999999,E2=1.0000000000001;function _7(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,aw(e,l)),i&&vr(s.latestValues)&&Pc(e,s.latestValues,(c=s.layout)==null?void 0:c.layoutBox))}t.x<E2&&t.x>v2&&(t.x=1),t.y<E2&&t.y>v2&&(t.y=1)}function _a(e,t){e.min+=t,e.max+=t}function T2(e,t,n,i,o=.5){const s=At(e.min,e.max,o);Q0(e,t,n,s,i)}function S2(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Pc(e,t,n){const i=n??e;T2(e.x,S2(t.x,i.x),t.scaleX,t.scale,t.originX),T2(e.y,S2(t.y,i.y),t.scaleY,t.scale,t.originY)}function iw(e,t){return tw(N7(e.getBoundingClientRect(),t))}function M7(e,t,n){const i=iw(e,n),{scroll:o}=t;return o&&(_a(i.x,o.offset.x),_a(i.y,o.offset.y)),i}const R7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},D7=Xs.length;function L7(e,t,n){let i="",o=!0;for(let l=0;l<D7;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 m=parseFloat(d);f=c.startsWith("scale")?m===1:m===0}if(!f||n){const m=X0(d,id[c]);if(!f){o=!1;const x=R7[c]||c;i+=`${x}(${m}) `}n&&(t[c]=m)}}const s=e.pathRotation;return s&&(o=!1,i+=`rotate(${X0(s,id.pathRotation)}) `),i=i.trim(),n?i=n(t,o?"":i):o&&(i="none"),i}function rg(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(pk(d)){o[d]=f;continue}else{const m=X0(f,id[d]);d.startsWith("origin")?(c=!0,s[d]=m):i[d]=m}}if(t.transform||(l||n?i.transform=L7(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:m=0}=s;i.transformOrigin=`${d} ${f} ${m}`}}function rw(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 k2(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(Oe.test(e))e=parseFloat(e);else return e;const n=k2(e,t.target.x),i=k2(e,t.target.y);return`${n}% ${i}%`}},O7={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=At(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=f),typeof o[3+l]=="number"&&(o[3+l]/=f),s(o)}},W0={borderRadius:{...el,applyTo:[...Jp]},borderTopLeftRadius:el,borderTopRightRadius:el,borderBottomLeftRadius:el,borderBottomRightRadius:el,boxShadow:O7};function sw(e,{layout:t,layoutId:n}){return Ks.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W0[e]||e==="opacity")}function sg(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])||sw(c,e)||((l=n==null?void 0:n.getValue(c))==null?void 0:l.liveStyle)!==void 0)&&(s[c]=i[c]);return s}function I7(e){return window.getComputedStyle(e)}class j7 extends ew{constructor(){super(...arguments),this.type="html",this.renderInstance=rw}mount(t){Nd(!!t.style),super.mount(t)}readValueFromInstance(t,n){var i;if(Ks.has(n))return(i=this.projection)!=null&&i.isProjecting?j0(n):nP(t,n);{const o=I7(t),s=(pk(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return iw(t,n)}build(t,n,i){rg(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return sg(t,n,i)}}const P7={offset:"stroke-dashoffset",array:"stroke-dasharray"},B7={offset:"strokeDashoffset",array:"strokeDasharray"};function z7(e,t,n=1,i=0,o=!0){e.pathLength=1;const s=o?P7:B7;e[s.offset]=`${-i}`,e[s.array]=`${t} ${n}`}const ow=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function lw(e,{attrX:t,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...c},d,f,m){if(rg(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 p of ow)x[p]!==void 0&&(b[p]=x[p],delete x[p]);(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=(m==null?void 0:m.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&&z7(x,o,s,l,!1)}const uw=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"]),cw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function U7(e,t,n,i){rw(e,t,void 0,i);for(const o in t.attrs)e.setAttribute(uw.has(o)?o:Zp(o),t.attrs[o])}function dw(e,t,n){const i=sg(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 H7 extends ew{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ks.has(n)){const i=qk(n);return i&&i.default||0}if(ow.includes(n)){const o=getComputedStyle(t)[n];if(typeof o=="string"&&o)return o.trim()}return n=uw.has(n)?n:Zp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return dw(t,n,i)}build(t,n,i){lw(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,o){U7(t,n,i,o)}mount(t){this.isSVGTag=cw(t.tagName),super.mount(t)}}const F7=ig.length;function fw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?fw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<F7;n++){const i=ig[n],o=e.props[i];(Nl(o)||o===!1)&&(t[i]=o)}return t}function hw(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 V7=[...ag].reverse(),q7=ag.length;function Y7(e){return t=>Promise.all(t.map(({animation:n,options:i})=>VP(e,n,i)))}function G7(e){let t=Y7(e),n=w2(),i=!0,o=!1;const s=f=>(m,x)=>{var p;const b=Dr(e,x,f==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(b){const{transition:y,transitionEnd:E,...T}=b;m={...m,...T,...E}}return m};function l(f){t=f(e)}function c(f){const{props:m}=e,x=fw(e.parent)||{},b=[],p=new Set;let y={},E=1/0;for(let w=0;w<q7;w++){const M=V7[w],N=n[M],L=m[M]!==void 0?m[M]:x[M],A=Nl(L),C=M===f?N.isActive:null;C===!1&&(E=w);let I=L===x[M]&&L!==m[M]&&A;if(I&&(i||o)&&e.manuallyAnimateOnMount&&(I=!1),N.protectedKeys={...y},!N.isActive&&C===null||!L&&!N.prevProp||Md(L)||typeof L=="boolean")continue;if(M==="exit"&&N.isActive&&C!==!0){N.prevResolvedValues&&(y={...y,...N.prevResolvedValues});continue}const R=X7(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,F={...Q,...B},z=W=>{j=!0,p.has(W)&&(D=!0,p.delete(W)),N.needsAnimating[W]=!0;const ae=e.getValue(W);ae&&(ae.liveStyle=!1)};for(const W in F){const ae=B[W],V=Q[W];if(y.hasOwnProperty(W))continue;let Y=!1;F0(ae)&&F0(V)?Y=!hw(ae,V)||R:Y=ae!==V,Y?ae!=null?z(W):p.add(W):ae!==void 0&&p.has(W)?z(W):N.protectedKeys[W]=!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(W=>{const ae={type:M};if(typeof W=="string"&&(i||o)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,Y=Dr(V,W);if(V.enteringChildren&&Y){const{delayChildren:te}=Y.transition||{};ae.delay=Ik(V.enteringChildren,e,te)}}return{animation:W,options:ae}}))}if(p.size){const w={};if(typeof m.initial!="boolean"){const M=Dr(e,Array.isArray(m.initial)?m.initial[0]:m.initial);M&&M.transition&&(w.transition=M.transition)}p.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&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,o=!1,T?t(b):Promise.resolve()}function d(f,m){var b;if(n[f].isActive===m)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(p=>{var y;return(y=p.animationState)==null?void 0:y.setActive(f,m)}),n[f].isActive=m;const x=c(f);for(const p in n)n[p].protectedKeys={};return x}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=w2(),o=!0}}}function X7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hw(t,e):!1}function gr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function w2(){return{animate:gr(!0),whileInView:gr(),whileHover:gr(),whileTap:gr(),whileDrag:gr(),whileFocus:gr(),exit:gr()}}function Z0(e,t){e.min=t.min,e.max=t.max}function ma(e,t){Z0(e.x,t.x),Z0(e.y,t.y)}function A2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const mw=1e-4,K7=1-mw,$7=1+mw,pw=.01,Q7=0-pw,W7=0+pw;function Tn(e){return e.max-e.min}function Z7(e,t,n){return Math.abs(e-t)<=n}function C2(e,t,n,i=.5){e.origin=i,e.originPoint=At(t.min,t.max,e.origin),e.scale=Tn(n)/Tn(t),e.translate=At(n.min,n.max,e.origin)-e.originPoint,(e.scale>=K7&&e.scale<=$7||isNaN(e.scale))&&(e.scale=1),(e.translate>=Q7&&e.translate<=W7||isNaN(e.translate))&&(e.translate=0)}function bl(e,t,n,i){C2(e.x,t.x,n.x,i?i.originX:void 0),C2(e.y,t.y,n.y,i?i.originY:void 0)}function N2(e,t,n,i=0){const o=i?At(n.min,n.max,i):n.min;e.min=o+t.min,e.max=e.min+Tn(t)}function J7(e,t,n,i){N2(e.x,t.x,n.x,i==null?void 0:i.x),N2(e.y,t.y,n.y,i==null?void 0:i.y)}function _2(e,t,n,i=0){const o=i?At(n.min,n.max,i):n.min;e.min=t.min-o,e.max=e.min+Tn(t)}function od(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,o){return e-=t,e=sd(e,1/n,i),o!==void 0&&(e=sd(e,1/o,i)),e}function eB(e,t=0,n=1,i=.5,o,s=e,l=e){if(Ma.test(t)&&(t=parseFloat(t),t=At(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=At(s.min,s.max,i);e===s&&(c-=t),e.min=M2(e.min,t,n,c,o),e.max=M2(e.max,t,n,c,o)}function R2(e,t,[n,i,o],s,l){eB(e,t[n],t[i],t[o],t.scale,s,l)}const tB=["x","scaleX","originX"],nB=["y","scaleY","originY"];function D2(e,t,n,i){R2(e.x,t,tB,n?n.x:void 0,i?i.x:void 0),R2(e.y,t,nB,n?n.y:void 0,i?i.y:void 0)}function L2(e){return e.translate===0&&e.scale===1}function gw(e){return L2(e.x)&&L2(e.y)}function O2(e,t){return e.min===t.min&&e.max===t.max}function aB(e,t){return O2(e.x,t.x)&&O2(e.y,t.y)}function I2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function xw(e,t){return I2(e.x,t.x)&&I2(e.y,t.y)}function j2(e){return Tn(e.x)/Tn(e.y)}function P2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Aa(e){return[e("x"),e("y")]}function iB(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:m,pathRotation:x,rotateX:b,rotateY:p,skewX:y,skewY:E}=n;f&&(i=`perspective(${f}px) ${i}`),m&&(i+=`rotate(${m}deg) `),x&&(i+=`rotate(${x}deg) `),b&&(i+=`rotateX(${b}deg) `),p&&(i+=`rotateY(${p}deg) `),y&&(i+=`skewX(${y}deg) `),E&&(i+=`skewY(${E}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}const rB=Jp.length,B2=e=>typeof e=="string"?parseFloat(e):e,z2=e=>typeof e=="number"||Oe.test(e);function sB(e,t,n,i,o,s){o?(e.opacity=At(0,n.opacity??1,oB(i)),e.opacityExit=At(t.opacity??1,0,lB(i))):s&&(e.opacity=At(t.opacity??1,n.opacity??1,i));for(let l=0;l<rB;l++){const c=Jp[l];let d=U2(t,c),f=U2(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||z2(d)===z2(f)?(e[c]=Math.max(At(B2(d),B2(f),i),0),(Ma.test(f)||Ma.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=At(t.rotate||0,n.rotate||0,i))}function U2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const oB=bw(0,.5,uk),lB=bw(.5,.95,oa);function bw(e,t,n){return i=>i<e?0:i>t?1:n(Al(e,t,i))}function uB(e,t,n){const i=mn(e)?e:zs(e);return i.start(Qp("",i,t,n)),i.animation}function _l(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const cB=(e,t)=>e.depth-t.depth;class dB{constructor(){this.children=[],this.isDirty=!1}add(t){Bp(this.children,t),this.isDirty=!0}remove(t){Jc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(cB),this.isDirty=!1,this.children.forEach(t)}}function fB(e,t){const n=En.now(),i=({timestamp:o})=>{const s=o-n;s>=t&&(Ui(i),e(s-t))};return Ct.setup(i,!0),()=>Ui(i)}function Bc(e){return mn(e)?e.get():e}class hB{constructor(){this.members=[]}add(t){Bp(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const o=i.instance;(!o||o.isConnected===!1)&&!i.snapshot&&(Jc(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Jc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let i=this.members.indexOf(t)-1;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:l}=t.options;(s===void 0||s!==l)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,i,o,s,l;(i=(n=t.options).onExitComplete)==null||i.call(n),(l=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||l.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const zc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$m=["","X","Y","Z"],mB=1e3;let pB=0;function Qm(e,t,n,i){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),i&&(i[e]=0))}function yw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Uk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(o||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&yw(i)}function vw({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=pB++,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(bB),this.nodes.forEach(kB),this.nodes.forEach(wB),this.nodes.forEach(yB)},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 dB)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new zp),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=ng(l)&&!b7(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 m,x=0;const b=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{x=window.innerWidth}),e(l,()=>{const p=window.innerWidth;p!==x&&(x=p,this.root.updateBlockedByResize=!0,m&&m(),m=fB(b,250),zc.hasAnimatedSinceResize&&(zc.hasAnimatedSinceResize=!1,this.nodes.forEach(V2)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||MB,{onLayoutAnimationStart:E,onLayoutAnimationComplete:T}=f.getProps(),w=!this.targetLayout||!xw(this.targetLayout,p),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(m,M,N.path)}else x||V2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),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(AB),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&&yw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const x=this.path[m];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(EB),this.nodes.forEach(H2);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(F2);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(TB),this.nodes.forEach(SB),this.nodes.forEach(gB),this.nodes.forEach(xB)):this.nodes.forEach(F2),this.clearAllSnapshots();const c=En.now();hn.delta=Ra(0,1e3/60,c-hn.timestamp),hn.timestamp=c,hn.isProcessing=!0,Hm.update.process(hn),Hm.preRender.process(hn),Hm.render.process(hn),hn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,eg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vB),this.sharedNodes.forEach(CB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.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=tn()),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&&!gw(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||vr(this.latestValues)||m)&&(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)),RB(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:l}=this.options;if(!l)return tn();const c=l.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(DB))){const{scroll:m}=this.root;m&&(_a(c.x,m.offset.x),_a(c.y,m.offset.y))}return c}removeElementScroll(l){var d;const c=tn();if(ma(c,l),(d=this.scroll)!=null&&d.wasRoot)return c;for(let f=0;f<this.path.length;f++){const m=this.path[f],{scroll:x,options:b}=m;m!==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 m,x;const f=d||tn();ma(f,l);for(let b=0;b<this.path.length;b++){const p=this.path[b];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(_a(f.x,-p.scroll.offset.x),_a(f.y,-p.scroll.offset.y)),vr(p.latestValues)&&Pc(f,p.latestValues,(m=p.layout)==null?void 0:m.layoutBox)}return vr(this.latestValues)&&Pc(f,this.latestValues,(x=this.layout)==null?void 0:x.layoutBox),f}removeTransform(l){var d;const c=tn();ma(c,l);for(let f=0;f<this.path.length;f++){const m=this.path[f];if(!vr(m.latestValues))continue;let x;m.instance&&($0(m.latestValues)&&m.updateSnapshot(),x=tn(),ma(x,m.measurePageBox())),D2(c,m.latestValues,(d=m.snapshot)==null?void 0:d.layoutBox,x)}return vr(this.latestValues)&&D2(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 p;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:x}=this.options;if(!this.layout||!(m||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=tn(),this.targetWithTransforms=tn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),J7(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),aw(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)||nw(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=tn(),this.relativeTargetOrigin=tn(),od(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),ma(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===hn.timestamp&&(d=!1),d)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;ma(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;_7(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=tn());const{target:p}=l;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(A2(this.prevProjectionDelta.x,this.projectionDelta.x),A2(this.prevProjectionDelta.y,this.projectionDelta.y)),bl(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!P2(this.projectionDelta.x,this.prevProjectionDelta.x)||!P2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rs(),this.projectionDelta=Rs(),this.projectionDeltaWithTransform=Rs()}setAnimationOrigin(l,c=!1,d){const f=this.snapshot,m=f?f.latestValues:{},x={...this.latestValues},b=Rs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const p=tn(),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(_B));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=At(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=At(l.y.scale,1,I),b.y.origin=l.y.origin,b.y.originPoint=l.y.originPoint):(q2(b.x,l.x,I),q2(b.y,l.y,I)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(od(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),NB(this.relativeTarget,this.relativeTargetOrigin,p,I),L&&aB(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=tn()),ma(L,this.relativeTarget)),T&&(this.animationValues=x,sB(x,m,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=Ct.update(()=>{zc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zs(0)),this.motionValue.jump(0,!1),this.currentAnimation=uB(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:m=>{this.mixTargetDelta(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(mB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:m}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&Ew(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||tn();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),Pc(c,m),bl(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new hB),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&&Qm("z",l,f,this.animationValues);for(let m=0;m<$m.length;m++)Qm(`rotate${$m[m]}`,l,f,this.animationValues),Qm(`skew${$m[m]}`,l,f,this.animationValues);l.render();for(const m in f)l.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Bc(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const 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=Bc(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!vr(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let x=iB(this.projectionDeltaWithTransform,this.treeScale,m);d&&(x=d(m,x)),l.transform=x;const{x:b,y:p}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${p.origin*100}% 0`,f.animationValues?l.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const y in W0){if(m[y]===void 0)continue;const{correct:E,applyTo:T,isCSSVariable:w}=W0[y],M=x==="none"?m[y]:E(m[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?Bc(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(H2),this.root.sharedNodes.clear()}}}function gB(e){e.updateLayout()}function xB(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],p=Tn(b);b.min=i[x].min,b.max=b.min+p});else if(s==="x"||s==="y"){const x=s==="x"?"y":"x";Z0(l?t.measuredBox[x]:t.layoutBox[x],i[x])}else Ew(s,t.layoutBox,i)&&Aa(x=>{const b=l?t.measuredBox[x]:t.layoutBox[x],p=Tn(i[x]);b.max=b.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[x].max=e.relativeTarget[x].min+p)});const c=Rs();bl(c,i,t.layoutBox);const d=Rs();l?bl(d,e.applyTransform(o,!0),t.measuredBox):bl(d,i,t.layoutBox);const f=!gw(c);let m=!1;if(!e.resumeFrom){const x=e.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:b,layout:p}=x;if(b&&p){const y=e.options.layoutAnchor||void 0,E=tn();od(E,t.layoutBox,b.layoutBox,y);const T=tn();od(T,i,p.layoutBox,y),xw(E,T)||(m=!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:m})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function bB(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 yB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vB(e){e.clearSnapshot()}function H2(e){e.clearMeasurements()}function EB(e){e.isLayoutDirty=!0,e.updateLayout()}function F2(e){e.isLayoutDirty=!1}function TB(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function SB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function V2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function kB(e){e.resolveTargetDelta()}function wB(e){e.calcProjection()}function AB(e){e.resetSkewAndRotation()}function CB(e){e.removeLeadSnapshot()}function q2(e,t,n){e.translate=At(t.translate,0,n),e.scale=At(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Y2(e,t,n,i){e.min=At(t.min,n.min,i),e.max=At(t.max,n.max,i)}function NB(e,t,n,i){Y2(e.x,t.x,n.x,i),Y2(e.y,t.y,n.y,i)}function _B(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const MB={duration:.45,ease:[.4,0,.1,1]},G2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),X2=G2("applewebkit/")&&!G2("chrome/")?Math.round:oa;function K2(e){e.min=X2(e.min),e.max=X2(e.max)}function RB(e){K2(e.x),K2(e.y)}function Ew(e,t,n){return e==="position"||e==="preserve-aspect"&&!Z7(j2(t),j2(n),.2)}function DB(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const LB=vw({attachResizeListener:(e,t)=>_l(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Wm={current:void 0},Tw=vw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wm.current){const e=new LB({});e.mount(window),e.setOptions({layoutScroll:!0}),Wm.current=e}return Wm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),og=_.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 OB(...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 IB(...e){return _.useCallback(OB(...e),e)}class jB extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Lc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,o=Lc(i)&&i.offsetWidth||0,s=Lc(i)&&i.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=o-c.width-c.left,c.bottom=s-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function PB({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(og),m=s!==!1?((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref):void 0,x=IB(c,m);return _.useInsertionEffect(()=>{const{width:p,height:y,top:E,left:T,right:w,bottom:M,direction:N}=d.current;if(t||s===!1||!c.current||!p||!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(`
546
- [data-motion-pop-id="${l}"] {
547
- position: absolute !important;
548
- width: ${p}px !important;
549
- height: ${y}px !important;
550
- ${A}px !important;
551
- ${C}px !important;
552
- }
553
- `),()=>{var j;(j=c.current)==null||j.removeAttribute("data-motion-pop-id"),R.contains(I)&&R.removeChild(I)}},[t]),g.jsx(jB,{isPresent:t,childRef:c,sizeRef:d,pop:s,children:s===!1?e:_.cloneElement(e,{ref:x})})}const BB=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:d,root:f})=>{const m=Pp(zB),x=_.useId(),b=_.useRef(n),p=_.useRef(i);Zc(()=>{b.current=n,p.current=i});let y=!0,E=_.useMemo(()=>(y=!1,{id:x,initial:t,isPresent:n,custom:o,onExitComplete:T=>{m.set(T,!0);for(const w of m.values())if(!w)return;i&&i()},register:T=>(m.set(T,!1),()=>{var w;m.delete(T),!b.current&&!m.size&&((w=p.current)==null||w.call(p))})}),[n,m,i]);return s&&y&&(E={...E}),_.useMemo(()=>{m.forEach((T,w)=>m.set(w,!1))},[n]),_.useEffect(()=>{!n&&!m.size&&i&&i()},[n]),e=g.jsx(PB,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:f,children:e}),g.jsx(Cd.Provider,{value:E,children:e})};function zB(){return new Map}function Sw(e=!0){const t=_.useContext(Cd);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 Sc=e=>e.key||"";function Q2(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const UB=({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[m,x]=Sw(l),b=_.useMemo(()=>Q2(e),[e]),p=l&&!m?[]:b.map(Sc),y=_.useRef(!0),E=_.useRef(b),T=Pp(()=>new Map),w=_.useRef(new Set),[M,N]=_.useState(b),[L,A]=_.useState(b);Zc(()=>{l&&!m&&!L.length&&(x==null||x())},[m,l,L.length,x]),Zc(()=>{y.current=!1,E.current=b;for(let R=0;R<L.length;R++){const j=Sc(L[R]);p.includes(j)?(T.delete(j),w.current.delete(j)):T.get(j)!==!0&&T.set(j,!1)}},[L,p.length,p.join("-")]);const C=[];if(b!==M){let R=[...b];for(let j=0;j<L.length;j++){const D=L[j],P=Sc(D);p.includes(P)||(R.splice(j,0,D),C.push(D))}return s==="wait"&&C.length&&(R=C),A(Q2(R)),N(b),null}const{forceRender:I}=_.useContext(jp);return g.jsx(g.Fragment,{children:L.map(R=>{const j=Sc(R),D=l&&!m?!1:b===L||p.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 g.jsx(BB,{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)})})},kw=_.createContext({strict:!1}),W2={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 Z2=!1;function HB(){if(Z2)return;const e={};for(const t in W2)e[t]={isEnabled:n=>W2[t].some(i=>!!n[i])};Jk(e),Z2=!0}function ww(){return HB(),w7()}function FB(e){const t=ww();for(const n in e)t[n]={...t[n],...e[n]};Jk(t)}const Dd=_.createContext({});function VB(e,t){if(Rd(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Nl(n)?n:void 0,animate:Nl(i)?i:void 0}}return e.inherit!==!1?t:{}}function qB(e){const{initial:t,animate:n}=VB(e,_.useContext(Dd));return _.useMemo(()=>({initial:t,animate:n}),[J2(t),J2(n)])}function J2(e){return Array.isArray(e)?e.join(" "):e}const lg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Aw(e,t,n){for(const i in t)!mn(t[i])&&!sw(i,n)&&(e[i]=t[i])}function YB({transformTemplate:e},t){return _.useMemo(()=>{const n=lg();return rg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function GB(e,t){const n=e.style||{},i={};return Aw(i,n,e),Object.assign(i,YB(e,t)),i}function XB(e,t){const n={},i=GB(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 Cw=()=>({...lg(),attrs:{}});function KB(e,t,n,i){const o=_.useMemo(()=>{const s=Cw();return lw(s,t,cw(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Aw(s,e.style,e),o.style={...s,...o.style}}return o}const $B=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ld(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$B.has(e)}function QB(e,t){return e.startsWith("on")?!ld(e):(t==null?void 0:t(e))??!ld(e)}function WB(e,t,n,i){const o={};for(const s in e)s==="values"&&typeof e.values=="object"||mn(e[s])||(QB(s,i)||n===!0&&ld(s)||!t&&!ld(s)||e.draggable&&s.startsWith("onDrag"))&&(o[s]=e[s]);return o}const ZB=["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 ug(e){return typeof e!="string"||e.includes("-")?!1:!!(ZB.indexOf(e)>-1||/[A-Z]/u.test(e))}function JB(e,t,n,{latestValues:i},o,s=!1,l,c){const f=(l??ug(e)?KB:XB)(t,i,o,e),m=WB(t,typeof e=="string",s,c),x=e!==_.Fragment?{...m,...f,ref:n}:{},{children:b}=t,p=_.useMemo(()=>mn(b)?b.get():b,[b]);return _.createElement(e,{...x,children:p})}function ez({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,o){return{latestValues:tz(n,i,o,e),renderState:t()}}function tz(e,t,n,i){const o={},s=i(e,{});for(const b in s)o[b]=Bc(s[b]);let{initial:l,animate:c}=e;const d=Rd(e),f=Wk(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const x=m?c:l;if(x&&typeof x!="boolean"&&!Md(x)){const b=Array.isArray(x)?x:[x];for(let p=0;p<b.length;p++){const y=Wp(e,b[p]);if(y){const{transitionEnd:E,transition:T,...w}=y;for(const M in w){let N=w[M];if(Array.isArray(N)){const L=m?N.length-1:0;N=N[L]}N!==null&&(o[M]=N)}for(const M in E)o[M]=E[M]}}}return o}const Nw=e=>(t,n)=>{const i=_.useContext(Dd),o=_.useContext(Cd),s=()=>ez(e,t,i,o);return n?s():Pp(s)},nz=Nw({scrapeMotionValuesFromProps:sg,createRenderState:lg}),az=Nw({scrapeMotionValuesFromProps:dw,createRenderState:Cw}),iz=Symbol.for("motionComponentSymbol");function rz(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 _w=_.createContext({});function Cs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sz(e,t,n,i,o,s){var N,L;const{visualElement:l}=_.useContext(Dd),c=_.useContext(kw),d=_.useContext(Cd),f=_.useContext(og),m=f.reducedMotion,x=f.skipAnimations,b=_.useRef(null),p=_.useRef(!1);i=i||c.renderer,!b.current&&i&&(b.current=i(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m,skipAnimations:x,isSVG:s}),p.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const y=b.current,E=_.useContext(_w);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&oz(b.current,n,o,E);const T=_.useRef(!1);_.useInsertionEffect(()=>{y&&T.current&&y.update(n,d)});const w=n[zk],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 Zc(()=>{p.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 oz(e,t,n,i){const{layoutId:o,layout:s,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutAnchor:m,layoutCrossfade:x}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Mw(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:m})}function Mw(e){if(e)return e.options.allowProjection!==!1?e.projection:Mw(e.parent)}function Zm(e,{forwardMotionProps:t=!1,type:n}={},i,o){i&&FB(i);const s=n?n==="svg":ug(e),l=s?az:nz;function c(f,m){let x;const b={..._.useContext(og),...f,layoutId:lz(f)},{isStatic:p,isValidProp:y}=b,E=qB(f),T=l(f,p);if(!p&&typeof window<"u"){uz();const w=cz(b);x=w.MeasureLayout,E.visualElement=sz(e,T,b,o,w.ProjectionNode,s)}return g.jsxs(Dd.Provider,{value:E,children:[x&&E.visualElement?g.jsx(x,{visualElement:E.visualElement,...b}):null,JB(e,f,rz(T,E.visualElement,m),T,p,t,s,y)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=_.forwardRef(c);return d[iz]=e,d}function lz({layoutId:e}){const t=_.useContext(jp).id;return t&&e!==void 0?t+"-"+e:e}function uz(e,t){_.useContext(kw).strict}function cz(e){const t=ww(),{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 dz(e,t){if(typeof Proxy>"u")return Zm;const n=new Map,i=(s,l)=>Zm(s,l,e,t),o=(s,l)=>i(s,l);return new Proxy(o,{get:(s,l)=>l==="create"?i:(n.has(l)||n.set(l,Zm(l,void 0,e,t)),n.get(l))})}const fz=(e,t)=>t.isSVG??ug(e)?new H7(t):new j7(t,{allowProjection:e!==_.Fragment});class hz extends Vi{constructor(t){super(t),t.animationState||(t.animationState=G7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Md(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mz=0;class pz extends Vi{constructor(){super(...arguments),this.id=mz++,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:m,...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 gz={animation:{Feature:hz},exit:{Feature:pz}};function ql(e){return{point:{x:e.pageX,y:e.pageY}}}const xz=e=>t=>tg(t)&&e(t,ql(t));function yl(e,t,n,i){return _l(e,t,xz(n),i)}const Rw=({current:e})=>e?e.ownerDocument.defaultView:null,eE=(e,t)=>Math.abs(e-t);function bz(e,t){const n=eE(e.x,t.x),i=eE(e.y,t.y);return Math.sqrt(n**2+i**2)}const tE=new Set(["auto","scroll"]);class Dw{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=kc(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Jm(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,T=bz(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=kc(E,this.transformPagePoint),Ct.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=Jm(y.type==="pointercancel"?this.lastMoveEventInfo:kc(E,this.transformPagePoint),this.history);this.startEvent&&T&&T(y,N),w&&w(y,N)},!tg(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=o||window;const d=ql(t),f=kc(d,this.transformPagePoint),{point:m}=f,{timestamp:x}=hn;this.history=[{...m,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,Jm(f,this.history));const p={passive:!0,capture:!0};this.removeListeners=Hl(yl(this.contextWindow,"pointermove",this.handlePointerMove,p),yl(this.contextWindow,"pointerup",this.handlePointerUp,p),yl(this.contextWindow,"pointercancel",this.handlePointerUp,p)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(tE.has(i.overflowX)||tE.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),Ct.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 kc(e,t){return t?{point:t(e.point)}:e}function nE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jm({point:e},t){return{point:e,delta:nE(e,Lw(t)),offset:nE(e,yz(t)),velocity:vz(t,.1)}}function yz(e){return e[0]}function Lw(e){return e[e.length-1]}function vz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const o=Lw(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 Ez(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?At(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?At(n,e,i.max):Math.min(e,n)),e}function aE(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 Tz(e,{top:t,left:n,bottom:i,right:o}){return{x:aE(e.x,n,o),y:aE(e.y,t,i)}}function iE(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 Sz(e,t){return{x:iE(e.x,t.x),y:iE(e.y,t.y)}}function kz(e,t){let n=.5;const i=Tn(e),o=Tn(t);return o>i?n=Al(t.min,t.max-i,e.min):i>o&&(n=Al(e.min,e.max-o,t.min)),Ra(0,1,n)}function wz(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const J0=.35;function Az(e=J0){return e===!1?e=0:e===!0&&(e=J0),{x:rE(e,"left","right"),y:rE(e,"top","bottom")}}function rE(e,t,n){return{min:sE(e,t),max:sE(e,n)}}function sE(e,t){return typeof e=="number"?e:e[t]||0}const Cz=new WeakMap;class Nz{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=tn(),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(ql(x).point),this.stopAnimation()},l=(x,b)=>{const{drag:p,dragPropagation:y,onDragStart:E}=this.getProps();if(p&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=t7(p),!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&&Ct.update(()=>E(x,b),!1,!0),V0(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:p,dragDirectionLock:y,onDirectionLock:E,onDrag:T}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=b;if(y&&this.currentDirection===null){this.currentDirection=Mz(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&&Ct.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:m}=this.getProps();this.panSession=new Dw(t,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:Rw(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&&Ct.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||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=Ez(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=Tz(i.layoutBox,t):this.constraints=!1,this.elastic=Az(n),o!==this.constraints&&!Cs(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Aa(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=wz(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=M7(i,o.root,this.visualElement.getTransformPagePoint());let l=Sz(o.layout.layoutBox,s);if(n){const c=n(C7(l));this.hasMutatedConstraints=!!c,c&&(l=tw(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(m=>{if(!wc(m,n,this.currentDirection))return;let x=d&&d[m]||{};(l===!0||l===m)&&(x={min:0,max:0});const b=o?200:1e6,p=o?40:1e7,y={type:"inertia",velocity:i?t[m]:0,bounceStiffness:b,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...x};return this.startAxisValueAnimation(m,y)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return V0(this.visualElement,t),i.start(Qp(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(!wc(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]-At(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]=kz({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(!wc(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(At(d,f,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Cz.set(this.visualElement,this);const t=this.visualElement.current,n=yl(t,"pointerdown",f=>{const{drag:m,dragListener:x=!0}=this.getProps(),b=f.target,p=b!==t&&o7(b);m&&x&&!p&&this.start(f)});let i;const o=()=>{const{dragConstraints:f}=this.getProps();Cs(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=_z(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ct.read(o);const c=_l(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(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=J0,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function oE(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function _z(e,t,n){const i=m2(e,oE(n)),o=m2(t,oE(n));return()=>{i(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Mz(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Rz extends Vi{constructor(t){super(t),this.removeGroupControls=oa,this.removeListeners=oa,this.controls=new Nz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||oa}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const e0=e=>(t,n)=>{e&&Ct.update(()=>e(t,n),!1,!0)};class Dz extends Vi{constructor(){super(...arguments),this.removePointerDownListener=oa}onPointerDown(t){this.session=new Dw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Rw(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:e0(t),onStart:e0(n),onMove:e0(i),onEnd:(s,l)=>{delete this.session,o&&Ct.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=yl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let t0=!1;class Lz 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),t0&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:o,isPresent:s}=this.props,{projection:l}=i;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),t0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||Ct.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(),eg.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:o}=t;t0=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),i&&i.deregister&&i.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ow(e){const[t,n]=Sw(),i=_.useContext(jp);return g.jsx(Lz,{...e,layoutGroup:i,switchLayoutGroup:_.useContext(_w),isPresent:t,safeToRemove:n})}const Oz={pan:{Feature:Dz},drag:{Feature:Rz,ProjectionNode:Tw,MeasureLayout:Ow}};function lE(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&&Ct.postRender(()=>s(t,ql(t)))}class Iz extends Vi{mount(){const{current:t}=this.node;t&&(this.unmount=a7(t,(n,i)=>(lE(this.node,i,"Start"),o=>lE(this.node,o,"End"))))}unmount(){}}class jz extends Vi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Hl(_l(this.node.current,"focus",()=>this.onFocus()),_l(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uE(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&&Ct.postRender(()=>s(t,ql(t)))}class Pz extends Vi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=u7(t,(o,s)=>(uE(this.node,s,"Start"),(l,{success:c})=>uE(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const ep=new WeakMap,n0=new WeakMap,Bz=e=>{const t=ep.get(e.target);t&&t(e)},zz=e=>{e.forEach(Bz)};function Uz({root:e,...t}){const n=e||document;n0.has(n)||n0.set(n,{});const i=n0.get(n),o=JSON.stringify(t);return i[o]||(i[o]=new IntersectionObserver(zz,{root:e,...t})),i[o]}function Hz(e,t,n){const i=Uz(t);return ep.set(e,n),i.observe(e),()=>{ep.delete(e),i.unobserve(e)}}const Fz={some:0,all:1};class Vz 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:Fz[o]},c=f=>{const{isIntersecting:m}=f;if(this.isInView===m||(this.isInView=m,s&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:x,onViewportLeave:b}=this.node.getProps(),p=m?x:b;p&&p(f)};this.stopObserver=Hz(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(qz(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function qz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Yz={inView:{Feature:Vz},tap:{Feature:Pz},focus:{Feature:jz},hover:{Feature:Iz}},Gz={layout:{ProjectionNode:Tw,MeasureLayout:Ow}},Xz={...gz,...Yz,...Oz,...Gz},Kz=dz(Xz,fz),$z=Kz;function Qz(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:bE,color:"var(--gold)"};case"unlock":return{Icon:r0,color:"var(--brand)"};case"streak":return{Icon:yE,color:"var(--review)"};case"energy-full":return{Icon:o0,color:"var(--brand)"};case"exam-pass":return{Icon:lC,color:"var(--exam)"};case"lesson-complete":return{Icon:qC,color:"var(--gold)"};default:return{Icon:r0,color:"var(--brand)"}}}function Wz(){const e=BE(),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 p=b.length-1;p>=0;p--){const y=b[p];if(y.x+=y.vx,y.y+=y.vy,y.vy+=.25,y.vx*=.99,y.rot+=y.vr,y.life--,y.life<=0){b.splice(p,1);continue}const E=Math.min(1,y.life/y.maxLife);c.save(),c.globalAlpha=E,c.translate(y.x,y.y),c.rotate(y.rot),c.fillStyle=y.color,y.shape==="circle"?(c.beginPath(),c.arc(0,0,y.size,0,Math.PI*2),c.fill()):c.fillRect(-y.size/2,-y.size/2,y.size,y.size*.6),c.restore()}i.current=b.length>0?requestAnimationFrame(f):0},x=yy(b=>{var w,M;const p=t5(b.kind),y=Math.round(p.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=p.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:p.colors[N%p.colors.length],size:4+Math.random()*5,rot:Math.random()*Math.PI,vr:(Math.random()-.5)*.3,shape:Math.random()<.5?"rect":"circle"})}i.current===0&&(i.current=requestAnimationFrame(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 yy(d=>{const f=++l;s({kind:d.kind,id:f}),setTimeout(()=>{f===l&&s(null)},600)})},[e]),e?g.jsx(UB,{children:o&&(()=>{const{Icon:l,color:c}=Qz(o.kind);return g.jsx($z.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:g.jsx(l,{className:"w-24 h-24",color:c,strokeWidth:1.5})},o.id)})()}):g.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const cE=["direct","guide","practice"];function Zz(){const e=Ye(),[t,n]=_.useState([]),[i,o]=_.useState([]),[s,l]=_.useState({}),[c,d]=_.useState(null),[f,m]=_.useState(null),[x,b]=_.useState(null),[p,y]=_.useState(null),E=_.useCallback(le=>{y(le instanceof Error?le.message:String(le)),console.error(le)},[]),[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),[F,z]=_.useState(null),H=_.useRef({active:!1,terminate:null}),[G,W]=_.useState({open:!1,pendingAction:null}),ae=_.useRef(null),[V,Y]=_.useState(null),[te,U]=_.useState(!1),[ie,K]=_.useState(!0),[$,J]=_.useState(!0),se=Qj(),[ke,Pe]=_.useState("notebook"),[Be,ze]=_.useState("chat"),St=_.useRef(Be);St.current=Be;const pt=_.useRef(se);_.useEffect(()=>{pt.current!==se&&(se===1?(K(!0),J(!0)):se===2&&pt.current===3&&Pe(Yj(St.current)),pt.current=se)},[se]);const ye=se===3?Be==="rail":se===2?ke==="rail":ie,Ke=se===3?Be==="notebook":se===2?ke==="notebook":$,Ot=se!==3||Be==="chat",Bt=()=>{se===1?K(le=>!le):se===2?Pe(le=>le==="rail"?"notebook":"rail"):ze(le=>le==="rail"?"chat":"rail")},zt=()=>{se===1?J(le=>!le):se===2?Pe(le=>le==="notebook"?"rail":"notebook"):ze(le=>le==="notebook"?"chat":"notebook")},ht=_.useRef(null),ln=le=>{var _e,Ue;if(se!==3)return;const ve=le.touches[0];ht.current={x:ve.clientX,y:ve.clientY,multi:le.touches.length>1,noswipe:!!((Ue=(_e=le.target).closest)!=null&&Ue.call(_e,"[data-noswipe]"))}},Rt=le=>{const ve=ht.current;if(ht.current=null,!ve||ve.multi||ve.noswipe||se!==3)return;const _e=le.changedTouches[0],Ue=Gj(St.current,_e.clientX-ve.x,_e.clientY-ve.y);Ue&&ze(Ue)},[xe,Fe]=_.useState(!1),[je,me]=_.useState(null),[Se,De]=_.useState([]),Me=Uj(x,F),$e=ME(),Ne=Pj(Me.activeId,$e),[et,Je]=_.useState(""),Qe=_.useCallback(le=>{Je(le)},[]),an=_.useCallback((le,ve,_e)=>{if(le.type==="content"){if(Y("content"),_e){const Ue=ct=>{document.querySelector(`mark[data-note-id="${_e}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:_e})):ct>0&&setTimeout(()=>Ue(ct-1),150)};setTimeout(()=>Ue(10),100)}}else if(le.threadId!==Me.activeId&&Me.setActiveId(le.threadId),_e){const Ue=ct=>{document.querySelector(`mark[data-note-id="${_e}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:_e})):ct>0&&setTimeout(()=>Ue(ct-1),150)};setTimeout(()=>Ue(10),120)}},[Me]),[gt,Yn]=_.useState(null);_.useEffect(()=>{if(!F){Yn(null);return}let le=!1;return fe.getNodeSummary(F,$e).then(ve=>{le||Yn(ve)}).catch(()=>{le||Yn(null)}),()=>{le=!0}},[F,$e]);const ot=_.useMemo(()=>i.find(le=>le.id===F)??null,[i,F]),Ld=_.useMemo(()=>Se.map(le=>({...le,label:e(`starter.${le.key}.label`),hint:e(`starter.${le.key}.hint`),message:e(`starter.${le.key}.message`,{title:(ot==null?void 0:ot.title)??""})})),[Se,ot,e]),Gn=_.useRef(null),Pr=_.useCallback(()=>{var le;ot&&((le=Gn.current)==null||le.call(Gn,e("chat.action.startLearningPrompt",{title:ot.title}),e("chat.action.startLearning",{title:ot.title})))},[ot,e]),Ln=_.useCallback(async()=>{try{const[le,ve,_e,Ue,ct,jt]=await Promise.all([fe.listCourses(),fe.getStreak(),fe.listSouls(),fe.getActiveSoul(),fe.getXpStatus(),fe.getDueReviews()]);n(le),d(ve),A(_e),m(ct),I(Ue),Q(new Set(jt)),x&&!le.some(Sn=>Sn.id===x)&&(b(null),z(null),o([]),l({}),P(null),w([]),N(null))}catch(le){y(le instanceof Error?le.message:String(le))}},[x]);_.useEffect(()=>{Ln()},[Ln]);const ua=_.useCallback(async()=>{try{me(await fe.isAgentReady())}catch{me({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);_.useEffect(()=>{ua();const le=()=>ua();return window.addEventListener("llm-config-changed",le),()=>window.removeEventListener("llm-config-changed",le)},[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 le=i.filter(Ue=>Ue.type==="lesson"||Ue.type==="exam"),ve=await Promise.all(le.map(async Ue=>{const ct=await fe.getProgress(Ue.id);return[Ue.id,ct]})),_e={};for(const[Ue,ct]of ve)ct&&(_e[Ue]=ct);l(_e)},[i]);_.useEffect(()=>fe.on("state:changed",ve=>{ve==="xp"?fe.getXpStatus().then(_e=>{m(_e),qi.current<100&&_e.todayXp>=100&&Nr("energy-full")}).catch(()=>{}):ve==="streak"?fe.getStreak().then(_e=>{d(_e),_e.currentStreak>oi.current&&Nr("streak")}).catch(()=>{}):ve==="mastery"&&(Nr("mastery"),Ln(),Br())}),[Ln,Br]),_.useEffect(()=>{x&&(fe.getCourseLanguages(x).then(w).catch(()=>w([])),fe.getCourseLanguage(x).then(N).catch(()=>N(null)))},[x]),_.useEffect(()=>{x&&(fe.getCourseTree(x,M??void 0).then(async le=>{o(le);const ve=le.filter(ct=>ct.type==="lesson"||ct.type==="exam"),_e=await Promise.all(ve.map(async ct=>{const jt=await fe.getProgress(ct.id);return[ct.id,jt]})),Ue={};for(const[ct,jt]of _e)jt&&(Ue[ct]=jt);l(Ue)}).catch(E),fe.getDashboard(x).then(P).catch(E))},[x,M,E]),_.useEffect(()=>{if(!F){De([]);return}fe.getStarterPrompts(F).then(De).catch(()=>De([]))},[F]),_.useEffect(()=>{const le=ve=>{if(ve.key==="Escape"&&Me.activeId&&(fe.abortAgentChatThread(Me.activeId).catch(()=>{}),U(!1),Fe(!1)),(ve.ctrlKey||ve.metaKey)&&ve.key==="k"&&(ve.preventDefault(),Fe(_e=>!_e)),(ve.ctrlKey||ve.metaKey)&&ve.key==="b"&&(ve.preventDefault(),Bt()),(ve.ctrlKey||ve.metaKey)&&ve.key==="Tab"){if(ve.preventDefault(),H.current.active)return;const _e=Me.threads;if(_e.length>1){const Ue=_e.findIndex(jt=>jt.id===Me.activeId),ct=ve.shiftKey?(Ue-1+_e.length)%_e.length:(Ue+1)%_e.length;Me.setActiveId(_e[ct].id)}}(!ve.target||!ve.target.matches("input, textarea, select"))&&(ve.key==="1"&&j("map"),ve.key==="2"&&j("import"),ve.key==="s"&&(ve.ctrlKey||ve.metaKey)&&(ve.preventDefault(),U(!0)))};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[F]);const zr=_.useCallback(async le=>{var ve;try{if(le.type==="exam"){z(le.id),Y("content");return}if(((ve=s[le.id])==null?void 0:ve.status)==="locked"){z(null);return}await fe.markNodeAttempted(le.id);const _e=await fe.getStreak();await Br(),d(_e),z(le.id),Y("content"),eo(!1)}catch(_e){E(_e)}},[s,Br,E]),Yi=_.useCallback(le=>{if(H.current.active){W({open:!0,pendingAction:le});return}le()},[]),Gi=_.useCallback(le=>{if(H.current.active&&le.id!==F){W({open:!0,pendingAction:()=>void zr(le)});return}zr(le)},[zr,F]),Od=_.useCallback(le=>{H.current=le},[]),Yl=_.useCallback(async()=>{const le=G.pendingAction;W({open:!1,pendingAction:null});const ve=H.current;if(H.current={active:!1,terminate:null},ve.active&&ve.terminate)try{await ve.terminate()}catch{}le==null||le()},[G.pendingAction]);Us(ae,G.open),_.useEffect(()=>{if(!G.open)return;const le=ve=>{ve.key==="Escape"&&W({open:!1,pendingAction:null})};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[G.open]);const Gl=async le=>{try{await fe.setActiveSoul(le),I(le)}catch(ve){E(ve)}},Xl=_.useCallback(async(le,ve,_e)=>{try{await fe.applyProposal(le),Ne.markProposalStatus(ve,_e,!0)}catch(Ue){E(Ue)}},[Ne,E]),$s=_.useCallback(async(le,ve,_e)=>{try{await fe.rejectProposal(le),Ne.markProposalStatus(ve,_e,!1)}catch(Ue){E(Ue)}},[Ne,E]),Xi=t.find(le=>le.id===x),Qs=_.useMemo(()=>{const le=new Set(i.map(ve=>ve.id));return new Set([...B].filter(ve=>le.has(ve)))},[B,i]),Ki=Qs.size,va=_.useMemo(()=>i.filter(le=>le.type==="section").sort((le,ve)=>le.orderIdx-ve.orderIdx),[i]),Jt=_.useMemo(()=>{const le=cE.map(_e=>L.find(Ue=>Ue.name===_e)).filter(_e=>!!_e),ve=L.filter(_e=>!cE.includes(_e.name));return[...le,...ve]},[L]),yt=zI(x),Oa=HI(),It=Ip();_.useEffect(()=>fe.on("exam:status",ve=>{if(ve.status!=="ready"||ve.nodeId===F)return;const _e=i.find(Ue=>Ue.id===ve.nodeId);_e&&It.show(e("exam.ready.toast",{title:_e.title}),{duration:4e3})}),[F,i,It,e]);const Id=_.useCallback(async le=>{const ve=t.find(_e=>_e.id===le);try{await fe.deleteCourse(le),It.show(e("import.deleted",{title:(ve==null?void 0:ve.title)??le}),{duration:3e3}),Ln()}catch(_e){E(_e)}},[t,Ln,E,It,e]),Ws=_.useCallback(async(le,ve,_e)=>{if(!le.trim()||Ne.streaming)return;if(!Me.activeId){const ct=await Me.ensureThreadForSend(le,ve);if(ct){Ne.send(le,ct,ve,_e);return}It.show(e("toast.threadCreateFailed"));return}const Ue=Me.activeThread;Ue&&!Ue.title&&Me.update(Ue.id,{title:(ve??le).trim()}),Ne.send(le,void 0,ve,_e)},[Ne,Me,It,e]),Zs=_.useRef(Ne.streaming);Zs.current=Ne.streaming;const $i=_.useCallback(le=>{const ve=zj(le,e),_e=Bj(le,e),Ue=ct=>{var jt;if(!Zs.current){(jt=Gn.current)==null||jt.call(Gn,ve,_e);return}ct>0&&setTimeout(()=>Ue(ct-1),2e3)};Ue(10)},[e]);Gn.current=Ws;const Ur=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Xn=_.useMemo(()=>{const le=Hv(Ne.messages).filter(_e=>{var Ue;return Ur.has(((Ue=_e.output)==null?void 0:Ue.artifactType)??"")});if(le.length)return le[le.length-1];const ve=yt.items.filter(_e=>Ur.has(_e.artifactType)).map(_e=>{try{return{id:_e.id,toolName:_e.artifactType,output:JSON.parse(_e.data)}}catch{return null}}).filter(_e=>_e!==null);return ve.length?ve[ve.length-1]:null},[Ne.messages,yt.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 Qi=_.useMemo(()=>Ne.messages.reduce((le,ve)=>le+ve.parts.reduce((_e,Ue)=>Ue.type==="text"?_e+AE(Ue.text):_e,0),0),[Ne.messages]),ja=_.useRef(!1);_.useEffect(()=>{Ki>0&&!ja.current&&(ja.current=!0,It.show(e("review.nudge",{n:Ki}),{duration:4e3}))},[Ki,It,e]);const Vt=_.useMemo(()=>Hv(Ne.messages),[Ne.messages]),Js=_.useRef(new Set);_.useEffect(()=>{for(const le of Vt){const ve=le.output;if(!ve||!ve.artifactType)continue;const _e=`${ve.artifactType}:${JSON.stringify(ve)}`;Js.current.has(_e)||(Js.current.add(_e),yt.save({nodeId:F,artifactType:ve.artifactType,title:ve.title??null,data:ve}),It.show(e("toast.artifactSaved"),{duration:3e3}))}},[Vt,yt,F,It,e]),_.useEffect(()=>{R!=="map"&&Y(null)},[R]);const[Kl,ca]=_.useState(!1),[li,eo]=_.useState(!1);return g.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[g.jsx(eU,{streak:c,xp:f,fontSize:Oa.size,onFontBump:Oa.bump,onOpenSettings:()=>U(!0),leftVisible:ye,rightVisible:Ke,onToggleLeft:Bt,onToggleRight:zt,tier:se,bottomBar:se===3?g.jsx("nav",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-ink/5 ring-1 ring-inset ring-[var(--border)]","data-testid":"t3-pane-switcher",role:"tablist","aria-label":e("pane.switcher"),children:[{k:"rail",icon:rp,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:AC,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:LC,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:le,icon:ve,label:_e,testid:Ue})=>g.jsx("button",{role:"tab","aria-selected":Be===le,"aria-label":_e,"data-testid":Ue,"data-tooltip":_e,onClick:()=>ze(le),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${Be===le?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:g.jsx(ve,{className:"w-4 h-4"})},le))}):void 0}),p&&g.jsx(aU,{message:p,onClose:()=>y(null)}),g.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:ln,onTouchEnd:Rt,children:[ye&&g.jsx(r5,{fullWidth:se===3,view:R,onViewChange:j,courseTitle:(Xi==null?void 0:Xi.title)??null,courseId:x,courses:t,sections:va,tree:i,progressMap:s,selectedNodeId:F,dueCount:Ki,dueNodeIds:Qs,overallMastery:(D==null?void 0:D.overallMastery)??0,streak:(c==null?void 0:c.currentStreak)??0,streaming:Ne.streaming,onJumpNode:le=>{if(Ne.streaming)return;const ve=i.find(_e=>_e.id===le);ve&&Gi(ve),se===3&&ze("chat")},onOpenReview:()=>ca(!0),onSelectCourse:le=>Yi(()=>{b(le),Ln()}),onDeleteCourse:le=>Yi(()=>{Id(le)}),onCoursesChanged:()=>{Ln()},availableLanguages:T,currentLocale:M,onLocaleChange:async le=>{x&&(await fe.setCourseLanguage(x,le),N(le))}}),g.jsxs(g.Fragment,{children:[Ot&&g.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:se===3?{flex:1}:Ke?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:x?(ot==null?void 0:ot.type)==="exam"?g.jsx(Ej,{examNode:ot,locale:$e,onSessionChange:Od,paused:G.open,onExamCompleted:()=>{fe.getProgress(ot.id).then(le=>{le&&l(ve=>({...ve,[ot.id]:le}))})}}):g.jsxs(g.Fragment,{children:[g.jsx(Hj,{threads:Me.threads,activeThread:Me.activeThread,focusNodeTitle:(ot==null?void 0:ot.title)??null,onPickThread:le=>{Ne.streaming||Me.setActiveId(le)},onCreate:()=>{Ne.streaming||(Me.create({title:null}),It.show(e("toast.threadCreated")))},onRename:(le,ve)=>{Me.update(le,{title:ve}),It.show(e("toast.threadRenamed"))},onArchive:le=>{Me.update(le,{status:"archived"}),It.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>Me.update(le,{status:"active"})}})},onDelete:le=>{const ve=Me.removeWithUndo(le);ve&&(It.show(`${e("toast.threadDeleted")}${ve.title?`「${ve.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{Me.restore(ve),It.show(e("toast.restored"))}}}),setTimeout(()=>{fe.threadDelete(ve.id).catch(()=>{})},5500))}}),g.jsx(YI,{messages:Ne.messages,streaming:Ne.streaming,onApplyProposal:Xl,onRejectProposal:$s,summary:gt,onStartLearning:je!=null&&je.ready?Pr:void 0,agentReady:(je==null?void 0:je.ready)??!1,onGotoSettings:()=>U(!0),hasNode:!!ot,selectedNodeId:F,threadId:Me.activeId,onPickQuizAction:le=>{Ws(le)},onQuizCompleted:$i,cardMode:se===3,chatNotes:yt.items.filter(le=>le.artifactType==="user_note"&&le.sourceAnchor),onSaveChatNote:(le,ve,_e,Ue)=>{!ot||!Me.activeId||(yt.saveUserNote({nodeId:ot.id,text:le,sourceType:"chat",sourceAnchor:{type:"chat",threadId:Me.activeId,msgId:ve,startOffset:_e,endOffset:Ue}}),It.show(e("toast.noteSaved"),{duration:2e3}))}}),g.jsx(pj,{nodeId:F,agentReady:(je==null?void 0:je.ready)??!1,streaming:Ne.streaming,souls:Jt,activeSoul:C,starterPrompts:Ne.messages.length>0?Ld:[],onPickSoul:Gl,onSend:Ws,onStop:Ne.stop,onLogFriction:F?(le,ve)=>{fe.logFriction(F,le,ve),It.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>U(!0),insertText:et,historyTokens:Qi})]}):g.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:g.jsxs("div",{className:"text-center max-w-sm",children:[g.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),g.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),g.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),Ke&&g.jsx("main",{className:se===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":se===3?"notebook-pane-full":void 0,children:g.jsx(OI,{selectedNode:ot,items:yt.items,loading:yt.loading,forceTab:V,canvasArtifact:Xn,onUserTabChange:()=>Y(null),onRemove:le=>{yt.remove(le),It.show(e("toast.noteDeleted"))},onTogglePin:le=>{yt.togglePin(le)},onRecordQuizResult:(le,ve)=>{yt.recordQuizResult(le,ve)},onUpdateNoteComment:(le,ve)=>{yt.updateUserNoteComment(le,ve)},onSaveContentNote:(le,ve)=>{ot&&(yt.saveUserNote({nodeId:ot.id,text:le,sourceType:"content",sourceAnchor:ve}),It.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:an,onQuoteToChat:Qe,locale:M,isReviewing:li,onReviewDone:()=>eo(!1)})})]})]}),te&&g.jsx(tU,{onClose:()=>U(!1)}),Kl&&g.jsx(nU,{onClose:()=>ca(!1),tree:i,dashboard:D,progressMap:s,onPickNode:le=>{Yi(()=>{z(le),Y("content"),ca(!1),eo(!0)})}}),G.open&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:g.jsxs("div",{ref:ae,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:[g.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[g.jsx(ri,{className:"w-5 h-5 text-warning shrink-0"}),g.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),g.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx("button",{className:"btn-3d-neutral px-4 py-1.5 text-body",onClick:()=>W({open:!1,pendingAction:null}),"data-testid":"exam-leave-cancel",children:e("exam.leave.cancel")}),g.jsx("button",{className:"btn-3d-brand px-4 py-1.5 text-body",style:{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"},onClick:()=>void Yl(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),xe&&g.jsx(kj,{onClose:()=>Fe(!1),onPick:le=>{Fe(!1),Jz(le)},hasNode:!!F}),g.jsx(g5,{}),g.jsx(Wz,{})]})}function Jz(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function eU({streak:e,xp:t,fontSize:n,onFontBump:i,onOpenSettings:o,leftVisible:s,rightVisible:l,onToggleLeft:c,onToggleRight:d,tier:f,bottomBar:m}){const x=Ye();return m?g.jsx("header",{className:"app-header shrink-0",children:g.jsxs("div",{className:"flex items-center h-12 px-4",children:[g.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&g.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:x("header.energy"),children:[g.jsx(o0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),g.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),m,g.jsx("div",{className:"flex-1 flex items-center justify-end",children:g.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:g.jsx(Fc,{className:"w-4 h-4"})})})]})}):g.jsx("header",{className:"app-header shrink-0 flex flex-col",children:g.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[g.jsx("div",{className:"flex items-center gap-2 min-w-0",children:g.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",g.jsx("span",{className:"text-brand",children:"Study"})]})}),g.jsxs("div",{className:"flex items-center gap-3",children:[f!==3&&g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.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:g.jsx(MC,{className:"w-4 h-4"})}),g.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:g.jsx(RC,{className:"w-4 h-4"})})]}),f!==3&&g.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[g.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-"}),g.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&&g.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:x("header.energy"),children:[g.jsx(o0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),g.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:g.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),g.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&g.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:g.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&g.jsx(iU,{streak:e}),g.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:g.jsx(Fc,{className:"w-4 h-4"})})]})]})})}function tU({onClose:e}){const t=Ye(),n=_.useRef(null);return Us(n,!0),g.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[g.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),g.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:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[g.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),g.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:"✕"})]}),g.jsx("div",{className:"flex-1 overflow-y-auto",children:g.jsx(Cj,{})})]})]})}function nU({onClose:e,tree:t,onPickNode:n,dashboard:i,progressMap:o}){const s=Ye(),l=_.useRef(null);Us(l,!0);const[c,d]=_.useState([]);_.useEffect(()=>{fe.getAllSrsItems().then(N=>d(N)).catch(()=>d([]))},[]);const f=_.useMemo(()=>new Map(c.map(N=>[N.nodeId,N])),[c]),m=_.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]),p=_.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=m.overdue.length>0;return g.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[g.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),g.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:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[g.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[g.jsx(ii,{className:"w-4 h-4","aria-hidden":"true"})," ",s("review.title")]}),g.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:"✕"})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[p.length>0&&g.jsxs("button",{onClick:()=>{const N=p[Math.floor(Math.random()*p.length)];N&&n(N.id)},"data-testid":"review-interleave",className:"btn-3d-neutral w-full py-2.5 text-body flex items-center justify-center gap-1.5",children:[g.jsx(UC,{className:"w-4 h-4"}),s("review.interleave")]}),c.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.srsHint")}),g.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:m.overdue,label:s("review.quadrant.overdue"),dot:"bg-review"},{items:m.short,label:s("review.quadrant.short"),dot:"bg-gold"},{items:m.long,label:s("review.quadrant.long"),dot:"bg-brand"},{items:m.inactive,label:s("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(N=>N.items.length>0).map(N=>g.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[g.jsx("span",{className:`w-2 h-2 rounded-full ${N.dot}`}),g.jsx("span",{className:"text-label text-ink-muted",children:N.label}),g.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:N.items.length})]},N.label))}),M&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:s("review.overdueQuickHint")}),g.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.overdue.slice(0,8).map(N=>{const L=t.find(A=>A.id===N.nodeId);return L?g.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&&g.jsxs("div",{children:[g.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.myProgress")}),g.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 g.jsxs("div",{children:[g.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?g.jsx(ap,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):g.jsx(dC,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),g.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:N.title}),I.length>0&&g.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[g.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-full rounded-full ${A>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,A)}%`}})}),g.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[A,"%"]})]})]}),C&&g.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:L.length===0?g.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 g.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?g.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${P.color} shrink-0`,title:P.title}):g.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),g.jsx("span",{className:`text-label truncate flex-1 ${B?"text-ink-strong":"text-ink-faint"}`,children:R.title}),D!==null&&g.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[D,"%"]}),B&&g.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&&g.jsxs("div",{children:[g.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:s("dashboard.mini.struggle")}),i.frictionByNode.map(N=>g.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:[g.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[N.count,"×"]}),g.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:N.title})]},N.nodeId))]}),p.length===0&&c.length===0&&x.length===0&&g.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[g.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),g.jsx("div",{className:"text-body text-ink-muted",children:s("review.empty.title")}),g.jsx("div",{className:"text-label text-ink-faint mt-1",children:s("review.empty.desc")})]})]})]})]})}function aU({message:e,onClose:t}){const n=Ye();return g.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:[g.jsxs("span",{children:["⚠️ ",e]}),g.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function iU({streak:e}){const t=Ye();return g.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:[g.jsx(yE,{className:"w-4 h-4 text-review flame-flicker"}),g.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&g.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:[g.jsx(zC,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),g.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 rU({rejected:e}){const t=navigator.language.startsWith("zh"),[n,i]=np.useState(""),o=s=>{s.preventDefault();const l=n.trim();if(!l)return;const c=l.includes("token=")?new URL(l).searchParams.get("token")??"":l;c&&Uc(async()=>{const{setWebToken:d}=await import("./api-web-CfrRrKkd.js");return{setWebToken:d}},[],import.meta.url).then(({setWebToken:d})=>d(c))};return g.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:g.jsxs("form",{onSubmit:o,className:"w-full max-w-sm text-center",children:[g.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),g.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),g.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&&g.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),g.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"}),g.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"}),g.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 Iw=nC.createRoot(document.getElementById("root"));function sU(){Iw.render(g.jsx(np.StrictMode,{children:g.jsx(_I,{children:g.jsx(Zz,{})})}))}function dE(e){Iw.render(g.jsx(np.StrictMode,{children:g.jsx(rU,{rejected:e})}))}async function oU(){const{installAppHeight:e}=await Uc(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await Uc(()=>import("./api-web-CfrRrKkd.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>dE(!0)),!t.hasWebToken()){dE(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}sU()}oU();export{Uc as _,Ml as g};