cognitune 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +183 -42
  3. package/dist/cli.js +8 -7
  4. package/dist/web/assets/Map-xBJDQ_Xn.js +1 -0
  5. package/dist/web/assets/{Practice-DJ_GeEEw.js → Practice-DNf-tMjl.js} +3 -3
  6. package/dist/web/assets/{_baseUniq-Cgcxu-ug.js → _baseUniq-7KLmbwxc.js} +1 -1
  7. package/dist/web/assets/{architectureDiagram-UYN6MBPD-F11egvO5.js → architectureDiagram-UYN6MBPD-DFK-K3Yp.js} +1 -1
  8. package/dist/web/assets/{blockDiagram-ZHA2E4KO-DcLwUr6e.js → blockDiagram-ZHA2E4KO-D9jSBc-F.js} +1 -1
  9. package/dist/web/assets/{c4Diagram-6F5ED5ID-DoK6LsEW.js → c4Diagram-6F5ED5ID-KAOALvx3.js} +1 -1
  10. package/dist/web/assets/channel-BW4MllLS.js +1 -0
  11. package/dist/web/assets/{chunk-5HRBRIJM-BZZC4mrX.js → chunk-5HRBRIJM-Btr12S8H.js} +1 -1
  12. package/dist/web/assets/{chunk-7U56Z5CX-CRQL1BaD.js → chunk-7U56Z5CX-NWMyaEQ0.js} +1 -1
  13. package/dist/web/assets/{chunk-ASOPGD6M-MyeXPUAo.js → chunk-ASOPGD6M-DdvxpUSZ.js} +1 -1
  14. package/dist/web/assets/{chunk-KFBOBJHC-ivtJnQTl.js → chunk-KFBOBJHC-CLK5Qods.js} +1 -1
  15. package/dist/web/assets/{chunk-T2TOU4HS-DfaWwXAy.js → chunk-T2TOU4HS-B-nrzheR.js} +1 -1
  16. package/dist/web/assets/{chunk-TMUBEWPD-1vGEp44G.js → chunk-TMUBEWPD-DCsdC8PC.js} +1 -1
  17. package/dist/web/assets/classDiagram-LNE6IOMH-D4kEJsvG.js +1 -0
  18. package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-D4kEJsvG.js +1 -0
  19. package/dist/web/assets/clone-C8mTbP7R.js +1 -0
  20. package/dist/web/assets/{dagre-4EVJKHTY-BzJqGMK1.js → dagre-4EVJKHTY-D_09gC0H.js} +1 -1
  21. package/dist/web/assets/{diagram-QW4FP2JN-DserUmhH.js → diagram-QW4FP2JN-quH5WQny.js} +1 -1
  22. package/dist/web/assets/{erDiagram-6RL3IURR-BeMwcZZW.js → erDiagram-6RL3IURR-BmJHLDew.js} +1 -1
  23. package/dist/web/assets/{flowDiagram-7ASYPVHJ-C2Qt1H4b.js → flowDiagram-7ASYPVHJ-DNzT7Cua.js} +1 -1
  24. package/dist/web/assets/{ganttDiagram-NTVNEXSI-DjG6T96W.js → ganttDiagram-NTVNEXSI-6reJ1AIG.js} +1 -1
  25. package/dist/web/assets/{gitGraph-YCYPL57B-C92c8R4j.js → gitGraph-YCYPL57B-BfipSUJ3.js} +1 -1
  26. package/dist/web/assets/{gitGraphDiagram-NRZ2UAAF-C0OK2-pl.js → gitGraphDiagram-NRZ2UAAF-BRb9bqzI.js} +1 -1
  27. package/dist/web/assets/{graph-jcgmh1Ot.js → graph-BHXuL-RR.js} +1 -1
  28. package/dist/web/assets/{index-BTAmHv-d.js → index-7JDqNzz1.js} +1 -1
  29. package/dist/web/assets/{index-DgVZUoYY.js → index-B49g1XNF.js} +1 -1
  30. package/dist/web/assets/{index-BD8q1ij7.js → index-B5Tomqy6.js} +1 -1
  31. package/dist/web/assets/{index-D8PR6AHG.js → index-BCM7jSxq.js} +1 -1
  32. package/dist/web/assets/{index-DB9Tltht.js → index-BM9KwSU5.js} +1 -1
  33. package/dist/web/assets/{index-BPFm8xBn.js → index-BiiiKqbq.js} +1 -1
  34. package/dist/web/assets/{index-D5AcpGl_.js → index-Bli4383n.js} +1 -1
  35. package/dist/web/assets/{index-DJ7YtDlC.js → index-BsH1Ca5H.js} +1 -1
  36. package/dist/web/assets/{index-H4qir-5V.js → index-Bsf4UF_h.js} +1 -1
  37. package/dist/web/assets/{index-DgTHE4KH.js → index-C5JoMvch.js} +1 -1
  38. package/dist/web/assets/{index-CW1WHdXq.js → index-C67RtHfG.js} +1 -1
  39. package/dist/web/assets/{index-CfFkiEw9.js → index-CNViI9C2.js} +1 -1
  40. package/dist/web/assets/{index-TRTMCU2f.js → index-CQjof-kk.js} +1 -1
  41. package/dist/web/assets/{index-DM-V8yrZ.js → index-CyHGDhfc.js} +1 -1
  42. package/dist/web/assets/index-CyhIx47s.css +1 -0
  43. package/dist/web/assets/{index-DIV7qBvA.js → index-D-DY42g9.js} +1 -1
  44. package/dist/web/assets/{index-B05Rh3LW.js → index-DRri1mnd.js} +1 -1
  45. package/dist/web/assets/{index-D3Zk0Btz.js → index-DXji-ikE.js} +1 -1
  46. package/dist/web/assets/{index-D-9XGv5u.js → index-D_DIS1os.js} +1 -1
  47. package/dist/web/assets/{index-BtCLkneo.js → index-Dl6tJxzv.js} +1 -1
  48. package/dist/web/assets/{index-HBtEhFV8.js → index-TI1LWXRL.js} +1 -1
  49. package/dist/web/assets/index-dA5Y-R2D.js +514 -0
  50. package/dist/web/assets/{index-a7yJqPRD.js → index-wnqHtEcu.js} +1 -1
  51. package/dist/web/assets/{index-BJepU7_w.js → index-ysHMZpcw.js} +1 -1
  52. package/dist/web/assets/{infoDiagram-A4XQUW5V-DqkPyvzP.js → infoDiagram-A4XQUW5V-CE9eDiRA.js} +1 -1
  53. package/dist/web/assets/{journeyDiagram-G5WM74LC-CPoGO9lU.js → journeyDiagram-G5WM74LC-D_iPCzBK.js} +1 -1
  54. package/dist/web/assets/{kanban-definition-QRCXZQQD-DhYcbXpZ.js → kanban-definition-QRCXZQQD-Bxj-EOmZ.js} +1 -1
  55. package/dist/web/assets/{layout-D3h_RNbG.js → layout-CQ6J22ew.js} +1 -1
  56. package/dist/web/assets/layout.worker-Bzrmqu8H.js +1 -0
  57. package/dist/web/assets/{mermaid.core-QonkHgY_.js → mermaid.core-27sLJoRM.js} +4 -4
  58. package/dist/web/assets/{min-u5yV8FH_.js → min-h0zR_W4w.js} +1 -1
  59. package/dist/web/assets/{mindmap-definition-GWI6TPTV-7qne4US6.js → mindmap-definition-GWI6TPTV-DiBTVWc8.js} +28 -28
  60. package/dist/web/assets/{pieDiagram-YF2LJOPJ-CYjuzLxS.js → pieDiagram-YF2LJOPJ-BE2VMHC3.js} +1 -1
  61. package/dist/web/assets/{quadrantDiagram-OS5C2QUG-iNs3hmmI.js → quadrantDiagram-OS5C2QUG-DkN-8Avj.js} +1 -1
  62. package/dist/web/assets/{requirementDiagram-MIRIMTAZ-tDYOd2xQ.js → requirementDiagram-MIRIMTAZ-0OCRbKti.js} +1 -1
  63. package/dist/web/assets/{sankeyDiagram-Y46BX6SQ-Ce34Wa1G.js → sankeyDiagram-Y46BX6SQ-6v9qBJFv.js} +1 -1
  64. package/dist/web/assets/{sequenceDiagram-G6AWOVSC-i7VCqMq3.js → sequenceDiagram-G6AWOVSC-CjH7axp-.js} +1 -1
  65. package/dist/web/assets/{stateDiagram-MAYHULR4-BSREATU6.js → stateDiagram-MAYHULR4-Bbbno_Ix.js} +1 -1
  66. package/dist/web/assets/stateDiagram-v2-4JROLMXI-CvrRdVH2.js +1 -0
  67. package/dist/web/assets/{timeline-definition-U7ZMHBDA-DgAweJ73.js → timeline-definition-U7ZMHBDA-BSIsFSlr.js} +1 -1
  68. package/dist/web/assets/{xychartDiagram-6QU3TZC5-DxWMJtPc.js → xychartDiagram-6QU3TZC5-B12dxFiy.js} +1 -1
  69. package/dist/web/index.html +2 -2
  70. package/package.json +1 -1
  71. package/dist/web/assets/Map-pFoOaroM.js +0 -1
  72. package/dist/web/assets/channel-cS78OL1L.js +0 -1
  73. package/dist/web/assets/classDiagram-LNE6IOMH-BV-X_A98.js +0 -1
  74. package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-BV-X_A98.js +0 -1
  75. package/dist/web/assets/clone-CX7XQP1C.js +0 -1
  76. package/dist/web/assets/index-Bs71achu.js +0 -509
  77. package/dist/web/assets/index-DajatLhQ.css +0 -1
  78. package/dist/web/assets/stateDiagram-v2-4JROLMXI-CtOZAypx.js +0 -1
@@ -1,509 +0,0 @@
1
- var Rp=e=>{throw TypeError(e)};var uc=(e,t,n)=>t.has(e)||Rp("Cannot "+n);var P=(e,t,n)=>(uc(e,t,"read from private field"),n?n.call(e):t.get(e)),se=(e,t,n)=>t.has(e)?Rp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),K=(e,t,n,r)=>(uc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ce=(e,t,n)=>(uc(e,t,"access private method"),n);var Ja=(e,t,n,r)=>({set _(i){K(e,t,i,n)},get _(){return P(e,t,r)}});function $x(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Aw="modulepreload",Iw=function(e){return"/"+e},zp={},dl=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=Iw(u),u in zp)return;zp[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Aw,c||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),c)return new Promise((p,f)=>{h.addEventListener("load",p),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return i.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};var vL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bx={exports:{}},Su={},Ux={exports:{}},Ce={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 Ra=Symbol.for("react.element"),Fw=Symbol.for("react.portal"),Dw=Symbol.for("react.fragment"),Ow=Symbol.for("react.strict_mode"),_w=Symbol.for("react.profiler"),$w=Symbol.for("react.provider"),Bw=Symbol.for("react.context"),Uw=Symbol.for("react.forward_ref"),qw=Symbol.for("react.suspense"),Hw=Symbol.for("react.memo"),Vw=Symbol.for("react.lazy"),Ap=Symbol.iterator;function Ww(e){return e===null||typeof e!="object"?null:(e=Ap&&e[Ap]||e["@@iterator"],typeof e=="function"?e:null)}var qx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hx=Object.assign,Vx={};function hl(e,t,n){this.props=e,this.context=t,this.refs=Vx,this.updater=n||qx}hl.prototype.isReactComponent={};hl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Wx(){}Wx.prototype=hl.prototype;function qh(e,t,n){this.props=e,this.context=t,this.refs=Vx,this.updater=n||qx}var Hh=qh.prototype=new Wx;Hh.constructor=qh;Hx(Hh,hl.prototype);Hh.isPureReactComponent=!0;var Ip=Array.isArray,Qx=Object.prototype.hasOwnProperty,Vh={current:null},Kx={key:!0,ref:!0,__self:!0,__source:!0};function Gx(e,t,n){var r,i={},s=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(s=""+t.key),t)Qx.call(t,r)&&!Kx.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Ra,type:e,key:s,ref:l,props:i,_owner:Vh.current}}function Qw(e,t){return{$$typeof:Ra,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ra}function Kw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fp=/\/+/g;function cc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kw(""+e.key):t.toString(36)}function No(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Ra:case Fw:l=!0}}if(l)return l=e,i=i(l),e=r===""?"."+cc(l,0):r,Ip(i)?(n="",e!=null&&(n=e.replace(Fp,"$&/")+"/"),No(i,t,n,"",function(c){return c})):i!=null&&(Wh(i)&&(i=Qw(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(Fp,"$&/")+"/")+e)),t.push(i)),1;if(l=0,r=r===""?".":r+":",Ip(e))for(var o=0;o<e.length;o++){s=e[o];var u=r+cc(s,o);l+=No(s,t,n,u,i)}else if(u=Ww(e),typeof u=="function")for(e=u.call(e),o=0;!(s=e.next()).done;)s=s.value,u=r+cc(s,o++),l+=No(s,t,n,u,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Za(e,t,n){if(e==null)return e;var r=[],i=0;return No(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Gw(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Vt={current:null},So={transition:null},Yw={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:So,ReactCurrentOwner:Vh};function Yx(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:Za,forEach:function(e,t,n){Za(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Za(e,function(){t++}),t},toArray:function(e){return Za(e,function(t){return t})||[]},only:function(e){if(!Wh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Component=hl;Ce.Fragment=Dw;Ce.Profiler=_w;Ce.PureComponent=qh;Ce.StrictMode=Ow;Ce.Suspense=qw;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yw;Ce.act=Yx;Ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Hx({},e.props),i=e.key,s=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,l=Vh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Qx.call(t,u)&&!Kx.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:Ra,type:e.type,key:i,ref:s,props:r,_owner:l}};Ce.createContext=function(e){return e={$$typeof:Bw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:$w,_context:e},e.Consumer=e};Ce.createElement=Gx;Ce.createFactory=function(e){var t=Gx.bind(null,e);return t.type=e,t};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:Uw,render:e}};Ce.isValidElement=Wh;Ce.lazy=function(e){return{$$typeof:Vw,_payload:{_status:-1,_result:e},_init:Gw}};Ce.memo=function(e,t){return{$$typeof:Hw,type:e,compare:t===void 0?null:t}};Ce.startTransition=function(e){var t=So.transition;So.transition={};try{e()}finally{So.transition=t}};Ce.unstable_act=Yx;Ce.useCallback=function(e,t){return Vt.current.useCallback(e,t)};Ce.useContext=function(e){return Vt.current.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e){return Vt.current.useDeferredValue(e)};Ce.useEffect=function(e,t){return Vt.current.useEffect(e,t)};Ce.useId=function(){return Vt.current.useId()};Ce.useImperativeHandle=function(e,t,n){return Vt.current.useImperativeHandle(e,t,n)};Ce.useInsertionEffect=function(e,t){return Vt.current.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return Vt.current.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return Vt.current.useMemo(e,t)};Ce.useReducer=function(e,t,n){return Vt.current.useReducer(e,t,n)};Ce.useRef=function(e){return Vt.current.useRef(e)};Ce.useState=function(e){return Vt.current.useState(e)};Ce.useSyncExternalStore=function(e,t,n){return Vt.current.useSyncExternalStore(e,t,n)};Ce.useTransition=function(){return Vt.current.useTransition()};Ce.version="18.3.1";Ux.exports=Ce;var b=Ux.exports;const Xw=Uh(b),Jw=$x({__proto__:null,default:Xw},[b]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Zw=b,ek=Symbol.for("react.element"),tk=Symbol.for("react.fragment"),nk=Object.prototype.hasOwnProperty,rk=Zw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ik={key:!0,ref:!0,__self:!0,__source:!0};function Xx(e,t,n){var r,i={},s=null,l=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)nk.call(t,r)&&!ik.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:ek,type:e,key:s,ref:l,props:i,_owner:rk.current}}Su.Fragment=tk;Su.jsx=Xx;Su.jsxs=Xx;Bx.exports=Su;var a=Bx.exports;const Jx=()=>window.matchMedia("(prefers-color-scheme: dark)");function Dp(e){const t=e==="dark"||e==="system"&&Jx().matches;document.documentElement.classList.toggle("dark",t),window.dispatchEvent(new CustomEvent("gl-theme",{detail:t}))}function Zx(){const[e,t]=b.useState(()=>{try{return localStorage.getItem("cognitune.theme")||"system"}catch{return"system"}});return b.useEffect(()=>{try{localStorage.setItem("cognitune.theme",e)}catch{}if(Dp(e),e!=="system")return;const n=Jx(),r=()=>Dp("system");return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),{pref:e,setPref:t}}function sk(){const[e,t]=b.useState(()=>document.documentElement.classList.contains("dark"));return b.useEffect(()=>{const n=r=>t(r.detail);return window.addEventListener("gl-theme",n),()=>window.removeEventListener("gl-theme",n)},[]),e}function ey(){try{return localStorage.getItem("cognitune.readingFont2")==="sans"?"sans":"serif"}catch{return"serif"}}function ty(e=ey()){document.documentElement.dataset.read=e}function lk(){const[e,t]=b.useState(ey);return b.useEffect(()=>{try{localStorage.setItem("cognitune.readingFont2",e)}catch{}ty(e)},[e]),{font:e,setFont:t}}var ny={exports:{}},xn={},ry={exports:{}},iy={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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
- */(function(e){function t(z,H){var N=z.length;z.push(H);e:for(;0<N;){var ue=N-1>>>1,ye=z[ue];if(0<i(ye,H))z[ue]=H,z[N]=ye,N=ue;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var H=z[0],N=z.pop();if(N!==H){z[0]=N;e:for(var ue=0,ye=z.length,T=ye>>>1;ue<T;){var Te=2*(ue+1)-1,De=z[Te],ve=Te+1,Ne=z[ve];if(0>i(De,N))ve<ye&&0>i(Ne,De)?(z[ue]=Ne,z[ve]=N,ue=ve):(z[ue]=De,z[Te]=N,ue=Te);else if(ve<ye&&0>i(Ne,N))z[ue]=Ne,z[ve]=N,ue=ve;else break e}}return H}function i(z,H){var N=z.sortIndex-H.sortIndex;return N!==0?N:z.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var u=[],c=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(z){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=z)r(c),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(c)}}function j(z){if(g=!1,v(z),!m)if(n(u)!==null)m=!0,G(E);else{var H=n(c);H!==null&&Y(j,H.startTime-z)}}function E(z,H){m=!1,g&&(g=!1,y(M),M=-1),f=!0;var N=p;try{for(v(H),h=n(u);h!==null&&(!(h.expirationTime>H)||z&&!O());){var ue=h.callback;if(typeof ue=="function"){h.callback=null,p=h.priorityLevel;var ye=ue(h.expirationTime<=H);H=e.unstable_now(),typeof ye=="function"?h.callback=ye:h===n(u)&&r(u),v(H)}else r(u);h=n(u)}if(h!==null)var T=!0;else{var Te=n(c);Te!==null&&Y(j,Te.startTime-H),T=!1}return T}finally{h=null,p=N,f=!1}}var k=!1,S=null,M=-1,F=5,C=-1;function O(){return!(e.unstable_now()-C<F)}function I(){if(S!==null){var z=e.unstable_now();C=z;var H=!0;try{H=S(!0,z)}finally{H?Q():(k=!1,S=null)}}else k=!1}var Q;if(typeof x=="function")Q=function(){x(I)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,$=q.port2;q.port1.onmessage=I,Q=function(){$.postMessage(null)}}else Q=function(){w(I,0)};function G(z){S=z,k||(k=!0,Q())}function Y(z,H){M=w(function(){z(e.unstable_now())},H)}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(z){z.callback=null},e.unstable_continueExecution=function(){m||f||(m=!0,G(E))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(z){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var N=p;p=H;try{return z()}finally{p=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,H){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var N=p;p=z;try{return H()}finally{p=N}},e.unstable_scheduleCallback=function(z,H,N){var ue=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?ue+N:ue):N=ue,z){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=N+ye,z={id:d++,callback:H,priorityLevel:z,startTime:N,expirationTime:ye,sortIndex:-1},N>ue?(z.sortIndex=N,t(c,z),n(u)===null&&z===n(c)&&(g?(y(M),M=-1):g=!0,Y(j,N-ue))):(z.sortIndex=ye,t(u,z),m||f||(m=!0,G(E))),z},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(z){var H=p;return function(){var N=p;p=H;try{return z.apply(this,arguments)}finally{p=N}}}})(iy);ry.exports=iy;var ak=ry.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 ok=b,gn=ak;function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sy=new Set,ia={};function os(e,t){tl(e,t),tl(e+"Capture",t)}function tl(e,t){for(ia[e]=t,e=0;e<t.length;e++)sy.add(t[e])}var Lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ad=Object.prototype.hasOwnProperty,uk=/^[: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]*$/,Op={},_p={};function ck(e){return ad.call(_p,e)?!0:ad.call(Op,e)?!1:uk.test(e)?_p[e]=!0:(Op[e]=!0,!1)}function dk(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hk(e,t,n,r){if(t===null||typeof t>"u"||dk(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wt(e,t,n,r,i,s,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=l}var Pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pt[e]=new Wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Pt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qh=/[\-:]([a-z])/g;function Kh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qh,Kh);Pt[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qh,Kh);Pt[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qh,Kh);Pt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Pt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gh(e,t,n,r){var i=Pt.hasOwnProperty(t)?Pt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hk(t,n,i,r)&&(n=null),r||i===null?ck(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Fr=ok.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,eo=Symbol.for("react.element"),ws=Symbol.for("react.portal"),ks=Symbol.for("react.fragment"),Yh=Symbol.for("react.strict_mode"),od=Symbol.for("react.profiler"),ly=Symbol.for("react.provider"),ay=Symbol.for("react.context"),Xh=Symbol.for("react.forward_ref"),ud=Symbol.for("react.suspense"),cd=Symbol.for("react.suspense_list"),Jh=Symbol.for("react.memo"),Hr=Symbol.for("react.lazy"),oy=Symbol.for("react.offscreen"),$p=Symbol.iterator;function Nl(e){return e===null||typeof e!="object"?null:(e=$p&&e[$p]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,dc;function Ol(e){if(dc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dc=t&&t[1]||""}return`
34
- `+dc+e}var hc=!1;function fc(e,t){if(!e||hc)return"";hc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
- `),s=r.stack.split(`
36
- `),l=i.length-1,o=s.length-1;1<=l&&0<=o&&i[l]!==s[o];)o--;for(;1<=l&&0<=o;l--,o--)if(i[l]!==s[o]){if(l!==1||o!==1)do if(l--,o--,0>o||i[l]!==s[o]){var u=`
37
- `+i[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=o);break}}}finally{hc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ol(e):""}function fk(e){switch(e.tag){case 5:return Ol(e.type);case 16:return Ol("Lazy");case 13:return Ol("Suspense");case 19:return Ol("SuspenseList");case 0:case 2:case 15:return e=fc(e.type,!1),e;case 11:return e=fc(e.type.render,!1),e;case 1:return e=fc(e.type,!0),e;default:return""}}function dd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ks:return"Fragment";case ws:return"Portal";case od:return"Profiler";case Yh:return"StrictMode";case ud:return"Suspense";case cd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ay:return(e.displayName||"Context")+".Consumer";case ly:return(e._context.displayName||"Context")+".Provider";case Xh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jh:return t=e.displayName||null,t!==null?t:dd(e.type)||"Memo";case Hr:t=e._payload,e=e._init;try{return dd(e(t))}catch{}}return null}function pk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dd(t);case 8:return t===Yh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mk(e){var t=uy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,s.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function to(e){e._valueTracker||(e._valueTracker=mk(e))}function cy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hd(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dy(e,t){t=t.checked,t!=null&&Gh(e,"checked",t,!1)}function fd(e,t){dy(e,t);var n=mi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pd(e,t.type,n):t.hasOwnProperty("defaultValue")&&pd(e,t.type,mi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Up(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pd(e,t,n){(t!=="number"||Bo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _l=Array.isArray;function Rs(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+mi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function md(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(_l(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mi(n)}}function hy(e,t){var n=mi(t.value),r=mi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Hp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function fy(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?fy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var no,py=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(no=no||document.createElement("div"),no.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=no.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Hl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gk=["Webkit","ms","Moz","O"];Object.keys(Hl).forEach(function(e){gk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hl[t]=Hl[e]})});function my(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Hl.hasOwnProperty(e)&&Hl[e]?(""+t).trim():t+"px"}function gy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=my(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var xk=Xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xd(e,t){if(t){if(xk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function yd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vd=null;function Zh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wd=null,zs=null,As=null;function Vp(e){if(e=Ia(e)){if(typeof wd!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Lu(t),wd(e.stateNode,e.type,t))}}function xy(e){zs?As?As.push(e):As=[e]:zs=e}function yy(){if(zs){var e=zs,t=As;if(As=zs=null,Vp(e),t)for(e=0;e<t.length;e++)Vp(t[e])}}function vy(e,t){return e(t)}function wy(){}var pc=!1;function ky(e,t,n){if(pc)return e(t,n);pc=!0;try{return vy(e,t,n)}finally{pc=!1,(zs!==null||As!==null)&&(wy(),yy())}}function la(e,t){var n=e.stateNode;if(n===null)return null;var r=Lu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(V(231,t,typeof n));return n}var kd=!1;if(Lr)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){kd=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{kd=!1}function yk(e,t,n,r,i,s,l,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Vl=!1,Uo=null,qo=!1,bd=null,vk={onError:function(e){Vl=!0,Uo=e}};function wk(e,t,n,r,i,s,l,o,u){Vl=!1,Uo=null,yk.apply(vk,arguments)}function kk(e,t,n,r,i,s,l,o,u){if(wk.apply(this,arguments),Vl){if(Vl){var c=Uo;Vl=!1,Uo=null}else throw Error(V(198));qo||(qo=!0,bd=c)}}function us(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function by(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Wp(e){if(us(e)!==e)throw Error(V(188))}function bk(e){var t=e.alternate;if(!t){if(t=us(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Wp(i),e;if(s===r)return Wp(i),t;s=s.sibling}throw Error(V(188))}if(n.return!==r.return)n=i,r=s;else{for(var l=!1,o=i.child;o;){if(o===n){l=!0,n=i,r=s;break}if(o===r){l=!0,r=i,n=s;break}o=o.sibling}if(!l){for(o=s.child;o;){if(o===n){l=!0,n=s,r=i;break}if(o===r){l=!0,r=s,n=i;break}o=o.sibling}if(!l)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function jy(e){return e=bk(e),e!==null?Ny(e):null}function Ny(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ny(e);if(t!==null)return t;e=e.sibling}return null}var Sy=gn.unstable_scheduleCallback,Qp=gn.unstable_cancelCallback,jk=gn.unstable_shouldYield,Nk=gn.unstable_requestPaint,st=gn.unstable_now,Sk=gn.unstable_getCurrentPriorityLevel,ef=gn.unstable_ImmediatePriority,Cy=gn.unstable_UserBlockingPriority,Ho=gn.unstable_NormalPriority,Ck=gn.unstable_LowPriority,Ey=gn.unstable_IdlePriority,Cu=null,cr=null;function Ek(e){if(cr&&typeof cr.onCommitFiberRoot=="function")try{cr.onCommitFiberRoot(Cu,e,void 0,(e.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:Lk,Pk=Math.log,Tk=Math.LN2;function Lk(e){return e>>>=0,e===0?32:31-(Pk(e)/Tk|0)|0}var ro=64,io=4194304;function $l(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Vo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,l=n&268435455;if(l!==0){var o=l&~i;o!==0?r=$l(o):(s&=l,s!==0&&(r=$l(s)))}else l=n&~i,l!==0?r=$l(l):s!==0&&(r=$l(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Un(t),i=1<<n,r|=e[n],t&=~i;return r}function Mk(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Un(s),o=1<<l,u=i[l];u===-1?(!(o&n)||o&r)&&(i[l]=Mk(o,t)):u<=t&&(e.expiredLanes|=o),s&=~o}}function jd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Py(){var e=ro;return ro<<=1,!(ro&4194240)&&(ro=64),e}function mc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function za(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Un(t),e[t]=n}function zk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Un(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function tf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Un(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Fe=0;function Ty(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ly,nf,My,Ry,zy,Nd=!1,so=[],ai=null,oi=null,ui=null,aa=new Map,oa=new Map,Wr=[],Ak="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 submit".split(" ");function Kp(e,t){switch(e){case"focusin":case"focusout":ai=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":aa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oa.delete(t.pointerId)}}function Cl(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ia(t),t!==null&&nf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ik(e,t,n,r,i){switch(t){case"focusin":return ai=Cl(ai,e,t,n,r,i),!0;case"dragenter":return oi=Cl(oi,e,t,n,r,i),!0;case"mouseover":return ui=Cl(ui,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return aa.set(s,Cl(aa.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,oa.set(s,Cl(oa.get(s)||null,e,t,n,r,i)),!0}return!1}function Ay(e){var t=Ii(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=by(n),t!==null){e.blockedOn=t,zy(e.priority,function(){My(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vd=r,n.target.dispatchEvent(r),vd=null}else return t=Ia(n),t!==null&&nf(t),e.blockedOn=n,!1;t.shift()}return!0}function Gp(e,t,n){Co(e)&&n.delete(t)}function Fk(){Nd=!1,ai!==null&&Co(ai)&&(ai=null),oi!==null&&Co(oi)&&(oi=null),ui!==null&&Co(ui)&&(ui=null),aa.forEach(Gp),oa.forEach(Gp)}function El(e,t){e.blockedOn===t&&(e.blockedOn=null,Nd||(Nd=!0,gn.unstable_scheduleCallback(gn.unstable_NormalPriority,Fk)))}function ua(e){function t(i){return El(i,e)}if(0<so.length){El(so[0],e);for(var n=1;n<so.length;n++){var r=so[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ai!==null&&El(ai,e),oi!==null&&El(oi,e),ui!==null&&El(ui,e),aa.forEach(t),oa.forEach(t),n=0;n<Wr.length;n++)r=Wr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wr.length&&(n=Wr[0],n.blockedOn===null);)Ay(n),n.blockedOn===null&&Wr.shift()}var Is=Fr.ReactCurrentBatchConfig,Wo=!0;function Dk(e,t,n,r){var i=Fe,s=Is.transition;Is.transition=null;try{Fe=1,rf(e,t,n,r)}finally{Fe=i,Is.transition=s}}function Ok(e,t,n,r){var i=Fe,s=Is.transition;Is.transition=null;try{Fe=4,rf(e,t,n,r)}finally{Fe=i,Is.transition=s}}function rf(e,t,n,r){if(Wo){var i=Sd(e,t,n,r);if(i===null)Sc(e,t,r,Qo,n),Kp(e,r);else if(Ik(i,e,t,n,r))r.stopPropagation();else if(Kp(e,r),t&4&&-1<Ak.indexOf(e)){for(;i!==null;){var s=Ia(i);if(s!==null&&Ly(s),s=Sd(e,t,n,r),s===null&&Sc(e,t,r,Qo,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Sc(e,t,r,null,n)}}var Qo=null;function Sd(e,t,n,r){if(Qo=null,e=Zh(r),e=Ii(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=by(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Qo=e,null}function Iy(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sk()){case ef:return 1;case Cy:return 4;case Ho:case Ck:return 16;case Ey:return 536870912;default:return 16}default:return 16}}var ii=null,sf=null,Eo=null;function Fy(){if(Eo)return Eo;var e,t=sf,n=t.length,r,i="value"in ii?ii.value:ii.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===i[s-r];r++);return Eo=i.slice(e,1<r?1-r:void 0)}function Po(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function lo(){return!0}function Yp(){return!1}function yn(e){function t(n,r,i,s,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?lo:Yp,this.isPropagationStopped=Yp,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=lo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),t}var fl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=yn(fl),Aa=Xe({},fl,{view:0,detail:0}),_k=yn(Aa),gc,xc,Pl,Eu=Xe({},Aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Pl&&(Pl&&e.type==="mousemove"?(gc=e.screenX-Pl.screenX,xc=e.screenY-Pl.screenY):xc=gc=0,Pl=e),gc)},movementY:function(e){return"movementY"in e?e.movementY:xc}}),Xp=yn(Eu),$k=Xe({},Eu,{dataTransfer:0}),Bk=yn($k),Uk=Xe({},Aa,{relatedTarget:0}),yc=yn(Uk),qk=Xe({},fl,{animationName:0,elapsedTime:0,pseudoElement:0}),Hk=yn(qk),Vk=Xe({},fl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wk=yn(Vk),Qk=Xe({},fl,{data:0}),Jp=yn(Qk),Kk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gk={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"},Yk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yk[e])?!!t[e]:!1}function af(){return Xk}var Jk=Xe({},Aa,{key:function(e){if(e.key){var t=Kk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Po(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(e){return e.type==="keypress"?Po(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Po(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zk=yn(Jk),eb=Xe({},Eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zp=yn(eb),tb=Xe({},Aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),nb=yn(tb),rb=Xe({},fl,{propertyName:0,elapsedTime:0,pseudoElement:0}),ib=yn(rb),sb=Xe({},Eu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lb=yn(sb),ab=[9,13,27,32],of=Lr&&"CompositionEvent"in window,Wl=null;Lr&&"documentMode"in document&&(Wl=document.documentMode);var ob=Lr&&"TextEvent"in window&&!Wl,Dy=Lr&&(!of||Wl&&8<Wl&&11>=Wl),em=" ",tm=!1;function Oy(e,t){switch(e){case"keyup":return ab.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _y(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bs=!1;function ub(e,t){switch(e){case"compositionend":return _y(t);case"keypress":return t.which!==32?null:(tm=!0,em);case"textInput":return e=t.data,e===em&&tm?null:e;default:return null}}function cb(e,t){if(bs)return e==="compositionend"||!of&&Oy(e,t)?(e=Fy(),Eo=sf=ii=null,bs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dy&&t.locale!=="ko"?null:t.data;default:return null}}var db={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 nm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!db[e.type]:t==="textarea"}function $y(e,t,n,r){xy(r),t=Ko(t,"onChange"),0<t.length&&(n=new lf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ql=null,ca=null;function hb(e){Xy(e,0)}function Pu(e){var t=Ss(e);if(cy(t))return e}function fb(e,t){if(e==="change")return t}var By=!1;if(Lr){var vc;if(Lr){var wc="oninput"in document;if(!wc){var rm=document.createElement("div");rm.setAttribute("oninput","return;"),wc=typeof rm.oninput=="function"}vc=wc}else vc=!1;By=vc&&(!document.documentMode||9<document.documentMode)}function im(){Ql&&(Ql.detachEvent("onpropertychange",Uy),ca=Ql=null)}function Uy(e){if(e.propertyName==="value"&&Pu(ca)){var t=[];$y(t,ca,e,Zh(e)),ky(hb,t)}}function pb(e,t,n){e==="focusin"?(im(),Ql=t,ca=n,Ql.attachEvent("onpropertychange",Uy)):e==="focusout"&&im()}function mb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pu(ca)}function gb(e,t){if(e==="click")return Pu(t)}function xb(e,t){if(e==="input"||e==="change")return Pu(t)}function yb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wn=typeof Object.is=="function"?Object.is:yb;function da(e,t){if(Wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ad.call(t,i)||!Wn(e[i],t[i]))return!1}return!0}function sm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lm(e,t){var n=sm(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sm(n)}}function qy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hy(){for(var e=window,t=Bo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bo(e.document)}return t}function uf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function vb(e){var t=Hy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qy(n.ownerDocument.documentElement,n)){if(r!==null&&uf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=lm(n,s);var l=lm(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var wb=Lr&&"documentMode"in document&&11>=document.documentMode,js=null,Cd=null,Kl=null,Ed=!1;function am(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ed||js==null||js!==Bo(r)||(r=js,"selectionStart"in r&&uf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kl&&da(Kl,r)||(Kl=r,r=Ko(Cd,"onSelect"),0<r.length&&(t=new lf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=js)))}function ao(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ns={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionend:ao("Transition","TransitionEnd")},kc={},Vy={};Lr&&(Vy=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function Tu(e){if(kc[e])return kc[e];if(!Ns[e])return e;var t=Ns[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vy)return kc[e]=t[n];return e}var Wy=Tu("animationend"),Qy=Tu("animationiteration"),Ky=Tu("animationstart"),Gy=Tu("transitionend"),Yy=new Map,om="abort auxClick 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(" ");function vi(e,t){Yy.set(e,t),os(t,[e])}for(var bc=0;bc<om.length;bc++){var jc=om[bc],kb=jc.toLowerCase(),bb=jc[0].toUpperCase()+jc.slice(1);vi(kb,"on"+bb)}vi(Wy,"onAnimationEnd");vi(Qy,"onAnimationIteration");vi(Ky,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(Gy,"onTransitionEnd");tl("onMouseEnter",["mouseout","mouseover"]);tl("onMouseLeave",["mouseout","mouseover"]);tl("onPointerEnter",["pointerout","pointerover"]);tl("onPointerLeave",["pointerout","pointerover"]);os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));os("onBeforeInput",["compositionend","keypress","textInput","paste"]);os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),jb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bl));function um(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,kk(r,t,void 0,e),e.currentTarget=null}function Xy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var l=r.length-1;0<=l;l--){var o=r[l],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==s&&i.isPropagationStopped())break e;um(i,o,c),s=u}else for(l=0;l<r.length;l++){if(o=r[l],u=o.instance,c=o.currentTarget,o=o.listener,u!==s&&i.isPropagationStopped())break e;um(i,o,c),s=u}}}if(qo)throw e=bd,qo=!1,bd=null,e}function He(e,t){var n=t[Rd];n===void 0&&(n=t[Rd]=new Set);var r=e+"__bubble";n.has(r)||(Jy(t,e,2,!1),n.add(r))}function Nc(e,t,n){var r=0;t&&(r|=4),Jy(n,e,r,t)}var oo="_reactListening"+Math.random().toString(36).slice(2);function ha(e){if(!e[oo]){e[oo]=!0,sy.forEach(function(n){n!=="selectionchange"&&(jb.has(n)||Nc(n,!1,e),Nc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oo]||(t[oo]=!0,Nc("selectionchange",!1,t))}}function Jy(e,t,n,r){switch(Iy(t)){case 1:var i=Dk;break;case 4:i=Ok;break;default:i=rf}n=i.bind(null,t,n,e),i=void 0,!kd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Sc(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;l=l.return}for(;o!==null;){if(l=Ii(o),l===null)return;if(u=l.tag,u===5||u===6){r=s=l;continue e}o=o.parentNode}}r=r.return}ky(function(){var c=s,d=Zh(n),h=[];e:{var p=Yy.get(e);if(p!==void 0){var f=lf,m=e;switch(e){case"keypress":if(Po(n)===0)break e;case"keydown":case"keyup":f=Zk;break;case"focusin":m="focus",f=yc;break;case"focusout":m="blur",f=yc;break;case"beforeblur":case"afterblur":f=yc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=Xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=nb;break;case Wy:case Qy:case Ky:f=Hk;break;case Gy:f=ib;break;case"scroll":f=_k;break;case"wheel":f=lb;break;case"copy":case"cut":case"paste":f=Wk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=Zp}var g=(t&4)!==0,w=!g&&e==="scroll",y=g?p!==null?p+"Capture":null:p;g=[];for(var x=c,v;x!==null;){v=x;var j=v.stateNode;if(v.tag===5&&j!==null&&(v=j,y!==null&&(j=la(x,y),j!=null&&g.push(fa(x,j,v)))),w)break;x=x.return}0<g.length&&(p=new f(p,m,null,n,d),h.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",p&&n!==vd&&(m=n.relatedTarget||n.fromElement)&&(Ii(m)||m[Mr]))break e;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=c,m=m?Ii(m):null,m!==null&&(w=us(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(f=null,m=c),f!==m)){if(g=Xp,j="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=Zp,j="onPointerLeave",y="onPointerEnter",x="pointer"),w=f==null?p:Ss(f),v=m==null?p:Ss(m),p=new g(j,x+"leave",f,n,d),p.target=w,p.relatedTarget=v,j=null,Ii(d)===c&&(g=new g(y,x+"enter",m,n,d),g.target=v,g.relatedTarget=w,j=g),w=j,f&&m)t:{for(g=f,y=m,x=0,v=g;v;v=gs(v))x++;for(v=0,j=y;j;j=gs(j))v++;for(;0<x-v;)g=gs(g),x--;for(;0<v-x;)y=gs(y),v--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=gs(g),y=gs(y)}g=null}else g=null;f!==null&&cm(h,p,f,g,!1),m!==null&&w!==null&&cm(h,w,m,g,!0)}}e:{if(p=c?Ss(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var E=fb;else if(nm(p))if(By)E=xb;else{E=mb;var k=pb}else(f=p.nodeName)&&f.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=gb);if(E&&(E=E(e,c))){$y(h,E,n,d);break e}k&&k(e,p,c),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&pd(p,"number",p.value)}switch(k=c?Ss(c):window,e){case"focusin":(nm(k)||k.contentEditable==="true")&&(js=k,Cd=c,Kl=null);break;case"focusout":Kl=Cd=js=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,am(h,n,d);break;case"selectionchange":if(wb)break;case"keydown":case"keyup":am(h,n,d)}var S;if(of)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else bs?Oy(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Dy&&n.locale!=="ko"&&(bs||M!=="onCompositionStart"?M==="onCompositionEnd"&&bs&&(S=Fy()):(ii=d,sf="value"in ii?ii.value:ii.textContent,bs=!0)),k=Ko(c,M),0<k.length&&(M=new Jp(M,e,null,n,d),h.push({event:M,listeners:k}),S?M.data=S:(S=_y(n),S!==null&&(M.data=S)))),(S=ob?ub(e,n):cb(e,n))&&(c=Ko(c,"onBeforeInput"),0<c.length&&(d=new Jp("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:c}),d.data=S))}Xy(h,t)})}function fa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ko(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=la(e,n),s!=null&&r.unshift(fa(e,s,i)),s=la(e,t),s!=null&&r.push(fa(e,s,i))),e=e.return}return r}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function cm(e,t,n,r,i){for(var s=t._reactName,l=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=la(n,s),u!=null&&l.unshift(fa(n,u,o))):i||(u=la(n,s),u!=null&&l.push(fa(n,u,o)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var Nb=/\r\n?/g,Sb=/\u0000|\uFFFD/g;function dm(e){return(typeof e=="string"?e:""+e).replace(Nb,`
38
- `).replace(Sb,"")}function uo(e,t,n){if(t=dm(t),dm(e)!==t&&n)throw Error(V(425))}function Go(){}var Pd=null,Td=null;function Ld(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Md=typeof setTimeout=="function"?setTimeout:void 0,Cb=typeof clearTimeout=="function"?clearTimeout:void 0,hm=typeof Promise=="function"?Promise:void 0,Eb=typeof queueMicrotask=="function"?queueMicrotask:typeof hm<"u"?function(e){return hm.resolve(null).then(e).catch(Pb)}:Md;function Pb(e){setTimeout(function(){throw e})}function Cc(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ua(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ua(t)}function ci(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var pl=Math.random().toString(36).slice(2),or="__reactFiber$"+pl,pa="__reactProps$"+pl,Mr="__reactContainer$"+pl,Rd="__reactEvents$"+pl,Tb="__reactListeners$"+pl,Lb="__reactHandles$"+pl;function Ii(e){var t=e[or];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mr]||n[or]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[or])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ia(e){return e=e[or]||e[Mr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ss(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function Lu(e){return e[pa]||null}var zd=[],Cs=-1;function wi(e){return{current:e}}function Ve(e){0>Cs||(e.current=zd[Cs],zd[Cs]=null,Cs--)}function qe(e,t){Cs++,zd[Cs]=e.current,e.current=t}var gi={},At=wi(gi),tn=wi(!1),Ji=gi;function nl(e,t){var n=e.type.contextTypes;if(!n)return gi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function nn(e){return e=e.childContextTypes,e!=null}function Yo(){Ve(tn),Ve(At)}function pm(e,t,n){if(At.current!==gi)throw Error(V(168));qe(At,t),qe(tn,n)}function Zy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(V(108,pk(e)||"Unknown",i));return Xe({},n,r)}function Xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gi,Ji=At.current,qe(At,e),qe(tn,tn.current),!0}function mm(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=Zy(e,t,Ji),r.__reactInternalMemoizedMergedChildContext=e,Ve(tn),Ve(At),qe(At,e)):Ve(tn),qe(tn,n)}var jr=null,Mu=!1,Ec=!1;function ev(e){jr===null?jr=[e]:jr.push(e)}function Mb(e){Mu=!0,ev(e)}function ki(){if(!Ec&&jr!==null){Ec=!0;var e=0,t=Fe;try{var n=jr;for(Fe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}jr=null,Mu=!1}catch(i){throw jr!==null&&(jr=jr.slice(e+1)),Sy(ef,ki),i}finally{Fe=t,Ec=!1}}return null}var Es=[],Ps=0,Jo=null,Zo=0,Sn=[],Cn=0,Zi=null,Sr=1,Cr="";function Li(e,t){Es[Ps++]=Zo,Es[Ps++]=Jo,Jo=e,Zo=t}function tv(e,t,n){Sn[Cn++]=Sr,Sn[Cn++]=Cr,Sn[Cn++]=Zi,Zi=e;var r=Sr;e=Cr;var i=32-Un(r)-1;r&=~(1<<i),n+=1;var s=32-Un(t)+i;if(30<s){var l=i-i%5;s=(r&(1<<l)-1).toString(32),r>>=l,i-=l,Sr=1<<32-Un(t)+i|n<<i|r,Cr=s+e}else Sr=1<<s|n<<i|r,Cr=e}function cf(e){e.return!==null&&(Li(e,1),tv(e,1,0))}function df(e){for(;e===Jo;)Jo=Es[--Ps],Es[Ps]=null,Zo=Es[--Ps],Es[Ps]=null;for(;e===Zi;)Zi=Sn[--Cn],Sn[Cn]=null,Cr=Sn[--Cn],Sn[Cn]=null,Sr=Sn[--Cn],Sn[Cn]=null}var pn=null,fn=null,Qe=!1,$n=null;function nv(e,t){var n=Pn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function gm(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pn=e,fn=ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pn=e,fn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:Sr,overflow:Cr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pn=e,fn=null,!0):!1;default:return!1}}function Ad(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Id(e){if(Qe){var t=fn;if(t){var n=t;if(!gm(e,t)){if(Ad(e))throw Error(V(418));t=ci(n.nextSibling);var r=pn;t&&gm(e,t)?nv(r,n):(e.flags=e.flags&-4097|2,Qe=!1,pn=e)}}else{if(Ad(e))throw Error(V(418));e.flags=e.flags&-4097|2,Qe=!1,pn=e}}}function xm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pn=e}function co(e){if(e!==pn)return!1;if(!Qe)return xm(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ld(e.type,e.memoizedProps)),t&&(t=fn)){if(Ad(e))throw rv(),Error(V(418));for(;t;)nv(e,t),t=ci(t.nextSibling)}if(xm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){fn=ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}fn=null}}else fn=pn?ci(e.stateNode.nextSibling):null;return!0}function rv(){for(var e=fn;e;)e=ci(e.nextSibling)}function rl(){fn=pn=null,Qe=!1}function hf(e){$n===null?$n=[e]:$n.push(e)}var Rb=Fr.ReactCurrentBatchConfig;function Tl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(l){var o=i.refs;l===null?delete o[s]:o[s]=l},t._stringRef=s,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function ho(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ym(e){var t=e._init;return t(e._payload)}function iv(e){function t(y,x){if(e){var v=y.deletions;v===null?(y.deletions=[x],y.flags|=16):v.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=pi(y,x),y.index=0,y.sibling=null,y}function s(y,x,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<x?(y.flags|=2,x):v):(y.flags|=2,x)):(y.flags|=1048576,x)}function l(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,x,v,j){return x===null||x.tag!==6?(x=Ac(v,y.mode,j),x.return=y,x):(x=i(x,v),x.return=y,x)}function u(y,x,v,j){var E=v.type;return E===ks?d(y,x,v.props.children,j,v.key):x!==null&&(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Hr&&ym(E)===x.type)?(j=i(x,v.props),j.ref=Tl(y,x,v),j.return=y,j):(j=Io(v.type,v.key,v.props,null,y.mode,j),j.ref=Tl(y,x,v),j.return=y,j)}function c(y,x,v,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=Ic(v,y.mode,j),x.return=y,x):(x=i(x,v.children||[]),x.return=y,x)}function d(y,x,v,j,E){return x===null||x.tag!==7?(x=Ki(v,y.mode,j,E),x.return=y,x):(x=i(x,v),x.return=y,x)}function h(y,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Ac(""+x,y.mode,v),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case eo:return v=Io(x.type,x.key,x.props,null,y.mode,v),v.ref=Tl(y,null,x),v.return=y,v;case ws:return x=Ic(x,y.mode,v),x.return=y,x;case Hr:var j=x._init;return h(y,j(x._payload),v)}if(_l(x)||Nl(x))return x=Ki(x,y.mode,v,null),x.return=y,x;ho(y,x)}return null}function p(y,x,v,j){var E=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:o(y,x,""+v,j);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case eo:return v.key===E?u(y,x,v,j):null;case ws:return v.key===E?c(y,x,v,j):null;case Hr:return E=v._init,p(y,x,E(v._payload),j)}if(_l(v)||Nl(v))return E!==null?null:d(y,x,v,j,null);ho(y,v)}return null}function f(y,x,v,j,E){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(v)||null,o(x,y,""+j,E);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case eo:return y=y.get(j.key===null?v:j.key)||null,u(x,y,j,E);case ws:return y=y.get(j.key===null?v:j.key)||null,c(x,y,j,E);case Hr:var k=j._init;return f(y,x,v,k(j._payload),E)}if(_l(j)||Nl(j))return y=y.get(v)||null,d(x,y,j,E,null);ho(x,j)}return null}function m(y,x,v,j){for(var E=null,k=null,S=x,M=x=0,F=null;S!==null&&M<v.length;M++){S.index>M?(F=S,S=null):F=S.sibling;var C=p(y,S,v[M],j);if(C===null){S===null&&(S=F);break}e&&S&&C.alternate===null&&t(y,S),x=s(C,x,M),k===null?E=C:k.sibling=C,k=C,S=F}if(M===v.length)return n(y,S),Qe&&Li(y,M),E;if(S===null){for(;M<v.length;M++)S=h(y,v[M],j),S!==null&&(x=s(S,x,M),k===null?E=S:k.sibling=S,k=S);return Qe&&Li(y,M),E}for(S=r(y,S);M<v.length;M++)F=f(S,y,M,v[M],j),F!==null&&(e&&F.alternate!==null&&S.delete(F.key===null?M:F.key),x=s(F,x,M),k===null?E=F:k.sibling=F,k=F);return e&&S.forEach(function(O){return t(y,O)}),Qe&&Li(y,M),E}function g(y,x,v,j){var E=Nl(v);if(typeof E!="function")throw Error(V(150));if(v=E.call(v),v==null)throw Error(V(151));for(var k=E=null,S=x,M=x=0,F=null,C=v.next();S!==null&&!C.done;M++,C=v.next()){S.index>M?(F=S,S=null):F=S.sibling;var O=p(y,S,C.value,j);if(O===null){S===null&&(S=F);break}e&&S&&O.alternate===null&&t(y,S),x=s(O,x,M),k===null?E=O:k.sibling=O,k=O,S=F}if(C.done)return n(y,S),Qe&&Li(y,M),E;if(S===null){for(;!C.done;M++,C=v.next())C=h(y,C.value,j),C!==null&&(x=s(C,x,M),k===null?E=C:k.sibling=C,k=C);return Qe&&Li(y,M),E}for(S=r(y,S);!C.done;M++,C=v.next())C=f(S,y,M,C.value,j),C!==null&&(e&&C.alternate!==null&&S.delete(C.key===null?M:C.key),x=s(C,x,M),k===null?E=C:k.sibling=C,k=C);return e&&S.forEach(function(I){return t(y,I)}),Qe&&Li(y,M),E}function w(y,x,v,j){if(typeof v=="object"&&v!==null&&v.type===ks&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case eo:e:{for(var E=v.key,k=x;k!==null;){if(k.key===E){if(E=v.type,E===ks){if(k.tag===7){n(y,k.sibling),x=i(k,v.props.children),x.return=y,y=x;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Hr&&ym(E)===k.type){n(y,k.sibling),x=i(k,v.props),x.ref=Tl(y,k,v),x.return=y,y=x;break e}n(y,k);break}else t(y,k);k=k.sibling}v.type===ks?(x=Ki(v.props.children,y.mode,j,v.key),x.return=y,y=x):(j=Io(v.type,v.key,v.props,null,y.mode,j),j.ref=Tl(y,x,v),j.return=y,y=j)}return l(y);case ws:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(y,x.sibling),x=i(x,v.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=Ic(v,y.mode,j),x.return=y,y=x}return l(y);case Hr:return k=v._init,w(y,x,k(v._payload),j)}if(_l(v))return m(y,x,v,j);if(Nl(v))return g(y,x,v,j);ho(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(y,x.sibling),x=i(x,v),x.return=y,y=x):(n(y,x),x=Ac(v,y.mode,j),x.return=y,y=x),l(y)):n(y,x)}return w}var il=iv(!0),sv=iv(!1),eu=wi(null),tu=null,Ts=null,ff=null;function pf(){ff=Ts=tu=null}function mf(e){var t=eu.current;Ve(eu),e._currentValue=t}function Fd(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fs(e,t){tu=e,ff=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(en=!0),e.firstContext=null)}function Ln(e){var t=e._currentValue;if(ff!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(tu===null)throw Error(V(308));Ts=e,tu.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var Fi=null;function gf(e){Fi===null?Fi=[e]:Fi.push(e)}function lv(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,gf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Rr(e,r)}function Rr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vr=!1;function xf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function av(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Er(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function di(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Rr(e,n)}return i=r.interleaved,i===null?(t.next=t,gf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Rr(e,n)}function To(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tf(e,n)}}function vm(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=l:s=s.next=l,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nu(e,t,n,r){var i=e.updateQueue;Vr=!1;var s=i.firstBaseUpdate,l=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,l===null?s=c:l.next=c,l=u;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==l&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=u))}if(s!==null){var h=i.baseState;l=0,d=c=u=null,o=s;do{var p=o.lane,f=o.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,g=o;switch(p=t,f=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){h=m.call(f,h,p);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,p=typeof m=="function"?m.call(f,h,p):m,p==null)break e;h=Xe({},h,p);break e;case 2:Vr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[o]:p.push(o))}else f={eventTime:f,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=f,u=h):d=d.next=f,l|=p;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ts|=l,e.lanes=l,e.memoizedState=h}}function wm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(V(191,i));i.call(r)}}}var Fa={},dr=wi(Fa),ma=wi(Fa),ga=wi(Fa);function Di(e){if(e===Fa)throw Error(V(174));return e}function yf(e,t){switch(qe(ga,t),qe(ma,e),qe(dr,Fa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gd(t,e)}Ve(dr),qe(dr,t)}function sl(){Ve(dr),Ve(ma),Ve(ga)}function ov(e){Di(ga.current);var t=Di(dr.current),n=gd(t,e.type);t!==n&&(qe(ma,e),qe(dr,n))}function vf(e){ma.current===e&&(Ve(dr),Ve(ma))}var Ge=wi(0);function ru(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pc=[];function wf(){for(var e=0;e<Pc.length;e++)Pc[e]._workInProgressVersionPrimary=null;Pc.length=0}var Lo=Fr.ReactCurrentDispatcher,Tc=Fr.ReactCurrentBatchConfig,es=0,Ye=null,pt=null,yt=null,iu=!1,Gl=!1,xa=0,zb=0;function Lt(){throw Error(V(321))}function kf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wn(e[n],t[n]))return!1;return!0}function bf(e,t,n,r,i,s){if(es=s,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Lo.current=e===null||e.memoizedState===null?Db:Ob,e=n(r,i),Gl){s=0;do{if(Gl=!1,xa=0,25<=s)throw Error(V(301));s+=1,yt=pt=null,t.updateQueue=null,Lo.current=_b,e=n(r,i)}while(Gl)}if(Lo.current=su,t=pt!==null&&pt.next!==null,es=0,yt=pt=Ye=null,iu=!1,t)throw Error(V(300));return e}function jf(){var e=xa!==0;return xa=0,e}function nr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Ye.memoizedState=yt=e:yt=yt.next=e,yt}function Mn(){if(pt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=yt===null?Ye.memoizedState:yt.next;if(t!==null)yt=t,pt=e;else{if(e===null)throw Error(V(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},yt===null?Ye.memoizedState=yt=e:yt=yt.next=e}return yt}function ya(e,t){return typeof t=="function"?t(e):t}function Lc(e){var t=Mn(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=pt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var l=i.next;i.next=s.next,s.next=l}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=l=null,u=null,c=s;do{var d=c.lane;if((es&d)===d)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=h,l=r):u=u.next=h,Ye.lanes|=d,ts|=d}c=c.next}while(c!==null&&c!==s);u===null?l=r:u.next=o,Wn(r,t.memoizedState)||(en=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ye.lanes|=s,ts|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mc(e){var t=Mn(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do s=e(s,l.action),l=l.next;while(l!==i);Wn(s,t.memoizedState)||(en=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function uv(){}function cv(e,t){var n=Ye,r=Mn(),i=t(),s=!Wn(r.memoizedState,i);if(s&&(r.memoizedState=i,en=!0),r=r.queue,Nf(fv.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||yt!==null&&yt.memoizedState.tag&1){if(n.flags|=2048,va(9,hv.bind(null,n,r,i,t),void 0,null),vt===null)throw Error(V(349));es&30||dv(n,t,i)}return i}function dv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hv(e,t,n,r){t.value=n,t.getSnapshot=r,pv(t)&&mv(e)}function fv(e,t,n){return n(function(){pv(t)&&mv(e)})}function pv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wn(e,n)}catch{return!0}}function mv(e){var t=Rr(e,1);t!==null&&qn(t,e,1,-1)}function km(e){var t=nr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t.queue=e,e=e.dispatch=Fb.bind(null,Ye,e),[t.memoizedState,e]}function va(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function gv(){return Mn().memoizedState}function Mo(e,t,n,r){var i=nr();Ye.flags|=e,i.memoizedState=va(1|t,n,void 0,r===void 0?null:r)}function Ru(e,t,n,r){var i=Mn();r=r===void 0?null:r;var s=void 0;if(pt!==null){var l=pt.memoizedState;if(s=l.destroy,r!==null&&kf(r,l.deps)){i.memoizedState=va(t,n,s,r);return}}Ye.flags|=e,i.memoizedState=va(1|t,n,s,r)}function bm(e,t){return Mo(8390656,8,e,t)}function Nf(e,t){return Ru(2048,8,e,t)}function xv(e,t){return Ru(4,2,e,t)}function yv(e,t){return Ru(4,4,e,t)}function vv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wv(e,t,n){return n=n!=null?n.concat([e]):null,Ru(4,4,vv.bind(null,t,e),n)}function Sf(){}function kv(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bv(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function jv(e,t,n){return es&21?(Wn(n,t)||(n=Py(),Ye.lanes|=n,ts|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,en=!0),e.memoizedState=n)}function Ab(e,t){var n=Fe;Fe=n!==0&&4>n?n:4,e(!0);var r=Tc.transition;Tc.transition={};try{e(!1),t()}finally{Fe=n,Tc.transition=r}}function Nv(){return Mn().memoizedState}function Ib(e,t,n){var r=fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sv(e))Cv(t,n);else if(n=lv(e,t,n,r),n!==null){var i=Ht();qn(n,e,r,i),Ev(n,t,r)}}function Fb(e,t,n){var r=fi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sv(e))Cv(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var l=t.lastRenderedState,o=s(l,n);if(i.hasEagerState=!0,i.eagerState=o,Wn(o,l)){var u=t.interleaved;u===null?(i.next=i,gf(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=lv(e,t,i,r),n!==null&&(i=Ht(),qn(n,e,r,i),Ev(n,t,r))}}function Sv(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function Cv(e,t){Gl=iu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ev(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tf(e,n)}}var su={readContext:Ln,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},Db={readContext:Ln,useCallback:function(e,t){return nr().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:bm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Mo(4194308,4,vv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Mo(4,2,e,t)},useMemo:function(e,t){var n=nr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ib.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=nr();return e={current:e},t.memoizedState=e},useState:km,useDebugValue:Sf,useDeferredValue:function(e){return nr().memoizedState=e},useTransition:function(){var e=km(!1),t=e[0];return e=Ab.bind(null,e[1]),nr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,i=nr();if(Qe){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),vt===null)throw Error(V(349));es&30||dv(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,bm(fv.bind(null,r,s,e),[e]),r.flags|=2048,va(9,hv.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=nr(),t=vt.identifierPrefix;if(Qe){var n=Cr,r=Sr;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=zb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ob={readContext:Ln,useCallback:kv,useContext:Ln,useEffect:Nf,useImperativeHandle:wv,useInsertionEffect:xv,useLayoutEffect:yv,useMemo:bv,useReducer:Lc,useRef:gv,useState:function(){return Lc(ya)},useDebugValue:Sf,useDeferredValue:function(e){var t=Mn();return jv(t,pt.memoizedState,e)},useTransition:function(){var e=Lc(ya)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:uv,useSyncExternalStore:cv,useId:Nv,unstable_isNewReconciler:!1},_b={readContext:Ln,useCallback:kv,useContext:Ln,useEffect:Nf,useImperativeHandle:wv,useInsertionEffect:xv,useLayoutEffect:yv,useMemo:bv,useReducer:Mc,useRef:gv,useState:function(){return Mc(ya)},useDebugValue:Sf,useDeferredValue:function(e){var t=Mn();return pt===null?t.memoizedState=e:jv(t,pt.memoizedState,e)},useTransition:function(){var e=Mc(ya)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:uv,useSyncExternalStore:cv,useId:Nv,unstable_isNewReconciler:!1};function Fn(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Dd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zu={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ht(),i=fi(e),s=Er(r,i);s.payload=t,n!=null&&(s.callback=n),t=di(e,s,i),t!==null&&(qn(t,e,i,r),To(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ht(),i=fi(e),s=Er(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=di(e,s,i),t!==null&&(qn(t,e,i,r),To(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ht(),r=fi(e),i=Er(n,r);i.tag=2,t!=null&&(i.callback=t),t=di(e,i,r),t!==null&&(qn(t,e,r,n),To(t,e,r))}};function jm(e,t,n,r,i,s,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,l):t.prototype&&t.prototype.isPureReactComponent?!da(n,r)||!da(i,s):!0}function Pv(e,t,n){var r=!1,i=gi,s=t.contextType;return typeof s=="object"&&s!==null?s=Ln(s):(i=nn(t)?Ji:At.current,r=t.contextTypes,s=(r=r!=null)?nl(e,i):gi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Nm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function Od(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},xf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Ln(s):(s=nn(t)?Ji:At.current,i.context=nl(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Dd(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&zu.enqueueReplaceState(i,i.state,null),nu(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ll(e,t){try{var n="",r=t;do n+=fk(r),r=r.return;while(r);var i=n}catch(s){i=`
39
- Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _d(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $b=typeof WeakMap=="function"?WeakMap:Map;function Tv(e,t,n){n=Er(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){au||(au=!0,Gd=r),_d(e,t)},n}function Lv(e,t,n){n=Er(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){_d(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){_d(e,t),typeof r!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Sm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $b;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=ej.bind(null,e,t,n),t.then(e,e))}function Cm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Em(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Er(-1,1),t.tag=2,di(n,t,1))),n.lanes|=1),e)}var Bb=Fr.ReactCurrentOwner,en=!1;function Ut(e,t,n,r){t.child=e===null?sv(t,null,n,r):il(t,e.child,n,r)}function Pm(e,t,n,r,i){n=n.render;var s=t.ref;return Fs(t,i),r=bf(e,t,n,r,s,i),n=jf(),e!==null&&!en?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zr(e,t,i)):(Qe&&n&&cf(t),t.flags|=1,Ut(e,t,r,i),t.child)}function Tm(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!zf(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Mv(e,t,s,r,i)):(e=Io(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var l=s.memoizedProps;if(n=n.compare,n=n!==null?n:da,n(l,r)&&e.ref===t.ref)return zr(e,t,i)}return t.flags|=1,e=pi(s,r),e.ref=t.ref,e.return=t,t.child=e}function Mv(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(da(s,r)&&e.ref===t.ref)if(en=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(en=!0);else return t.lanes=e.lanes,zr(e,t,i)}return $d(e,t,n,r,i)}function Rv(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(Ms,dn),dn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qe(Ms,dn),dn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,qe(Ms,dn),dn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,qe(Ms,dn),dn|=r;return Ut(e,t,i,n),t.child}function zv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $d(e,t,n,r,i){var s=nn(n)?Ji:At.current;return s=nl(t,s),Fs(t,i),n=bf(e,t,n,r,s,i),r=jf(),e!==null&&!en?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zr(e,t,i)):(Qe&&r&&cf(t),t.flags|=1,Ut(e,t,n,i),t.child)}function Lm(e,t,n,r,i){if(nn(n)){var s=!0;Xo(t)}else s=!1;if(Fs(t,i),t.stateNode===null)Ro(e,t),Pv(t,n,r),Od(t,n,r,i),r=!0;else if(e===null){var l=t.stateNode,o=t.memoizedProps;l.props=o;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ln(c):(c=nn(n)?Ji:At.current,c=nl(t,c));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Nm(t,l,r,c),Vr=!1;var p=t.memoizedState;l.state=p,nu(t,r,l,i),u=t.memoizedState,o!==r||p!==u||tn.current||Vr?(typeof d=="function"&&(Dd(t,n,d,r),u=t.memoizedState),(o=Vr||jm(t,n,o,r,p,u,c))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=c,r=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,av(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:Fn(t.type,o),l.props=c,h=t.pendingProps,p=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ln(u):(u=nn(n)?Ji:At.current,u=nl(t,u));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==h||p!==u)&&Nm(t,l,r,u),Vr=!1,p=t.memoizedState,l.state=p,nu(t,r,l,i);var m=t.memoizedState;o!==h||p!==m||tn.current||Vr?(typeof f=="function"&&(Dd(t,n,f,r),m=t.memoizedState),(c=Vr||jm(t,n,c,r,p,m,u)||!1)?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,m,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,m,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),l.props=r,l.state=m,l.context=u,r=c):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Bd(e,t,n,r,s,i)}function Bd(e,t,n,r,i,s){zv(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return i&&mm(t,n,!1),zr(e,t,s);r=t.stateNode,Bb.current=t;var o=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=il(t,e.child,null,s),t.child=il(t,null,o,s)):Ut(e,t,o,s),t.memoizedState=r.state,i&&mm(t,n,!0),t.child}function Av(e){var t=e.stateNode;t.pendingContext?pm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pm(e,t.context,!1),yf(e,t.containerInfo)}function Mm(e,t,n,r,i){return rl(),hf(i),t.flags|=256,Ut(e,t,n,r),t.child}var Ud={dehydrated:null,treeContext:null,retryLane:0};function qd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Iv(e,t,n){var r=t.pendingProps,i=Ge.current,s=!1,l=(t.flags&128)!==0,o;if((o=l)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),qe(Ge,i&1),e===null)return Id(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,s?(r=t.mode,s=t.child,l={mode:"hidden",children:l},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=l):s=Fu(l,r,0,null),e=Ki(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=qd(n),t.memoizedState=Ud,e):Cf(t,l));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Ub(e,t,l,r,o,i,n);if(s){s=r.fallback,l=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=pi(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=pi(o,s):(s=Ki(s,l,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,l=e.child.memoizedState,l=l===null?qd(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Ud,r}return s=e.child,e=s.sibling,r=pi(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Cf(e,t){return t=Fu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fo(e,t,n,r){return r!==null&&hf(r),il(t,e.child,null,n),e=Cf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ub(e,t,n,r,i,s,l){if(n)return t.flags&256?(t.flags&=-257,r=Rc(Error(V(422))),fo(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Fu({mode:"visible",children:r.children},i,0,null),s=Ki(s,i,l,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&il(t,e.child,null,l),t.child.memoizedState=qd(l),t.memoizedState=Ud,s);if(!(t.mode&1))return fo(e,t,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(V(419)),r=Rc(s,r,void 0),fo(e,t,l,r)}if(o=(l&e.childLanes)!==0,en||o){if(r=vt,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Rr(e,i),qn(r,e,i,-1))}return Rf(),r=Rc(Error(V(421))),fo(e,t,l,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=tj.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,fn=ci(i.nextSibling),pn=t,Qe=!0,$n=null,e!==null&&(Sn[Cn++]=Sr,Sn[Cn++]=Cr,Sn[Cn++]=Zi,Sr=e.id,Cr=e.overflow,Zi=t),t=Cf(t,r.children),t.flags|=4096,t)}function Rm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fd(e.return,t,n)}function zc(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Fv(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ut(e,t,r.children,n),r=Ge.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rm(e,n,t);else if(e.tag===19)Rm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(qe(Ge,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ru(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),zc(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ru(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}zc(t,!0,n,null,s);break;case"together":zc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ro(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ts|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function qb(e,t,n){switch(t.tag){case 3:Av(t),rl();break;case 5:ov(t);break;case 1:nn(t.type)&&Xo(t);break;case 4:yf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;qe(eu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(qe(Ge,Ge.current&1),t.flags|=128,null):n&t.child.childLanes?Iv(e,t,n):(qe(Ge,Ge.current&1),e=zr(e,t,n),e!==null?e.sibling:null);qe(Ge,Ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Fv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qe(Ge,Ge.current),r)break;return null;case 22:case 23:return t.lanes=0,Rv(e,t,n)}return zr(e,t,n)}var Dv,Hd,Ov,_v;Dv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Hd=function(){};Ov=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Di(dr.current);var s=null;switch(n){case"input":i=hd(e,i),r=hd(e,r),s=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),s=[];break;case"textarea":i=md(e,i),r=md(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Go)}xd(n,r);var l;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(l in o)o.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ia.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(l in o)!o.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&o[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ia.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&He("scroll",e),s||o===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};_v=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ll(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hb(e,t,n){var r=t.pendingProps;switch(df(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return nn(t.type)&&Yo(),Mt(t),null;case 3:return r=t.stateNode,sl(),Ve(tn),Ve(At),wf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(co(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$n!==null&&(Jd($n),$n=null))),Hd(e,t),Mt(t),null;case 5:vf(t);var i=Di(ga.current);if(n=t.type,e!==null&&t.stateNode!=null)Ov(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return Mt(t),null}if(e=Di(dr.current),co(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[or]=t,r[pa]=s,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<Bl.length;i++)He(Bl[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":Bp(r,s),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},He("invalid",r);break;case"textarea":qp(r,s),He("invalid",r)}xd(n,s),i=null;for(var l in s)if(s.hasOwnProperty(l)){var o=s[l];l==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&uo(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&uo(r.textContent,o,e),i=["children",""+o]):ia.hasOwnProperty(l)&&o!=null&&l==="onScroll"&&He("scroll",r)}switch(n){case"input":to(r),Up(r,s,!0);break;case"textarea":to(r),Hp(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Go)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=fy(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[or]=t,e[pa]=r,Dv(e,t,!1,!1),t.stateNode=e;e:{switch(l=yd(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<Bl.length;i++)He(Bl[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":Bp(e,r),i=hd(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),He("invalid",e);break;case"textarea":qp(e,r),i=md(e,r),He("invalid",e);break;default:i=r}xd(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var u=o[s];s==="style"?gy(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&py(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&sa(e,u):typeof u=="number"&&sa(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ia.hasOwnProperty(s)?u!=null&&s==="onScroll"&&He("scroll",e):u!=null&&Gh(e,s,u,l))}switch(n){case"input":to(e),Up(e,r,!1);break;case"textarea":to(e),Hp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+mi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Rs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Rs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Go)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Mt(t),null;case 6:if(e&&t.stateNode!=null)_v(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Di(ga.current),Di(dr.current),co(t)){if(r=t.stateNode,n=t.memoizedProps,r[or]=t,(s=r.nodeValue!==n)&&(e=pn,e!==null))switch(e.tag){case 3:uo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uo(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[or]=t,t.stateNode=r}return Mt(t),null;case 13:if(Ve(Ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&fn!==null&&t.mode&1&&!(t.flags&128))rv(),rl(),t.flags|=98560,s=!1;else if(s=co(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(V(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(V(317));s[or]=t}else rl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mt(t),s=!1}else $n!==null&&(Jd($n),$n=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ge.current&1?mt===0&&(mt=3):Rf())),t.updateQueue!==null&&(t.flags|=4),Mt(t),null);case 4:return sl(),Hd(e,t),e===null&&ha(t.stateNode.containerInfo),Mt(t),null;case 10:return mf(t.type._context),Mt(t),null;case 17:return nn(t.type)&&Yo(),Mt(t),null;case 19:if(Ve(Ge),s=t.memoizedState,s===null)return Mt(t),null;if(r=(t.flags&128)!==0,l=s.rendering,l===null)if(r)Ll(s,!1);else{if(mt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=ru(e),l!==null){for(t.flags|=128,Ll(s,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,l=s.alternate,l===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return qe(Ge,Ge.current&1|2),t.child}e=e.sibling}s.tail!==null&&st()>al&&(t.flags|=128,r=!0,Ll(s,!1),t.lanes=4194304)}else{if(!r)if(e=ru(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ll(s,!0),s.tail===null&&s.tailMode==="hidden"&&!l.alternate&&!Qe)return Mt(t),null}else 2*st()-s.renderingStartTime>al&&n!==1073741824&&(t.flags|=128,r=!0,Ll(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(n=s.last,n!==null?n.sibling=l:t.child=l,s.last=l)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=st(),t.sibling=null,n=Ge.current,qe(Ge,r?n&1|2:n&1),t):(Mt(t),null);case 22:case 23:return Mf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?dn&1073741824&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function Vb(e,t){switch(df(t),t.tag){case 1:return nn(t.type)&&Yo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sl(),Ve(tn),Ve(At),wf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vf(t),null;case 13:if(Ve(Ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ge),null;case 4:return sl(),null;case 10:return mf(t.type._context),null;case 22:case 23:return Mf(),null;case 24:return null;default:return null}}var po=!1,zt=!1,Wb=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Ls(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function Vd(e,t,n){try{n()}catch(r){nt(e,t,r)}}var zm=!1;function Qb(e,t){if(Pd=Wo,e=Hy(),uf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var l=0,o=-1,u=-1,c=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||i!==0&&h.nodeType!==3||(o=l+i),h!==s||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(f=h.firstChild)!==null;)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++c===i&&(o=l),p===s&&++d===r&&(u=l),(f=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=f}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Td={focusedElem:e,selectionRange:n},Wo=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Fn(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(j){nt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return m=zm,zm=!1,m}function Yl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Vd(t,n,s)}i=i.next}while(i!==r)}}function Au(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $v(e){var t=e.alternate;t!==null&&(e.alternate=null,$v(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[or],delete t[pa],delete t[Rd],delete t[Tb],delete t[Lb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bv(e){return e.tag===5||e.tag===3||e.tag===4}function Am(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Go));else if(r!==4&&(e=e.child,e!==null))for(Qd(e,t,n),e=e.sibling;e!==null;)Qd(e,t,n),e=e.sibling}function Kd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Kd(e,t,n),e=e.sibling;e!==null;)Kd(e,t,n),e=e.sibling}var Nt=null,On=!1;function $r(e,t,n){for(n=n.child;n!==null;)Uv(e,t,n),n=n.sibling}function Uv(e,t,n){if(cr&&typeof cr.onCommitFiberUnmount=="function")try{cr.onCommitFiberUnmount(Cu,n)}catch{}switch(n.tag){case 5:zt||Ls(n,t);case 6:var r=Nt,i=On;Nt=null,$r(e,t,n),Nt=r,On=i,Nt!==null&&(On?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(On?(e=Nt,n=n.stateNode,e.nodeType===8?Cc(e.parentNode,n):e.nodeType===1&&Cc(e,n),ua(e)):Cc(Nt,n.stateNode));break;case 4:r=Nt,i=On,Nt=n.stateNode.containerInfo,On=!0,$r(e,t,n),Nt=r,On=i;break;case 0:case 11:case 14:case 15:if(!zt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,l=s.destroy;s=s.tag,l!==void 0&&(s&2||s&4)&&Vd(n,t,l),i=i.next}while(i!==r)}$r(e,t,n);break;case 1:if(!zt&&(Ls(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){nt(n,t,o)}$r(e,t,n);break;case 21:$r(e,t,n);break;case 22:n.mode&1?(zt=(r=zt)||n.memoizedState!==null,$r(e,t,n),zt=r):$r(e,t,n);break;default:$r(e,t,n)}}function Im(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Wb),t.forEach(function(r){var i=nj.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function In(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,l=t,o=l;e:for(;o!==null;){switch(o.tag){case 5:Nt=o.stateNode,On=!1;break e;case 3:Nt=o.stateNode.containerInfo,On=!0;break e;case 4:Nt=o.stateNode.containerInfo,On=!0;break e}o=o.return}if(Nt===null)throw Error(V(160));Uv(s,l,i),Nt=null,On=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){nt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qv(t,e),t=t.sibling}function qv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(In(t,e),tr(e),r&4){try{Yl(3,e,e.return),Au(3,e)}catch(g){nt(e,e.return,g)}try{Yl(5,e,e.return)}catch(g){nt(e,e.return,g)}}break;case 1:In(t,e),tr(e),r&512&&n!==null&&Ls(n,n.return);break;case 5:if(In(t,e),tr(e),r&512&&n!==null&&Ls(n,n.return),e.flags&32){var i=e.stateNode;try{sa(i,"")}catch(g){nt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,l=n!==null?n.memoizedProps:s,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&dy(i,s),yd(o,l);var c=yd(o,s);for(l=0;l<u.length;l+=2){var d=u[l],h=u[l+1];d==="style"?gy(i,h):d==="dangerouslySetInnerHTML"?py(i,h):d==="children"?sa(i,h):Gh(i,d,h,c)}switch(o){case"input":fd(i,s);break;case"textarea":hy(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?Rs(i,!!s.multiple,f,!1):p!==!!s.multiple&&(s.defaultValue!=null?Rs(i,!!s.multiple,s.defaultValue,!0):Rs(i,!!s.multiple,s.multiple?[]:"",!1))}i[pa]=s}catch(g){nt(e,e.return,g)}}break;case 6:if(In(t,e),tr(e),r&4){if(e.stateNode===null)throw Error(V(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){nt(e,e.return,g)}}break;case 3:if(In(t,e),tr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ua(t.containerInfo)}catch(g){nt(e,e.return,g)}break;case 4:In(t,e),tr(e);break;case 13:In(t,e),tr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Tf=st())),r&4&&Im(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(zt=(c=zt)||d,In(t,e),zt=c):In(t,e),tr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ee=e,d=e.child;d!==null;){for(h=ee=d;ee!==null;){switch(p=ee,f=p.child,p.tag){case 0:case 11:case 14:case 15:Yl(4,p,p.return);break;case 1:Ls(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){nt(r,n,g)}}break;case 5:Ls(p,p.return);break;case 22:if(p.memoizedState!==null){Dm(h);continue}}f!==null?(f.return=p,ee=f):Dm(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=h.stateNode,u=h.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=my("display",l))}catch(g){nt(e,e.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(g){nt(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:In(t,e),tr(e),r&4&&Im(e);break;case 21:break;default:In(t,e),tr(e)}}function tr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Bv(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(sa(i,""),r.flags&=-33);var s=Am(e);Kd(e,s,i);break;case 3:case 4:var l=r.stateNode.containerInfo,o=Am(e);Qd(e,o,l);break;default:throw Error(V(161))}}catch(u){nt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kb(e,t,n){ee=e,Hv(e)}function Hv(e,t,n){for(var r=(e.mode&1)!==0;ee!==null;){var i=ee,s=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||po;if(!l){var o=i.alternate,u=o!==null&&o.memoizedState!==null||zt;o=po;var c=zt;if(po=l,(zt=u)&&!c)for(ee=i;ee!==null;)l=ee,u=l.child,l.tag===22&&l.memoizedState!==null?Om(i):u!==null?(u.return=l,ee=u):Om(i);for(;s!==null;)ee=s,Hv(s),s=s.sibling;ee=i,po=o,zt=c}Fm(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ee=s):Fm(e)}}function Fm(e){for(;ee!==null;){var t=ee;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:zt||Au(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!zt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Fn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&wm(t,s,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}wm(t,l,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ua(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}zt||t.flags&512&&Wd(t)}catch(p){nt(t,t.return,p)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function Dm(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ee=n;break}ee=t.return}}function Om(e){for(;ee!==null;){var t=ee;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Au(4,t)}catch(u){nt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){nt(t,i,u)}}var s=t.return;try{Wd(t)}catch(u){nt(t,s,u)}break;case 5:var l=t.return;try{Wd(t)}catch(u){nt(t,l,u)}}}catch(u){nt(t,t.return,u)}if(t===e){ee=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ee=o;break}ee=t.return}}var Gb=Math.ceil,lu=Fr.ReactCurrentDispatcher,Ef=Fr.ReactCurrentOwner,Tn=Fr.ReactCurrentBatchConfig,Me=0,vt=null,dt=null,Et=0,dn=0,Ms=wi(0),mt=0,wa=null,ts=0,Iu=0,Pf=0,Xl=null,Zt=null,Tf=0,al=1/0,br=null,au=!1,Gd=null,hi=null,mo=!1,si=null,ou=0,Jl=0,Yd=null,zo=-1,Ao=0;function Ht(){return Me&6?st():zo!==-1?zo:zo=st()}function fi(e){return e.mode&1?Me&2&&Et!==0?Et&-Et:Rb.transition!==null?(Ao===0&&(Ao=Py()),Ao):(e=Fe,e!==0||(e=window.event,e=e===void 0?16:Iy(e.type)),e):1}function qn(e,t,n,r){if(50<Jl)throw Jl=0,Yd=null,Error(V(185));za(e,n,r),(!(Me&2)||e!==vt)&&(e===vt&&(!(Me&2)&&(Iu|=n),mt===4&&Qr(e,Et)),rn(e,r),n===1&&Me===0&&!(t.mode&1)&&(al=st()+500,Mu&&ki()))}function rn(e,t){var n=e.callbackNode;Rk(e,t);var r=Vo(e,e===vt?Et:0);if(r===0)n!==null&&Qp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qp(n),t===1)e.tag===0?Mb(_m.bind(null,e)):ev(_m.bind(null,e)),Eb(function(){!(Me&6)&&ki()}),n=null;else{switch(Ty(r)){case 1:n=ef;break;case 4:n=Cy;break;case 16:n=Ho;break;case 536870912:n=Ey;break;default:n=Ho}n=Jv(n,Vv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Vv(e,t){if(zo=-1,Ao=0,Me&6)throw Error(V(327));var n=e.callbackNode;if(Ds()&&e.callbackNode!==n)return null;var r=Vo(e,e===vt?Et:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=uu(e,r);else{t=r;var i=Me;Me|=2;var s=Qv();(vt!==e||Et!==t)&&(br=null,al=st()+500,Qi(e,t));do try{Jb();break}catch(o){Wv(e,o)}while(!0);pf(),lu.current=s,Me=i,dt!==null?t=0:(vt=null,Et=0,t=mt)}if(t!==0){if(t===2&&(i=jd(e),i!==0&&(r=i,t=Xd(e,i))),t===1)throw n=wa,Qi(e,0),Qr(e,r),rn(e,st()),n;if(t===6)Qr(e,r);else{if(i=e.current.alternate,!(r&30)&&!Yb(i)&&(t=uu(e,r),t===2&&(s=jd(e),s!==0&&(r=s,t=Xd(e,s))),t===1))throw n=wa,Qi(e,0),Qr(e,r),rn(e,st()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:Mi(e,Zt,br);break;case 3:if(Qr(e,r),(r&130023424)===r&&(t=Tf+500-st(),10<t)){if(Vo(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ht(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Md(Mi.bind(null,e,Zt,br),t);break}Mi(e,Zt,br);break;case 4:if(Qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var l=31-Un(r);s=1<<l,l=t[l],l>i&&(i=l),r&=~s}if(r=i,r=st()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Gb(r/1960))-r,10<r){e.timeoutHandle=Md(Mi.bind(null,e,Zt,br),r);break}Mi(e,Zt,br);break;case 5:Mi(e,Zt,br);break;default:throw Error(V(329))}}}return rn(e,st()),e.callbackNode===n?Vv.bind(null,e):null}function Xd(e,t){var n=Xl;return e.current.memoizedState.isDehydrated&&(Qi(e,t).flags|=256),e=uu(e,t),e!==2&&(t=Zt,Zt=n,t!==null&&Jd(t)),e}function Jd(e){Zt===null?Zt=e:Zt.push.apply(Zt,e)}function Yb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Wn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qr(e,t){for(t&=~Pf,t&=~Iu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Un(t),r=1<<n;e[n]=-1,t&=~r}}function _m(e){if(Me&6)throw Error(V(327));Ds();var t=Vo(e,0);if(!(t&1))return rn(e,st()),null;var n=uu(e,t);if(e.tag!==0&&n===2){var r=jd(e);r!==0&&(t=r,n=Xd(e,r))}if(n===1)throw n=wa,Qi(e,0),Qr(e,t),rn(e,st()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Mi(e,Zt,br),rn(e,st()),null}function Lf(e,t){var n=Me;Me|=1;try{return e(t)}finally{Me=n,Me===0&&(al=st()+500,Mu&&ki())}}function ns(e){si!==null&&si.tag===0&&!(Me&6)&&Ds();var t=Me;Me|=1;var n=Tn.transition,r=Fe;try{if(Tn.transition=null,Fe=1,e)return e()}finally{Fe=r,Tn.transition=n,Me=t,!(Me&6)&&ki()}}function Mf(){dn=Ms.current,Ve(Ms)}function Qi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Cb(n)),dt!==null)for(n=dt.return;n!==null;){var r=n;switch(df(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yo();break;case 3:sl(),Ve(tn),Ve(At),wf();break;case 5:vf(r);break;case 4:sl();break;case 13:Ve(Ge);break;case 19:Ve(Ge);break;case 10:mf(r.type._context);break;case 22:case 23:Mf()}n=n.return}if(vt=e,dt=e=pi(e.current,null),Et=dn=t,mt=0,wa=null,Pf=Iu=ts=0,Zt=Xl=null,Fi!==null){for(t=0;t<Fi.length;t++)if(n=Fi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var l=s.next;s.next=i,r.next=l}n.pending=r}Fi=null}return e}function Wv(e,t){do{var n=dt;try{if(pf(),Lo.current=su,iu){for(var r=Ye.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}iu=!1}if(es=0,yt=pt=Ye=null,Gl=!1,xa=0,Ef.current=null,n===null||n.return===null){mt=1,wa=t,dt=null;break}e:{var s=e,l=n.return,o=n,u=t;if(t=Et,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Cm(l);if(f!==null){f.flags&=-257,Em(f,l,o,s,t),f.mode&1&&Sm(s,c,t),t=f,u=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}else{if(!(t&1)){Sm(s,c,t),Rf();break e}u=Error(V(426))}}else if(Qe&&o.mode&1){var w=Cm(l);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Em(w,l,o,s,t),hf(ll(u,o));break e}}s=u=ll(u,o),mt!==4&&(mt=2),Xl===null?Xl=[s]:Xl.push(s),s=l;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=Tv(s,u,t);vm(s,y);break e;case 1:o=u;var x=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(hi===null||!hi.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=Lv(s,o,t);vm(s,j);break e}}s=s.return}while(s!==null)}Gv(n)}catch(E){t=E,dt===n&&n!==null&&(dt=n=n.return);continue}break}while(!0)}function Qv(){var e=lu.current;return lu.current=su,e===null?su:e}function Rf(){(mt===0||mt===3||mt===2)&&(mt=4),vt===null||!(ts&268435455)&&!(Iu&268435455)||Qr(vt,Et)}function uu(e,t){var n=Me;Me|=2;var r=Qv();(vt!==e||Et!==t)&&(br=null,Qi(e,t));do try{Xb();break}catch(i){Wv(e,i)}while(!0);if(pf(),Me=n,lu.current=r,dt!==null)throw Error(V(261));return vt=null,Et=0,mt}function Xb(){for(;dt!==null;)Kv(dt)}function Jb(){for(;dt!==null&&!jk();)Kv(dt)}function Kv(e){var t=Xv(e.alternate,e,dn);e.memoizedProps=e.pendingProps,t===null?Gv(e):dt=t,Ef.current=null}function Gv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Vb(n,t),n!==null){n.flags&=32767,dt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{mt=6,dt=null;return}}else if(n=Hb(n,t,dn),n!==null){dt=n;return}if(t=t.sibling,t!==null){dt=t;return}dt=t=e}while(t!==null);mt===0&&(mt=5)}function Mi(e,t,n){var r=Fe,i=Tn.transition;try{Tn.transition=null,Fe=1,Zb(e,t,n,r)}finally{Tn.transition=i,Fe=r}return null}function Zb(e,t,n,r){do Ds();while(si!==null);if(Me&6)throw Error(V(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(zk(e,s),e===vt&&(dt=vt=null,Et=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||mo||(mo=!0,Jv(Ho,function(){return Ds(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Tn.transition,Tn.transition=null;var l=Fe;Fe=1;var o=Me;Me|=4,Ef.current=null,Qb(e,n),qv(n,e),vb(Td),Wo=!!Pd,Td=Pd=null,e.current=n,Kb(n),Nk(),Me=o,Fe=l,Tn.transition=s}else e.current=n;if(mo&&(mo=!1,si=e,ou=i),s=e.pendingLanes,s===0&&(hi=null),Ek(n.stateNode),rn(e,st()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(au)throw au=!1,e=Gd,Gd=null,e;return ou&1&&e.tag!==0&&Ds(),s=e.pendingLanes,s&1?e===Yd?Jl++:(Jl=0,Yd=e):Jl=0,ki(),null}function Ds(){if(si!==null){var e=Ty(ou),t=Tn.transition,n=Fe;try{if(Tn.transition=null,Fe=16>e?16:e,si===null)var r=!1;else{if(e=si,si=null,ou=0,Me&6)throw Error(V(331));var i=Me;for(Me|=4,ee=e.current;ee!==null;){var s=ee,l=s.child;if(ee.flags&16){var o=s.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(ee=c;ee!==null;){var d=ee;switch(d.tag){case 0:case 11:case 15:Yl(8,d,s)}var h=d.child;if(h!==null)h.return=d,ee=h;else for(;ee!==null;){d=ee;var p=d.sibling,f=d.return;if($v(d),d===c){ee=null;break}if(p!==null){p.return=f,ee=p;break}ee=f}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}ee=s}}if(s.subtreeFlags&2064&&l!==null)l.return=s,ee=l;else e:for(;ee!==null;){if(s=ee,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Yl(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,ee=y;break e}ee=s.return}}var x=e.current;for(ee=x;ee!==null;){l=ee;var v=l.child;if(l.subtreeFlags&2064&&v!==null)v.return=l,ee=v;else e:for(l=x;ee!==null;){if(o=ee,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Au(9,o)}}catch(E){nt(o,o.return,E)}if(o===l){ee=null;break e}var j=o.sibling;if(j!==null){j.return=o.return,ee=j;break e}ee=o.return}}if(Me=i,ki(),cr&&typeof cr.onPostCommitFiberRoot=="function")try{cr.onPostCommitFiberRoot(Cu,e)}catch{}r=!0}return r}finally{Fe=n,Tn.transition=t}}return!1}function $m(e,t,n){t=ll(n,t),t=Tv(e,t,1),e=di(e,t,1),t=Ht(),e!==null&&(za(e,1,t),rn(e,t))}function nt(e,t,n){if(e.tag===3)$m(e,e,n);else for(;t!==null;){if(t.tag===3){$m(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hi===null||!hi.has(r))){e=ll(n,e),e=Lv(t,e,1),t=di(t,e,1),e=Ht(),t!==null&&(za(t,1,e),rn(t,e));break}}t=t.return}}function ej(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ht(),e.pingedLanes|=e.suspendedLanes&n,vt===e&&(Et&n)===n&&(mt===4||mt===3&&(Et&130023424)===Et&&500>st()-Tf?Qi(e,0):Pf|=n),rn(e,t)}function Yv(e,t){t===0&&(e.mode&1?(t=io,io<<=1,!(io&130023424)&&(io=4194304)):t=1);var n=Ht();e=Rr(e,t),e!==null&&(za(e,t,n),rn(e,n))}function tj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yv(e,n)}function nj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),Yv(e,n)}var Xv;Xv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tn.current)en=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return en=!1,qb(e,t,n);en=!!(e.flags&131072)}else en=!1,Qe&&t.flags&1048576&&tv(t,Zo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ro(e,t),e=t.pendingProps;var i=nl(t,At.current);Fs(t,n),i=bf(null,t,r,e,i,n);var s=jf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nn(r)?(s=!0,Xo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xf(t),i.updater=zu,t.stateNode=i,i._reactInternals=t,Od(t,r,e,n),t=Bd(null,t,r,!0,s,n)):(t.tag=0,Qe&&s&&cf(t),Ut(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ro(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ij(r),e=Fn(r,e),i){case 0:t=$d(null,t,r,e,n);break e;case 1:t=Lm(null,t,r,e,n);break e;case 11:t=Pm(null,t,r,e,n);break e;case 14:t=Tm(null,t,r,Fn(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),$d(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Lm(e,t,r,i,n);case 3:e:{if(Av(t),e===null)throw Error(V(387));r=t.pendingProps,s=t.memoizedState,i=s.element,av(e,t),nu(t,r,null,n);var l=t.memoizedState;if(r=l.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ll(Error(V(423)),t),t=Mm(e,t,r,n,i);break e}else if(r!==i){i=ll(Error(V(424)),t),t=Mm(e,t,r,n,i);break e}else for(fn=ci(t.stateNode.containerInfo.firstChild),pn=t,Qe=!0,$n=null,n=sv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rl(),r===i){t=zr(e,t,n);break e}Ut(e,t,r,n)}t=t.child}return t;case 5:return ov(t),e===null&&Id(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,l=i.children,Ld(r,i)?l=null:s!==null&&Ld(r,s)&&(t.flags|=32),zv(e,t),Ut(e,t,l,n),t.child;case 6:return e===null&&Id(t),null;case 13:return Iv(e,t,n);case 4:return yf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=il(t,null,r,n):Ut(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Pm(e,t,r,i,n);case 7:return Ut(e,t,t.pendingProps,n),t.child;case 8:return Ut(e,t,t.pendingProps.children,n),t.child;case 12:return Ut(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,l=i.value,qe(eu,r._currentValue),r._currentValue=l,s!==null)if(Wn(s.value,l)){if(s.children===i.children&&!tn.current){t=zr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){l=s.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Er(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Fd(s.return,n,t),o.lanes|=n;break}u=u.next}}else if(s.tag===10)l=s.type===t.type?null:s.child;else if(s.tag===18){if(l=s.return,l===null)throw Error(V(341));l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Fd(l,n,t),l=s.sibling}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===t){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}Ut(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Fs(t,n),i=Ln(i),r=r(i),t.flags|=1,Ut(e,t,r,n),t.child;case 14:return r=t.type,i=Fn(r,t.pendingProps),i=Fn(r.type,i),Tm(e,t,r,i,n);case 15:return Mv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Ro(e,t),t.tag=1,nn(r)?(e=!0,Xo(t)):e=!1,Fs(t,n),Pv(t,r,i),Od(t,r,i,n),Bd(null,t,r,!0,e,n);case 19:return Fv(e,t,n);case 22:return Rv(e,t,n)}throw Error(V(156,t.tag))};function Jv(e,t){return Sy(e,t)}function rj(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(e,t,n,r){return new rj(e,t,n,r)}function zf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ij(e){if(typeof e=="function")return zf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xh)return 11;if(e===Jh)return 14}return 2}function pi(e,t){var n=e.alternate;return n===null?(n=Pn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Io(e,t,n,r,i,s){var l=2;if(r=e,typeof e=="function")zf(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ks:return Ki(n.children,i,s,t);case Yh:l=8,i|=8;break;case od:return e=Pn(12,n,t,i|2),e.elementType=od,e.lanes=s,e;case ud:return e=Pn(13,n,t,i),e.elementType=ud,e.lanes=s,e;case cd:return e=Pn(19,n,t,i),e.elementType=cd,e.lanes=s,e;case oy:return Fu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ly:l=10;break e;case ay:l=9;break e;case Xh:l=11;break e;case Jh:l=14;break e;case Hr:l=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Pn(l,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Ki(e,t,n,r){return e=Pn(7,e,r,t),e.lanes=n,e}function Fu(e,t,n,r){return e=Pn(22,e,r,t),e.elementType=oy,e.lanes=n,e.stateNode={isHidden:!1},e}function Ac(e,t,n){return e=Pn(6,e,null,t),e.lanes=n,e}function Ic(e,t,n){return t=Pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sj(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mc(0),this.expirationTimes=mc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Af(e,t,n,r,i,s,l,o,u){return e=new sj(e,t,n,o,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Pn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xf(s),e}function lj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Zv(e){if(!e)return gi;e=e._reactInternals;e:{if(us(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(nn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(nn(n))return Zy(e,n,t)}return t}function e1(e,t,n,r,i,s,l,o,u){return e=Af(n,r,!0,e,i,s,l,o,u),e.context=Zv(null),n=e.current,r=Ht(),i=fi(n),s=Er(r,i),s.callback=t??null,di(n,s,i),e.current.lanes=i,za(e,i,r),rn(e,r),e}function Du(e,t,n,r){var i=t.current,s=Ht(),l=fi(i);return n=Zv(n),t.context===null?t.context=n:t.pendingContext=n,t=Er(s,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=di(i,t,l),e!==null&&(qn(e,i,l,s),To(e,i,l)),l}function cu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Bm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function If(e,t){Bm(e,t),(e=e.alternate)&&Bm(e,t)}function aj(){return null}var t1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ff(e){this._internalRoot=e}Ou.prototype.render=Ff.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Du(e,t,null,null)};Ou.prototype.unmount=Ff.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){Du(null,e,null,null)}),t[Mr]=null}};function Ou(e){this._internalRoot=e}Ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ry();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wr.length&&t!==0&&t<Wr[n].priority;n++);Wr.splice(n,0,e),n===0&&Ay(e)}};function Df(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Um(){}function oj(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=cu(l);s.call(c)}}var l=e1(t,r,e,0,null,!1,!1,"",Um);return e._reactRootContainer=l,e[Mr]=l.current,ha(e.nodeType===8?e.parentNode:e),ns(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=cu(u);o.call(c)}}var u=Af(e,0,!1,null,null,!1,!1,"",Um);return e._reactRootContainer=u,e[Mr]=u.current,ha(e.nodeType===8?e.parentNode:e),ns(function(){Du(t,u,n,r)}),u}function $u(e,t,n,r,i){var s=n._reactRootContainer;if(s){var l=s;if(typeof i=="function"){var o=i;i=function(){var u=cu(l);o.call(u)}}Du(t,l,e,i)}else l=oj(n,t,e,i,r);return cu(l)}Ly=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$l(t.pendingLanes);n!==0&&(tf(t,n|1),rn(t,st()),!(Me&6)&&(al=st()+500,ki()))}break;case 13:ns(function(){var r=Rr(e,1);if(r!==null){var i=Ht();qn(r,e,1,i)}}),If(e,1)}};nf=function(e){if(e.tag===13){var t=Rr(e,134217728);if(t!==null){var n=Ht();qn(t,e,134217728,n)}If(e,134217728)}};My=function(e){if(e.tag===13){var t=fi(e),n=Rr(e,t);if(n!==null){var r=Ht();qn(n,e,t,r)}If(e,t)}};Ry=function(){return Fe};zy=function(e,t){var n=Fe;try{return Fe=e,t()}finally{Fe=n}};wd=function(e,t,n){switch(t){case"input":if(fd(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Lu(r);if(!i)throw Error(V(90));cy(r),fd(r,i)}}}break;case"textarea":hy(e,n);break;case"select":t=n.value,t!=null&&Rs(e,!!n.multiple,t,!1)}};vy=Lf;wy=ns;var uj={usingClientEntryPoint:!1,Events:[Ia,Ss,Lu,xy,yy,Lf]},Ml={findFiberByHostInstance:Ii,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cj={bundleType:Ml.bundleType,version:Ml.version,rendererPackageName:Ml.rendererPackageName,rendererConfig:Ml.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jy(e),e===null?null:e.stateNode},findFiberByHostInstance:Ml.findFiberByHostInstance||aj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!go.isDisabled&&go.supportsFiber)try{Cu=go.inject(cj),cr=go}catch{}}xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uj;xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Df(t))throw Error(V(200));return lj(e,t,null,n)};xn.createRoot=function(e,t){if(!Df(e))throw Error(V(299));var n=!1,r="",i=t1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Af(e,1,!1,null,null,n,!1,r,i),e[Mr]=t.current,ha(e.nodeType===8?e.parentNode:e),new Ff(t)};xn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=jy(t),e=e===null?null:e.stateNode,e};xn.flushSync=function(e){return ns(e)};xn.hydrate=function(e,t,n){if(!_u(t))throw Error(V(200));return $u(null,e,t,!0,n)};xn.hydrateRoot=function(e,t,n){if(!Df(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",l=t1;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=e1(t,null,e,1,n??null,i,!1,s,l),e[Mr]=t.current,ha(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Ou(t)};xn.render=function(e,t,n){if(!_u(t))throw Error(V(200));return $u(null,e,t,!1,n)};xn.unmountComponentAtNode=function(e){if(!_u(e))throw Error(V(40));return e._reactRootContainer?(ns(function(){$u(null,null,e,!1,function(){e._reactRootContainer=null,e[Mr]=null})}),!0):!1};xn.unstable_batchedUpdates=Lf;xn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_u(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return $u(e,t,n,!1,r)};xn.version="18.3.1-next-f1338f8080-20240426";function n1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n1)}catch(e){console.error(e)}}n1(),ny.exports=xn;var Of=ny.exports;const dj=Uh(Of),hj=$x({__proto__:null,default:dj},[Of]);var r1,qm=Of;r1=qm.createRoot,qm.hydrateRoot;var cs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rs=typeof window>"u"||"Deno"in globalThis;function Nn(){}function fj(e,t){return typeof e=="function"?e(t):e}function Zd(e){return typeof e=="number"&&e>=0&&e!==1/0}function i1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Os(e,t){return typeof e=="function"?e(t):e}function Bn(e,t){return typeof e=="function"?e(t):e}function Hm(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==_f(l,t.options))return!1}else if(!ka(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function Vm(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(is(t.options.mutationKey)!==is(s))return!1}else if(!ka(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _f(e,t){return((t==null?void 0:t.queryKeyHashFn)||is)(e)}function is(e){return JSON.stringify(e,(t,n)=>eh(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ka(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ka(e[n],t[n])):!1}function $f(e,t){if(e===t)return e;const n=Wm(e)&&Wm(t);if(n||eh(e)&&eh(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),l=s.length,o=n?[]:{};let u=0;for(let c=0;c<l;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(o[d]=void 0,u++):(o[d]=$f(e[d],t[d]),o[d]===e[d]&&e[d]!==void 0&&u++)}return i===l&&u===i?e:o}return t}function du(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Wm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eh(e){if(!Qm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Qm(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Qm(e){return Object.prototype.toString.call(e)==="[object Object]"}function pj(e){return new Promise(t=>{setTimeout(t,e)})}function th(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$f(e,t):t}function mj(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function gj(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Bf=Symbol();function s1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Bf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var _i,Kr,$s,Tx,xj=(Tx=class extends cs{constructor(){super();se(this,_i);se(this,Kr);se(this,$s);K(this,$s,t=>{if(!rs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Kr)||this.setEventListener(P(this,$s))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Kr))==null||t.call(this),K(this,Kr,void 0))}setEventListener(t){var n;K(this,$s,t),(n=P(this,Kr))==null||n.call(this),K(this,Kr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,_i)!==t&&(K(this,_i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,_i)=="boolean"?P(this,_i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},_i=new WeakMap,Kr=new WeakMap,$s=new WeakMap,Tx),Uf=new xj,Bs,Gr,Us,Lx,yj=(Lx=class extends cs{constructor(){super();se(this,Bs,!0);se(this,Gr);se(this,Us);K(this,Us,t=>{if(!rs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,Gr)||this.setEventListener(P(this,Us))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Gr))==null||t.call(this),K(this,Gr,void 0))}setEventListener(t){var n;K(this,Us,t),(n=P(this,Gr))==null||n.call(this),K(this,Gr,t(this.setOnline.bind(this)))}setOnline(t){P(this,Bs)!==t&&(K(this,Bs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,Bs)}},Bs=new WeakMap,Gr=new WeakMap,Us=new WeakMap,Lx),hu=new yj;function nh(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function vj(e){return Math.min(1e3*2**e,3e4)}function l1(e){return(e??"online")==="online"?hu.isOnline():!0}var a1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Fc(e){return e instanceof a1}function o1(e){let t=!1,n=0,r=!1,i;const s=nh(),l=g=>{var w;r||(p(new a1(g)),(w=e.abort)==null||w.call(e))},o=()=>{t=!0},u=()=>{t=!1},c=()=>Uf.isFocused()&&(e.networkMode==="always"||hu.isOnline())&&e.canRun(),d=()=>l1(e.networkMode)&&e.canRun(),h=g=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,g),i==null||i(),s.resolve(g))},p=g=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,g),i==null||i(),s.reject(g))},f=()=>new Promise(g=>{var w;i=y=>{(r||c())&&g(y)},(w=e.onPause)==null||w.call(e)}).then(()=>{var g;i=void 0,r||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(r)return;let g;const w=n===0?e.initialPromise:void 0;try{g=w??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(h).catch(y=>{var k;if(r)return;const x=e.retry??(rs?0:3),v=e.retryDelay??vj,j=typeof v=="function"?v(n,y):v,E=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!E){p(y);return}n++,(k=e.onFail)==null||k.call(e,n,y),pj(j).then(()=>c()?void 0:f()).then(()=>{t?p(y):m()})})};return{promise:s,cancel:l,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:u,canStart:d,start:()=>(d()?m():f().then(m),s)}}function wj(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=o=>setTimeout(o,0);const s=o=>{t?e.push(o):i(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||l()}return u},batchCalls:o=>(...u)=>{s(()=>{o(...u)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var rt=wj(),$i,Mx,u1=(Mx=class{constructor(){se(this,$i)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zd(this.gcTime)&&K(this,$i,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rs?1/0:5*60*1e3))}clearGcTimeout(){P(this,$i)&&(clearTimeout(P(this,$i)),K(this,$i,void 0))}},$i=new WeakMap,Mx),qs,Hs,kn,Rt,Ca,Bi,Dn,kr,Rx,kj=(Rx=class extends u1{constructor(t){super();se(this,Dn);se(this,qs);se(this,Hs);se(this,kn);se(this,Rt);se(this,Ca);se(this,Bi);K(this,Bi,!1),K(this,Ca,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,kn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,qs,bj(this.options)),this.state=t.state??P(this,qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Rt))==null?void 0:t.promise}setOptions(t){this.options={...P(this,Ca),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,kn).remove(this)}setData(t,n){const r=th(this.state.data,t,this.options);return ce(this,Dn,kr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ce(this,Dn,kr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,Rt))==null?void 0:r.promise;return(i=P(this,Rt))==null||i.cancel(t),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,qs))}isActive(){return this.observers.some(t=>Bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!i1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Rt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Rt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,kn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,Rt)&&(P(this,Bi)?P(this,Rt).cancel({revert:!0}):P(this,Rt).cancelRetry()),this.scheduleGc()),P(this,kn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Dn,kr).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,Rt))return P(this,Rt).continueRetry(),P(this,Rt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(K(this,Bi,!0),r.signal)})},s=()=>{const h=s1(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),K(this,Bi,!1),this.options.persister?this.options.persister(h,p,this):h(p)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(l),(u=this.options.behavior)==null||u.onFetch(l,this),K(this,Hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=l.fetchOptions)==null?void 0:c.meta))&&ce(this,Dn,kr).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta});const o=h=>{var p,f,m,g;Fc(h)&&h.silent||ce(this,Dn,kr).call(this,{type:"error",error:h}),Fc(h)||((f=(p=P(this,kn).config).onError)==null||f.call(p,h,this),(g=(m=P(this,kn).config).onSettled)==null||g.call(m,this.state.data,h,this)),this.scheduleGc()};return K(this,Rt,o1({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var p,f,m,g;if(h===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(w){o(w);return}(f=(p=P(this,kn).config).onSuccess)==null||f.call(p,h,this),(g=(m=P(this,kn).config).onSettled)==null||g.call(m,h,this.state.error,this),this.scheduleGc()},onError:o,onFail:(h,p)=>{ce(this,Dn,kr).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{ce(this,Dn,kr).call(this,{type:"pause"})},onContinue:()=>{ce(this,Dn,kr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),P(this,Rt).start()}},qs=new WeakMap,Hs=new WeakMap,kn=new WeakMap,Rt=new WeakMap,Ca=new WeakMap,Bi=new WeakMap,Dn=new WeakSet,kr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...c1(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Fc(i)&&i.revert&&P(this,Hs)?{...P(this,Hs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,kn).notify({query:this,type:"updated",action:t})})},Rx);function c1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bj(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ir,zx,jj=(zx=class extends cs{constructor(t={}){super();se(this,ir);this.config=t,K(this,ir,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??_f(i,n);let l=this.get(s);return l||(l=new kj({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){P(this,ir).has(t.queryHash)||(P(this,ir).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,ir).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,ir).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,ir).get(t)}getAll(){return[...P(this,ir).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hm(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Hm(t,r)):n}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ir=new WeakMap,zx),sr,$t,Ui,lr,Ur,Ax,Nj=(Ax=class extends u1{constructor(t){super();se(this,lr);se(this,sr);se(this,$t);se(this,Ui);this.mutationId=t.mutationId,K(this,$t,t.mutationCache),K(this,sr,[]),this.state=t.state||d1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,sr).includes(t)||(P(this,sr).push(t),this.clearGcTimeout(),P(this,$t).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,sr,P(this,sr).filter(n=>n!==t)),this.scheduleGc(),P(this,$t).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,sr).length||(this.state.status==="pending"?this.scheduleGc():P(this,$t).remove(this))}continue(){var t;return((t=P(this,Ui))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,l,o,u,c,d,h,p,f,m,g,w,y,x,v,j,E,k,S;K(this,Ui,o1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,F)=>{ce(this,lr,Ur).call(this,{type:"failed",failureCount:M,error:F})},onPause:()=>{ce(this,lr,Ur).call(this,{type:"pause"})},onContinue:()=>{ce(this,lr,Ur).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,$t).canRun(this)}));const n=this.state.status==="pending",r=!P(this,Ui).canStart();try{if(!n){ce(this,lr,Ur).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=P(this,$t).config).onMutate)==null?void 0:s.call(i,t,this));const F=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t));F!==this.state.context&&ce(this,lr,Ur).call(this,{type:"pending",context:F,variables:t,isPaused:r})}const M=await P(this,Ui).start();return await((c=(u=P(this,$t).config).onSuccess)==null?void 0:c.call(u,M,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,M,t,this.state.context)),await((f=(p=P(this,$t).config).onSettled)==null?void 0:f.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,M,null,t,this.state.context)),ce(this,lr,Ur).call(this,{type:"success",data:M}),M}catch(M){try{throw await((y=(w=P(this,$t).config).onError)==null?void 0:y.call(w,M,t,this.state.context,this)),await((v=(x=this.options).onError)==null?void 0:v.call(x,M,t,this.state.context)),await((E=(j=P(this,$t).config).onSettled)==null?void 0:E.call(j,void 0,M,this.state.variables,this.state.context,this)),await((S=(k=this.options).onSettled)==null?void 0:S.call(k,void 0,M,t,this.state.context)),M}finally{ce(this,lr,Ur).call(this,{type:"error",error:M})}}finally{P(this,$t).runNext(this)}}},sr=new WeakMap,$t=new WeakMap,Ui=new WeakMap,lr=new WeakSet,Ur=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),rt.batch(()=>{P(this,sr).forEach(r=>{r.onMutationUpdate(t)}),P(this,$t).notify({mutation:this,type:"updated",action:t})})},Ax);function d1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn,Ea,Ix,Sj=(Ix=class extends cs{constructor(t={}){super();se(this,cn);se(this,Ea);this.config=t,K(this,cn,new Map),K(this,Ea,Date.now())}build(t,n,r){const i=new Nj({mutationCache:this,mutationId:++Ja(this,Ea)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=xo(t),r=P(this,cn).get(n)??[];r.push(t),P(this,cn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=xo(t);if(P(this,cn).has(n)){const i=(r=P(this,cn).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?P(this,cn).delete(n):P(this,cn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=P(this,cn).get(xo(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=P(this,cn).get(xo(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...P(this,cn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Vm(n,r))}findAll(t={}){return this.getAll().filter(n=>Vm(t,n))}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nn))))}},cn=new WeakMap,Ea=new WeakMap,Ix);function xo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Km(e){return{onFetch:(t,n)=>{var d,h,p,f,m;const r=t.options,i=(p=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],l=((m=t.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const c=async()=>{let g=!1;const w=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=s1(t.options,t.fetchOptions),x=async(v,j,E)=>{if(g)return Promise.reject();if(j==null&&v.pages.length)return Promise.resolve(v);const k={queryKey:t.queryKey,pageParam:j,direction:E?"backward":"forward",meta:t.options.meta};w(k);const S=await y(k),{maxPages:M}=t.options,F=E?gj:mj;return{pages:F(v.pages,S,M),pageParams:F(v.pageParams,j,M)}};if(i&&s.length){const v=i==="backward",j=v?Cj:Gm,E={pages:s,pageParams:l},k=j(r,E);o=await x(E,k,v)}else{const v=e??s.length;do{const j=u===0?l[0]??r.initialPageParam:Gm(r,o);if(u>0&&j==null)break;o=await x(o,j),u++}while(u<v)}return o};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Gm(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cj(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var tt,Yr,Xr,Vs,Ws,Jr,Qs,Ks,Fx,Ej=(Fx=class{constructor(e={}){se(this,tt);se(this,Yr);se(this,Xr);se(this,Vs);se(this,Ws);se(this,Jr);se(this,Qs);se(this,Ks);K(this,tt,e.queryCache||new jj),K(this,Yr,e.mutationCache||new Sj),K(this,Xr,e.defaultOptions||{}),K(this,Vs,new Map),K(this,Ws,new Map),K(this,Jr,0)}mount(){Ja(this,Jr)._++,P(this,Jr)===1&&(K(this,Qs,Uf.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,tt).onFocus())})),K(this,Ks,hu.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,tt).onOnline())})))}unmount(){var e,t;Ja(this,Jr)._--,P(this,Jr)===0&&((e=P(this,Qs))==null||e.call(this),K(this,Qs,void 0),(t=P(this,Ks))==null||t.call(this),K(this,Ks,void 0))}isFetching(e){return P(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,Yr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,tt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,tt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Os(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,tt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=P(this,tt).get(r.queryHash),s=i==null?void 0:i.state.data,l=fj(t,s);if(l!==void 0)return P(this,tt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>P(this,tt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,tt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,tt);rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,tt),r={type:"active",...e};return rt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>P(this,tt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return rt.batch(()=>{if(P(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>P(this,tt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Nn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Nn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,tt).build(this,t);return n.isStaleByTime(Os(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e.behavior=Km(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e.behavior=Km(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hu.isOnline()?P(this,Yr).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,tt)}getMutationCache(){return P(this,Yr)}getDefaultOptions(){return P(this,Xr)}setDefaultOptions(e){K(this,Xr,e)}setQueryDefaults(e,t){P(this,Vs).set(is(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Vs).values()],n={};return t.forEach(r=>{ka(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Ws).set(is(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Ws).values()];let n={};return t.forEach(r=>{ka(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Xr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_f(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Bf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Xr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,tt).clear(),P(this,Yr).clear()}},tt=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Vs=new WeakMap,Ws=new WeakMap,Jr=new WeakMap,Qs=new WeakMap,Ks=new WeakMap,Fx),Yt,Pe,Pa,Bt,qi,Gs,Zr,ar,Ta,Ys,Xs,Hi,Vi,ei,Js,Ie,Ul,rh,ih,sh,lh,ah,oh,uh,h1,Dx,qf=(Dx=class extends cs{constructor(t,n){super();se(this,Ie);se(this,Yt);se(this,Pe);se(this,Pa);se(this,Bt);se(this,qi);se(this,Gs);se(this,Zr);se(this,ar);se(this,Ta);se(this,Ys);se(this,Xs);se(this,Hi);se(this,Vi);se(this,ei);se(this,Js,new Set);this.options=n,K(this,Yt,t),K(this,ar,null),K(this,Zr,nh()),this.options.experimental_prefetchInRender||P(this,Zr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Pe).addObserver(this),Ym(P(this,Pe),this.options)?ce(this,Ie,Ul).call(this):this.updateResult(),ce(this,Ie,lh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ch(P(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ch(P(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ie,ah).call(this),ce(this,Ie,oh).call(this),P(this,Pe).removeObserver(this)}setOptions(t,n){const r=this.options,i=P(this,Pe);if(this.options=P(this,Yt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Bn(this.options.enabled,P(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Ie,uh).call(this),P(this,Pe).setOptions(this.options),r._defaulted&&!du(this.options,r)&&P(this,Yt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Pe),observer:this});const s=this.hasListeners();s&&Xm(P(this,Pe),i,this.options,r)&&ce(this,Ie,Ul).call(this),this.updateResult(n),s&&(P(this,Pe)!==i||Bn(this.options.enabled,P(this,Pe))!==Bn(r.enabled,P(this,Pe))||Os(this.options.staleTime,P(this,Pe))!==Os(r.staleTime,P(this,Pe)))&&ce(this,Ie,rh).call(this);const l=ce(this,Ie,ih).call(this);s&&(P(this,Pe)!==i||Bn(this.options.enabled,P(this,Pe))!==Bn(r.enabled,P(this,Pe))||l!==P(this,ei))&&ce(this,Ie,sh).call(this,l)}getOptimisticResult(t){const n=P(this,Yt).getQueryCache().build(P(this,Yt),t),r=this.createResult(n,t);return Tj(this,r)&&(K(this,Bt,r),K(this,Gs,this.options),K(this,qi,P(this,Pe).state)),r}getCurrentResult(){return P(this,Bt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){P(this,Js).add(t)}getCurrentQuery(){return P(this,Pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Yt).defaultQueryOptions(t),r=P(this,Yt).getQueryCache().build(P(this,Yt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ce(this,Ie,Ul).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Bt)))}createResult(t,n){var M;const r=P(this,Pe),i=this.options,s=P(this,Bt),l=P(this,qi),o=P(this,Gs),c=t!==r?t.state:P(this,Pa),{state:d}=t;let h={...d},p=!1,f;if(n._optimisticResults){const F=this.hasListeners(),C=!F&&Ym(t,n),O=F&&Xm(t,r,n,i);(C||O)&&(h={...h,...c1(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:w}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(l==null?void 0:l.data)&&n.select===P(this,Ta))f=P(this,Ys);else try{K(this,Ta,n.select),f=n.select(h.data),f=th(s==null?void 0:s.data,f,n),K(this,Ys,f),K(this,ar,null)}catch(F){K(this,ar,F)}else f=h.data;if(n.placeholderData!==void 0&&f===void 0&&w==="pending"){let F;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))F=s.data;else if(F=typeof n.placeholderData=="function"?n.placeholderData((M=P(this,Xs))==null?void 0:M.state.data,P(this,Xs)):n.placeholderData,n.select&&F!==void 0)try{F=n.select(F),K(this,ar,null)}catch(C){K(this,ar,C)}F!==void 0&&(w="success",f=th(s==null?void 0:s.data,F,n),p=!0)}P(this,ar)&&(m=P(this,ar),f=P(this,Ys),g=Date.now(),w="error");const y=h.fetchStatus==="fetching",x=w==="pending",v=w==="error",j=x&&y,E=f!==void 0,S={status:w,fetchStatus:h.fetchStatus,isPending:x,isSuccess:w==="success",isError:v,isInitialLoading:j,isLoading:j,data:f,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!x,isLoadingError:v&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:v&&E,isStale:Hf(t,n),refetch:this.refetch,promise:P(this,Zr)};if(this.options.experimental_prefetchInRender){const F=I=>{S.status==="error"?I.reject(S.error):S.data!==void 0&&I.resolve(S.data)},C=()=>{const I=K(this,Zr,S.promise=nh());F(I)},O=P(this,Zr);switch(O.status){case"pending":t.queryHash===r.queryHash&&F(O);break;case"fulfilled":(S.status==="error"||S.data!==O.value)&&C();break;case"rejected":(S.status!=="error"||S.error!==O.reason)&&C();break}}return S}updateResult(t){const n=P(this,Bt),r=this.createResult(P(this,Pe),this.options);if(K(this,qi,P(this,Pe).state),K(this,Gs,this.options),P(this,qi).data!==void 0&&K(this,Xs,P(this,Pe)),du(r,n))return;K(this,Bt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!P(this,Js).size)return!0;const u=new Set(o??P(this,Js));return this.options.throwOnError&&u.add("error"),Object.keys(P(this,Bt)).some(c=>{const d=c;return P(this,Bt)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ce(this,Ie,h1).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Ie,lh).call(this)}},Yt=new WeakMap,Pe=new WeakMap,Pa=new WeakMap,Bt=new WeakMap,qi=new WeakMap,Gs=new WeakMap,Zr=new WeakMap,ar=new WeakMap,Ta=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,Hi=new WeakMap,Vi=new WeakMap,ei=new WeakMap,Js=new WeakMap,Ie=new WeakSet,Ul=function(t){ce(this,Ie,uh).call(this);let n=P(this,Pe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nn)),n},rh=function(){ce(this,Ie,ah).call(this);const t=Os(this.options.staleTime,P(this,Pe));if(rs||P(this,Bt).isStale||!Zd(t))return;const r=i1(P(this,Bt).dataUpdatedAt,t)+1;K(this,Hi,setTimeout(()=>{P(this,Bt).isStale||this.updateResult()},r))},ih=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Pe)):this.options.refetchInterval)??!1},sh=function(t){ce(this,Ie,oh).call(this),K(this,ei,t),!(rs||Bn(this.options.enabled,P(this,Pe))===!1||!Zd(P(this,ei))||P(this,ei)===0)&&K(this,Vi,setInterval(()=>{(this.options.refetchIntervalInBackground||Uf.isFocused())&&ce(this,Ie,Ul).call(this)},P(this,ei)))},lh=function(){ce(this,Ie,rh).call(this),ce(this,Ie,sh).call(this,ce(this,Ie,ih).call(this))},ah=function(){P(this,Hi)&&(clearTimeout(P(this,Hi)),K(this,Hi,void 0))},oh=function(){P(this,Vi)&&(clearInterval(P(this,Vi)),K(this,Vi,void 0))},uh=function(){const t=P(this,Yt).getQueryCache().build(P(this,Yt),this.options);if(t===P(this,Pe))return;const n=P(this,Pe);K(this,Pe,t),K(this,Pa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},h1=function(t){rt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Bt))}),P(this,Yt).getQueryCache().notify({query:P(this,Pe),type:"observerResultsUpdated"})})},Dx);function Pj(e,t){return Bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ym(e,t){return Pj(e,t)||e.state.data!==void 0&&ch(e,t,t.refetchOnMount)}function ch(e,t,n){if(Bn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Hf(e,t)}return!1}function Xm(e,t,n,r){return(e!==t||Bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Hf(e,n)}function Hf(e,t){return Bn(t.enabled,e)!==!1&&e.isStaleByTime(Os(t.staleTime,e))}function Tj(e,t){return!du(e.getCurrentResult(),t)}function Jm(e,t){return e.filter(n=>!t.includes(n))}function Lj(e,t,n){const r=e.slice(0);return r[t]=n,r}var Zs,bn,Wi,el,jn,ti,La,Ma,wt,dh,hh,Fo,fh,ph,Ox,Mj=(Ox=class extends cs{constructor(t,n,r){super();se(this,wt);se(this,Zs);se(this,bn);se(this,Wi);se(this,el);se(this,jn);se(this,ti);se(this,La);se(this,Ma);K(this,Zs,t),K(this,el,r),K(this,Wi,[]),K(this,jn,[]),K(this,bn,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&P(this,jn).forEach(t=>{t.subscribe(n=>{ce(this,wt,fh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,P(this,jn).forEach(t=>{t.destroy()})}setQueries(t,n,r){K(this,Wi,t),K(this,el,n),rt.batch(()=>{const i=P(this,jn),s=ce(this,wt,Fo).call(this,P(this,Wi));s.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions,r));const l=s.map(c=>c.observer),o=l.map(c=>c.getCurrentResult()),u=l.some((c,d)=>c!==i[d]);i.length===l.length&&!u||(K(this,jn,l),K(this,bn,o),this.hasListeners()&&(Jm(i,l).forEach(c=>{c.destroy()}),Jm(l,i).forEach(c=>{c.subscribe(d=>{ce(this,wt,fh).call(this,c,d)})}),ce(this,wt,ph).call(this)))})}getCurrentResult(){return P(this,bn)}getQueries(){return P(this,jn).map(t=>t.getCurrentQuery())}getObservers(){return P(this,jn)}getOptimisticResult(t,n){const i=ce(this,wt,Fo).call(this,t).map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[i,s=>ce(this,wt,hh).call(this,s??i,n),()=>ce(this,wt,dh).call(this,i,t)]}},Zs=new WeakMap,bn=new WeakMap,Wi=new WeakMap,el=new WeakMap,jn=new WeakMap,ti=new WeakMap,La=new WeakMap,Ma=new WeakMap,wt=new WeakSet,dh=function(t,n){const r=ce(this,wt,Fo).call(this,n);return r.map((i,s)=>{const l=t[s];return i.defaultedQueryOptions.notifyOnChangeProps?l:i.observer.trackResult(l,o=>{r.forEach(u=>{u.observer.trackProp(o)})})})},hh=function(t,n){return n?((!P(this,ti)||P(this,bn)!==P(this,Ma)||n!==P(this,La))&&(K(this,La,n),K(this,Ma,P(this,bn)),K(this,ti,$f(P(this,ti),n(t)))),P(this,ti)):t},Fo=function(t){const n=new Map(P(this,jn).map(i=>[i.options.queryHash,i])),r=[];return t.forEach(i=>{const s=P(this,Zs).defaultQueryOptions(i),l=n.get(s.queryHash);l?r.push({defaultedQueryOptions:s,observer:l}):r.push({defaultedQueryOptions:s,observer:new qf(P(this,Zs),s)})}),r},fh=function(t,n){const r=P(this,jn).indexOf(t);r!==-1&&(K(this,bn,Lj(P(this,bn),r,n)),ce(this,wt,ph).call(this))},ph=function(){var t;if(this.hasListeners()){const n=P(this,ti),r=ce(this,wt,hh).call(this,ce(this,wt,dh).call(this,P(this,bn),P(this,Wi)),(t=P(this,el))==null?void 0:t.combine);n!==r&&rt.batch(()=>{this.listeners.forEach(i=>{i(P(this,bn))})})}},Ox),ni,ri,Xt,Nr,Tr,Do,mh,_x,Rj=(_x=class extends cs{constructor(n,r){super();se(this,Tr);se(this,ni);se(this,ri);se(this,Xt);se(this,Nr);K(this,ni,n),this.setOptions(r),this.bindMethods(),ce(this,Tr,Do).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=P(this,ni).defaultMutationOptions(n),du(this.options,r)||P(this,ni).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Xt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&is(r.mutationKey)!==is(this.options.mutationKey)?this.reset():((i=P(this,Xt))==null?void 0:i.state.status)==="pending"&&P(this,Xt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Xt))==null||n.removeObserver(this)}onMutationUpdate(n){ce(this,Tr,Do).call(this),ce(this,Tr,mh).call(this,n)}getCurrentResult(){return P(this,ri)}reset(){var n;(n=P(this,Xt))==null||n.removeObserver(this),K(this,Xt,void 0),ce(this,Tr,Do).call(this),ce(this,Tr,mh).call(this)}mutate(n,r){var i;return K(this,Nr,r),(i=P(this,Xt))==null||i.removeObserver(this),K(this,Xt,P(this,ni).getMutationCache().build(P(this,ni),this.options)),P(this,Xt).addObserver(this),P(this,Xt).execute(n)}},ni=new WeakMap,ri=new WeakMap,Xt=new WeakMap,Nr=new WeakMap,Tr=new WeakSet,Do=function(){var r;const n=((r=P(this,Xt))==null?void 0:r.state)??d1();K(this,ri,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mh=function(n){rt.batch(()=>{var r,i,s,l,o,u,c,d;if(P(this,Nr)&&this.hasListeners()){const h=P(this,ri).variables,p=P(this,ri).context;(n==null?void 0:n.type)==="success"?((i=(r=P(this,Nr)).onSuccess)==null||i.call(r,n.data,h,p),(l=(s=P(this,Nr)).onSettled)==null||l.call(s,n.data,null,h,p)):(n==null?void 0:n.type)==="error"&&((u=(o=P(this,Nr)).onError)==null||u.call(o,n.error,h,p),(d=(c=P(this,Nr)).onSettled)==null||d.call(c,void 0,n.error,h,p))}this.listeners.forEach(h=>{h(P(this,ri))})})},_x),f1=b.createContext(void 0),Dt=e=>{const t=b.useContext(f1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zj=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(f1.Provider,{value:e,children:t})),p1=b.createContext(!1),m1=()=>b.useContext(p1);p1.Provider;function Aj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ij=b.createContext(Aj()),g1=()=>b.useContext(Ij);function x1(e,t){return typeof e=="function"?e(...t):!!e}function fu(){}var y1=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},v1=e=>{b.useEffect(()=>{e.clearReset()},[e])},w1=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&x1(n,[e.error,r]),k1=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},b1=(e,t)=>e.isLoading&&e.isFetching&&!t,gh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,pu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fj({queries:e,...t},n){const r=Dt(),i=m1(),s=g1(),l=b.useMemo(()=>e.map(m=>{const g=r.defaultQueryOptions(m);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[e,r,i]);l.forEach(m=>{k1(m),y1(m,s)}),v1(s);const[o]=b.useState(()=>new Mj(r,l,t)),[u,c,d]=o.getOptimisticResult(l,t.combine);b.useSyncExternalStore(b.useCallback(m=>i?fu:o.subscribe(rt.batchCalls(m)),[o,i]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),b.useEffect(()=>{o.setQueries(l,t,{listeners:!1})},[l,t,o]);const p=u.some((m,g)=>gh(l[g],m))?u.flatMap((m,g)=>{const w=l[g];if(w){const y=new qf(r,w);if(gh(w,m))return pu(w,y,s);b1(m,i)&&pu(w,y,s)}return[]}):[];if(p.length>0)throw Promise.all(p);const f=u.find((m,g)=>{const w=l[g];return w&&w1({result:m,errorResetBoundary:s,throwOnError:w.throwOnError,query:r.getQueryCache().get(w.queryHash)})});if(f!=null&&f.error)throw f.error;return c(d())}function Dj(e,t,n){var d,h,p,f,m;const r=Dt(),i=m1(),s=g1(),l=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,l),l._optimisticResults=i?"isRestoring":"optimistic",k1(l),y1(l,s),v1(s);const o=!r.getQueryCache().get(l.queryHash),[u]=b.useState(()=>new t(r,l)),c=u.getOptimisticResult(l);if(b.useSyncExternalStore(b.useCallback(g=>{const w=i?fu:u.subscribe(rt.batchCalls(g));return u.updateResult(),w},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(l,{listeners:!1})},[l,u]),gh(l,c))throw pu(l,u,s);if(w1({result:c,errorResetBoundary:s,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash)}))throw c.error;if((f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||f.call(p,l,c),l.experimental_prefetchInRender&&!rs&&b1(c,i)){const g=o?pu(l,u,s):(m=r.getQueryCache().get(l.queryHash))==null?void 0:m.promise;g==null||g.catch(fu).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?c:u.trackResult(c)}function xe(e,t){return Dj(e,qf)}function xi(e,t){const n=Dt(),[r]=b.useState(()=>new Rj(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(l=>r.subscribe(rt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=b.useCallback((l,o)=>{r.mutate(l,o).catch(fu)},[r]);if(i.error&&x1(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function j1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=j1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function le(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=j1(e))&&(r&&(r+=" "),r+=t);return r}/**
41
- * @license lucide-react v0.468.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */const Oj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
- * @license lucide-react v0.468.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */var _j={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"};/**
51
- * @license lucide-react v0.468.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const $j=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...o},u)=>b.createElement("svg",{ref:u,..._j,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:N1("lucide",i),...o},[...l.map(([c,d])=>b.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
56
- * @license lucide-react v0.468.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const X=(e,t)=>{const n=b.forwardRef(({className:r,...i},s)=>b.createElement($j,{ref:s,iconNode:t,className:N1(`lucide-${Oj(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
- * @license lucide-react v0.468.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const Bj=X("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
66
- * @license lucide-react v0.468.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const Vf=X("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
71
- * @license lucide-react v0.468.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const Bu=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76
- * @license lucide-react v0.468.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const S1=X("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
81
- * @license lucide-react v0.468.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const Uj=X("BookA",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"m8 13 4-7 4 7",key:"4rari8"}],["path",{d:"M9.1 11h5.7",key:"1gkovt"}]]);/**
86
- * @license lucide-react v0.468.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const Wf=X("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"}]]);/**
91
- * @license lucide-react v0.468.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const Uu=X("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
96
- * @license lucide-react v0.468.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const C1=X("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"}]]);/**
101
- * @license lucide-react v0.468.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const Qf=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
106
- * @license lucide-react v0.468.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const mu=X("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
111
- * @license lucide-react v0.468.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const ba=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
116
- * @license lucide-react v0.468.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const qj=X("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
121
- * @license lucide-react v0.468.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const E1=X("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"}]]);/**
126
- * @license lucide-react v0.468.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const ml=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
131
- * @license lucide-react v0.468.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const P1=X("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
136
- * @license lucide-react v0.468.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const T1=X("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"}]]);/**
141
- * @license lucide-react v0.468.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const L1=X("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
146
- * @license lucide-react v0.468.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const Hj=X("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
151
- * @license lucide-react v0.468.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Vj=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
156
- * @license lucide-react v0.468.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const Wj=X("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
161
- * @license lucide-react v0.468.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Da=X("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"}]]);/**
166
- * @license lucide-react v0.468.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const Qj=X("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
171
- * @license lucide-react v0.468.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const Kj=X("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
176
- * @license lucide-react v0.468.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const Gj=X("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
181
- * @license lucide-react v0.468.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const Kf=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
186
- * @license lucide-react v0.468.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const Yj=X("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
191
- * @license lucide-react v0.468.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const M1=X("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"}]]);/**
196
- * @license lucide-react v0.468.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const ol=X("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
201
- * @license lucide-react v0.468.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const Xj=X("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"}]]);/**
206
- * @license lucide-react v0.468.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const R1=X("File",[["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"}]]);/**
211
- * @license lucide-react v0.468.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const Jj=X("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"}]]);/**
216
- * @license lucide-react v0.468.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const z1=X("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
221
- * @license lucide-react v0.468.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const A1=X("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
226
- * @license lucide-react v0.468.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const I1=X("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]]);/**
231
- * @license lucide-react v0.468.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const F1=X("Folder",[["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"}]]);/**
236
- * @license lucide-react v0.468.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const qu=X("Footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);/**
241
- * @license lucide-react v0.468.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const Zj=X("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"}]]);/**
246
- * @license lucide-react v0.468.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const e2=X("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);/**
251
- * @license lucide-react v0.468.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const D1=X("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
256
- * @license lucide-react v0.468.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const Hu=X("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"}]]);/**
261
- * @license lucide-react v0.468.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const Vu=X("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"}]]);/**
266
- * @license lucide-react v0.468.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const t2=X("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
271
- * @license lucide-react v0.468.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const n2=X("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
276
- * @license lucide-react v0.468.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const r2=X("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
281
- * @license lucide-react v0.468.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const Ar=X("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
286
- * @license lucide-react v0.468.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const Gf=X("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"}]]);/**
291
- * @license lucide-react v0.468.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const Oa=X("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"}]]);/**
296
- * @license lucide-react v0.468.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const O1=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
301
- * @license lucide-react v0.468.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const _1=X("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"}]]);/**
306
- * @license lucide-react v0.468.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const i2=X("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"}]]);/**
311
- * @license lucide-react v0.468.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const Wu=X("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["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"}]]);/**
316
- * @license lucide-react v0.468.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const Zm=X("MessageSquarePlus",[["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"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
321
- * @license lucide-react v0.468.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const s2=X("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
326
- * @license lucide-react v0.468.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const l2=X("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
331
- * @license lucide-react v0.468.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const $1=X("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"}]]);/**
336
- * @license lucide-react v0.468.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const a2=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
341
- * @license lucide-react v0.468.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const B1=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
346
- * @license lucide-react v0.468.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const o2=X("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
351
- * @license lucide-react v0.468.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const Yf=X("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"}]]);/**
356
- * @license lucide-react v0.468.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const Xf=X("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
361
- * @license lucide-react v0.468.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const gl=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
366
- * @license lucide-react v0.468.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const U1=X("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
371
- * @license lucide-react v0.468.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const u2=X("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"}]]);/**
376
- * @license lucide-react v0.468.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const Jf=X("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"}]]);/**
381
- * @license lucide-react v0.468.0 - ISC
382
- *
383
- * This source code is licensed under the ISC license.
384
- * See the LICENSE file in the root directory of this source tree.
385
- */const c2=X("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
386
- * @license lucide-react v0.468.0 - ISC
387
- *
388
- * This source code is licensed under the ISC license.
389
- * See the LICENSE file in the root directory of this source tree.
390
- */const d2=X("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
391
- * @license lucide-react v0.468.0 - ISC
392
- *
393
- * This source code is licensed under the ISC license.
394
- * See the LICENSE file in the root directory of this source tree.
395
- */const q1=X("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
396
- * @license lucide-react v0.468.0 - ISC
397
- *
398
- * This source code is licensed under the ISC license.
399
- * See the LICENSE file in the root directory of this source tree.
400
- */const h2=X("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
401
- * @license lucide-react v0.468.0 - ISC
402
- *
403
- * This source code is licensed under the ISC license.
404
- * See the LICENSE file in the root directory of this source tree.
405
- */const f2=X("Sunrise",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);/**
406
- * @license lucide-react v0.468.0 - ISC
407
- *
408
- * This source code is licensed under the ISC license.
409
- * See the LICENSE file in the root directory of this source tree.
410
- */const Gi=X("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"}]]);/**
411
- * @license lucide-react v0.468.0 - ISC
412
- *
413
- * This source code is licensed under the ISC license.
414
- * See the LICENSE file in the root directory of this source tree.
415
- */const p2=X("TimerReset",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]);/**
416
- * @license lucide-react v0.468.0 - ISC
417
- *
418
- * This source code is licensed under the ISC license.
419
- * See the LICENSE file in the root directory of this source tree.
420
- */const fr=X("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"}]]);/**
421
- * @license lucide-react v0.468.0 - ISC
422
- *
423
- * This source code is licensed under the ISC license.
424
- * See the LICENSE file in the root directory of this source tree.
425
- */const Zf=X("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"}]]);/**
426
- * @license lucide-react v0.468.0 - ISC
427
- *
428
- * This source code is licensed under the ISC license.
429
- * See the LICENSE file in the root directory of this source tree.
430
- */const pr=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
431
- * @license lucide-react v0.468.0 - ISC
432
- *
433
- * This source code is licensed under the ISC license.
434
- * See the LICENSE file in the root directory of this source tree.
435
- */const eg=X("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"}]]);/**
436
- * @remix-run/router v1.21.0
437
- *
438
- * Copyright (c) Remix Software Inc.
439
- *
440
- * This source code is licensed under the MIT license found in the
441
- * LICENSE.md file in the root directory of this source tree.
442
- *
443
- * @license MIT
444
- */function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}var ct;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ct||(ct={}));const tg="popstate";function m2(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:l,hash:o}=r.location;return ja("",{pathname:s,search:l,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ss(i)}return x2(t,n,null,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ul(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function g2(){return Math.random().toString(36).substr(2,8)}function ng(e,t){return{usr:e.state,key:e.key,idx:t}}function ja(e,t,n,r){return n===void 0&&(n=null),We({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bi(t):t,{state:n,key:t&&t.key||r||g2()})}function ss(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function bi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function x2(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,l=i.history,o=ct.Pop,u=null,c=d();c==null&&(c=0,l.replaceState(We({},l.state,{idx:c}),""));function d(){return(l.state||{idx:null}).idx}function h(){o=ct.Pop;let w=d(),y=w==null?null:w-c;c=w,u&&u({action:o,location:g.location,delta:y})}function p(w,y){o=ct.Push;let x=ja(g.location,w,y);c=d()+1;let v=ng(x,c),j=g.createHref(x);try{l.pushState(v,"",j)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(j)}s&&u&&u({action:o,location:g.location,delta:1})}function f(w,y){o=ct.Replace;let x=ja(g.location,w,y);c=d();let v=ng(x,c),j=g.createHref(x);l.replaceState(v,"",j),s&&u&&u({action:o,location:g.location,delta:0})}function m(w){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof w=="string"?w:ss(w);return x=x.replace(/ $/,"%20"),be(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return o},get location(){return e(i,l)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(tg,h),u=w,()=>{i.removeEventListener(tg,h),u=null}},createHref(w){return t(i,w)},createURL:m,encodeLocation(w){let y=m(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:f,go(w){return l.go(w)}};return g}var Oe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Oe||(Oe={}));const y2=new Set(["lazy","caseSensitive","path","id","index","children"]);function v2(e){return e.index===!0}function gu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let l=[...n,String(s)],o=typeof i.id=="string"?i.id:l.join("-");if(be(i.index!==!0||!i.children,"Cannot specify children on an index route"),be(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),v2(i)){let u=We({},i,t(i),{id:o});return r[o]=u,u}else{let u=We({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=gu(i.children,t,l,r)),u}})}function zi(e,t,n){return n===void 0&&(n="/"),Oo(e,t,n,!1)}function Oo(e,t,n,r){let i=typeof t=="string"?bi(t):t,s=Ir(i.pathname||"/",n);if(s==null)return null;let l=H1(e);k2(l);let o=null;for(let u=0;o==null&&u<l.length;++u){let c=R2(s);o=L2(l[u],c,r)}return o}function w2(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function H1(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,l,o)=>{let u={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};u.relativePath.startsWith("/")&&(be(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Pr([r,u.relativePath]),d=n.concat(u);s.children&&s.children.length>0&&(be(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),H1(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:P2(c,s.index),routesMeta:d})};return e.forEach((s,l)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,l);else for(let u of V1(s.path))i(s,l,u)}),t}function V1(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let l=V1(r.join("/")),o=[];return o.push(...l.map(u=>u===""?s:[s,u].join("/"))),i&&o.push(...l),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function k2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:T2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const b2=/^:[\w-]+$/,j2=3,N2=2,S2=1,C2=10,E2=-2,rg=e=>e==="*";function P2(e,t){let n=e.split("/"),r=n.length;return n.some(rg)&&(r+=E2),t&&(r+=N2),n.filter(i=>!rg(i)).reduce((i,s)=>i+(b2.test(s)?j2:s===""?S2:C2),r)}function T2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function L2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",l=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",h=xu({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},d),p=u.route;if(!h&&c&&n&&!r[r.length-1].route.index&&(h=xu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),l.push({params:i,pathname:Pr([s,h.pathname]),pathnameBase:I2(Pr([s,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(s=Pr([s,h.pathnameBase]))}return l}function xu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=M2(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],l=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,d,h)=>{let{paramName:p,isOptional:f}=d;if(p==="*"){let g=o[h]||"";l=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=o[h];return f&&!m?c[p]=void 0:c[p]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:l,pattern:e}}function M2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ul(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function R2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ul(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ir(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function z2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?bi(e):e;return{pathname:n?n.startsWith("/")?n:A2(n,t):t,search:F2(r),hash:D2(i)}}function A2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Dc(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function W1(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qu(e,t){let n=W1(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ku(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=bi(e):(i=We({},e),be(!i.pathname||!i.pathname.includes("?"),Dc("?","pathname","search",i)),be(!i.pathname||!i.pathname.includes("#"),Dc("#","pathname","hash",i)),be(!i.search||!i.search.includes("#"),Dc("#","search","hash",i)));let s=e===""||i.pathname==="",l=s?"/":i.pathname,o;if(l==null)o=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}o=h>=0?t[h]:"/"}let u=z2(i,o),c=l&&l!=="/"&&l.endsWith("/"),d=(s||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Pr=e=>e.join("/").replace(/\/\/+/g,"/"),I2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),F2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,D2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class yu{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Gu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Q1=["post","put","patch","delete"],O2=new Set(Q1),_2=["get",...Q1],$2=new Set(_2),B2=new Set([301,302,303,307,308]),U2=new Set([307,308]),Oc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},q2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ep=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,H2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),K1="remix-router-transitions";function V2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;be(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let L=e.detectErrorBoundary;i=A=>({hasErrorBoundary:L(A)})}else i=H2;let s={},l=gu(e.routes,i,void 0,s),o,u=e.basename||"/",c=e.dataStrategy||G2,d=e.patchRoutesOnNavigation,h=We({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,f=new Set,m=null,g=null,w=null,y=e.hydrationData!=null,x=zi(l,e.history.location,u),v=null;if(x==null&&!d){let L=Jt(404,{pathname:e.history.location.pathname}),{matches:A,route:_}=pg(l);x=A,v={[_.id]:L}}x&&!e.hydrationData&&Ka(x,l,e.history.location.pathname).active&&(x=null);let j;if(x)if(x.some(L=>L.route.lazy))j=!1;else if(!x.some(L=>L.route.loader))j=!0;else if(h.v7_partialHydration){let L=e.hydrationData?e.hydrationData.loaderData:null,A=e.hydrationData?e.hydrationData.errors:null;if(A){let _=x.findIndex(B=>A[B.route.id]!==void 0);j=x.slice(0,_+1).every(B=>!yh(B.route,L,A))}else j=x.every(_=>!yh(_.route,L,A))}else j=e.hydrationData!=null;else if(j=!1,x=[],h.v7_partialHydration){let L=Ka(null,l,e.history.location.pathname);L.active&&L.matches&&(x=L.matches)}let E,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:j,navigation:Oc,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},S=ct.Pop,M=!1,F,C=!1,O=new Map,I=null,Q=!1,q=!1,$=[],G=new Set,Y=new Map,z=0,H=-1,N=new Map,ue=new Set,ye=new Map,T=new Map,Te=new Set,De=new Map,ve=new Map,Ne;function _t(){if(p=e.history.listen(L=>{let{action:A,location:_,delta:B}=L;if(Ne){Ne(),Ne=void 0;return}ul(ve.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let te=hs({currentLocation:k.location,nextLocation:_,historyAction:A});if(te&&B!=null){let ae=new Promise(ge=>{Ne=ge});e.history.go(B*-1),Ci(te,{state:"blocked",location:_,proceed(){Ci(te,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ae.then(()=>e.history.go(B))},reset(){let ge=new Map(k.blockers);ge.set(te,Rl),Be({blockers:ge})}});return}return Qt(A,_)}),n){uN(t,O);let L=()=>cN(t,O);t.addEventListener("pagehide",L),I=()=>t.removeEventListener("pagehide",L)}return k.initialized||Qt(ct.Pop,k.location,{initialHydration:!0}),E}function an(){p&&p(),I&&I(),f.clear(),F&&F.abort(),k.fetchers.forEach((L,A)=>fe(A)),k.blockers.forEach((L,A)=>vn(A))}function Tt(L){return f.add(L),()=>f.delete(L)}function Be(L,A){A===void 0&&(A={}),k=We({},k,L);let _=[],B=[];h.v7_fetcherPersist&&k.fetchers.forEach((te,ae)=>{te.state==="idle"&&(Te.has(ae)?B.push(ae):_.push(ae))}),[...f].forEach(te=>te(k,{deletedFetchers:B,viewTransitionOpts:A.viewTransitionOpts,flushSync:A.flushSync===!0})),h.v7_fetcherPersist&&(_.forEach(te=>k.fetchers.delete(te)),B.forEach(te=>fe(te)))}function lt(L,A,_){var B,te;let{flushSync:ae}=_===void 0?{}:_,ge=k.actionData!=null&&k.navigation.formMethod!=null&&_n(k.navigation.formMethod)&&k.navigation.state==="loading"&&((B=L.state)==null?void 0:B._isRedirect)!==!0,re;A.actionData?Object.keys(A.actionData).length>0?re=A.actionData:re=null:ge?re=k.actionData:re=null;let ie=A.loaderData?hg(k.loaderData,A.loaderData,A.matches||[],A.errors):k.loaderData,ne=k.blockers;ne.size>0&&(ne=new Map(ne),ne.forEach((Le,jt)=>ne.set(jt,Rl)));let oe=M===!0||k.navigation.formMethod!=null&&_n(k.navigation.formMethod)&&((te=L.state)==null?void 0:te._isRedirect)!==!0;o&&(l=o,o=void 0),Q||S===ct.Pop||(S===ct.Push?e.history.push(L,L.state):S===ct.Replace&&e.history.replace(L,L.state));let Ee;if(S===ct.Pop){let Le=O.get(k.location.pathname);Le&&Le.has(L.pathname)?Ee={currentLocation:k.location,nextLocation:L}:O.has(L.pathname)&&(Ee={currentLocation:L,nextLocation:k.location})}else if(C){let Le=O.get(k.location.pathname);Le?Le.add(L.pathname):(Le=new Set([L.pathname]),O.set(k.location.pathname,Le)),Ee={currentLocation:k.location,nextLocation:L}}Be(We({},A,{actionData:re,loaderData:ie,historyAction:S,location:L,initialized:!0,navigation:Oc,revalidation:"idle",restoreScrollPosition:Lp(L,A.matches||k.matches),preventScrollReset:oe,blockers:ne}),{viewTransitionOpts:Ee,flushSync:ae===!0}),S=ct.Pop,M=!1,C=!1,Q=!1,q=!1,$=[]}async function Rn(L,A){if(typeof L=="number"){e.history.go(L);return}let _=xh(k.location,k.matches,u,h.v7_prependBasename,L,h.v7_relativeSplatPath,A==null?void 0:A.fromRouteId,A==null?void 0:A.relative),{path:B,submission:te,error:ae}=ig(h.v7_normalizeFormMethod,!1,_,A),ge=k.location,re=ja(k.location,B,A&&A.state);re=We({},re,e.history.encodeLocation(re));let ie=A&&A.replace!=null?A.replace:void 0,ne=ct.Push;ie===!0?ne=ct.Replace:ie===!1||te!=null&&_n(te.formMethod)&&te.formAction===k.location.pathname+k.location.search&&(ne=ct.Replace);let oe=A&&"preventScrollReset"in A?A.preventScrollReset===!0:void 0,Ee=(A&&A.flushSync)===!0,Le=hs({currentLocation:ge,nextLocation:re,historyAction:ne});if(Le){Ci(Le,{state:"blocked",location:re,proceed(){Ci(Le,{state:"proceeding",proceed:void 0,reset:void 0,location:re}),Rn(L,A)},reset(){let jt=new Map(k.blockers);jt.set(Le,Rl),Be({blockers:jt})}});return}return await Qt(ne,re,{submission:te,pendingError:ae,preventScrollReset:oe,replace:A&&A.replace,enableViewTransition:A&&A.viewTransition,flushSync:Ee})}function zn(){if(Jn(),Be({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Qt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Qt(S||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:C===!0})}}async function Qt(L,A,_){F&&F.abort(),F=null,S=L,Q=(_&&_.startUninterruptedRevalidation)===!0,Lw(k.location,k.matches),M=(_&&_.preventScrollReset)===!0,C=(_&&_.enableViewTransition)===!0;let B=o||l,te=_&&_.overrideNavigation,ae=zi(B,A,u),ge=(_&&_.flushSync)===!0,re=Ka(ae,B,A.pathname);if(re.active&&re.matches&&(ae=re.matches),!ae){let{error:Ue,notFoundMatches:Ae,route:Ze}=bt(A.pathname);lt(A,{matches:Ae,loaderData:{},errors:{[Ze.id]:Ue}},{flushSync:ge});return}if(k.initialized&&!q&&tN(k.location,A)&&!(_&&_.submission&&_n(_.submission.formMethod))){lt(A,{matches:ae},{flushSync:ge});return}F=new AbortController;let ie=xs(e.history,A,F.signal,_&&_.submission),ne;if(_&&_.pendingError)ne=[Ai(ae).route.id,{type:Oe.error,error:_.pendingError}];else if(_&&_.submission&&_n(_.submission.formMethod)){let Ue=await Kn(ie,A,_.submission,ae,re.active,{replace:_.replace,flushSync:ge});if(Ue.shortCircuited)return;if(Ue.pendingActionResult){let[Ae,Ze]=Ue.pendingActionResult;if(hn(Ze)&&Gu(Ze.error)&&Ze.error.status===404){F=null,lt(A,{matches:Ue.matches,loaderData:{},errors:{[Ae]:Ze.error}});return}}ae=Ue.matches||ae,ne=Ue.pendingActionResult,te=_c(A,_.submission),ge=!1,re.active=!1,ie=xs(e.history,ie.url,ie.signal)}let{shortCircuited:oe,matches:Ee,loaderData:Le,errors:jt}=await on(ie,A,ae,re.active,te,_&&_.submission,_&&_.fetcherSubmission,_&&_.replace,_&&_.initialHydration===!0,ge,ne);oe||(F=null,lt(A,We({matches:Ee||ae},fg(ne),{loaderData:Le,errors:jt})))}async function Kn(L,A,_,B,te,ae){ae===void 0&&(ae={}),Jn();let ge=aN(A,_);if(Be({navigation:ge},{flushSync:ae.flushSync===!0}),te){let ne=await Ga(B,A.pathname,L.signal);if(ne.type==="aborted")return{shortCircuited:!0};if(ne.type==="error"){let oe=Ai(ne.partialMatches).route.id;return{matches:ne.partialMatches,pendingActionResult:[oe,{type:Oe.error,error:ne.error}]}}else if(ne.matches)B=ne.matches;else{let{notFoundMatches:oe,error:Ee,route:Le}=bt(A.pathname);return{matches:oe,pendingActionResult:[Le.id,{type:Oe.error,error:Ee}]}}}let re,ie=ql(B,A);if(!ie.route.action&&!ie.route.lazy)re={type:Oe.error,error:Jt(405,{method:L.method,pathname:A.pathname,routeId:ie.route.id})};else if(re=(await Kt("action",k,L,[ie],B,null))[ie.route.id],L.signal.aborted)return{shortCircuited:!0};if(Oi(re)){let ne;return ae&&ae.replace!=null?ne=ae.replace:ne=ug(re.response.headers.get("Location"),new URL(L.url),u)===k.location.pathname+k.location.search,await J(L,re,!0,{submission:_,replace:ne}),{shortCircuited:!0}}if(li(re))throw Jt(400,{type:"defer-action"});if(hn(re)){let ne=Ai(B,ie.route.id);return(ae&&ae.replace)!==!0&&(S=ct.Push),{matches:B,pendingActionResult:[ne.route.id,re]}}return{matches:B,pendingActionResult:[ie.route.id,re]}}async function on(L,A,_,B,te,ae,ge,re,ie,ne,oe){let Ee=te||_c(A,ae),Le=ae||ge||gg(Ee),jt=!Q&&(!h.v7_partialHydration||!ie);if(B){if(jt){let et=Gn(oe);Be(We({navigation:Ee},et!==void 0?{actionData:et}:{}),{flushSync:ne})}let Re=await Ga(_,A.pathname,L.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let et=Ai(Re.partialMatches).route.id;return{matches:Re.partialMatches,loaderData:{},errors:{[et]:Re.error}}}else if(Re.matches)_=Re.matches;else{let{error:et,notFoundMatches:ps,route:jl}=bt(A.pathname);return{matches:ps,loaderData:{},errors:{[jl.id]:et}}}}let Ue=o||l,[Ae,Ze]=lg(e.history,k,_,Le,A,h.v7_partialHydration&&ie===!0,h.v7_skipActionErrorRevalidation,q,$,G,Te,ye,ue,Ue,u,oe);if(Zn(Re=>!(_&&_.some(et=>et.route.id===Re))||Ae&&Ae.some(et=>et.route.id===Re)),H=++z,Ae.length===0&&Ze.length===0){let Re=R();return lt(A,We({matches:_,loaderData:{},errors:oe&&hn(oe[1])?{[oe[0]]:oe[1].error}:null},fg(oe),Re?{fetchers:new Map(k.fetchers)}:{}),{flushSync:ne}),{shortCircuited:!0}}if(jt){let Re={};if(!B){Re.navigation=Ee;let et=Gn(oe);et!==void 0&&(Re.actionData=et)}Ze.length>0&&(Re.fetchers=xr(Ze)),Be(Re,{flushSync:ne})}Ze.forEach(Re=>{Se(Re.key),Re.controller&&Y.set(Re.key,Re.controller)});let fs=()=>Ze.forEach(Re=>Se(Re.key));F&&F.signal.addEventListener("abort",fs);let{loaderResults:kl,fetcherResults:wr}=await vr(k,_,Ae,Ze,L);if(L.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",fs),Ze.forEach(Re=>Y.delete(Re.key));let er=yo(kl);if(er)return await J(L,er.result,!0,{replace:re}),{shortCircuited:!0};if(er=yo(wr),er)return ue.add(er.key),await J(L,er.result,!0,{replace:re}),{shortCircuited:!0};let{loaderData:oc,errors:bl}=dg(k,_,kl,oe,Ze,wr,De);De.forEach((Re,et)=>{Re.subscribe(ps=>{(ps||Re.done)&&De.delete(et)})}),h.v7_partialHydration&&ie&&k.errors&&(bl=We({},k.errors,bl));let Ei=R(),Ya=we(H),Xa=Ei||Ya||Ze.length>0;return We({matches:_,loaderData:oc,errors:bl},Xa?{fetchers:new Map(k.fetchers)}:{})}function Gn(L){if(L&&!hn(L[1]))return{[L[0]]:L[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function xr(L){return L.forEach(A=>{let _=k.fetchers.get(A.key),B=zl(void 0,_?_.data:void 0);k.fetchers.set(A.key,B)}),new Map(k.fetchers)}function Yn(L,A,_,B){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Se(L);let te=(B&&B.flushSync)===!0,ae=o||l,ge=xh(k.location,k.matches,u,h.v7_prependBasename,_,h.v7_relativeSplatPath,A,B==null?void 0:B.relative),re=zi(ae,ge,u),ie=Ka(re,ae,ge);if(ie.active&&ie.matches&&(re=ie.matches),!re){U(L,A,Jt(404,{pathname:ge}),{flushSync:te});return}let{path:ne,submission:oe,error:Ee}=ig(h.v7_normalizeFormMethod,!0,ge,B);if(Ee){U(L,A,Ee,{flushSync:te});return}let Le=ql(re,ne),jt=(B&&B.preventScrollReset)===!0;if(oe&&_n(oe.formMethod)){Xn(L,A,ne,Le,re,ie.active,te,jt,oe);return}ye.set(L,{routeId:A,path:ne}),yr(L,A,ne,Le,re,ie.active,te,jt,oe)}async function Xn(L,A,_,B,te,ae,ge,re,ie){Jn(),ye.delete(L);function ne(ot){if(!ot.route.action&&!ot.route.lazy){let ms=Jt(405,{method:ie.formMethod,pathname:_,routeId:A});return U(L,A,ms,{flushSync:ge}),!0}return!1}if(!ae&&ne(B))return;let oe=k.fetchers.get(L);D(L,oN(ie,oe),{flushSync:ge});let Ee=new AbortController,Le=xs(e.history,_,Ee.signal,ie);if(ae){let ot=await Ga(te,_,Le.signal);if(ot.type==="aborted")return;if(ot.type==="error"){U(L,A,ot.error,{flushSync:ge});return}else if(ot.matches){if(te=ot.matches,B=ql(te,_),ne(B))return}else{U(L,A,Jt(404,{pathname:_}),{flushSync:ge});return}}Y.set(L,Ee);let jt=z,Ae=(await Kt("action",k,Le,[B],te,L))[B.route.id];if(Le.signal.aborted){Y.get(L)===Ee&&Y.delete(L);return}if(h.v7_fetcherPersist&&Te.has(L)){if(Oi(Ae)||hn(Ae)){D(L,qr(void 0));return}}else{if(Oi(Ae))if(Y.delete(L),H>jt){D(L,qr(void 0));return}else return ue.add(L),D(L,zl(ie)),J(Le,Ae,!1,{fetcherSubmission:ie,preventScrollReset:re});if(hn(Ae)){U(L,A,Ae.error);return}}if(li(Ae))throw Jt(400,{type:"defer-action"});let Ze=k.navigation.location||k.location,fs=xs(e.history,Ze,Ee.signal),kl=o||l,wr=k.navigation.state!=="idle"?zi(kl,k.navigation.location,u):k.matches;be(wr,"Didn't find any matches after fetcher action");let er=++z;N.set(L,er);let oc=zl(ie,Ae.data);k.fetchers.set(L,oc);let[bl,Ei]=lg(e.history,k,wr,ie,Ze,!1,h.v7_skipActionErrorRevalidation,q,$,G,Te,ye,ue,kl,u,[B.route.id,Ae]);Ei.filter(ot=>ot.key!==L).forEach(ot=>{let ms=ot.key,Mp=k.fetchers.get(ms),zw=zl(void 0,Mp?Mp.data:void 0);k.fetchers.set(ms,zw),Se(ms),ot.controller&&Y.set(ms,ot.controller)}),Be({fetchers:new Map(k.fetchers)});let Ya=()=>Ei.forEach(ot=>Se(ot.key));Ee.signal.addEventListener("abort",Ya);let{loaderResults:Xa,fetcherResults:Re}=await vr(k,wr,bl,Ei,fs);if(Ee.signal.aborted)return;Ee.signal.removeEventListener("abort",Ya),N.delete(L),Y.delete(L),Ei.forEach(ot=>Y.delete(ot.key));let et=yo(Xa);if(et)return J(fs,et.result,!1,{preventScrollReset:re});if(et=yo(Re),et)return ue.add(et.key),J(fs,et.result,!1,{preventScrollReset:re});let{loaderData:ps,errors:jl}=dg(k,wr,Xa,void 0,Ei,Re,De);if(k.fetchers.has(L)){let ot=qr(Ae.data);k.fetchers.set(L,ot)}we(er),k.navigation.state==="loading"&&er>H?(be(S,"Expected pending action"),F&&F.abort(),lt(k.navigation.location,{matches:wr,loaderData:ps,errors:jl,fetchers:new Map(k.fetchers)})):(Be({errors:jl,loaderData:hg(k.loaderData,ps,wr,jl),fetchers:new Map(k.fetchers)}),q=!1)}async function yr(L,A,_,B,te,ae,ge,re,ie){let ne=k.fetchers.get(L);D(L,zl(ie,ne?ne.data:void 0),{flushSync:ge});let oe=new AbortController,Ee=xs(e.history,_,oe.signal);if(ae){let Ae=await Ga(te,_,Ee.signal);if(Ae.type==="aborted")return;if(Ae.type==="error"){U(L,A,Ae.error,{flushSync:ge});return}else if(Ae.matches)te=Ae.matches,B=ql(te,_);else{U(L,A,Jt(404,{pathname:_}),{flushSync:ge});return}}Y.set(L,oe);let Le=z,Ue=(await Kt("loader",k,Ee,[B],te,L))[B.route.id];if(li(Ue)&&(Ue=await tp(Ue,Ee.signal,!0)||Ue),Y.get(L)===oe&&Y.delete(L),!Ee.signal.aborted){if(Te.has(L)){D(L,qr(void 0));return}if(Oi(Ue))if(H>Le){D(L,qr(void 0));return}else{ue.add(L),await J(Ee,Ue,!1,{preventScrollReset:re});return}if(hn(Ue)){U(L,A,Ue.error);return}be(!li(Ue),"Unhandled fetcher deferred data"),D(L,qr(Ue.data))}}async function J(L,A,_,B){let{submission:te,fetcherSubmission:ae,preventScrollReset:ge,replace:re}=B===void 0?{}:B;A.response.headers.has("X-Remix-Revalidate")&&(q=!0);let ie=A.response.headers.get("Location");be(ie,"Expected a Location header on the redirect Response"),ie=ug(ie,new URL(L.url),u);let ne=ja(k.location,ie,{_isRedirect:!0});if(n){let Ae=!1;if(A.response.headers.has("X-Remix-Reload-Document"))Ae=!0;else if(ep.test(ie)){const Ze=e.history.createURL(ie);Ae=Ze.origin!==t.location.origin||Ir(Ze.pathname,u)==null}if(Ae){re?t.location.replace(ie):t.location.assign(ie);return}}F=null;let oe=re===!0||A.response.headers.has("X-Remix-Replace")?ct.Replace:ct.Push,{formMethod:Ee,formAction:Le,formEncType:jt}=k.navigation;!te&&!ae&&Ee&&Le&&jt&&(te=gg(k.navigation));let Ue=te||ae;if(U2.has(A.response.status)&&Ue&&_n(Ue.formMethod))await Qt(oe,ne,{submission:We({},Ue,{formAction:ie}),preventScrollReset:ge||M,enableViewTransition:_?C:void 0});else{let Ae=_c(ne,te);await Qt(oe,ne,{overrideNavigation:Ae,fetcherSubmission:ae,preventScrollReset:ge||M,enableViewTransition:_?C:void 0})}}async function Kt(L,A,_,B,te,ae){let ge,re={};try{ge=await Y2(c,L,A,_,B,te,ae,s,i)}catch(ie){return B.forEach(ne=>{re[ne.route.id]={type:Oe.error,error:ie}}),re}for(let[ie,ne]of Object.entries(ge))if(nN(ne)){let oe=ne.result;re[ie]={type:Oe.redirect,response:Z2(oe,_,ie,te,u,h.v7_relativeSplatPath)}}else re[ie]=await J2(ne);return re}async function vr(L,A,_,B,te){let ae=L.matches,ge=Kt("loader",L,te,_,A,null),re=Promise.all(B.map(async oe=>{if(oe.matches&&oe.match&&oe.controller){let Le=(await Kt("loader",L,xs(e.history,oe.path,oe.controller.signal),[oe.match],oe.matches,oe.key))[oe.match.route.id];return{[oe.key]:Le}}else return Promise.resolve({[oe.key]:{type:Oe.error,error:Jt(404,{pathname:oe.path})}})})),ie=await ge,ne=(await re).reduce((oe,Ee)=>Object.assign(oe,Ee),{});return await Promise.all([sN(A,ie,te.signal,ae,L.loaderData),lN(A,ne,B)]),{loaderResults:ie,fetcherResults:ne}}function Jn(){q=!0,$.push(...Zn()),ye.forEach((L,A)=>{Y.has(A)&&G.add(A),Se(A)})}function D(L,A,_){_===void 0&&(_={}),k.fetchers.set(L,A),Be({fetchers:new Map(k.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function U(L,A,_,B){B===void 0&&(B={});let te=Ai(k.matches,A);fe(L),Be({errors:{[te.route.id]:_},fetchers:new Map(k.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function he(L){return h.v7_fetcherPersist&&(T.set(L,(T.get(L)||0)+1),Te.has(L)&&Te.delete(L)),k.fetchers.get(L)||q2}function fe(L){let A=k.fetchers.get(L);Y.has(L)&&!(A&&A.state==="loading"&&N.has(L))&&Se(L),ye.delete(L),N.delete(L),ue.delete(L),Te.delete(L),G.delete(L),k.fetchers.delete(L)}function ht(L){if(h.v7_fetcherPersist){let A=(T.get(L)||0)-1;A<=0?(T.delete(L),Te.add(L)):T.set(L,A)}else fe(L);Be({fetchers:new Map(k.fetchers)})}function Se(L){let A=Y.get(L);A&&(A.abort(),Y.delete(L))}function at(L){for(let A of L){let _=he(A),B=qr(_.data);k.fetchers.set(A,B)}}function R(){let L=[],A=!1;for(let _ of ue){let B=k.fetchers.get(_);be(B,"Expected fetcher: "+_),B.state==="loading"&&(ue.delete(_),L.push(_),A=!0)}return at(L),A}function we(L){let A=[];for(let[_,B]of N)if(B<L){let te=k.fetchers.get(_);be(te,"Expected fetcher: "+_),te.state==="loading"&&(Se(_),N.delete(_),A.push(_))}return at(A),A.length>0}function Je(L,A){let _=k.blockers.get(L)||Rl;return ve.get(L)!==A&&ve.set(L,A),_}function vn(L){k.blockers.delete(L),ve.delete(L)}function Ci(L,A){let _=k.blockers.get(L)||Rl;be(_.state==="unblocked"&&A.state==="blocked"||_.state==="blocked"&&A.state==="blocked"||_.state==="blocked"&&A.state==="proceeding"||_.state==="blocked"&&A.state==="unblocked"||_.state==="proceeding"&&A.state==="unblocked","Invalid blocker state transition: "+_.state+" -> "+A.state);let B=new Map(k.blockers);B.set(L,A),Be({blockers:B})}function hs(L){let{currentLocation:A,nextLocation:_,historyAction:B}=L;if(ve.size===0)return;ve.size>1&&ul(!1,"A router only supports one blocker at a time");let te=Array.from(ve.entries()),[ae,ge]=te[te.length-1],re=k.blockers.get(ae);if(!(re&&re.state==="proceeding")&&ge({currentLocation:A,nextLocation:_,historyAction:B}))return ae}function bt(L){let A=Jt(404,{pathname:L}),_=o||l,{matches:B,route:te}=pg(_);return Zn(),{notFoundMatches:B,route:te,error:A}}function Zn(L){let A=[];return De.forEach((_,B)=>{(!L||L(B))&&(_.cancel(),A.push(B),De.delete(B))}),A}function An(L,A,_){if(m=L,w=A,g=_||null,!y&&k.navigation===Oc){y=!0;let B=Lp(k.location,k.matches);B!=null&&Be({restoreScrollPosition:B})}return()=>{m=null,w=null,g=null}}function Tp(L,A){return g&&g(L,A.map(B=>w2(B,k.loaderData)))||L.key}function Lw(L,A){if(m&&w){let _=Tp(L,A);m[_]=w()}}function Lp(L,A){if(m){let _=Tp(L,A),B=m[_];if(typeof B=="number")return B}return null}function Ka(L,A,_){if(d)if(L){if(Object.keys(L[0].params).length>0)return{active:!0,matches:Oo(A,_,u,!0)}}else return{active:!0,matches:Oo(A,_,u,!0)||[]};return{active:!1,matches:null}}async function Ga(L,A,_){if(!d)return{type:"success",matches:L};let B=L;for(;;){let te=o==null,ae=o||l,ge=s;try{await d({path:A,matches:B,patch:(ne,oe)=>{_.aborted||og(ne,oe,ae,ge,i)}})}catch(ne){return{type:"error",error:ne,partialMatches:B}}finally{te&&!_.aborted&&(l=[...l])}if(_.aborted)return{type:"aborted"};let re=zi(ae,A,u);if(re)return{type:"success",matches:re};let ie=Oo(ae,A,u,!0);if(!ie||B.length===ie.length&&B.every((ne,oe)=>ne.route.id===ie[oe].route.id))return{type:"success",matches:null};B=ie}}function Mw(L){s={},o=gu(L,i,void 0,s)}function Rw(L,A){let _=o==null;og(L,A,o||l,s,i),_&&(l=[...l],Be({}))}return E={get basename(){return u},get future(){return h},get state(){return k},get routes(){return l},get window(){return t},initialize:_t,subscribe:Tt,enableScrollRestoration:An,navigate:Rn,fetch:Yn,revalidate:zn,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:he,deleteFetcher:ht,dispose:an,getBlocker:Je,deleteBlocker:vn,patchRoutes:Rw,_internalFetchControllers:Y,_internalActiveDeferreds:De,_internalSetRoutes:Mw},E}function W2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xh(e,t,n,r,i,s,l,o){let u,c;if(l){u=[];for(let h of t)if(u.push(h),h.route.id===l){c=h;break}}else u=t,c=t[t.length-1];let d=Ku(i||".",Qu(u,s),Ir(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&c){let h=np(d.search);if(c.route.index&&!h)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&h){let p=new URLSearchParams(d.search),f=p.getAll("index");p.delete("index"),f.filter(g=>g).forEach(g=>p.append("index",g));let m=p.toString();d.search=m?"?"+m:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Pr([n,d.pathname])),ss(d)}function ig(e,t,n,r){if(!r||!W2(r))return{path:n};if(r.formMethod&&!iN(r.formMethod))return{path:n,error:Jt(405,{method:r.formMethod})};let i=()=>({path:n,error:Jt(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),o=X1(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!_n(l))return i();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[g,w]=m;return""+f+g+"="+w+`
445
- `},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!_n(l))return i();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:o,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}be(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=vh(r.formData),c=r.formData;else if(r.body instanceof FormData)u=vh(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=cg(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=cg(u)}catch{return i()}let d={formMethod:l,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(_n(d.formMethod))return{path:n,submission:d};let h=bi(n);return t&&h.search&&np(h.search)&&u.append("index",""),h.search="?"+u,{path:ss(h),submission:d}}function sg(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function lg(e,t,n,r,i,s,l,o,u,c,d,h,p,f,m,g){let w=g?hn(g[1])?g[1].error:g[1].data:void 0,y=e.createURL(t.location),x=e.createURL(i),v=n;s&&t.errors?v=sg(n,Object.keys(t.errors)[0],!0):g&&hn(g[1])&&(v=sg(n,g[0]));let j=g?g[1].statusCode:void 0,E=l&&j&&j>=400,k=v.filter((M,F)=>{let{route:C}=M;if(C.lazy)return!0;if(C.loader==null)return!1;if(s)return yh(C,t.loaderData,t.errors);if(Q2(t.loaderData,t.matches[F],M)||u.some(Q=>Q===M.route.id))return!0;let O=t.matches[F],I=M;return ag(M,We({currentUrl:y,currentParams:O.params,nextUrl:x,nextParams:I.params},r,{actionResult:w,actionStatus:j,defaultShouldRevalidate:E?!1:o||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||G1(O,I)}))}),S=[];return h.forEach((M,F)=>{if(s||!n.some(q=>q.route.id===M.routeId)||d.has(F))return;let C=zi(f,M.path,m);if(!C){S.push({key:F,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(F),I=ql(C,M.path),Q=!1;p.has(F)?Q=!1:c.has(F)?(c.delete(F),Q=!0):O&&O.state!=="idle"&&O.data===void 0?Q=o:Q=ag(I,We({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:j,defaultShouldRevalidate:E?!1:o})),Q&&S.push({key:F,routeId:M.routeId,path:M.path,matches:C,match:I,controller:new AbortController})}),[k,S]}function yh(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function Q2(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function G1(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ag(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function og(e,t,n,r,i){var s;let l;if(e){let c=r[e];be(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),l=c.children}else l=n;let o=t.filter(c=>!l.some(d=>Y1(c,d))),u=gu(o,i,[e||"_","patch",String(((s=l)==null?void 0:s.length)||"0")],r);l.push(...u)}function Y1(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>Y1(n,s))}):!1}async function K2(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];be(i,"No route found in manifest");let s={};for(let l in r){let u=i[l]!==void 0&&l!=="hasErrorBoundary";ul(!u,'Route "'+i.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!u&&!y2.has(l)&&(s[l]=r[l])}Object.assign(i,s),Object.assign(i,We({},t(i),{lazy:void 0}))}async function G2(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,l)=>Object.assign(i,{[n[l].route.id]:s}),{})}async function Y2(e,t,n,r,i,s,l,o,u,c){let d=s.map(f=>f.route.lazy?K2(f.route,u,o):void 0),h=s.map((f,m)=>{let g=d[m],w=i.some(x=>x.route.id===f.route.id);return We({},f,{shouldLoad:w,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(w=!0),w?X2(t,r,f,g,x,c):Promise.resolve({type:Oe.data,result:void 0}))})}),p=await e({matches:h,request:r,params:s[0].params,fetcherKey:l,context:c});try{await Promise.all(d)}catch{}return p}async function X2(e,t,n,r,i,s){let l,o,u=c=>{let d,h=new Promise((m,g)=>d=g);o=()=>d(),t.signal.addEventListener("abort",o);let p=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:s},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(g=>p(g)):p())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,h])};try{let c=n.route[e];if(r)if(c){let d,[h]=await Promise.all([u(c).catch(p=>{d=p}),r]);if(d!==void 0)throw d;l=h}else if(await r,c=n.route[e],c)l=await u(c);else if(e==="action"){let d=new URL(t.url),h=d.pathname+d.search;throw Jt(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:Oe.data,result:void 0};else if(c)l=await u(c);else{let d=new URL(t.url),h=d.pathname+d.search;throw Jt(404,{pathname:h})}be(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Oe.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return l}async function J2(e){let{result:t,type:n}=e;if(J1(t)){let c;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(d){return{type:Oe.error,error:d}}return n===Oe.error?{type:Oe.error,error:new yu(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Oe.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Oe.error){if(mg(t)){var r;if(t.data instanceof Error){var i;return{type:Oe.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new yu(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Oe.error,error:t,statusCode:Gu(t)?t.status:void 0}}if(rN(t)){var s,l;return{type:Oe.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(mg(t)){var o,u;return{type:Oe.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Oe.data,data:t}}function Z2(e,t,n,r,i,s){let l=e.headers.get("Location");if(be(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!ep.test(l)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);l=xh(new URL(t.url),o,i,!0,l,s),e.headers.set("Location",l)}return e}function ug(e,t,n){if(ep.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Ir(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function xs(e,t,n,r){let i=e.createURL(X1(t)).toString(),s={signal:n};if(r&&_n(r.formMethod)){let{formMethod:l,formEncType:o}=r;s.method=l.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(r.json)):o==="text/plain"?s.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?s.body=vh(r.formData):s.body=r.formData}return new Request(i,s)}function vh(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function cg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function eN(e,t,n,r,i){let s={},l=null,o,u=!1,c={},d=n&&hn(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let p=h.route.id,f=t[p];if(be(!Oi(f),"Cannot handle redirect results in processLoaderData"),hn(f)){let m=f.error;d!==void 0&&(m=d,d=void 0),l=l||{};{let g=Ai(e,p);l[g.route.id]==null&&(l[g.route.id]=m)}s[p]=void 0,u||(u=!0,o=Gu(f.error)?f.error.status:500),f.headers&&(c[p]=f.headers)}else li(f)?(r.set(p,f.deferredData),s[p]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!u&&(o=f.statusCode),f.headers&&(c[p]=f.headers)):(s[p]=f.data,f.statusCode&&f.statusCode!==200&&!u&&(o=f.statusCode),f.headers&&(c[p]=f.headers))}),d!==void 0&&n&&(l={[n[0]]:d},s[n[0]]=void 0),{loaderData:s,errors:l,statusCode:o||200,loaderHeaders:c}}function dg(e,t,n,r,i,s,l){let{loaderData:o,errors:u}=eN(t,n,r,l);return i.forEach(c=>{let{key:d,match:h,controller:p}=c,f=s[d];if(be(f,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(hn(f)){let m=Ai(e.matches,h==null?void 0:h.route.id);u&&u[m.route.id]||(u=We({},u,{[m.route.id]:f.error})),e.fetchers.delete(d)}else if(Oi(f))be(!1,"Unhandled fetcher revalidation redirect");else if(li(f))be(!1,"Unhandled fetcher deferred data");else{let m=qr(f.data);e.fetchers.set(d,m)}}),{loaderData:o,errors:u}}function hg(e,t,n,r){let i=We({},t);for(let s of n){let l=s.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(i[l]=t[l]):e[l]!==void 0&&s.route.loader&&(i[l]=e[l]),r&&r.hasOwnProperty(l))break}return i}function fg(e){return e?hn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ai(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function pg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Jt(e,t){let{pathname:n,routeId:r,method:i,type:s,message:l}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?u="defer() is not supported in actions":s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new yu(e||500,o,new Error(u),!0)}function yo(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Oi(i))return{key:r,result:i}}}function X1(e){let t=typeof e=="string"?bi(e):e;return ss(We({},t,{hash:""}))}function tN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function nN(e){return J1(e.result)&&B2.has(e.result.status)}function li(e){return e.type===Oe.deferred}function hn(e){return e.type===Oe.error}function Oi(e){return(e&&e.type)===Oe.redirect}function mg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function rN(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function J1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function iN(e){return $2.has(e.toLowerCase())}function _n(e){return O2.has(e.toLowerCase())}async function sN(e,t,n,r,i){let s=Object.entries(t);for(let l=0;l<s.length;l++){let[o,u]=s[l],c=e.find(p=>(p==null?void 0:p.route.id)===o);if(!c)continue;let d=r.find(p=>p.route.id===c.route.id),h=d!=null&&!G1(d,c)&&(i&&i[c.route.id])!==void 0;li(u)&&h&&await tp(u,n,!1).then(p=>{p&&(t[o]=p)})}}async function lN(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:l}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===s)&&li(o)&&(be(l,"Expected an AbortController for revalidating fetcher deferred result"),await tp(o,l.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function tp(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Oe.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Oe.error,error:i}}return{type:Oe.data,data:e.deferredData.data}}}function np(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ql(e,t){let n=typeof t=="string"?bi(t).search:t.search;if(e[e.length-1].route.index&&np(n||""))return e[e.length-1];let r=W1(e);return r[r.length-1]}function gg(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:l}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function _c(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function aN(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function zl(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function oN(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function qr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function uN(e,t){try{let n=e.sessionStorage.getItem(K1);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function cN(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(K1,JSON.stringify(n))}catch(r){ul(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
446
- * React Router v6.28.0
447
- *
448
- * Copyright (c) Remix Software Inc.
449
- *
450
- * This source code is licensed under the MIT license found in the
451
- * LICENSE.md file in the root directory of this source tree.
452
- *
453
- * @license MIT
454
- */function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vu.apply(this,arguments)}const _a=b.createContext(null),rp=b.createContext(null),Dr=b.createContext(null),ip=b.createContext(null),mr=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Z1=b.createContext(null);function dN(e,t){let{relative:n}=t===void 0?{}:t;xl()||be(!1);let{basename:r,navigator:i}=b.useContext(Dr),{hash:s,pathname:l,search:o}=Yu(e,{relative:n}),u=l;return r!=="/"&&(u=l==="/"?r:Pr([r,l])),i.createHref({pathname:u,search:o,hash:s})}function xl(){return b.useContext(ip)!=null}function ji(){return xl()||be(!1),b.useContext(ip).location}function e0(e){b.useContext(Dr).static||b.useLayoutEffect(e)}function gt(){let{isDataRoute:e}=b.useContext(mr);return e?SN():hN()}function hN(){xl()||be(!1);let e=b.useContext(_a),{basename:t,future:n,navigator:r}=b.useContext(Dr),{matches:i}=b.useContext(mr),{pathname:s}=ji(),l=JSON.stringify(Qu(i,n.v7_relativeSplatPath)),o=b.useRef(!1);return e0(()=>{o.current=!0}),b.useCallback(function(c,d){if(d===void 0&&(d={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let h=Ku(c,JSON.parse(l),s,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Pr([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,l,s,e])}const fN=b.createContext(null);function pN(e){let t=b.useContext(mr).outlet;return t&&b.createElement(fN.Provider,{value:e},t)}function Or(){let{matches:e}=b.useContext(mr),t=e[e.length-1];return t?t.params:{}}function Yu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Dr),{matches:i}=b.useContext(mr),{pathname:s}=ji(),l=JSON.stringify(Qu(i,r.v7_relativeSplatPath));return b.useMemo(()=>Ku(e,JSON.parse(l),s,n==="path"),[e,l,s,n])}function mN(e,t,n,r){xl()||be(!1);let{navigator:i}=b.useContext(Dr),{matches:s}=b.useContext(mr),l=s[s.length-1],o=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=ji(),d;d=c;let h=d.pathname||"/",p=h;if(u!=="/"){let g=u.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let f=zi(e,{pathname:p});return wN(f&&f.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Pr([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Pr([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,n,r)}function gN(){let e=NN(),t=Gu(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:i},n):null,null)}const xN=b.createElement(gN,null);class yN extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(mr.Provider,{value:this.props.routeContext},b.createElement(Z1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vN(e){let{routeContext:t,match:n,children:r}=e,i=b.useContext(_a);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(mr.Provider,{value:t},r)}function wN(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=l.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||be(!1),l=l.slice(0,Math.min(l.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<l.length;d++){let h=l[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=d),h.route.id){let{loaderData:p,errors:f}=n,m=h.route.loader&&p[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||m){u=!0,c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((d,h,p)=>{let f,m=!1,g=null,w=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,g=h.route.errorElement||xN,u&&(c<0&&p===0?(CN("route-fallback"),m=!0,w=null):c===p&&(m=!0,w=h.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),x=()=>{let v;return f?v=g:m?v=w:h.route.Component?v=b.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,b.createElement(vN,{match:h,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?b.createElement(yN,{location:n.location,revalidation:n.revalidation,component:g,error:f,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var t0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(t0||{}),n0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(n0||{});function kN(e){let t=b.useContext(_a);return t||be(!1),t}function bN(e){let t=b.useContext(rp);return t||be(!1),t}function jN(e){let t=b.useContext(mr);return t||be(!1),t}function r0(e){let t=jN(),n=t.matches[t.matches.length-1];return n.route.id||be(!1),n.route.id}function NN(){var e;let t=b.useContext(Z1),n=bN(),r=r0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function SN(){let{router:e}=kN(t0.UseNavigateStable),t=r0(n0.UseNavigateStable),n=b.useRef(!1);return e0(()=>{n.current=!0}),b.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,vu({fromRouteId:t},s)))},[e,t])}const xg={};function CN(e,t,n){xg[e]||(xg[e]=!0)}const yg={};function EN(e,t){yg[t]||(yg[t]=!0,console.warn(t))}const ys=(e,t,n)=>EN(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function PN(e,t){e!=null&&e.v7_startTransition||ys("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&ys("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||ys("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||ys("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||ys("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||ys("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function TN(e){let{to:t,replace:n,state:r,relative:i}=e;xl()||be(!1);let{future:s,static:l}=b.useContext(Dr),{matches:o}=b.useContext(mr),{pathname:u}=ji(),c=gt(),d=Ku(t,Qu(o,s.v7_relativeSplatPath),u,i==="path"),h=JSON.stringify(d);return b.useEffect(()=>c(JSON.parse(h),{replace:n,state:r,relative:i}),[c,h,i,n,r]),null}function i0(e){return pN(e.context)}function LN(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ct.Pop,navigator:s,static:l=!1,future:o}=e;xl()&&be(!1);let u=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:u,navigator:s,static:l,future:vu({v7_relativeSplatPath:!1},o)}),[u,o,s,l]);typeof r=="string"&&(r=bi(r));let{pathname:d="/",search:h="",hash:p="",state:f=null,key:m="default"}=r,g=b.useMemo(()=>{let w=Ir(d,u);return w==null?null:{location:{pathname:w,search:h,hash:p,state:f,key:m},navigationType:i}},[u,d,h,p,f,m,i]);return g==null?null:b.createElement(Dr.Provider,{value:c},b.createElement(ip.Provider,{children:n,value:g}))}new Promise(()=>{});function MN(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:b.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
455
- * React Router DOM v6.28.0
456
- *
457
- * Copyright (c) Remix Software Inc.
458
- *
459
- * This source code is licensed under the MIT license found in the
460
- * LICENSE.md file in the root directory of this source tree.
461
- *
462
- * @license MIT
463
- */function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cl.apply(this,arguments)}function s0(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function RN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zN(e,t){return e.button===0&&(!t||t==="_self")&&!RN(e)}function wh(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function AN(e,t){let n=wh(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const IN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],FN=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],DN="6";try{window.__reactRouterVersion=DN}catch{}function ON(e,t){return V2({basename:void 0,future:cl({},void 0,{v7_prependBasename:!0}),history:m2({window:void 0}),hydrationData:_N(),routes:e,mapRouteProperties:MN,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function _N(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=cl({},t,{errors:$N(t.errors)})),t}function $N(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new yu(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let l=new s(i.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}const l0=b.createContext({isTransitioning:!1}),BN=b.createContext(new Map),UN="startTransition",vg=Jw[UN],qN="flushSync",wg=hj[qN];function HN(e){vg?vg(e):e()}function Al(e){wg?wg(e):e()}class VN{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function WN(e){let{fallbackElement:t,router:n,future:r}=e,[i,s]=b.useState(n.state),[l,o]=b.useState(),[u,c]=b.useState({isTransitioning:!1}),[d,h]=b.useState(),[p,f]=b.useState(),[m,g]=b.useState(),w=b.useRef(new Map),{v7_startTransition:y}=r||{},x=b.useCallback(M=>{y?HN(M):M()},[y]),v=b.useCallback((M,F)=>{let{deletedFetchers:C,flushSync:O,viewTransitionOpts:I}=F;C.forEach(q=>w.current.delete(q)),M.fetchers.forEach((q,$)=>{q.data!==void 0&&w.current.set($,q.data)});let Q=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!I||Q){O?Al(()=>s(M)):x(()=>s(M));return}if(O){Al(()=>{p&&(d&&d.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let q=n.window.document.startViewTransition(()=>{Al(()=>s(M))});q.finished.finally(()=>{Al(()=>{h(void 0),f(void 0),o(void 0),c({isTransitioning:!1})})}),Al(()=>f(q));return}p?(d&&d.resolve(),p.skipTransition(),g({state:M,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(o(M),c({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,p,d,w,x]);b.useLayoutEffect(()=>n.subscribe(v),[n,v]),b.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new VN)},[u]),b.useEffect(()=>{if(d&&l&&n.window){let M=l,F=d.promise,C=n.window.document.startViewTransition(async()=>{x(()=>s(M)),await F});C.finished.finally(()=>{h(void 0),f(void 0),o(void 0),c({isTransitioning:!1})}),f(C)}},[x,l,d,n.window]),b.useEffect(()=>{d&&l&&i.location.key===l.location.key&&d.resolve()},[d,p,i.location,l]),b.useEffect(()=>{!u.isTransitioning&&m&&(o(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[u.isTransitioning,m]),b.useEffect(()=>{},[]);let j=b.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:M=>n.navigate(M),push:(M,F,C)=>n.navigate(M,{state:F,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(M,F,C)=>n.navigate(M,{replace:!0,state:F,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),E=n.basename||"/",k=b.useMemo(()=>({router:n,navigator:j,static:!1,basename:E}),[n,j,E]),S=b.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return b.useEffect(()=>PN(r,n.future),[r,n.future]),b.createElement(b.Fragment,null,b.createElement(_a.Provider,{value:k},b.createElement(rp.Provider,{value:i},b.createElement(BN.Provider,{value:w.current},b.createElement(l0.Provider,{value:u},b.createElement(LN,{basename:E,location:i.location,navigationType:i.historyAction,navigator:j,future:S},i.initialized||n.future.v7_partialHydration?b.createElement(QN,{routes:n.routes,future:n.future,state:i}):t))))),null)}const QN=b.memo(KN);function KN(e){let{routes:t,future:n,state:r}=e;return mN(t,void 0,r,n)}const GN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",YN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ft=b.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:l,state:o,target:u,to:c,preventScrollReset:d,viewTransition:h}=t,p=s0(t,IN),{basename:f}=b.useContext(Dr),m,g=!1;if(typeof c=="string"&&YN.test(c)&&(m=c,GN))try{let v=new URL(window.location.href),j=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=Ir(j.pathname,f);j.origin===v.origin&&E!=null?c=E+j.search+j.hash:g=!0}catch{}let w=dN(c,{relative:i}),y=JN(c,{replace:l,state:o,target:u,preventScrollReset:d,relative:i,viewTransition:h});function x(v){r&&r(v),v.defaultPrevented||y(v)}return b.createElement("a",cl({},p,{href:m||w,onClick:g||s?r:x,ref:n,target:u}))}),kh=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:l=!1,style:o,to:u,viewTransition:c,children:d}=t,h=s0(t,FN),p=Yu(u,{relative:h.relative}),f=ji(),m=b.useContext(rp),{navigator:g,basename:w}=b.useContext(Dr),y=m!=null&&ZN(p)&&c===!0,x=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,v=f.pathname,j=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(v=v.toLowerCase(),j=j?j.toLowerCase():null,x=x.toLowerCase()),j&&w&&(j=Ir(j,w)||j);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=v===x||!l&&v.startsWith(x)&&v.charAt(E)==="/",S=j!=null&&(j===x||!l&&j.startsWith(x)&&j.charAt(x.length)==="/"),M={isActive:k,isPending:S,isTransitioning:y},F=k?r:void 0,C;typeof s=="function"?C=s(M):C=[s,k?"active":null,S?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let O=typeof o=="function"?o(M):o;return b.createElement(ft,cl({},h,{"aria-current":F,className:C,ref:n,style:O,to:u,viewTransition:c}),typeof d=="function"?d(M):d)});var bh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(bh||(bh={}));var kg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kg||(kg={}));function XN(e){let t=b.useContext(_a);return t||be(!1),t}function JN(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:l,viewTransition:o}=t===void 0?{}:t,u=gt(),c=ji(),d=Yu(e,{relative:l});return b.useCallback(h=>{if(zN(h,n)){h.preventDefault();let p=r!==void 0?r:ss(c)===ss(d);u(e,{replace:p,state:i,preventScrollReset:s,relative:l,viewTransition:o})}},[c,u,d,r,i,n,e,s,l,o])}function sp(e){let t=b.useRef(wh(e)),n=b.useRef(!1),r=ji(),i=b.useMemo(()=>AN(r.search,n.current?null:t.current),[r.search]),s=gt(),l=b.useCallback((o,u)=>{const c=wh(typeof o=="function"?o(i):o);n.current=!0,s("?"+c,u)},[s,i]);return[i,l]}function ZN(e,t){t===void 0&&(t={});let n=b.useContext(l0);n==null&&be(!1);let{basename:r}=XN(bh.useViewTransitionState),i=Yu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Ir(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ir(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xu(i.pathname,l)!=null||xu(i.pathname,s)!=null}const bg=[{title:"Start here",sections:[{id:"start",title:"The idea in one minute",what:"cognitune helps you understand code, not just read it. It asks a model to explain, then makes you answer, explain back and find bugs, and it brings things back when you are about to forget them.",steps:["Open a folder (Projects page). cognitune only reads it. It never changes your files.","Go to Explore. Tick the files you want to understand.","Pick an activity on the right: Lens to read, Quiz or Teach to test yourself.","Wrong answers become Weak spots and review cards. Today shows what to do next."],examples:["First visit: Projects > Open a folder > Explore > tick src/queue.ts > Lens > Explain > Make lens.","Then: Quiz on the same file. Miss a question, and it shows up on Today under Weak spots."],notes:["Each model call takes about 20 to 90 seconds. A bar shows progress; you can keep browsing.","The model reads only the files you tick, plus the notes and context you add. Nothing else leaves your machine."]},{id:"projects",title:"Projects",what:"A project is one folder on your disk. Everything you make (lenses, quizzes, cards) is stored under that project.",steps:["Open a folder with Open folder. Type a path or browse.","Click a project card to enter it. The rail on the left changes to the project pages.","Remove (the button on the project card) takes it off the list. Its data moves to an archive and is deleted after the keep time (Settings > Storage). Opening the same folder again restores it."],examples:["Try the built-in sample: run cognitune with --demo. It opens a tiny queue project with a fake model."]},{id:"keys",title:"Keyboard shortcuts",what:"The short list. Press ? anywhere (outside a text box) to see it in a window.",examples:["Ctrl/Cmd + K : go to a page, file or project, or start an activity on the open file","Ctrl/Cmd + H : this help, opened at the section for the page you are on","? : shortcut list","[ and ] : fold or show the left and right panes","Space : Review, show the answer","1 2 3 4 : Review, rate again / hard / good / easy","Ctrl + Enter : Tutor, send the message","← → : Trace, step back and forward"]},{id:"palette",title:"Quick jump (Ctrl K)",what:"One box to go anywhere or start anything without the mouse.",steps:["Press Ctrl K (Cmd K on Mac).","Type a few letters. Pages, files in this project, other projects and activities are matched.","Press Enter to go. Esc closes."],examples:["Type: rev → Review","Type: queue → files with queue in the path","Type: quiz → start a quiz on the open file"]}]},{title:"Learn a codebase",sections:[{id:"today",title:"Today",what:"What to do now. The page picks the most useful next step so you do not have to decide.",steps:["Read the Suggested next card at the top. Start runs it.","Review cards: how many are due. Start review opens the flashcards.","Weak spots: things you got wrong. Quiz my weak spots builds a quiz from them.","Needs a refresh: files you passed a while ago, or that changed since. Click a file to quiz yourself on it.","Learning path: the next stop of a path you made."],notes:["The flame badge counts days in a row with any practice. Missing a day resets it; one review is enough to keep it."]},{id:"explore",title:"Explore: choose files and an activity",what:"The main workspace. File tree on the left, code in the middle, activities on the right.",steps:["Click a file name to open it and read it.","Tick the box beside a file or a folder to add it to the Context. The model reads only what is in Context.","Use the filter box above the tree to find a file by name.","Pick an activity (Lens, Quiz, Teach, Tutor, Walk, Practice, Bug hunt, Notes) in the right pane."],examples:["Understand one module: tick only src/queue.ts, Lens > Explain.","Understand how two files connect: tick both, Lens > Data flow.","A folder is ticked in one click; keep the selection small (1 to 5 files) for sharper answers."],notes:["Context · 3 means three files are selected. Add lets you pick files from the project or from a context folder (docs, notes, a session folder).","[ and ] fold the side panes to give the code more room."]},{id:"lens",title:"Lens: read an explanation through one question",what:"A lens is a written explanation of your selected files, built around one question. It is like a short blog post about the code, with a walkthrough, pitfalls and a check for each step.",steps:["Tick files in Explore. Open the Lens tab.","Pick a kind of lens (see the list below).","Choose depth: Overview (about 1.5 screens, 3 to 4 steps), Standard (at least 3 screens, enough to change the code safely), Deep (5 to 6 screens, like a long blog post: every branch and failure path). Deep takes several minutes because it is planned first, then written in parts.","Optional: type your own question for the lens to answer.","Click Make lens. A planner model first outlines the lesson, then a writer model writes it in parts. When it is ready, you land on the lens page."],examples:['Explain: "The tour: purpose, main pieces, how they connect." Best first lens for any file.',"Data flow: follow one value from where it enters to where it leaves. Try on a request handler.","State over time: what is stored, who changes it, in which order. Try on a class with fields.","Failure modes: bad input, timeouts, partial writes, retries. Try before changing error handling.","Contracts: inputs, outputs and invariants between parts. Try on an API or a module boundary.","Concepts: the vocabulary first, with the line where each term shows up. Try when the code uses words you do not know.","The change: pick it in Changes with a diff; gives intent, risk and what to check.","Trace a run: step by step through one example input, with the state at each line. Use the arrows to step.","History: what changed over time and why, from the commits."],notes:["On the lens page: Words you need first (click a term to see where it shows up), the walkthrough (each step has a code card, a pitfall and a check question), then gotchas and next steps.","Click open file on a step to jump the code pane to that range. The same file pane stays on the right.","Refresh rebuilds a lens when the code changed. A banner tells you when it did."]},{id:"quiz",title:"Quiz: answer in your own words",what:"Questions about your selected files. You type answers; the model grades each one and says what was missing.",steps:["Tick files. Open the Quiz tab. Choose how many questions (Default, 3, 5 or 8).","Click Make quiz. Answer every question in the box beneath it. Short answers are fine; the core idea is what counts.","Click Grade. Each answer gets a verdict, an explanation and the line it came from.","A wrong answer is saved as a Weak spot and turns into a review card."],examples:['Question: "What happens when pop() is called on an empty queue?" Answer: "It raises IndexError, the caller must catch it."',"Retake: open the quiz from Library > Quizzes. Your best score is kept; at most 20 attempts are stored."],notes:["Empty answers are not counted as misconceptions. They are just unanswered."]},{id:"teach",title:"Teach: explain it back",what:"You write an explanation as if teaching a colleague. The model grades it for what is right, what is missing and what is wrong.",steps:["Tick files. Open Teach.","Write your explanation in your own words. Do not look at the code more than you need.","Submit. You get strengths, gaps and corrections tied to lines.","Gaps become Weak spots, so they come back later."],examples:['"A queue stores items in order. push adds at the tail; pop removes the head. When it is empty, pop raises." Short and specific beats long and vague.']},{id:"tutor",title:"Tutor: get hints, not answers",what:"A chat that helps you reach the answer yourself. Hints come in steps. Ask for the answer when you are stuck.",steps:["Tick files. Open Tutor and type a question.","The tutor replies with a question or a small hint (level 1). Ask again for more help: level 2 is a stronger hint, level 3 nearly gives it away.","At level 4 it tells you directly. Use that when you are really stuck.","Ctrl + Enter sends the message."],examples:['You: "Why does flush() hold the lock while it writes?" Tutor: "What could happen to the buffer if another thread called push() in the middle?"'],notes:["Only the last 200 messages of a chat are kept."]},{id:"walk",title:"Walk: one block at a time",what:"A guided tour of one file in small blocks. After each block you answer a short check before moving on.",steps:["Open a file, tick it, open Walk, click Make walk.","Read the block. Answer the check below it. Press Check.","A right answer unlocks the next block. A wrong one explains and keeps you on the block."],examples:["Use it for a file you must understand fully before changing it, such as a parser or a state machine."]},{id:"practice",title:"Practice: write the key lines back",what:"The code with some lines removed. You type them from memory and get feedback.",steps:["Choose a level: 1 one short hole, 2 a condition and a computation, 3 core logic, 4 whole function bodies.","Click Make practice. Fill the gaps in the editor.","Submit. You see your version next to the real one, with differences explained.","The eye button hides or shows the original. Reset restores the gaps."],examples:["Start at level 1 on a function you read today. Move to level 3 a week later."]},{id:"hunt",title:"Bug hunt: find the planted bugs",what:"cognitune plants bugs in a copy of the code (your files are not touched). You mark the lines you think are wrong.",steps:["Choose difficulty: Easy (one visible bug), Medium (two, one needs the logic), Hard (two or three subtle ones).","Click Make hunt. Read the copy and click lines you think are buggy.","Press Grade. The real bugs show up, with what was wrong and how you did."],notes:["The bugs are hidden until you grade. Reloading the page does not reveal them."]},{id:"notes",title:"Notes",what:"Your own notes on a file or a line. They can be included in prompts so answers match what you already know.",steps:["Open a file. Click a line number, add a note, save.","A mark appears in the margin. Click it to read or edit.","Turn on Settings > Notes in prompts to let the model see your notes."],examples:['"I keep mixing up head and tail here. Head is where pop reads."']},{id:"changes",title:"Changes: learn from a diff",what:"Understand a commit, a branch or uncommitted work before you review or merge it.",steps:["Choose a repo, then what to compare (for example a branch against main, or a single commit).","Tick the changed files you care about.","Use the activity panel: Lens > The change gives intent, risk and what to check."],examples:["Before reviewing a colleague's branch: Changes > main..feature/x > tick the three biggest files > Lens > The change."]}]},{title:"Remember it",sections:[{id:"review",title:"Review: flashcards that come back on time",what:"Cards are spaced: easy ones return later, hard ones sooner (FSRS). Ten minutes a day beats an hour once.",steps:["Open Review (the badge shows how many are due).","Read the question. Say or type your answer in your head. Press Space to show the answer.","Rate yourself: 1 Again (forgot), 2 Hard, 3 Good, 4 Easy. The buttons show when each will return."],examples:["Forgot it completely → 1. It returns in minutes.","Got it but had to think → 2 or 3.","Got it instantly → 4. It goes weeks out."],notes:["Cards come from wrong quiz answers, teach-back gaps and weak spots (Settings > Cards from misses). You can also add a card from the file view with the card button.","Only the last 50 reviews of each card are kept."]},{id:"library",title:"Library: everything you made",what:"One place for every lens, quiz, practice, teach-back, walk, hunt, tutor chat, card, glossary term and note in this project.",steps:["Pick a tab. Use Search this tab to filter.","Click an item to open it. Items you delete go to an archive and are removed after the keep time.","Glossary is the list of terms the lenses defined, across all lenses."],examples:["Looking for the lens you made last week on the scheduler: Library > Lenses > search: scheduler."]},{id:"progress",title:"Progress",what:"A heatmap of when you practised and a level per file.",steps:["Levels: new, seen, understood, fading, stale. A file turns fading after a few weeks without practice, and stale when the code changed since you studied it (Settings > fade days).","Click a file to open it in Explore."]}]},{title:"See the shape",sections:[{id:"map",title:"Map: how files connect",what:"A graph of which files import which. Big dots are files many others depend on.",steps:["Open Map. Drag to move, scroll to zoom, click a node to open that file.","Use the selector at the top (same tree as Explore) to narrow the map to a folder or a few files.","Dot colours show your level on each file, so the new ones are what you have not studied."],examples:["Pick src/server only to see how the server files connect, ignoring the rest."],notes:["Import links are found by reading import lines (TypeScript, JavaScript and Python). Aliases from tsconfig paths are followed."]},{id:"paths",title:"Paths: an ordered tour",what:"A learning path is an ordered list of stops: where to start, what next, and how to check each stop.",steps:["Open Paths. Describe your goal, or leave it blank for a general tour.","Click Make a path. Each stop has files, why it matters and an activity.","Do this stop opens Explore with the files ticked and the activity ready.","Tick a stop off when done. Today shows the next stop."],examples:['Goal: "I need to add retries to the job runner." The path walks queue, worker, then error handling.']}]},{title:"Settings and storage",sections:[{id:"settings",title:"Settings",what:"Which model runs, how text looks, and what cognitune keeps.",steps:["Planning model (default claude-opus-5-5) plans lenses, quizzes, walks, practice, bug hunts and paths; the model above (default claude-sonnet-5-5) writes them. Plan first can be turned off for one-shot answers.","Model: choose the agent (Auto, Claude Code CLI, Codex CLI, GitHub Copilot CLI, an Anthropic API key, or Demo). Auto uses the first one installed.","Reading font: sans (default) or serif for lens pages.","Cards, progress and notes: switches for turning wrong answers into cards, how fast files fade, and whether notes go to the model.","Recent model calls: the last calls with how long they took and any error."]},{id:"storage",title:"Storage: keeping it small",what:"Everything is plain JSON files in your cognitune folder (shown in Settings). It stays bounded on its own and you can also remove things by hand.",steps:["Automatic: archived items and forgotten projects are removed after the keep time (30 days by default). The reply cache keeps to its size (50 MB). Quiz attempts, card history, tutor chats and the job log are capped.","Clean up now applies those limits at once.","Choose what to remove: open the list, filter by kind, tick the items, press Remove selected, then confirm. Select all shown ticks every row in the current filter."],examples:["Free space fast: Choose what to remove > kind: reply cache > Select all shown > Remove selected. Nothing you made is lost; answers are just asked again later.","Remove one old lens: kind: lenses > tick it > Remove selected."],notes:["Removing is permanent (no archive step). Your project folders are never touched."]}]}];function eS(e){const t=e.match(/^\/p\/[^/]+\/([^/]+)/),n=t==null?void 0:t[1];return e==="/settings"?"settings":e==="/"?"projects":n?{today:"today",explore:"explore",review:"review",map:"map",paths:"paths",path:"paths",library:"library",progress:"progress",changes:"changes",lens:"lens",quiz:"quiz",teach:"teach",tutor:"tutor",walk:"walk",practice:"practice",hunt:"hunt"}[n]??null:null}function tS(){const[e]=sp(),t=ji(),[n,r]=b.useState(""),i=e.get("s"),[s,l]=b.useState(i??"start"),o=b.useMemo(()=>{const c=n.trim().toLowerCase();return c?bg.map(d=>({...d,sections:d.sections.filter(h=>[h.title,h.what,...h.steps??[],...h.examples??[],...h.notes??[]].join(" ").toLowerCase().includes(c))})).filter(d=>d.sections.length):bg},[n]);b.useEffect(()=>{i&&(l(i),requestAnimationFrame(()=>{var c;return(c=document.getElementById(`help-${i}`))==null?void 0:c.scrollIntoView({block:"start"})}))},[i,t.key]);const u=c=>{var d;l(c),(d=document.getElementById(`help-${c}`))==null||d.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto flex max-w-6xl gap-10 px-8 py-10",children:[a.jsxs("nav",{className:"sticky top-0 hidden h-fit w-56 shrink-0 lg:block",children:[a.jsxs("div",{className:"relative",children:[a.jsx(gl,{className:"pointer-events-none absolute left-2.5 top-2.5 h-4 w-4 text-muted"}),a.jsx("input",{className:"input h-9 pl-8 text-[14px]",placeholder:"Search help",value:n,onChange:c=>r(c.target.value)})]}),a.jsx("div",{className:"mt-4 space-y-4",children:o.map(c=>a.jsxs("div",{children:[a.jsx("div",{className:"px-2 text-[11px] font-semibold uppercase tracking-wide text-muted",children:c.title}),a.jsx("ul",{className:"mt-1",children:c.sections.map(d=>a.jsx("li",{children:a.jsx("button",{onClick:()=>u(d.id),className:le("w-full rounded-md px-2 py-1.5 text-left text-[14px] hover:bg-raised",s===d.id?"bg-accent/10 font-medium text-accent":"text-ink"),children:d.title.split(":")[0]})},d.id))})]},c.title))})]}),a.jsxs("main",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Help"}),a.jsxs("p",{className:"mt-2 max-w-2xl text-[16px] leading-relaxed text-muted",children:["What every part does, how to use it, and something to try. Press ",a.jsx("span",{className:"kbd",children:"Ctrl H"})," on any page to open this at the matching part."]}),a.jsx("div",{className:"mt-4 lg:hidden",children:a.jsx("input",{className:"input",placeholder:"Search help",value:n,onChange:c=>r(c.target.value)})}),o.map(c=>a.jsxs("div",{children:[a.jsx("h2",{className:"mt-12 border-b border-line pb-2 text-sm font-semibold uppercase tracking-wide text-muted",children:c.title}),c.sections.map(d=>a.jsxs("section",{id:`help-${d.id}`,className:"scroll-mt-6 pt-8",children:[a.jsx("h3",{className:"text-2xl font-semibold tracking-tight",children:d.title}),a.jsx("p",{className:"mt-2 max-w-3xl text-[17px] leading-[1.65]",children:d.what}),d.steps&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-accent",children:"How to use it"}),a.jsx("ol",{className:"mt-2 max-w-3xl list-decimal space-y-2 pl-6 text-[16px] leading-[1.6] marker:text-muted",children:d.steps.map(h=>a.jsx("li",{children:h},h))})]}),d.examples&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-accent",children:"Try this"}),a.jsx("div",{className:"mt-2 max-w-3xl space-y-2",children:d.examples.map(h=>a.jsx("div",{className:"rounded-lg border border-line bg-raised px-4 py-2.5 text-[15px] leading-[1.55]",children:h},h))})]}),d.notes&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-muted",children:"Good to know"}),a.jsx("ul",{className:"mt-2 max-w-3xl list-disc space-y-1.5 pl-6 text-[15px] leading-[1.6] text-muted marker:text-line",children:d.notes.map(h=>a.jsx("li",{children:h},h))})]})]},d.id))]},c.title)),!o.length&&a.jsxs("p",{className:"mt-10 text-muted",children:['Nothing matches "',n,'".']}),a.jsx("div",{className:"h-24"})]})]})})}async function $a(e,t){const{json:n,...r}=t??{},i=await fetch(`/api${e}`,{...r,headers:{"content-type":"application/json",...r.headers??{}},body:n===void 0?r.body:JSON.stringify(n)}),s=await i.json().catch(()=>({}));if(!i.ok)throw new Error(s.error||`${i.status} ${i.statusText}`);return s}const me=e=>$a(e),Ni=(e,t={})=>$a(e,{method:"POST",json:t}),jh=(e,t)=>$a(e,{method:"PUT",json:t}),Ba=(e,t)=>$a(e,{method:"PATCH",json:t}),ls=e=>$a(e,{method:"DELETE"}),nS=e=>new Promise(t=>setTimeout(t,e)),Nh=new Set;function mn(){const e=Dt(),[t,n]=b.useState(null),[r,i]=b.useState(null),[s,l]=b.useState(0),o=b.useRef(!0);return b.useEffect(()=>()=>void(o.current=!1),[]),b.useEffect(()=>{if((t==null?void 0:t.status)!=="running")return;const c=Date.parse(t.startedAt),d=setInterval(()=>l(Math.round((Date.now()-c)/1e3)),500);return()=>clearInterval(d)},[t==null?void 0:t.status,t==null?void 0:t.startedAt]),{run:b.useCallback(async(c,d,h)=>{i(null),l(0);let p;try{let f=await Ni(c,d);for(p=f.id,Nh.add(p),n(f),e.invalidateQueries({queryKey:["project-jobs"]});f.status==="running";){if(await nS(1e3),!o.current)return;f=await me(`/jobs/${f.id}`),n(f)}f.status==="failed"?i(f.error??"the job failed"):(await e.invalidateQueries(),h==null||h(f))}catch(f){i(f instanceof Error?f.message:String(f)),n(null)}finally{p&&Nh.delete(p)}},[e]),job:t,busy:(t==null?void 0:t.status)==="running",error:r,elapsed:s,clearError:()=>i(null)}}function It(e){const t=Math.round((Date.now()-Date.parse(e))/1e3);return t<60?"just now":t<3600?`${Math.round(t/60)} min ago`:t<86400?`${Math.round(t/3600)} h ago`:`${Math.round(t/86400)} d ago`}function Z({variant:e="secondary",size:t="md",icon:n,className:r,children:i,loading:s,...l}){return a.jsxs("button",{...l,disabled:l.disabled||s,className:le("inline-flex select-none items-center justify-center gap-2 rounded-sm font-medium transition","disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",t==="sm"&&"h-[22px] px-2 text-xs",t==="md"&&"h-[26px] px-3 text-[13px]",t==="lg"&&"h-8 px-4 text-sm",e==="primary"&&"bg-accent text-accent-ink hover:brightness-110",e==="secondary"&&"border border-muted/40 bg-raised text-ink hover:border-muted/70 hover:brightness-95",e==="ghost"&&"text-muted hover:bg-raised hover:text-ink",e==="danger"&&"border border-bad/30 bg-bad/10 text-bad hover:bg-bad/15",r),children:[s?a.jsx(O1,{className:"h-4 w-4 animate-spin"}):n,i]})}function ke({tone:e="muted",children:t,className:n}){return a.jsx("span",{className:le("inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] font-medium",e==="muted"&&"bg-raised text-muted",e==="accent"&&"bg-accent/12 text-accent",e==="good"&&"bg-good/12 text-good",e==="warn"&&"bg-warn/15 text-warn",e==="bad"&&"bg-bad/12 text-bad",n),children:t})}function a0({v:e}){return a.jsx(ke,{tone:e==="right"?"good":e==="partial"?"warn":"bad",children:e})}function kt({className:e}){return a.jsx(O1,{className:le("h-4 w-4 animate-spin text-muted",e)})}function Ft({icon:e,title:t,children:n,action:r}){return a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-16 text-center",children:[e&&a.jsx("div",{className:"mb-4 grid h-12 w-12 place-items-center rounded-2xl bg-accent/10 text-accent",children:e}),a.jsx("h3",{className:"text-base font-semibold",children:t}),n&&a.jsx("div",{className:"mt-1.5 max-w-md text-sm text-muted",children:n}),r&&a.jsx("div",{className:"mt-5",children:r})]})}function Ke({error:e,onClose:t}){return a.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-bad/30 bg-bad/8 px-3 py-2 text-sm text-bad",children:[a.jsx(Zf,{className:"mt-0.5 h-4 w-4 shrink-0"}),a.jsx("div",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words",children:e}),t&&a.jsx("button",{onClick:t,className:"opacity-60 hover:opacity-100","aria-label":"Close",children:a.jsx(pr,{className:"h-4 w-4"})})]})}const rS={lens:["Reading the files","Finding the core idea","Writing the lesson"],quiz:["Reading the files","Choosing what matters","Writing questions"],grade:["Reading your answers","Checking against the code","Writing feedback"],practice:["Reading the file","Choosing the key logic","Cutting the holes"],review:["Reading your code","Comparing with the original","Writing feedback"],teachback:["Reading your explanation","Checking it against the code","Writing feedback"],tutor:["Reading the conversation","Thinking of a good question","Writing"],walk:["Reading the file","Finding the reading order","Writing check questions"],walkcheck:["Reading your answer","Checking the block"],hunt:["Reading the file","Choosing where to break it","Planting the bugs"],huntgrade:["Matching your marks","Checking your reasons","Writing feedback"],path:["Reading the repo layout","Ordering the stops","Writing the path"]};function sn({kind:e,elapsed:t}){const n=rS[e]??["Working"],r=Math.min(n.length-1,Math.floor(t/12));return a.jsxs("div",{className:"shimmer card p-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(kt,{className:"text-accent"}),a.jsxs("div",{className:"text-sm font-medium",children:[n[r],"..."]}),a.jsxs("div",{className:"ml-auto font-mono text-xs text-muted",children:[t,"s"]})]}),a.jsx("div",{className:"mt-3 flex gap-1.5",children:n.map((i,s)=>a.jsx("div",{className:le("h-1 flex-1 rounded-full transition-colors",s<=r?"bg-accent":"bg-line")},i))}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"Model calls take 20 seconds to 2 minutes. You can leave this page: it keeps running, and the status bar says when it is ready."})]})}function qt({value:e,onChange:t,options:n}){return a.jsx("div",{className:"inline-flex rounded-sm border border-line bg-raised p-0.5",children:n.map(r=>a.jsx("button",{title:r.title,onClick:()=>t(r.value),className:le("rounded-sm px-2.5 py-0.5 text-xs font-medium transition",r.value===e?"bg-panel text-ink":"text-muted hover:text-ink"),children:r.label},String(r.value)))})}function iS({value:e,onChange:t,tabs:n,className:r,wrap:i=!1}){return a.jsx("div",{className:le("flex border-b border-line bg-side",i?"flex-wrap":"overflow-x-auto",r),children:n.map(s=>a.jsxs("button",{onClick:()=>t(s.value),className:le("relative flex h-[35px] shrink-0 items-center gap-1.5 whitespace-nowrap border-r border-line px-3 text-[13px] transition",s.value===e?"bg-bg text-ink":"text-muted hover:text-ink"),children:[s.icon,s.label,s.count!==void 0&&s.count>0&&a.jsx("span",{className:"rounded-full bg-raised px-1.5 text-[11.5px] text-muted",children:s.count}),s.value===e&&a.jsx("span",{className:"absolute inset-x-0 top-0 h-px bg-accent"})]},s.value))})}function Na({score:e,size:t="md"}){const n=Math.round(e*100),r=e>=.67?"text-good":e>=.4?"text-warn":"text-bad";return a.jsxs("span",{className:le("font-semibold tabular-nums",r,t==="sm"?"text-xs":"text-sm"),children:[n,"%"]})}function Xu({title:e,onClose:t,children:n,footer:r,wide:i}){return a.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4",onClick:t,onKeyDown:s=>s.key==="Escape"&&t(),children:a.jsxs("div",{className:le("card flex max-h-[85vh] w-full flex-col overflow-hidden",i?"max-w-2xl":"max-w-lg"),onClick:s=>s.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center border-b border-line px-4 py-2",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:t,"aria-label":"Close",children:a.jsx(pr,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:n}),r&&a.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:r})]})})}function Ju({back:e,badges:t,title:n,sub:r,actions:i}){return a.jsxs("div",{children:[e,t&&a.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:t}),a.jsxs("div",{className:"mt-2 flex items-start gap-3",children:[a.jsx("h1",{className:"min-w-0 flex-1 text-[20px] font-semibold leading-tight tracking-tight",children:n}),i&&a.jsx("div",{className:"flex shrink-0 gap-2",children:i})]}),r&&a.jsx("div",{className:"mt-1 text-sm text-muted",children:r})]})}function Sh(e){const t=Math.max(0,Math.round((Date.parse(e)-Date.now())/1e3));return t<90?"now":t<3600?`${Math.round(t/60)} min`:t<86400?`${Math.round(t/3600)} h`:t<86400*60?`${Math.round(t/86400)} d`:`${Math.round(t/(86400*30))} mo`}const sS={"Go to":eg,Do:eg,Files:R1,Projects:z1};function o0(e,t){return e.flatMap(n=>n.kind==="file"?[{path:n.path,rel:n.path.startsWith(t+"/")?n.path.slice(t.length+1):n.path}]:o0(n.children??[],t))}function lS({pid:e,root:t,onClose:n,openFile:r}){const i=gt(),[s,l]=b.useState(""),[o,u]=b.useState(0),c=b.useRef(null),d=xe({queryKey:["tree-flat",e],queryFn:()=>me(`/projects/${e}/tree`),enabled:!!e,staleTime:6e4}),h=xe({queryKey:["projects"],queryFn:()=>me("/projects")}),p=b.useMemo(()=>{const g=y=>()=>i(y),w=[];if(e){const y=`/p/${e}`;for(const[x,v]of[["Today","today"],["Explore","explore"],["Changes","changes"],["Review cards","review"],["Map","map"],["Learning paths","paths"],["Library","library"],["Progress","progress"]])w.push({id:`go-${v}`,label:x,group:"Go to",run:g(`${y}/${v}`)});for(const[x,v]of[["Lens on the open file","lens"],["Quiz me on the open file","quiz"],["Teach it back","teach"],["Ask the tutor","tutor"],["Walk through the open file","walk"],["Practice on the open file","practice"],["Bug hunt in the open file","hunt"],["Notes on the open file","notes"]])w.push({id:`do-${v}`,label:x,group:"Do",run:g(`${y}/explore?do=${v}`)});if(d.data&&t)for(const x of o0(d.data,t))w.push({id:`f-${x.path}`,label:x.rel,group:"Files",run:()=>r==null?void 0:r(x.path)})}w.push({id:"go-help",label:"Help (Ctrl H)",group:"Go to",run:g("/help")}),w.push({id:"go-settings",label:"Settings",group:"Go to",run:g("/settings")});for(const y of h.data??[])w.push({id:`p-${y.id}`,label:y.name,hint:y.root,group:"Projects",run:g(`/p/${y.id}/today`)});return w},[e,t,d.data,h.data,i,r]),f=b.useMemo(()=>{const g=s.toLowerCase().split(/\s+/).filter(Boolean);return(g.length?p.filter(y=>g.every(x=>`${y.label} ${y.hint??""} ${y.group}`.toLowerCase().includes(x))):p.filter(y=>y.group!=="Files")).slice(0,60)},[p,s]);b.useEffect(()=>{u(0)},[s]),b.useEffect(()=>{var g,w;(w=(g=c.current)==null?void 0:g.querySelector(`[data-i="${o}"]`))==null||w.scrollIntoView({block:"nearest"})},[o]);const m=g=>{g&&(n(),g.run())};return a.jsxs(Xu,{title:"Go to or do",onClose:n,wide:!0,children:[a.jsxs("div",{className:"relative",children:[a.jsx(gl,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted"}),a.jsx("input",{autoFocus:!0,className:"input pl-9",placeholder:"Type a page, an activity, a file or a project",value:s,onChange:g=>l(g.target.value),onKeyDown:g=>{g.key==="ArrowDown"&&(g.preventDefault(),u(w=>Math.min(f.length-1,w+1))),g.key==="ArrowUp"&&(g.preventDefault(),u(w=>Math.max(0,w-1))),g.key==="Enter"&&m(f[o]),g.key==="Escape"&&n()}})]}),a.jsxs("div",{ref:c,className:"mt-3 max-h-[50vh] overflow-auto",children:[f.map((g,w)=>{const y=sS[g.group],x=w===0||f[w-1].group!==g.group;return a.jsxs("div",{children:[x&&a.jsx("div",{className:"px-2 pb-1 pt-2 text-[11.5px] font-semibold uppercase tracking-wide text-muted",children:g.group}),a.jsxs("button",{"data-i":w,onMouseMove:()=>u(w),onClick:()=>m(g),className:le("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px]",w===o?"bg-accent/12 text-ink":"text-ink/85"),children:[a.jsx(y,{className:"h-3.5 w-3.5 shrink-0 text-muted"}),a.jsx("span",{className:le("min-w-0 flex-1 truncate",g.group==="Files"&&"font-mono text-[13px]"),children:g.label}),g.hint&&a.jsx("span",{className:"truncate text-[12px] text-muted",children:g.hint}),w===o&&a.jsx(Qj,{className:"h-3.5 w-3.5 text-muted"})]})]},g.id)}),!f.length&&a.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted",children:"Nothing matches."})]})]})}const aS=[["Ctrl/Cmd + K","Go to a page, file or project; start an activity"],["Ctrl/Cmd + H","Help, opened at the part for this page"],["?","This list"],["[ and ]","Fold or show the left and right panes"],["Space","Review: reveal the answer"],["1 2 3 4","Review: again, hard, good, easy"],["Ctrl + Enter","Tutor: send"],["← →","Trace: step back and forward"]];function oS({onClose:e}){return a.jsx(Xu,{title:"Keyboard shortcuts",onClose:e,children:a.jsx("table",{className:"w-full text-sm",children:a.jsx("tbody",{children:aS.map(([t,n])=>a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-2 pr-4",children:a.jsx("span",{className:"kbd",children:t})}),a.jsx("td",{className:"py-2 text-muted",children:n})]},t))})})})}function u0({className:e}){return a.jsxs("svg",{viewBox:"0 0 32 32",className:e,"aria-hidden":!0,children:[a.jsx("rect",{width:"32",height:"32",rx:"6",fill:"rgb(var(--accent))"}),a.jsx("circle",{cx:"14",cy:"14",r:"6.5",fill:"none",stroke:"white",strokeWidth:"2.8"}),a.jsx("path",{d:"M19 19l6 6",stroke:"white",strokeWidth:"2.8",strokeLinecap:"round"})]})}function wn({to:e,icon:t,label:n,end:r,badge:i}){return a.jsxs(kh,{to:e,end:r,title:n,"aria-label":n,className:({isActive:s})=>le("relative grid h-12 w-12 shrink-0 place-items-center transition-colors",s?"text-ink before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-accent":"text-muted hover:text-ink"),children:[t,!!i&&a.jsx("span",{className:"absolute bottom-2 right-1.5 min-w-[16px] rounded-full bg-accent px-1 text-center text-[10px] font-semibold leading-4 text-accent-ink",children:i>99?"99+":i})]})}const uS={system:"light",light:"dark",dark:"system"},$c={lens:"lens",quiz:"quiz",grade:"grading",practice:"practice",review:"review",teachback:"teach-back",tutor:"tutor reply",walk:"walkthrough",walkcheck:"check",hunt:"bug hunt",huntgrade:"grading",path:"path"},jg={lens:"lens",quiz:"quiz",practice:"practice",teachback:"teach",tutor:"tutor",walk:"walk",hunt:"hunt",path:"paths"};function cS({pid:e}){const t=gt(),n=xe({queryKey:["project-jobs",e],queryFn:async()=>(await me(`/projects/${e}`)).running,refetchInterval:u=>{var c;return(c=u.state.data)!=null&&c.length?2e3:!1}}),r=n.data??[],i=b.useRef(new Set),[s,l]=b.useState([]);b.useEffect(()=>{const u=new Set(r.map(d=>d.id)),c=[...i.current].filter(d=>!u.has(d)&&!Nh.has(d));i.current=u;for(const d of c)me(`/jobs/${d}`).then(h=>{h.status==="done"&&h.resultId&&jg[h.kind]&&l(p=>[...p.filter(f=>f.id!==h.id),h])}).catch(()=>{})},[n.dataUpdatedAt]);const o=s[s.length-1];if(r.length){const u=r[0],c=Math.max(0,Math.round((Date.now()-Date.parse(u.startedAt))/1e3));return a.jsxs("span",{className:"flex items-center gap-1.5 px-1.5",title:r.map(d=>$c[d.kind]).join(", "),children:[a.jsx("span",{className:"[&>svg]:h-3 [&>svg]:w-3",children:a.jsx(kt,{className:"text-accent"})}),r.length===1?`${$c[u.kind]} running · ${c}s`:`${r.length} jobs running`]})}return o?a.jsxs("span",{className:"flex items-center",children:[a.jsxs("button",{className:"flex items-center gap-1.5 px-1.5 text-good hover:bg-raised",onClick:()=>{l(u=>u.filter(c=>c.id!==o.id)),t(`/p/${e}/${jg[o.kind]}/${o.resultId}`)},children:[a.jsx(ml,{className:"h-3 w-3"})," ",$c[o.kind]," ready · open",s.length>1?` (+${s.length-1})`:""]}),a.jsx("button",{className:"px-1 hover:bg-raised hover:text-ink",title:"Dismiss",onClick:()=>l(u=>u.filter(c=>c.id!==o.id)),children:a.jsx(pr,{className:"h-3 w-3"})})]}):null}function dS(){var g,w,y,x,v;const{pid:e}=Or(),{pref:t,setPref:n}=Zx(),r=xe({queryKey:["health"],queryFn:()=>me("/health"),staleTime:6e4}),i=(g=r.data)==null?void 0:g.agent.ready,s=t==="dark"?l2:t==="light"?h2:s2,l=gt(),[o,u]=b.useState(!1),[c,d]=b.useState(!1),h=xe({queryKey:["cards-due",e],queryFn:()=>me(`/projects/${e}/cards/due`),enabled:!!e,staleTime:6e4}),f=(y=(w=xe({queryKey:["projects"],queryFn:()=>me("/projects"),enabled:!!e,staleTime:6e4}).data)==null?void 0:w.find(j=>j.id===e))==null?void 0:y.root;b.useEffect(()=>{const j=E=>{if((E.ctrlKey||E.metaKey)&&E.key.toLowerCase()==="k"){E.preventDefault(),u(S=>!S);return}if((E.ctrlKey||E.metaKey)&&!E.shiftKey&&!E.altKey&&E.key.toLowerCase()==="h"){E.preventDefault();const S=eS(window.location.pathname);l(S?`/help?s=${S}`:"/help");return}!E.target.closest("input, textarea, [contenteditable], .cm-editor")&&E.key==="?"&&d(!0)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[]);const m=i===void 0?"checking model":i?"model ready":"model off";return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex min-h-0 flex-1",children:[a.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-stretch overflow-y-auto bg-rail",children:[a.jsx(kh,{to:"/",className:"grid h-12 place-items-center",title:"cognitune: projects","aria-label":"cognitune: projects",children:a.jsx(u0,{className:"h-6 w-6"})}),e?a.jsxs(a.Fragment,{children:[a.jsx(wn,{to:`/p/${e}/today`,icon:a.jsx(f2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Today"}),a.jsx(wn,{to:`/p/${e}/explore`,icon:a.jsx(Da,{className:"h-6 w-6",strokeWidth:1.5}),label:"Explore"}),a.jsx(wn,{to:`/p/${e}/changes`,icon:a.jsx(D1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Changes"}),a.jsx(wn,{to:`/p/${e}/review`,icon:a.jsx(Ar,{className:"h-6 w-6",strokeWidth:1.5}),label:"Review",badge:(x=h.data)==null?void 0:x.length}),a.jsx(wn,{to:`/p/${e}/map`,icon:a.jsx(_1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Map"}),a.jsx(wn,{to:`/p/${e}/paths`,icon:a.jsx(Xf,{className:"h-6 w-6",strokeWidth:1.5}),label:"Paths"}),a.jsx(wn,{to:`/p/${e}/library`,icon:a.jsx(Wf,{className:"h-6 w-6",strokeWidth:1.5}),label:"Library"}),a.jsx(wn,{to:`/p/${e}/progress`,icon:a.jsx(C1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Progress"})]}):a.jsx(wn,{to:"/",end:!0,icon:a.jsx(r2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Projects"}),a.jsx("div",{className:"flex-1"}),e&&a.jsx(wn,{to:"/",end:!0,icon:a.jsx(z1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Projects"}),a.jsx(wn,{to:"/help",icon:a.jsx(T1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Help"}),a.jsx(wn,{to:"/settings",icon:a.jsx(u2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Settings"})]}),a.jsx("main",{className:"min-w-0 flex-1",children:a.jsx(i0,{})})]}),a.jsxs("footer",{className:"flex h-[22px] shrink-0 items-center gap-1 border-t border-line bg-status px-2 text-[12px] text-muted",children:[f&&a.jsx("span",{className:"px-1.5",title:f,children:f.split("/").filter(Boolean).pop()}),a.jsxs(kh,{to:"/settings",title:((v=r.data)==null?void 0:v.agent.detail)??"checking the model",className:"flex items-center gap-1.5 px-1.5 hover:bg-raised",children:[a.jsx("span",{className:le("h-2 w-2 rounded-full",i===void 0?"bg-line":i?"bg-good":"bg-bad")}),m]}),e&&a.jsx(cS,{pid:e}),a.jsx("div",{className:"flex-1"}),a.jsxs("button",{onClick:()=>u(!0),title:"Go to or do (Ctrl/Cmd+K). Press ? for all shortcuts.",className:"flex items-center gap-1 px-1.5 hover:bg-raised",children:[a.jsx(Wj,{className:"h-3 w-3"})," Ctrl K"]}),a.jsxs("button",{onClick:()=>n(uS[t]),title:`Theme: ${t} (click to change)`,className:"flex items-center gap-1 px-1.5 hover:bg-raised",children:[a.jsx(s,{className:"h-3 w-3"})," ",a.jsx("span",{className:"capitalize",children:t})]})]}),o&&a.jsx(lS,{pid:e,root:f,onClose:()=>u(!1),openFile:j=>{try{sessionStorage.setItem(`gl.open.${e}`,JSON.stringify(j))}catch{}l(`/p/${e}/explore`),window.dispatchEvent(new CustomEvent("cognitune:open",{detail:j}))}}),c&&a.jsx(oS,{onClose:()=>d(!1)})]})}const c0=b.createContext(null);function Ng(e,t){try{const n=sessionStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function Sg(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function hS({pid:e,children:t,fallback:n}){const r=xe({queryKey:["project",e],queryFn:()=>me(`/projects/${e}`)}),[i,s]=b.useState(()=>Ng(`gl.sel.${e}`,[])),[l,o]=b.useState(()=>Ng(`gl.open.${e}`,null)),[u,c]=b.useState(null);b.useEffect(()=>Sg(`gl.sel.${e}`,i),[e,i]),b.useEffect(()=>{const m=g=>{o(g.detail),c(null)};return window.addEventListener("cognitune:open",m),()=>window.removeEventListener("cognitune:open",m)},[]),b.useEffect(()=>Sg(`gl.open.${e}`,l),[e,l]);const d=b.useCallback(m=>s([...new Set(m)]),[]),h=b.useCallback((m,g)=>{s(w=>{const y=w.includes(m);return g??!y?y?w:[...w,m]:w.filter(v=>v!==m)})},[]),p=b.useCallback((m,g)=>{o(m),c(g??null)},[]),f=b.useMemo(()=>{const m=r.data;return m?{project:m,selected:i,toggle:h,setSelected:d,openFile:l,setOpenFile:p,focusLine:u,rel:w=>{if(w.startsWith(m.root+"/"))return w.slice(m.root.length+1);for(const y of m.contexts)if(w.startsWith(y+"/"))return`${y.split("/").pop()}/${w.slice(y.length+1)}`;return w}}:null},[r.data,i,h,d,l,p,u]);return r.error?a.jsx(a.Fragment,{children:n}):f?a.jsx(c0.Provider,{value:f,children:t}):null}function it(){const e=b.useContext(c0);if(!e)throw new Error("useProject outside ProjectProvider");return e}function lp({title:e,start:t,onPick:n,onClose:r,cta:i="Open this folder"}){var h,p;const[s,l]=b.useState(t??""),[o,u]=b.useState(t??""),c=xe({queryKey:["browse",s],queryFn:()=>me(`/browse?path=${encodeURIComponent(s)}`)}),d=((h=c.data)==null?void 0:h.path)??s;return a.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4 backdrop-blur-sm",onClick:r,children:a.jsxs("div",{className:"card flex max-h-[80vh] w-full max-w-xl flex-col overflow-hidden",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:r,"aria-label":"Close",children:a.jsx(pr,{className:"h-4 w-4"})})]}),a.jsxs("form",{className:"flex gap-2 border-b border-line p-3",onSubmit:f=>{f.preventDefault(),l(o)},children:[a.jsx("input",{className:"input font-mono text-xs",value:o,onChange:f=>u(f.target.value),placeholder:"/path/to/folder"}),a.jsx(Z,{type:"submit",children:"Go"})]}),a.jsxs("div",{className:"min-h-[240px] flex-1 overflow-auto p-2",children:[c.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),c.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:c.error.message})}),c.data&&a.jsxs(a.Fragment,{children:[c.data.parent&&a.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-muted hover:bg-raised",onClick:()=>{l(c.data.parent),u(c.data.parent)},children:[a.jsx(S1,{className:"h-4 w-4"})," .."]}),c.data.dirs.map(f=>{const m=`${c.data.path.replace(/\/$/,"")}/${f}`;return a.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm hover:bg-raised",onDoubleClick:()=>n(m),onClick:()=>{l(m),u(m)},children:[a.jsx(F1,{className:"h-4 w-4 text-accent/80"})," ",f]},f)}),!c.data.dirs.length&&a.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted",children:"No sub-folders."})]})]}),a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-3",children:[a.jsxs("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted",title:d,children:[((p=c.data)==null?void 0:p.isGit)&&a.jsx(Zj,{className:"mr-1 inline h-3.5 w-3.5 text-good"}),d]}),a.jsx(Z,{variant:"ghost",onClick:r,children:"Cancel"}),a.jsx(Z,{variant:"primary",disabled:!c.data,onClick:()=>n(d),children:i})]})]})})}const fS=[{icon:Da,title:"Lenses",text:"See code through one question: data flow, state, failure modes, contracts."},{icon:Oa,title:"Quizzes",text:"Questions about behaviour, not names. Graded with feedback that names the line."},{icon:Vu,title:"Practice",text:"Key logic cut out of your own code. Write it back, with hints when stuck."},{icon:Wf,title:"Progress",text:"What you understand, per file. A pass goes stale when the code changes."}];function pS(){var u;const e=gt(),t=Dt(),[n,r]=b.useState(!1),i=xe({queryKey:["projects"],queryFn:()=>me("/projects")}),s=xi({mutationFn:c=>Ni("/projects",{root:c}),onSuccess:c=>{t.invalidateQueries({queryKey:["projects"]}),e(`/p/${c.id}/today`)}}),l=xi({mutationFn:c=>ls(`/projects/${c}`),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]})}),o=i.data??[];return a.jsxs("div",{className:"h-full overflow-auto",children:[a.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(u0,{className:"h-11 w-11"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"cognitune"}),a.jsx("p",{className:"text-sm text-muted",children:"Understand any codebase. Prove it to yourself."})]})]}),a.jsx("div",{className:"mt-10 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:fS.map(({icon:c,title:d,text:h})=>a.jsxs("div",{className:"card p-4",children:[a.jsx("div",{className:"mb-3 grid h-9 w-9 place-items-center rounded-lg bg-accent/10 text-accent",children:a.jsx(c,{className:"h-[18px] w-[18px]"})}),a.jsx("div",{className:"text-sm font-semibold",children:d}),a.jsx("p",{className:"mt-1 text-[14px] leading-snug text-muted",children:h})]},d))}),a.jsxs("div",{className:"mt-12 flex items-end justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Projects"}),a.jsx("p",{className:"text-sm text-muted",children:"A project is a folder of code. Nothing in it is written."})]}),a.jsx(Z,{variant:"primary",size:"lg",icon:a.jsx(A1,{className:"h-4 w-4"}),onClick:()=>r(!0),children:"Open a folder"})]}),s.error&&a.jsx("div",{className:"mt-4",children:a.jsx(Ke,{error:s.error.message})}),a.jsxs("div",{className:"mt-5 grid gap-3 md:grid-cols-2",children:[o.map(c=>a.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s.mutate(c.root),onKeyDown:d=>d.key==="Enter"&&s.mutate(c.root),className:"card group flex cursor-pointer items-center gap-4 p-4 transition hover:-translate-y-0.5 hover:border-accent/40",children:[a.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-md bg-gradient-to-br from-accent/20 to-fuchsia-500/20 text-sm font-bold uppercase text-accent",children:c.name.slice(0,2)}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-medium",children:c.name}),a.jsx("div",{className:"truncate font-mono text-xs text-muted",title:c.root,children:c.root}),a.jsxs("div",{className:"mt-1 text-[12px] text-muted",children:["opened ",It(c.openedAt),c.contexts.length>0&&` · ${c.contexts.length} context folder${c.contexts.length>1?"s":""}`]})]}),a.jsx("button",{className:"rounded-md p-1.5 text-muted opacity-0 transition hover:bg-raised hover:text-bad group-hover:opacity-100",title:"Remove from the list (your lenses and quizzes stay on disk)",onClick:d=>{d.stopPropagation(),l.mutate(c.id)},children:a.jsx(fr,{className:"h-4 w-4"})}),a.jsx(Bu,{className:"h-4 w-4 text-muted transition group-hover:translate-x-0.5 group-hover:text-accent"})]},c.id)),!i.isLoading&&!o.length&&a.jsxs("div",{className:"card col-span-full border-dashed p-10 text-center text-sm text-muted",children:["No projects yet. Open a folder, or start from a terminal: ",a.jsx("span",{className:"kbd",children:"npx cognitune ./my-repo"})]})]})]}),n&&a.jsx(lp,{title:"Open a folder",start:((u=o[0])==null?void 0:u.root.split("/").slice(0,-1).join("/"))||void 0,onClose:()=>r(!1),onPick:c=>{r(!1),s.mutate(c)}})]})}function hr(e,t=36){if(e.length<=t)return e;const n=e.split("/"),r=n.pop()??"";return[...n.map(s=>s===""?"":s.startsWith(".")?s.slice(0,2):s[0]),r].join("/")}const mS={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"csharp",c:"c",h:"c",cpp:"cpp",hpp:"cpp",swift:"swift",scala:"scala",sh:"bash",zsh:"bash",bash:"bash",sql:"sql",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue",svelte:"svelte",tf:"hcl",hcl:"hcl",xml:"xml",ini:"ini",lua:"lua",r:"r",dart:"dart",ex:"elixir",exs:"elixir"};function d0(e){const t=(e.split("/").pop()??"").toLowerCase();if(t==="dockerfile")return"docker";if(t==="makefile")return"make";const n=t.includes(".")?t.slice(t.lastIndexOf(".")+1):"";return mS[n]??"text"}const gS=/\.(ts|tsx|js|jsx|mjs|py|go|rs|java|kt|rb|php|cs|c|h|cpp|swift|scala|sh|sql|vue|svelte|lua|dart|ex)$/i,xS=/\.(md|txt|rst|json|ya?ml|toml|ini|cfg)$/i;function h0(e){return e.kind==="file"?[e.path]:(e.children??[]).flatMap(h0)}function f0(e,t){if(!t)return e;const n=t.toLowerCase(),r=[];for(const i of e)if(i.kind==="file")i.path.toLowerCase().includes(n)&&r.push(i);else{const s=f0(i.children??[],t);s.length&&r.push({...i,children:s})}return r}const yS={new:"",seen:"bg-muted/50",understood:"bg-good",fading:"bg-warn/50",stale:"bg-warn"};function ap({roots:e,selected:t,onToggle:n,openFile:r,onOpen:i,levels:s,meta:l,openAll:o=!1}){const[u,c]=b.useState(""),[d,h]=b.useState(()=>o?new Set:new Set(e.map(g=>g.path))),p=b.useMemo(()=>new Set(t),[t]),f=b.useMemo(()=>f0(e,u.trim()),[e,u]),m=(g,w)=>{var M;const y=u?!0:o?!d.has(g.path):d.has(g.path),x=g.kind==="dir"?h0(g):[g.path],v=x.filter(F=>p.has(F)).length,j=v>0&&v===x.length,E=v>0&&!j,k=s==null?void 0:s.get(g.path),S=g.kind==="dir"?y?A1:F1:gS.test(g.name)?ol:xS.test(g.name)?Xj:R1;return a.jsxs("div",{children:[a.jsxs("div",{className:le("group flex h-[22px] cursor-pointer items-center gap-1 pr-2 text-[13px]",r===g.path?"bg-sel text-ink dark:text-white":"hover:bg-raised"),style:{paddingLeft:w*12+8},onClick:()=>{g.kind==="dir"?h(F=>{const C=new Set(F);return C.has(g.path)?C.delete(g.path):C.add(g.path),C}):i(g.path)},children:[a.jsx(ba,{className:le("h-3.5 w-3.5 shrink-0 text-muted transition",g.kind==="file"&&"invisible",y&&"rotate-90")}),a.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 shrink-0 cursor-pointer accent-[rgb(var(--accent))]",checked:j,ref:F=>{F&&(F.indeterminate=E)},onClick:F=>F.stopPropagation(),onChange:()=>n(x,!j),title:g.kind==="dir"?`Tick all ${x.length} files`:"Use as context"}),a.jsx(S,{className:le("h-4 w-4 shrink-0","text-muted")}),a.jsx("span",{className:"truncate",children:g.name}),k&&k!=="new"&&a.jsx("span",{title:k,className:le("ml-auto h-1.5 w-1.5 shrink-0 rounded-full",yS[k])}),l&&g.kind==="file"&&a.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:l(g.path)})]}),g.kind==="dir"&&y&&((M=g.children)==null?void 0:M.map(F=>m(F,w+1)))]},g.path)};return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsx("div",{className:"px-2 py-1.5",children:a.jsxs("div",{className:"relative",children:[a.jsx(gl,{className:"pointer-events-none absolute left-2 top-[6px] h-3.5 w-3.5 text-muted"}),a.jsx("input",{className:"input h-[26px] pl-7 text-[13px]",placeholder:"Filter files",value:u,onChange:g=>c(g.target.value)})]})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto pb-4",children:f.map(g=>m(g,0))})]})}function vS({current:e,onApply:t,onClose:n}){const{project:r}=it(),i=Dt(),[s,l]=b.useState(e),[o,u]=b.useState(null),[c,d]=b.useState(!1),h=xe({queryKey:["tree",r.id,r.contexts],queryFn:()=>me(`/projects/${r.id}/tree`)}),p=xi({mutationFn:f=>Ba(`/projects/${r.id}`,{contexts:[...r.contexts,f]}),onSuccess:()=>i.invalidateQueries()});return a.jsxs("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4 backdrop-blur-sm",onClick:n,children:[a.jsxs("div",{className:"card flex h-[80vh] w-full max-w-xl flex-col overflow-hidden",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Add context"}),a.jsxs("span",{className:"text-xs text-muted",children:[s.length," ticked"]}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:n,"aria-label":"Close",children:a.jsx(pr,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 text-xs text-muted",children:[a.jsx("span",{className:"flex-1",children:"Tick files from the project or its context folders. The model reads them next to the change."}),a.jsx(Z,{size:"sm",icon:a.jsx(I1,{className:"h-3.5 w-3.5"}),onClick:()=>d(!0),children:"Add a folder"})]}),p.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:p.error.message})}),a.jsxs("div",{className:"min-h-0 flex-1",children:[h.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),h.data&&a.jsx(ap,{roots:h.data,selected:s,onToggle:(f,m)=>l(m?[...new Set([...s,...f])]:s.filter(g=>!f.includes(g))),openFile:o,onOpen:f=>{u(f),l(s.includes(f)?s.filter(m=>m!==f):[...s,f])}})]}),a.jsxs("div",{className:"flex justify-end gap-2 border-t border-line px-4 py-3",children:[a.jsx(Z,{variant:"ghost",onClick:n,children:"Cancel"}),a.jsxs(Z,{variant:"primary",onClick:()=>{t(s),n()},children:["Use ",s.length," file",s.length===1?"":"s"]})]})]}),c&&a.jsx("div",{onClick:f=>f.stopPropagation(),children:a.jsx(lp,{title:"Add a context folder",cta:"Add as context",start:r.root.split("/").slice(0,-1).join("/"),onClose:()=>d(!1),onPick:f=>{d(!1),p.mutate(f)}})})]})}const Bc=5,Uc=[{id:"lens",label:"Lens",icon:Da,hint:"Read an explanation through one question"},{id:"quiz",label:"Quiz",icon:Oa,hint:"Answer questions in your own words"},{id:"teach",label:"Teach",icon:Hu,hint:"Explain it yourself; get graded"},{id:"tutor",label:"Tutor",icon:Wu,hint:"Ask; get questions and hints back"},{id:"walk",label:"Walk",icon:qu,hint:"One block at a time, with a check each"},{id:"practice",label:"Practice",icon:Vu,hint:"Write the key lines back"},{id:"hunt",label:"Bug hunt",icon:Uu,hint:"Find the bugs planted in a copy"},{id:"notes",label:"Notes",icon:q1,hint:"Your notes on this file"}],wS=["walk","hunt","notes"],Cg=[{value:1,label:"1",title:"One short hole"},{value:2,label:"2",title:"A condition and a computation"},{value:3,label:"3",title:"Core logic"},{value:4,label:"4",title:"Whole function bodies"}],Eg=[{value:1,label:"Easy",title:"One bug, fairly visible"},{value:2,label:"Medium",title:"Two bugs, one needs the logic"},{value:3,label:"Hard",title:"Two or three subtle bugs"}];function p0({files:e,diff:t,practiceFile:n,onRemove:r,onSetFiles:i}){var Yn,Xn,yr;const{project:s,rel:l,toggle:o,setSelected:u,focusLine:c}=it(),d=r??(J=>o(J,!1)),h=i??u,[p,f]=sp(),[m,g]=b.useState(!1),[w,y]=b.useState(!1),x=gt(),[v,j]=b.useState(()=>Uc.some(J=>J.id===p.get("do"))?p.get("do"):"lens"),[E,k]=b.useState(t?"change":"explain"),[S,M]=b.useState(""),[F,C]=b.useState(!1),[O,I]=b.useState(""),[Q,q]=b.useState(""),[$,G]=b.useState("standard"),[Y,z]=b.useState(null),[H,N]=b.useState(2),[ue,ye]=b.useState(""),[T,Te]=b.useState(1),[De,ve]=b.useState(""),Ne=mn(),_t=xe({queryKey:["lens-kinds"],queryFn:()=>me("/lens-kinds"),staleTime:1/0}),an=xe({queryKey:["misconceptions",s.id],queryFn:()=>me(`/projects/${s.id}/misconceptions`)});b.useEffect(()=>{if(!p.get("do"))return;const J=new URLSearchParams(p);J.delete("do"),f(J,{replace:!0})},[]);const Tt=`/projects/${s.id}`,Be=`/p/${s.id}`,lt=e.length===0,Rn=wS.includes(v),zn=xe({queryKey:["estimate",s.id,e],queryFn:()=>Ni(`${Tt}/estimate`,{files:e}),enabled:!lt&&!Rn,staleTime:3e4}),Qt=()=>Ne.run(`${Tt}/lenses`,{files:e,kind:S.trim()?"custom":E,question:S.trim()||void 0,diff:t,sketch:F&&O.trim()||void 0,traceInput:E==="trace"?Q:void 0,depth:$},J=>x(`${Be}/lens/${J.resultId}`)),Kn=(J=!1)=>Ne.run(`${Tt}/quizzes`,J?{files:[],weak:!0}:{files:e,diff:t,count:Y??void 0},Kt=>x(`${Be}/quiz/${Kt.resultId}`)),on=(J,Kt,vr)=>Ne.run(`${Tt}/${J}`,Kt,Jn=>x(`${Be}/${vr}/${Jn.resultId}`)),Gn=Uc.find(J=>J.id===v),xr=((Yn=an.data)==null?void 0:Yn.length)??0;return a.jsxs("div",{className:"flex h-full flex-col bg-panel",children:[a.jsx("div",{className:"grid grid-cols-4 gap-1 border-b border-line p-2",children:Uc.map(J=>a.jsxs("button",{onClick:()=>j(J.id),title:J.hint,className:le("flex flex-col items-center gap-0.5 rounded-lg px-1 py-1.5 text-[12px] font-medium transition",v===J.id?"bg-accent/12 text-accent":"text-muted hover:bg-raised hover:text-ink"),children:[a.jsx(J.icon,{className:"h-4 w-4"}),J.label]},J.id))}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto p-4",children:[a.jsxs("p",{className:"-mb-1 text-xs text-muted",children:[Gn.hint,"."]}),!Rn&&a.jsxs("section",{children:[a.jsxs("div",{className:"label flex items-center gap-1",children:[a.jsxs("span",{children:["Context · ",e.length]}),t&&a.jsxs("span",{className:"truncate normal-case tracking-normal",children:["· change ",t.base,"..",t.head||"working tree"]}),a.jsxs("button",{className:"ml-auto inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 normal-case tracking-normal text-accent hover:bg-accent/10",onClick:()=>g(!0),title:"Add files from the project or a context folder (docs, notes, a session)",children:[a.jsx(B1,{className:"h-3 w-3"})," Add"]})]}),lt?a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"Tick files in the tree, open one, or use Add. The model reads only what you pick."}):a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(w?e:e.slice(0,Bc)).map(J=>a.jsxs("span",{className:"group inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px]",title:J,children:[a.jsx("span",{className:"truncate",children:hr(l(J))}),a.jsx("button",{className:"text-muted hover:text-bad",onClick:()=>d(J),"aria-label":"Remove",children:a.jsx(pr,{className:"h-3 w-3"})})]},J)),e.length>Bc&&a.jsx("button",{className:"rounded-md px-2 py-1 text-[12px] font-medium text-accent hover:bg-accent/10",onClick:()=>y(J=>!J),children:w?"show less":`+${e.length-Bc} more`})]}),zn.data&&a.jsxs("div",{className:le("mt-1.5 text-[12px]",zn.data.cut?"text-warn":"text-muted"),children:["~",zn.data.tokens.toLocaleString()," tokens",zn.data.cut&&" · some files do not fit and will be left out"]})]}),Rn&&a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"File"}),n?a.jsx("div",{className:"truncate rounded-md bg-raised px-2 py-1.5 font-mono text-xs",title:n,children:l(n)}):a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"Open a file first."})]}),v==="lens"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Pick a lens"}),a.jsx("div",{className:"grid grid-cols-1 gap-1.5",children:(_t.data??[]).map(J=>a.jsxs("button",{onClick:()=>{k(J.id),M("")},className:le("rounded-lg border px-3 py-2 text-left transition",E===J.id&&!S.trim()?"border-accent/60 bg-accent/8 ring-1 ring-accent/30":"border-line hover:border-accent/30 hover:bg-raised"),children:[a.jsx("div",{className:"text-[14px] font-medium",children:J.label}),a.jsx("div",{className:"text-xs text-muted",children:J.blurb})]},J.id))})]}),E==="trace"&&!S.trim()&&a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Input to trace"}),a.jsx("input",{className:"input",placeholder:"e.g. add(3) (empty = the model picks one)",value:Q,onChange:J=>q(J.target.value)})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Depth"}),a.jsx(qt,{value:$,onChange:G,options:[{value:"overview",label:"Overview",title:"About 1.5 screens: the big picture, 3-4 steps"},{value:"standard",label:"Standard",title:"At least 3 screens: enough to change it safely, 6-9 steps"},{value:"deep",label:"Deep",title:"5-6 screens, a long blog post: every branch and failure path, 11-15 steps"}]})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Or ask your own question"}),a.jsx("textarea",{className:"input min-h-[64px] resize-y",placeholder:"e.g. Why is the retry here and not in the caller?",value:S,onChange:J=>M(J.target.value)})]}),a.jsxs("section",{className:"rounded-lg border border-line p-3",children:[a.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[14px] font-medium",children:[a.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:F,onChange:J=>C(J.target.checked)}),a.jsx($1,{className:"h-3.5 w-3.5 text-accent"}),t?"Predict first":"My take first"]}),F&&a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-2 min-h-[72px] resize-y",placeholder:t?"What behaviour changes, and what test or caller would break?":"In 2-3 lines: what does it do, and how? Where is the risk?",value:O,onChange:J=>I(J.target.value)}),a.jsx("p",{className:"mt-1 text-[12px] text-muted",children:"The lens opens with where your take differs. That gap is where the learning is."})]})]}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(Jf,{className:"h-4 w-4"}),disabled:lt||Ne.busy||F&&!O.trim(),onClick:Qt,children:"Make the lens"})]}),v==="quiz"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Questions"}),a.jsx(qt,{value:Y??0,onChange:J=>z(J===0?null:J),options:[{value:0,label:"Default"},{value:3,label:"3"},{value:5,label:"5"},{value:8,label:"8"}]}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"Free-text answers. Questions ask about behaviour and reasons, not names. Mark each answer sure or guess."})]}),a.jsxs(Z,{variant:"primary",className:"w-full",icon:a.jsx(Oa,{className:"h-4 w-4"}),disabled:lt||Ne.busy,onClick:()=>Kn(),children:["Quiz me on ",e.length||""," file",e.length===1?"":"s"]}),a.jsxs("div",{className:"rounded-lg border border-line p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-medium",children:[a.jsx(Gi,{className:"h-3.5 w-3.5 text-bad"})," Weak spots · ",xr]}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"New questions aimed at what you got wrong before, from any file. A right answer clears the weak spot."}),a.jsx(Z,{className:"mt-2 w-full",size:"sm",disabled:!xr||Ne.busy,onClick:()=>Kn(!0),children:"Quiz my weak spots"})]})]}),v==="teach"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Explain it to a new teammate"}),a.jsx("textarea",{className:"input min-h-[180px] resize-y",placeholder:"What does this code do, how, and why this way? What would surprise someone? Write it before you look anything up.",value:De,onChange:J=>ve(J.target.value)}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Graded 1-5 against the code: what you got right, what you missed, what is wrong. 4+ counts as understood."})]}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(Hu,{className:"h-4 w-4"}),disabled:lt||Ne.busy||De.trim().length<20,onClick:()=>on("teachbacks",{files:e,text:De,diff:t},"teach"),children:"Grade my explanation"})]}),v==="tutor"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Your question"}),a.jsx("textarea",{className:"input min-h-[100px] resize-y",placeholder:"e.g. Why does this return early here?",value:De,onChange:J=>ve(J.target.value)}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"The tutor answers with a question or a hint first, and gives more each turn. Ask it to just tell you any time."})]}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(Wu,{className:"h-4 w-4"}),disabled:lt||Ne.busy||!De.trim(),onClick:()=>on("threads",{files:e,text:De,diff:t},"tutor"),children:"Ask the tutor"})]}),v==="walk"&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xs text-muted",children:"The file in reading order, one block at a time. Answer a short check on each block before the next."}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(qu,{className:"h-4 w-4"}),disabled:!n||Ne.busy,onClick:()=>on("walks",{file:n},"walk"),children:"Walk me through it"})]}),v==="practice"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsxs("div",{className:"label",children:["Concept to practise ",a.jsx("span",{className:"normal-case tracking-normal",children:"(optional)"})]}),a.jsx("input",{className:"input",placeholder:"e.g. retry with backoff, how a run resumes",value:ue,onChange:J=>ye(J.target.value)}),a.jsx("p",{className:"mt-1.5 text-xs text-muted",children:"Leave it empty and the model picks the main idea of the files above. Holes can land in any of them."})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Difficulty"}),a.jsx(qt,{value:H,onChange:N,options:Cg.map(J=>({...J}))}),a.jsxs("p",{className:"mt-2 text-xs text-muted",children:[(Xn=Cg.find(J=>J.value===H))==null?void 0:Xn.title,". The key lines are cut out of a copy; you write them back here, with hints if you need them. Your folder is not touched."]})]}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(Vu,{className:"h-4 w-4"}),disabled:lt||Ne.busy,onClick:()=>on("practice",{files:e,level:H,concept:ue.trim()||void 0},"practice"),children:"Make the practice"})]}),v==="hunt"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Difficulty"}),a.jsx(qt,{value:T,onChange:Te,options:Eg.map(J=>({...J}))}),a.jsxs("p",{className:"mt-2 text-xs text-muted",children:[(yr=Eg.find(J=>J.value===T))==null?void 0:yr.title,". Bugs go into a copy of the file. Click the lines you think are wrong and say why."]})]}),a.jsx(Z,{variant:"primary",className:"w-full",icon:a.jsx(Uu,{className:"h-4 w-4"}),disabled:!n||Ne.busy,onClick:()=>on("hunts",{file:n,level:T},"hunt"),children:"Start the hunt"})]}),v==="notes"&&n&&a.jsx(kS,{file:n,line:c}),Ne.busy&&Ne.job&&a.jsx(sn,{kind:Ne.job.kind,elapsed:Ne.elapsed}),Ne.error&&a.jsx(Ke,{error:Ne.error,onClose:Ne.clearError})]}),m&&a.jsx(vS,{current:e,onApply:h,onClose:()=>g(!1)})]})}function kS({file:e,line:t}){const{project:n,setOpenFile:r}=it(),i=Dt(),[s,l]=b.useState(""),o=xe({queryKey:["notes",n.id,e],queryFn:()=>me(`/projects/${n.id}/notes?file=${encodeURIComponent(e)}`)}),u=async()=>{await Ni(`/projects/${n.id}/notes`,{file:e,line:t??void 0,text:s}),l(""),i.invalidateQueries({queryKey:["notes",n.id]})},c=[...o.data??[]].sort((d,h)=>(d.line??0)-(h.line??0));return a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsxs("div",{className:"label",children:["New note ",t?`on line ${t}`:"on the file"]}),a.jsx("textarea",{className:"input min-h-[72px] resize-y",placeholder:"Click a line in the code to pin the note there.",value:s,onChange:d=>l(d.target.value)}),a.jsx(Z,{className:"mt-2 w-full",size:"sm",disabled:!s.trim(),onClick:u,children:"Add note"})]}),a.jsxs("section",{className:"space-y-2",children:[c.map(d=>a.jsxs("div",{className:"group rounded-lg border border-line p-2.5 text-[14px]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[d.line?a.jsxs("button",{className:"font-mono text-[12px] text-accent hover:underline",onClick:()=>r(e,d.line),children:["line ",d.line]}):a.jsx("span",{className:"text-[12px] text-muted",children:"file"}),a.jsx("button",{className:"ml-auto text-muted opacity-0 transition hover:text-bad group-hover:opacity-100",onClick:async()=>{await ls(`/projects/${n.id}/notes/${d.id}`),i.invalidateQueries({queryKey:["notes",n.id]})},"aria-label":"Delete note",children:a.jsx(fr,{className:"h-3.5 w-3.5"})})]}),a.jsx("div",{className:"mt-1 whitespace-pre-wrap",children:d.text})]},d.id)),!c.length&&a.jsx("p",{className:"text-xs text-muted",children:"No notes on this file yet."})]})]})}function Ua({initial:e,onClose:t}){const{project:n,rel:r}=it(),i=Dt(),[s,l]=b.useState(e.front??""),[o,u]=b.useState(e.back??""),[c,d]=b.useState(null),[h,p]=b.useState(!1),f=async()=>{p(!0);try{await Ni(`/projects/${n.id}/cards`,{...e,front:s,back:o}),await i.invalidateQueries(),t()}catch(m){d(m.message),p(!1)}};return a.jsxs(Xu,{title:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ar,{className:"h-4 w-4 text-accent"})," New review card"]}),onClose:t,footer:a.jsxs(a.Fragment,{children:[a.jsx(Z,{variant:"ghost",onClick:t,children:"Cancel"}),a.jsx(Z,{variant:"primary",loading:h,disabled:!s.trim()||!o.trim(),onClick:f,children:"Save card"})]}),children:[e.file&&a.jsxs("div",{className:"mb-3 font-mono text-[12px] text-muted",children:[r(e.file),e.line?`:${e.line}`:""]}),a.jsx("label",{className:"label",children:"Question (front)"}),a.jsx("textarea",{className:"input min-h-[72px]",value:s,onChange:m=>l(m.target.value),placeholder:"What should you be able to recall?",autoFocus:!0}),a.jsx("label",{className:"label mt-3",children:"Answer (back)"}),a.jsx("textarea",{className:"input min-h-[96px]",value:o,onChange:m=>u(m.target.value),placeholder:"The answer, in your own words"}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"The card comes back on the Review page: soon at first, then less often as you remember it."}),c&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:c})})]})}const bS=4e3;let jS=null;const NS=()=>jS??(jS=dl(()=>import("./index-DM-V8yrZ.js"),[])),SS={docker:"dockerfile",make:"makefile",text:"text"};function CS(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function qc(e,t){return`<pre><code>${e.split(`
464
- `).map((n,r)=>`<span class="line ${t(r+1)}" data-line="${r+1}">${CS(n)}</span>`).join(`
465
- `)}</code></pre>`}function qa({text:e,lang:t,focusLine:n,marks:r,className:i,onLineClick:s,firstLine:l=1}){const[o,u]=b.useState(""),c=b.useRef(null),d=b.useRef(null);return b.useEffect(()=>{let h=!0;const p=m=>{const g=m+l-1,w=(r??[]).filter(y=>g>=y.from&&g<=y.to).map(y=>y.cls);return le(w,g===n&&"hl")};if(e.split(`
466
- `).length>bS||t==="text"){u(qc(e,p));return}return u(m=>m||qc(e,p)),NS().then(async m=>{const g=SS[t]??t,w=await m.codeToHtml(e,{lang:g in m.bundledLanguages?g:"text",themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1,transformers:[{line(y,x){y.properties["data-line"]=x;const v=p(x);v&&this.addClassToHast(y,v)}}]});h&&u(w)}).catch(()=>h&&u(qc(e,p))),()=>{h=!1}},[e,t,n,r,l]),b.useEffect(()=>{if(!n||!c.current||d.current===n)return;const h=c.current.querySelector(`[data-line="${n-l+1}"]`);h==null||h.scrollIntoView({block:"center",behavior:"smooth"})},[o,n]),a.jsx("div",{ref:c,className:le("code-view font-mono",s&&"clickable",i),style:l>1?{"--line-start":l-1}:void 0,onClick:h=>{var f,m;if((f=window.getSelection())!=null&&f.toString())return;const p=(m=h.target.closest("[data-line]"))==null?void 0:m.dataset.line;if(p&&s){const g=Number(p)+l-1;d.current=g,s(g)}},dangerouslySetInnerHTML:{__html:o}})}function Pg(e,t,n){try{const r=localStorage.getItem(e);return r===null?t:n(r)}catch{return t}}function Tg(e,t){try{localStorage.setItem(e,t)}catch{}}function Qn({id:e,left:t,right:n,initial:r=280,min:i=180,max:s=640,side:l="left",className:o,collapsible:u=!1,startCollapsed:c=!1,openSignal:d}){const h=`cognitune.split.${e}`,[p,f]=b.useState(()=>Pg(h,r,Number)||r),[m,g]=b.useState(()=>u&&Pg(`${h}.collapsed`,c,q=>q==="1")),w=b.useRef(!0);b.useEffect(()=>{if(w.current){w.current=!1;return}d!=null&&g(!1)},[d]);const[y,x]=b.useState(!1),v=b.useRef(null),j=b.useRef();b.useEffect(()=>Tg(h,String(p)),[h,p]),b.useEffect(()=>Tg(`${h}.collapsed`,m?"1":"0"),[h,m]),b.useEffect(()=>{const q=G=>{if(!v.current)return;const Y=G.clientX-v.current.x;f(Math.min(s,Math.max(i,v.current.size+(l==="left"?Y:-Y))))},$=()=>{v.current=null,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("pointermove",q),window.addEventListener("pointerup",$),()=>{window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",$)}},[i,s,l]);const E=()=>{clearTimeout(j.current),x(!0)},k=()=>{clearTimeout(j.current),j.current=setTimeout(()=>x(!1),250)};b.useEffect(()=>()=>clearTimeout(j.current),[]);const S=l==="left";b.useEffect(()=>{if(!u)return;const q=S?"[":"]",$=G=>{const Y=G.target;G.key!==q||G.ctrlKey||G.metaKey||G.altKey||Y.closest("input, textarea, select, [contenteditable=true], .cm-editor")||(g(z=>!z),x(!1))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[u,S]);const M=S?mu:ba,F=S?ba:mu,C=a.jsxs("div",{className:"group relative w-px shrink-0 cursor-col-resize bg-line",onPointerDown:q=>{q.target.closest("button")||(v.current={x:q.clientX,size:p},document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onDoubleClick:()=>f(r),title:"Drag to resize, double-click to reset",children:[a.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5 transition group-hover:bg-accent/30"}),u&&a.jsx("button",{onClick:()=>{g(!0),x(!1)},title:`Fold this pane away (key ${S?"[":"]"}); hover the edge to see it again`,className:"absolute top-1/2 z-20 -mt-5 grid h-10 w-5 -translate-x-1/2 place-items-center rounded-full border border-line bg-panel text-muted shadow-sm transition hover:border-accent/50 hover:text-accent",children:a.jsx(M,{className:"h-3 w-3"})})]}),O=a.jsx("div",{onMouseEnter:E,onMouseLeave:k,className:le("group flex w-3 shrink-0 cursor-pointer flex-col items-center justify-center bg-panel transition hover:bg-accent/10",S?"border-r border-line":"border-l border-line"),onClick:()=>{g(!1),x(!1)},title:`Hover to peek, click to pin open (key ${S?"[":"]"})`,children:a.jsx(F,{className:"h-3 w-3 text-muted group-hover:text-accent"})}),I=a.jsx("div",{style:{width:p},onMouseEnter:m?E:void 0,onMouseLeave:m?k:void 0,className:le("min-h-0 shrink-0 overflow-hidden",m&&!y&&"hidden",m&&y&&le("absolute inset-y-0 z-30 shadow-2xl ring-1 ring-line",S?"left-3":"right-3")),children:S?t:n}),Q=a.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:S?n:t});return a.jsx("div",{className:le("relative flex h-full min-h-0 min-w-0",o),children:S?a.jsxs(a.Fragment,{children:[m&&O,I,!m&&C,Q]}):a.jsxs(a.Fragment,{children:[Q,!m&&C,I,m&&O]})})}function ES(){var M;const{project:e,selected:t,setSelected:n,toggle:r,openFile:i,setOpenFile:s,focusLine:l,rel:o}=it(),u=Dt(),[c,d]=b.useState(!1),[h,p]=b.useState(!1),f=xe({queryKey:["notes",e.id,i],queryFn:()=>me(`/projects/${e.id}/notes?file=${encodeURIComponent(i)}`),enabled:!!i}),m=b.useMemo(()=>(f.data??[]).filter(F=>F.line).map(F=>({from:F.line,to:F.line,cls:"note"})),[f.data]),g=xe({queryKey:["tree",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/tree`)}),w=xe({queryKey:["progress",e.id],queryFn:()=>me(`/projects/${e.id}/progress`)}),y=xe({queryKey:["file",e.id,i],queryFn:()=>me(`/projects/${e.id}/file?path=${encodeURIComponent(i)}`),enabled:!!i}),x=xi({mutationFn:F=>Ba(`/projects/${e.id}`,{contexts:F}),onSuccess:()=>u.invalidateQueries()}),v=b.useMemo(()=>new Map((w.data??[]).map(F=>[F.path,F.level])),[w.data]),j=t.length?t:i?[i]:[],E=i?t.includes(i):!1,k=a.jsxs("div",{className:"flex h-full flex-col bg-side",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-2.5",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate text-sm font-semibold",children:e.name}),a.jsx("div",{className:"truncate font-mono text-[12px] text-muted",title:e.root,children:hr(e.root,30)})]}),a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(I1,{className:"h-4 w-4"}),title:"Add a context folder (docs, notes, a session folder)",onClick:()=>d(!0)})]}),e.contexts.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line px-3 py-2",children:e.contexts.map(F=>a.jsxs(ke,{tone:"accent",className:"max-w-full",children:[a.jsxs("span",{className:"truncate",title:F,children:["+ ",F.split("/").pop()]}),a.jsx("button",{onClick:()=>x.mutate(e.contexts.filter(C=>C!==F)),"aria-label":"Remove context folder",children:a.jsx(pr,{className:"h-3 w-3"})})]},F))}),t.length>0&&a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-accent/5 px-3 py-1.5 text-xs",children:[a.jsxs("span",{className:"font-medium text-accent",children:[t.length," ticked"]}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:()=>n([]),children:"clear"})]}),a.jsxs("div",{className:"min-h-0 flex-1",children:[g.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),g.error&&a.jsx("div",{className:"p-3",children:a.jsx(Ke,{error:g.error.message})}),g.data&&a.jsx(ap,{roots:g.data,selected:t,onToggle:(F,C)=>n(C?[...t,...F]:t.filter(O=>!F.includes(O))),openFile:i,onOpen:F=>s(F),levels:v})]})]}),S=a.jsx("div",{className:"flex h-full flex-col",children:i?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-panel px-4 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[14px]",children:o(i)}),y.data&&a.jsx(ke,{children:y.data.lang}),v.get(i)&&v.get(i)!=="new"&&a.jsx(ke,{tone:v.get(i)==="understood"?"good":v.get(i)==="stale"?"warn":"muted",children:v.get(i)}),a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(Ar,{className:"h-3.5 w-3.5"}),title:"Make a review card about this file (click a line first to pin it)",onClick:()=>p(!0),children:"Card"}),a.jsx(Z,{size:"sm",variant:E?"primary":"secondary",icon:E?a.jsx(c2,{className:"h-3.5 w-3.5"}):a.jsx(d2,{className:"h-3.5 w-3.5"}),onClick:()=>r(i),children:E?"In context":"Add to context"})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto bg-panel",children:[y.isLoading&&a.jsx("div",{className:"p-6",children:a.jsx(kt,{})}),y.error&&a.jsx("div",{className:"p-4",children:a.jsx(Ke,{error:y.error.message})}),y.data&&a.jsx(qa,{text:y.data.text,lang:y.data.lang,focusLine:l,marks:m,onLineClick:F=>s(i,F)}),((M=y.data)==null?void 0:M.truncated)&&a.jsx("div",{className:"p-3 text-xs text-warn",children:"File cut at 400 KB."})]})]}):a.jsx(Ft,{icon:a.jsx(Da,{className:"h-6 w-6"}),title:"Pick a file to read",children:"Open a file on the left, or tick several to give the model more context. Then choose a lens, a quiz or a practice on the right."})});return a.jsxs(a.Fragment,{children:[a.jsx(Qn,{id:"explore-tree",collapsible:!0,className:"h-full",initial:290,left:k,right:a.jsx(Qn,{id:"explore-panel",collapsible:!0,side:"right",initial:360,min:300,max:560,left:S,right:a.jsx(p0,{files:j,practiceFile:i,onSetFiles:n})})}),h&&i&&a.jsx(Ua,{initial:{kind:"own",file:i,line:l??void 0},onClose:()=>p(!1)}),c&&a.jsx(lp,{title:"Add a context folder",cta:"Add as context",start:e.root.split("/").slice(0,-1).join("/"),onClose:()=>d(!1),onPick:F=>{d(!1),x.mutate([...e.contexts,F])}})]})}function Hc({value:e,options:t,onChange:n,placeholder:r="Pick one",className:i}){const[s,l]=b.useState(!1),[o,u]=b.useState(""),[c,d]=b.useState(0),h=b.useRef(null),p=b.useRef(null),f=t.find(w=>w.value===e),m=b.useMemo(()=>{const w=o.toLowerCase().split(/\s+/).filter(Boolean);return w.length?t.filter(y=>{const x=`${y.label} ${y.hint??""} ${y.group??""}`.toLowerCase();return w.every(v=>x.includes(v))}):t},[t,o]);b.useEffect(()=>{if(!s)return;const w=y=>{var x;return!((x=h.current)!=null&&x.contains(y.target))&&l(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[s]),b.useEffect(()=>d(0),[o,s]),b.useEffect(()=>{var w,y;(y=(w=p.current)==null?void 0:w.querySelector(`[data-i="${c}"]`))==null||y.scrollIntoView({block:"nearest"})},[c]);const g=w=>{n(w),l(!1),u("")};return a.jsxs("div",{ref:h,className:le("relative",i),children:[a.jsxs("button",{type:"button",onClick:()=>l(w=>!w),className:le("input flex h-8 items-center gap-2 py-0 text-left text-xs",s&&"border-accent ring-2 ring-accent/20"),title:f?`${f.label}${f.hint?` · ${f.hint}`:""}`:void 0,children:[a.jsx("span",{className:"min-w-0 flex-1 truncate",children:f?f.label:a.jsx("span",{className:"text-muted",children:r})}),(f==null?void 0:f.hint)&&a.jsx("span",{className:"max-w-[40%] shrink-0 truncate text-[12px] text-muted",children:f.hint}),a.jsx(qj,{className:"h-3.5 w-3.5 shrink-0 text-muted"})]}),s&&a.jsxs("div",{className:"absolute left-0 right-0 top-full z-40 mt-1 overflow-hidden rounded-lg border border-line bg-panel shadow-xl",children:[a.jsxs("div",{className:"relative border-b border-line",children:[a.jsx(gl,{className:"pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted"}),a.jsx("input",{autoFocus:!0,value:o,onChange:w=>u(w.target.value),placeholder:"Type to filter",className:"w-full bg-transparent py-2 pl-8 pr-3 text-xs text-ink outline-none placeholder:text-muted/70",onKeyDown:w=>{w.key==="ArrowDown"?(w.preventDefault(),d(y=>Math.min(m.length-1,y+1))):w.key==="ArrowUp"?(w.preventDefault(),d(y=>Math.max(0,y-1))):w.key==="Enter"&&m[c]?(w.preventDefault(),g(m[c].value)):w.key==="Escape"&&l(!1)}})]}),a.jsxs("div",{ref:p,className:"max-h-72 overflow-auto py-1",children:[m.map((w,y)=>{var x;return a.jsxs("div",{children:[w.group&&w.group!==((x=m[y-1])==null?void 0:x.group)&&a.jsx("div",{className:"px-3 pb-1 pt-2 text-[11.5px] font-medium uppercase tracking-wide text-muted",children:w.group}),a.jsxs("button",{type:"button","data-i":y,onMouseEnter:()=>d(y),onClick:()=>g(w.value),className:le("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",y===c?"bg-accent/10 text-ink":"text-ink/90"),children:[a.jsx(Qf,{className:le("h-3.5 w-3.5 shrink-0 text-accent",w.value!==e&&"invisible")}),a.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.label}),w.hint&&a.jsx("span",{className:"max-w-[45%] shrink-0 truncate text-[12px] text-muted",children:w.hint})]})]},w.value)}),!m.length&&a.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted",children:"No match"})]})]})]})}let PS=null;const TS=()=>PS??(PS=dl(()=>import("./index-DM-V8yrZ.js"),[])),LS=4e3;function MS(e){const t=[];let n=0,r=0,i=!1;for(const s of e.split(`
467
- `)){const l=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@(.*)$/.exec(s);if(l){n=Number(l[1]),r=Number(l[2]),i=!0,t.push({kind:"hunk",text:s});continue}if(i)if(s.startsWith("+"))t.push({kind:"add",right:r++,text:s.slice(1)});else if(s.startsWith("-"))t.push({kind:"del",left:n++,text:s.slice(1)});else{if(s.startsWith("\\"))continue;(s.startsWith(" ")||s==="")&&t.push({kind:"ctx",left:n++,right:r++,text:s.slice(1)})}}return t.length&&t[t.length-1].kind==="ctx"&&t[t.length-1].text===""&&t.pop(),t}function RS(e){const t=[];for(let n=0;n<e.length;){const r=e[n];if(r.kind==="hunk")t.push({hunk:r.text}),n++;else if(r.kind==="ctx")t.push({left:r,right:r}),n++;else{const i=[],s=[];for(;n<e.length&&e[n].kind==="del";)i.push(e[n++]);for(;n<e.length&&e[n].kind==="add";)s.push(e[n++]);for(let l=0;l<Math.max(i.length,s.length);l++)t.push({left:i[l],right:s[l]})}}return t}const Ch="w-12 shrink-0 select-none pr-3 text-right text-muted/60",m0="min-w-0 flex-1 whitespace-pre-wrap break-all pr-4";function zS(e,t){const[n,r]=b.useState(new Map);return b.useEffect(()=>{const i=e.filter(l=>l.kind!=="hunk");if(!i.length||t==="text"||i.length>LS){r(new Map);return}let s=!0;return TS().then(async l=>{if(!(t in l.bundledLanguages))return;const o=await l.codeToHtml(i.map(d=>d.text).join(`
468
- `),{lang:t,themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1}),u=new DOMParser().parseFromString(o,"text/html").querySelectorAll(".line"),c=new Map;i.forEach((d,h)=>u[h]&&c.set(d,u[h].innerHTML)),s&&r(c)}).catch(()=>{}),()=>{s=!1}},[e,t]),n}function AS({patch:e,mode:t,lang:n="text"}){const r=b.useMemo(()=>MS(e),[e]),i=zS(r,n),s=o=>i.has(o)?a.jsx("span",{className:"shiki",dangerouslySetInnerHTML:{__html:i.get(o)}}):o.text,l=!r.some(o=>o.kind==="ctx")&&(!r.some(o=>o.kind==="add")||!r.some(o=>o.kind==="del"));return r.length?t==="unified"||l?a.jsx("div",{className:"min-h-full py-1 font-mono text-[13.5px] leading-6",children:r.map((o,u)=>o.kind==="hunk"?a.jsx("div",{className:"diff-hunk px-4",children:o.text},u):a.jsxs("div",{className:le("flex",o.kind==="add"&&"diff-add",o.kind==="del"&&"diff-del"),children:[a.jsx("span",{className:Ch,children:o.left??""}),a.jsx("span",{className:Ch,children:o.right??""}),a.jsx("span",{className:"w-4 shrink-0 select-none text-muted",children:o.kind==="add"?"+":o.kind==="del"?"-":""}),a.jsx("span",{className:m0,children:s(o)})]},u))}):a.jsx(IS,{rows:RS(r),hl:i}):a.jsx("div",{className:"p-6 text-sm text-muted",children:"No text changes (binary file or mode change)."})}function IS({rows:e,hl:t}){const n=b.useRef(null),[r,i]=b.useState(()=>{try{return Number(localStorage.getItem("cognitune.diff.split"))||50}catch{return 50}});b.useEffect(()=>{try{localStorage.setItem("cognitune.diff.split",String(r))}catch{}},[r]);const s=o=>{var h;const u=(h=n.current)==null?void 0:h.getBoundingClientRect();if(!u)return;o.preventDefault();const c=p=>i(Math.min(85,Math.max(15,(p.clientX-u.left)/u.width*100))),d=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",c),window.addEventListener("pointerup",d)},l=(o,u,c)=>a.jsxs("div",{className:le("flex min-w-0",(o==null?void 0:o.kind)==="del"&&"diff-del",(o==null?void 0:o.kind)==="add"&&"diff-add",!o&&"bg-raised/60"),children:[a.jsx("span",{className:Ch,children:o?u===0?o.left:o.right:""}),a.jsx("span",{className:m0,children:o?t.has(o)?a.jsx("span",{className:"shiki",dangerouslySetInnerHTML:{__html:t.get(o)}}):o.text:""})]},c);return a.jsxs("div",{ref:n,className:"relative min-h-full font-mono text-[13.5px] leading-6",children:[a.jsx("div",{className:"grid py-1",style:{gridTemplateColumns:`${r}% ${100-r}%`},children:e.map((o,u)=>o.hunk?a.jsx("div",{className:"diff-hunk col-span-2 whitespace-pre-wrap break-all px-4",children:o.hunk},u):[l(o.left,0,`${u}l`),l(o.right,1,`${u}r`)])}),a.jsx("div",{className:"group absolute inset-y-0 z-10 w-px cursor-col-resize bg-line",style:{left:`${r}%`},onPointerDown:s,onDoubleClick:()=>i(50),title:"Drag to move, double-click to centre",children:a.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5 transition group-hover:bg-accent/30"})})]})}function FS(e,t){const n={name:"",path:e,kind:"dir",children:[]};for(const i of t){if(!i.startsWith(e+"/"))continue;const s=i.slice(e.length+1).split("/");let l=n;s.forEach((o,u)=>{const c=u===s.length-1;l.children??(l.children=[]);let d=l.children.find(h=>h.name===o&&h.kind===(c?"file":"dir"));d||(d={name:o,path:`${l.path}/${o}`,kind:c?"file":"dir",...c?{}:{children:[]}},l.children.push(d)),l=d})}const r=i=>{var o;if(i.kind==="file")return i;let s=i;for(;((o=s.children)==null?void 0:o.length)===1&&s.children[0].kind==="dir";){const u=s.children[0];s={...u,name:`${s.name}/${u.name}`}}const l=(s.children??[]).map(r);return l.sort((u,c)=>u.kind===c.kind?u.name.localeCompare(c.name):u.kind==="dir"?-1:1),{...s,children:l}};return(r(n).children??[]).map(i=>i.name.startsWith("/")?{...i,name:i.name.slice(1)}:i)}const DS={added:"text-good",deleted:"text-bad",modified:"text-warn",renamed:"text-accent"};function OS(){var I,Q,q;const{project:e,rel:t}=it(),n=xe({queryKey:["repos",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/repos`)}),r=`cognitune.repo.${e.id}`,[i,s]=b.useState(()=>{let $;try{$=sessionStorage.getItem(r)||void 0}catch{}return{repo:$,base:"HEAD",head:""}}),[l,o]=b.useState(null),[u,c]=b.useState(new Set),[d,h]=b.useState([]),[p,f]=b.useState("split"),m=n.data??[],g=m.find($=>$.path===i.repo)??m[0];b.useEffect(()=>{g&&g.path!==i.repo&&s($=>({...$,repo:g.path}))},[g,i.repo]);const w=$=>{try{sessionStorage.setItem(r,$)}catch{}s({repo:$,base:"HEAD",head:""})},y=!!g&&i.repo===g.path,x=$=>`/projects/${e.id}/${$}${$.includes("?")?"&":"?"}repo=${encodeURIComponent(i.repo??"")}`,v=xe({queryKey:["refs",e.id,i.repo],queryFn:()=>me(x("refs")),enabled:y}),j=xe({queryKey:["diff",e.id,i],queryFn:()=>me(x(`diff?base=${encodeURIComponent(i.base)}&head=${encodeURIComponent(i.head)}`)),enabled:y}),E=j.data??[];b.useEffect(()=>{c(new Set(E.map($=>$.path))),o($=>{var G;return $&&E.some(Y=>Y.path===$)?$:((G=E[0])==null?void 0:G.path)??null})},[j.data]);const k=b.useMemo(()=>E.find($=>$.path===l),[E,l]),S=b.useMemo(()=>new Map(E.map($=>[$.path,$])),[E]),M=b.useMemo(()=>i.repo?FS(i.repo,E.map($=>$.path)):[],[i.repo,E]);if(n.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!m.length)return a.jsx(Ft,{icon:a.jsx(D1,{className:"h-6 w-6"}),title:"No git repositories found",children:"Changes needs git history. No repo was found in this folder or its sub-folders (4 levels down). Explore, lenses and quizzes work without it."});const F=[{value:"HEAD",label:"HEAD",hint:(I=v.data)==null?void 0:I.current,group:"Current"},...(((Q=v.data)==null?void 0:Q.branches)??[]).map($=>({value:$,label:$,group:"Branches"})),...(((q=v.data)==null?void 0:q.commits)??[]).map($=>({value:$.sha,label:`${$.sha} ${$.subject}`,hint:$.when,group:"Recent commits"}))],C=a.jsxs("div",{className:"flex h-full flex-col bg-side",children:[a.jsxs("div",{className:"space-y-2 border-b border-line p-3",children:[m.length>1&&a.jsxs("div",{children:[a.jsxs("div",{className:"label",children:["Repository (",m.length,")"]}),a.jsx(Hc,{value:(g==null?void 0:g.path)??"",onChange:w,options:m.map($=>({value:$.path,label:$.name,hint:$.branch}))})]}),a.jsxs("div",{children:[a.jsx("div",{className:"label",children:"From"}),a.jsx(Hc,{value:i.base,onChange:$=>s({...i,base:$}),options:F})]}),a.jsxs("div",{children:[a.jsx("div",{className:"label",children:"To"}),a.jsx(Hc,{value:i.head,onChange:$=>s({...i,head:$}),options:[{value:"",label:"Working tree (uncommitted)",group:"Current"},...F]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-muted",children:[a.jsxs("span",{children:[E.length," files"]}),a.jsxs("span",{className:"text-good",children:["+",E.reduce(($,G)=>$+G.additions,0)]}),a.jsxs("span",{className:"text-bad",children:["-",E.reduce(($,G)=>$+G.deletions,0)]}),a.jsx("button",{className:"ml-auto hover:text-ink",onClick:()=>c(u.size===E.length?new Set:new Set(E.map($=>$.path))),children:u.size===E.length?"none":"all"})]}),a.jsxs("div",{className:"min-h-0 flex-1",children:[j.isLoading&&a.jsx("div",{className:"p-3",children:a.jsx(kt,{})}),j.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:j.error.message})}),E.length>0&&a.jsx(ap,{roots:M,openAll:!0,selected:[...u],onToggle:($,G)=>{const Y=new Set(u);for(const z of $)G?Y.add(z):Y.delete(z);c(Y)},openFile:l,onOpen:o,meta:$=>{const G=S.get($);return G?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"font-mono text-[11.5px] text-good",children:["+",G.additions]}),a.jsxs("span",{className:"font-mono text-[11.5px] text-bad",children:["-",G.deletions]}),a.jsx("span",{className:le("w-3 text-center font-mono text-[12px] font-bold uppercase",DS[G.status]),title:G.status,children:G.status[0]})]}):null}},`${i.repo}|${i.base}|${i.head}`),!j.isLoading&&!E.length&&a.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted",children:"No changes between these two."})]})]}),O=a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-panel px-4 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[14px]",children:k?t(k.path):""}),a.jsx(qt,{value:p,onChange:f,options:[{value:"split",label:"Split"},{value:"unified",label:"Unified"}]})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-panel",children:k?a.jsx(AS,{patch:k.patch,mode:p,lang:d0(k.path)}):a.jsx(Ft,{title:"Pick a file"})})]});return a.jsx(Qn,{id:"changes-list",collapsible:!0,initial:300,className:"h-full",left:C,right:a.jsx(Qn,{id:"changes-panel",collapsible:!0,side:"right",initial:360,min:300,max:560,left:O,right:a.jsx(p0,{files:[...u,...d],diff:i,onRemove:$=>{c(new Set([...u].filter(G=>G!==$))),h(d.filter(G=>G!==$))},onSetFiles:$=>{const G=new Set(E.map(Y=>Y.path));c(new Set($.filter(Y=>G.has(Y)))),h($.filter(Y=>!G.has(Y)))},practiceFile:(k==null?void 0:k.status)!=="deleted"?k==null?void 0:k.path:null})})})}const _S=["lenses","quizzes","practice","teachbacks","walks","hunts","threads","cards","weak","glossary","notes"],$S={quiz:"quiz miss",teachback:"teach-back",walk:"walk check",hunt:"bug hunt"};function BS(){var ue,ye,T,Te,De,ve,Ne,_t,an,Tt,Be,lt,Rn,zn,Qt,Kn,on,Gn,xr,Yn,Xn,yr,J,Kt,vr,Jn,D,U,he,fe,ht,Se,at;const{project:e,rel:t,setOpenFile:n}=it(),r=Dt(),[i,s]=sp(),l=_S.includes(i.get("tab"))?i.get("tab"):"lenses",o=R=>s({tab:R},{replace:!0}),[u,c]=b.useState(""),[d,h]=b.useState(null),p=`/projects/${e.id}`,f=`/p/${e.id}`,m=R=>xe({queryKey:[R,e.id],queryFn:()=>me(`${p}/${R}`)}),g=m("lenses"),w=m("quizzes"),y=m("practice"),x=m("teachbacks"),v=m("walks"),j=m("hunts"),E=m("threads"),k=m("cards"),S=m("notes"),M=m("misconceptions"),F=gt(),C=mn(),[O,I]=b.useState(null),Q=(R,we)=>{I(we),C.run(`${p}/quizzes`,{files:[],weak:!0,weakIds:R},Je=>F(`${f}/quiz/${Je.resultId}`))},q=async R=>{await ls(`${p}/misconceptions/${R}`),r.invalidateQueries({queryKey:["misconceptions",e.id]}),r.invalidateQueries({queryKey:["today",e.id]})},$=xe({queryKey:["glossary",e.id],queryFn:()=>me(`${p}/glossary`),enabled:l==="glossary"}),G=b.useMemo(()=>{const R=u.toLowerCase().split(/\s+/).filter(Boolean);return(...we)=>{const Je=we.join(" ").toLowerCase();return R.every(vn=>Je.includes(vn))}},[u]),Y=R=>a.jsxs("div",{className:"mt-2 truncate font-mono text-[12px] text-muted",children:[R.slice(0,3).map(we=>hr(t(we),28)).join(" · "),R.length>3&&` +${R.length-3}`]}),z="card block p-4 transition hover:-translate-y-0.5 hover:border-accent/40",H=R=>a.jsx("span",{className:"ml-auto text-[12px] text-muted",children:It(R)}),N=(R,we,Je)=>a.jsx(Ft,{icon:R,title:we,children:Je});return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsx("div",{className:"border-b border-line bg-panel px-8 pt-6",children:a.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Library"}),a.jsxs("p",{className:"text-sm text-muted",children:["Everything made in ",e.name,"."]})]}),a.jsxs("div",{className:"relative w-64",children:[a.jsx(gl,{className:"pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted"}),a.jsx("input",{className:"input h-8 pl-8 text-[14px]",placeholder:"Search this tab",value:u,onChange:R=>c(R.target.value)})]}),a.jsxs("a",{href:`/api${p}/export`,className:"inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-xs text-muted hover:bg-raised hover:text-ink",title:"Everything for this project as one JSON file",children:[a.jsx(Kf,{className:"h-3.5 w-3.5"})," Export all"]})]}),a.jsx(iS,{className:"-mx-2 mt-3 border-b-0",wrap:!0,value:l,onChange:o,tabs:[{value:"lenses",label:"Lenses",count:(ue=g.data)==null?void 0:ue.length},{value:"quizzes",label:"Quizzes",count:(ye=w.data)==null?void 0:ye.length},{value:"teachbacks",label:"Teach-backs",count:(T=x.data)==null?void 0:T.length},{value:"walks",label:"Walks",count:(Te=v.data)==null?void 0:Te.length},{value:"practice",label:"Practice",count:(De=y.data)==null?void 0:De.length},{value:"hunts",label:"Bug hunts",count:(ve=j.data)==null?void 0:ve.length},{value:"threads",label:"Tutor",count:(Ne=E.data)==null?void 0:Ne.length},{value:"cards",label:"Cards",count:(_t=k.data)==null?void 0:_t.length},{value:"weak",label:"Weak spots",count:(an=M.data)==null?void 0:an.length},{value:"glossary",label:"Glossary"},{value:"notes",label:"Notes",count:(Tt=S.data)==null?void 0:Tt.length}]})]})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-8",children:a.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[l==="weak"&&!!((Be=M.data)!=null&&Be.length)&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("p",{className:"flex-1 text-[14px] text-muted",children:"Wrong beliefs picked up from your answers. Answer a question on one correctly and it goes away; dismiss one the grader got wrong."}),a.jsxs(Z,{size:"sm",variant:"primary",icon:a.jsx(Gi,{className:"h-3.5 w-3.5"}),disabled:C.busy,onClick:()=>Q(M.data.slice(0,6).map(R=>R.id),"all"),children:["Quiz me on ",M.data.length>6?"the top 6":"all of them"]})]}),C.busy&&C.job&&O==="all"&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:C.elapsed})}),C.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:C.error,onClose:C.clearError})})]}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[l==="lenses"&&((lt=g.data)==null?void 0:lt.filter(R=>G(R.title,R.summary,R.kind,...R.files)).map(R=>a.jsxs(ft,{to:`${f}/lens/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ke,{tone:"accent",children:R.kind}),R.diff&&a.jsx(ke,{tone:"warn",children:"change"}),R.sketch&&a.jsx(ke,{children:"your take first"}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 font-medium leading-snug",children:R.title}),a.jsx("p",{className:"mt-1 line-clamp-2 text-[14px] text-muted",children:R.summary}),Y(R.files)]},R.id))),l==="quizzes"&&((Rn=w.data)==null?void 0:Rn.filter(R=>G(R.title,...R.files)).map(R=>{const we=R.attempts.length?Math.max(...R.attempts.map(Je=>Je.score)):null;return a.jsxs(ft,{to:`${f}/quiz/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ke,{children:[R.questions.length," questions"]}),we===null?a.jsx(ke,{tone:"warn",children:"not taken"}):a.jsxs("span",{className:"text-xs text-muted",children:["best ",a.jsx(Na,{score:we,size:"sm"})," · ",R.attempts.length," tries"]}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 font-medium leading-snug",children:R.title}),Y(R.files)]},R.id)})),l==="teachbacks"&&((zn=x.data)==null?void 0:zn.filter(R=>G(R.text,...R.files)).map(R=>a.jsxs(ft,{to:`${f}/teach/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[R.grade&&a.jsxs(ke,{tone:R.grade.score>=4?"good":R.grade.score>=3?"warn":"bad",children:[R.grade.score,"/5"]}),H(R.createdAt)]}),a.jsx("p",{className:"mt-2 line-clamp-3 text-[14px]",children:R.text}),Y(R.files)]},R.id))),l==="walks"&&((Qt=v.data)==null?void 0:Qt.filter(R=>G(R.file,...R.blocks.map(we=>we.title))).map(R=>{const we=R.blocks.filter(Je=>Je.verdict).length;return a.jsxs(ft,{to:`${f}/walk/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ke,{tone:we===R.blocks.length?"good":"warn",children:[we,"/",R.blocks.length," checked"]}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id)})),l==="practice"&&((Kn=y.data)==null?void 0:Kn.filter(R=>G(R.file)).map(R=>{var Je;const we=(Je=R.review)==null?void 0:Je.holes.filter(vn=>vn.verdict==="right").length;return a.jsxs(ft,{to:`${f}/practice/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ke,{tone:"accent",children:["level ",R.level]}),a.jsxs(ke,{children:[R.holes.length," holes"]}),R.review?a.jsxs(ke,{tone:we===R.holes.length?"good":"warn",children:[we,"/",R.holes.length," right"]}):a.jsx(ke,{tone:"warn",children:"open"}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id)})),l==="hunts"&&((on=j.data)==null?void 0:on.filter(R=>G(R.file)).map(R=>a.jsxs(ft,{to:`${f}/hunt/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ke,{tone:"bad",children:["","easy","medium","hard"][R.level]}),R.grade?a.jsx("span",{className:"text-xs text-muted",children:a.jsx(Na,{score:R.grade.score,size:"sm"})}):a.jsx(ke,{tone:"warn",children:"open"}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id))),l==="threads"&&((Gn=E.data)==null?void 0:Gn.filter(R=>G(R.title,...R.messages.map(we=>we.text))).map(R=>a.jsxs(ft,{to:`${f}/tutor/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ke,{children:[R.messages.length," messages"]}),H(R.createdAt)]}),a.jsx("div",{className:"mt-2 line-clamp-2 font-medium leading-snug",children:R.title}),Y(R.files)]},R.id))),l==="cards"&&((xr=k.data)==null?void 0:xr.filter(R=>G(R.front,R.back,R.file)).map(R=>a.jsxs("div",{className:"card group p-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ke,{tone:R.kind==="miss"?"bad":R.kind==="concept"?"accent":"muted",children:R.kind}),R.suspended?a.jsx(ke,{children:"paused"}):a.jsxs("span",{className:"text-[12px] text-muted",children:["due in ",Sh(R.fsrs.due)]}),a.jsxs("span",{className:"ml-auto flex gap-1 opacity-0 transition group-hover:opacity-100",children:[a.jsx("button",{className:"text-muted hover:text-ink",title:R.suspended?"Resume":"Pause",onClick:async()=>{await Ba(`${p}/cards/${R.id}`,{suspended:!R.suspended}),r.invalidateQueries({queryKey:["cards",e.id]})},children:R.suspended?a.jsx(Hj,{className:"h-3.5 w-3.5"}):a.jsx(L1,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"text-muted hover:text-bad",title:"Archive",onClick:async()=>{await ls(`${p}/cards/${R.id}`),r.invalidateQueries({queryKey:["cards",e.id]})},children:a.jsx(fr,{className:"h-3.5 w-3.5"})})]})]}),a.jsx("div",{className:"mt-2 text-[14.5px] font-medium leading-snug",children:R.front}),a.jsx("p",{className:"mt-1 line-clamp-2 text-[14px] text-muted",children:R.back}),R.file&&a.jsxs("div",{className:"mt-2 truncate font-mono text-[12px] text-muted",children:[t(R.file),R.line?`:${R.line}`:""]})]},R.id))),l==="weak"&&((Yn=M.data)==null?void 0:Yn.filter(R=>G(R.text,R.file)).map(R=>a.jsxs("div",{className:"card flex flex-col p-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ke,{tone:"bad",children:$S[R.from]??R.from}),R.seen>1&&a.jsxs(ke,{tone:"warn",children:["seen ",R.seen,"×"]}),H(R.createdAt)]}),a.jsx("p",{className:"mt-2 text-[14.5px] leading-snug",children:R.text}),R.file&&a.jsxs(ft,{to:`${f}/explore`,onClick:()=>n(R.file,R.line),className:"mt-2 truncate font-mono text-[12px] text-muted hover:text-accent",children:[t(R.file),R.line?`:${R.line}`:""]}),a.jsxs("div",{className:"mt-3 flex items-center gap-2 pt-1",children:[a.jsx(Z,{size:"sm",icon:a.jsx(Gi,{className:"h-3.5 w-3.5"}),disabled:C.busy,onClick:()=>Q([R.id],R.id),children:"Quiz me on this"}),a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:()=>q(R.id),title:"The grader got this wrong, or it no longer applies",children:"Dismiss"})]}),C.busy&&C.job&&O===R.id&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:C.elapsed})})]},R.id))),l==="notes"&&((Xn=S.data)==null?void 0:Xn.filter(R=>G(R.text,R.file)).map(R=>a.jsxs(ft,{to:`${f}/explore`,onClick:()=>R.file&&n(R.file,R.line),className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[R.file&&a.jsxs("span",{className:"truncate font-mono text-[12px] text-accent",children:[t(R.file),R.line?`:${R.line}`:""]}),H(R.createdAt)]}),a.jsx("p",{className:"mt-2 whitespace-pre-wrap text-[14.5px]",children:R.text})]},R.id)))]}),l==="glossary"&&a.jsxs("div",{className:"divide-y divide-line",children:[(yr=$.data)==null?void 0:yr.filter(R=>G(R.term,...R.explains.map(we=>we.text))).map(R=>a.jsxs("div",{className:"group py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-[16px] font-semibold",children:R.term}),a.jsx("span",{className:"text-[12px] text-muted",children:R.files.slice(0,3).map(we=>hr(t(we),24)).join(" · ")}),a.jsx("button",{className:"ml-auto text-muted opacity-0 transition hover:text-accent group-hover:opacity-100",title:"Make a review card",onClick:()=>{var we;return h({kind:"concept",front:`What is "${R.term}" here, and why does it matter?`,back:((we=R.explains[0])==null?void 0:we.text)??"",file:R.files[0]})},children:a.jsx(Ar,{className:"h-3.5 w-3.5"})})]}),R.explains.map((we,Je)=>a.jsxs("p",{className:"mt-1 text-[14.5px] text-ink/85",children:[we.text," ",a.jsxs(ft,{to:`${f}/lens/${we.lensId}`,className:"text-[12px] text-muted hover:text-accent",children:["(",we.lensTitle,")"]})]},Je))]},R.term)),((J=$.data)==null?void 0:J.length)===0&&N(a.jsx(Uj,{className:"h-6 w-6"}),"No terms yet","Every lens adds the concepts it explains here.")]}),l==="lenses"&&((Kt=g.data)==null?void 0:Kt.length)===0&&N(a.jsx(Da,{className:"h-6 w-6"}),"No lenses yet","Open Explore, pick files, choose a lens."),l==="quizzes"&&((vr=w.data)==null?void 0:vr.length)===0&&N(a.jsx(Oa,{className:"h-6 w-6"}),"No quizzes yet","Quiz yourself from Explore, Changes, or the end of a lens."),l==="teachbacks"&&((Jn=x.data)==null?void 0:Jn.length)===0&&N(a.jsx(Hu,{className:"h-6 w-6"}),"No teach-backs yet","In Explore, pick Teach and explain the code in your own words."),l==="walks"&&((D=v.data)==null?void 0:D.length)===0&&N(a.jsx(qu,{className:"h-6 w-6"}),"No walkthroughs yet","Open a file in Explore and pick Walk."),l==="practice"&&((U=y.data)==null?void 0:U.length)===0&&N(a.jsx(Vu,{className:"h-6 w-6"}),"No practice yet","Open a file in Explore and pick Practice."),l==="hunts"&&((he=j.data)==null?void 0:he.length)===0&&N(a.jsx(Uu,{className:"h-6 w-6"}),"No bug hunts yet","Open a file in Explore and pick Bug hunt."),l==="threads"&&((fe=E.data)==null?void 0:fe.length)===0&&N(a.jsx(Wu,{className:"h-6 w-6"}),"No tutor chats yet","Ask the tutor from Explore or from a missed quiz question."),l==="cards"&&((ht=k.data)==null?void 0:ht.length)===0&&N(a.jsx(Ar,{className:"h-6 w-6"}),"No cards yet","Quiz misses become cards on their own. You can also make one from a lens concept or a code line."),l==="weak"&&((Se=M.data)==null?void 0:Se.length)===0&&N(a.jsx(Gi,{className:"h-6 w-6"}),"No weak spots","Wrong answers in quizzes, teach-backs and walks show up here as the belief behind them."),l==="notes"&&((at=S.data)==null?void 0:at.length)===0&&N(a.jsx(q1,{className:"h-6 w-6"}),"No notes yet","In Explore, click a line and add a note from the Notes tab.")]})}),d&&a.jsx(Ua,{initial:d,onClose:()=>h(null)})]})}function yl({file:e,text:t,lang:n,line:r,marks:i,onLineClick:s,title:l,empty:o="Code shows here",onClose:u}){var f,m;const{project:c,rel:d}=it(),h=xe({queryKey:["file",c.id,e],queryFn:()=>me(`/projects/${c.id}/file?path=${encodeURIComponent(e)}`),enabled:!!e&&t===void 0}),p=t??((f=h.data)==null?void 0:f.text);return a.jsx("div",{className:"flex h-full flex-col bg-panel",children:e?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 font-mono text-[13px] text-muted",children:[a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l??d(e),r?`:${r}`:""]}),u&&a.jsx("button",{className:"text-xs hover:text-ink",onClick:u,children:"close"})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[h.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),h.error&&a.jsx("div",{className:"p-3",children:a.jsx(Ke,{error:h.error.message})}),p!==void 0&&a.jsx(qa,{text:p,lang:n??((m=h.data)==null?void 0:m.lang)??d0(e),focusLine:r,marks:i,onLineClick:s})]})]}):a.jsx(Ft,{title:o})})}function US(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VS={};function Lg(e,t){return(VS.jsx?HS:qS).test(e)}const WS=/[ \t\n\f\r]/g;function QS(e){return typeof e=="object"?e.type==="text"?Mg(e.value):!1:Mg(e)}function Mg(e){return e.replace(WS,"")===""}class Ha{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ha.prototype.normal={};Ha.prototype.property={};Ha.prototype.space=void 0;function g0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ha(n,r,t)}function Eh(e){return e.toLowerCase()}class ln{constructor(t,n){this.attribute=n,this.property=t}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let KS=0;const pe=ds(),ut=ds(),Ph=ds(),W=ds(),_e=ds(),Yi=ds(),un=ds();function ds(){return 2**++KS}const Th=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:ut,commaOrSpaceSeparated:un,commaSeparated:Yi,number:W,overloadedBoolean:Ph,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Vc=Object.keys(Th);class op extends ln{constructor(t,n,r,i){let s=-1;if(super(t,n),Rg(this,"space",i),typeof r=="number")for(;++s<Vc.length;){const l=Vc[s];Rg(this,Vc[s],(r&Th[l])===Th[l])}}}op.prototype.defined=!0;function Rg(e,t,n){n&&(e[t]=n)}function vl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new op(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Eh(r)]=r,n[Eh(s.attribute)]=r}return new Ha(t,n,e.space)}const x0=vl({properties:{ariaActiveDescendant:null,ariaAtomic:ut,ariaAutoComplete:null,ariaBusy:ut,ariaChecked:ut,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:ut,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:ut,ariaFlowTo:_e,ariaGrabbed:ut,ariaHasPopup:null,ariaHidden:ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:W,ariaLive:null,ariaModal:ut,ariaMultiLine:ut,ariaMultiSelectable:ut,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:ut,ariaReadOnly:ut,ariaRelevant:null,ariaRequired:ut,ariaRoleDescription:_e,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:ut,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function y0(e,t){return t in e?e[t]:t}function v0(e,t){return y0(e,t.toLowerCase())}const GS=vl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yi,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:pe,allowPaymentRequest:pe,allowUserMedia:pe,alpha:pe,alt:null,as:null,async:pe,autoCapitalize:null,autoComplete:_e,autoFocus:pe,autoPlay:pe,blocking:_e,capture:null,charSet:null,checked:pe,cite:null,className:_e,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:ut,controls:pe,controlsList:_e,coords:W|Yi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pe,defer:pe,dir:null,dirName:null,disabled:pe,download:Ph,draggable:ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pe,formTarget:null,headers:_e,height:W,hidden:Ph,high:W,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:pe,inputMode:null,integrity:null,is:null,isMap:pe,itemId:null,itemProp:_e,itemRef:_e,itemScope:pe,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pe,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:pe,muted:pe,name:null,nonce:null,noModule:pe,noValidate:pe,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:pe,optimum:W,pattern:null,ping:_e,placeholder:null,playsInline:pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pe,referrerPolicy:null,rel:_e,required:pe,reversed:pe,rows:W,rowSpan:W,sandbox:_e,scope:null,scoped:pe,seamless:pe,selected:pe,shadowRootClonable:pe,shadowRootCustomElementRegistry:pe,shadowRootDelegatesFocus:pe,shadowRootMode:null,shadowRootSerializable:pe,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:pe,useMap:null,value:ut,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pe,declare:pe,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:pe,noHref:pe,noShade:pe,noWrap:pe,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:ut,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pe,disablePictureInPicture:pe,disableRemotePlayback:pe,exportParts:Yi,part:_e,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:v0}),YS=vl({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:un,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:_e,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:Yi,g2:Yi,glyphName:Yi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,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:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:un,rev:un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:un,requiredFeatures:un,requiredFonts:un,requiredFormats:un,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:un,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:y0}),w0=vl({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()}}),k0=vl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:v0}),b0=vl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),XS={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"},JS=/[A-Z]/g,zg=/-[a-z]/g,ZS=/^data[-\w.:]+$/i;function eC(e,t){const n=Eh(t);let r=t,i=ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZS.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(zg,nC);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!zg.test(s)){let l=s.replace(JS,tC);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=op}return new i(r,t)}function tC(e){return"-"+e.toLowerCase()}function nC(e){return e.charAt(1).toUpperCase()}const rC=g0([x0,GS,w0,k0,b0],"html"),up=g0([x0,YS,w0,k0,b0],"svg");function iC(e){return e.join(" ").trim()}var Ag=/\/\*(?:[^*]|\*(?!\/))*\*\//g,sC=/\n/g,lC=/^\s*/,aC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oC=/^:\s*/,uC=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,cC=/^[;\s]*/,dC=`
469
- `,Ig="/",Fg="*",Il="",hC="comment",fC="declaration";function pC(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match(sC);g&&(n+=g.length);var w=m.lastIndexOf(dC);r=~w?m.length-w:r+m.length}function s(){var m={line:n,column:r};return function(g){return g.position=new l(m),c(),g}}function l(m){this.start=m,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function o(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(m){var g=m.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(lC)}function d(m){for(var g;g=h();)m.push(g);return m}function h(){var m=s();if(!(Ig!=e.charAt(0)||Fg!=e.charAt(1))){for(var g=2;Il!=e.charAt(g)&&(Fg!=e.charAt(g)||Ig!=e.charAt(g+1));)++g;if(g+=2,Il===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,m({type:hC,comment:w})}}function p(){var m=s(),g=u(aC);if(g){if(h(),!u(oC))return o("property missing ':'");var w=u(uC),y=m({type:fC,property:g[0].replace(Ag,Il).trim(),value:w?w[0].replace(Ag,Il).trim():Il});return u(cC),y}}function f(){var m=[];d(m);for(var g;g=p();)m.push(g),d(m);return m}return c(),f()}function mC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=pC(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:l,value:o}=s;i?t(l,o,s):o&&(n=n??{},n[l]=o)}),n}const j0=N0("end"),cp=N0("start");function N0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gC(e){const t=cp(e),n=j0(e);if(t&&n)return{start:t,end:n}}function Zl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dg(e.position):"start"in e||"end"in e?Dg(e):"line"in e||"column"in e?Lh(e):""}function Lh(e){return Og(e&&e.line)+":"+Og(e&&e.column)}function Dg(e){return Lh(e&&e.start)+"-"+Lh(e&&e.end)}function Og(e){return e&&typeof e=="number"?e:1}class Ot extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",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"?i=t:!s.cause&&t&&(l=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Zl(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}}Ot.prototype.file="";Ot.prototype.name="";Ot.prototype.reason="";Ot.prototype.message="";Ot.prototype.stack="";Ot.prototype.column=void 0;Ot.prototype.line=void 0;Ot.prototype.ancestors=void 0;Ot.prototype.cause=void 0;Ot.prototype.fatal=void 0;Ot.prototype.place=void 0;Ot.prototype.ruleId=void 0;Ot.prototype.source=void 0;const dp={}.hasOwnProperty,xC=new Map,yC=/[A-Z]/g,vC=/-([a-z])/g,wC=new Set(["table","tbody","thead","tfoot","tr"]),kC=new Set(["td","th"]),S0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=LC(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");r=TC(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?up:rC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=C0(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function C0(e,t,n){if(t.type==="element")return jC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return NC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CC(e,t,n);if(t.type==="mdxjsEsm")return SC(e,t);if(t.type==="root")return EC(e,t,n);if(t.type==="text")return PC(e,t)}function jC(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=up,e.schema=i),e.ancestors.push(t);const s=P0(e,t.tagName,!1),l=MC(e,t);let o=fp(e,t);return wC.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!QS(u):!0})),E0(e,l,s,t),hp(l,o),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function NC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Sa(e,t.position)}function SC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Sa(e,t.position)}function CC(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=up,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:P0(e,t.name,!0),l=RC(e,t),o=fp(e,t);return E0(e,l,s,t),hp(l,o),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function EC(e,t,n){const r={};return hp(r,fp(e,t)),e.create(t,e.Fragment,r,n)}function PC(e,t){return t.value}function E0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function hp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function TC(e,t,n){return r;function r(i,s,l,o){const c=Array.isArray(l.children)?n:t;return o?c(s,l,o):c(s,l)}}function LC(e,t){return n;function n(r,i,s,l){const o=Array.isArray(s.children),u=cp(r);return t(i,s,l,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function MC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&dp.call(t.properties,i)){const s=zC(e,i,t.properties[i]);if(s){const[l,o]=s;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&kC.has(t.tagName)?r=o:n[l]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function RC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Sa(e,t.position);else{const{name:i}=r;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Sa(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function fp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:xC;for(;++r<t.children.length;){const s=t.children[r];let l;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const c=i.get(u)||0;l=u+"-"+c,i.set(u,c+1)}}const o=C0(e,s,l);o!==void 0&&n.push(o)}return n}function zC(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=eC(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?US(n):iC(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:IC(n):AC(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?XS[r.property]||r.property:r.attribute,n]}function AC(e,t){const n={};try{mC(t,function(r,i){if(r&&i){let s=r;s.slice(0,2)!=="--"&&(s=s.toLowerCase(),e.stylePropertyNameCase==="dom"&&(s.slice(0,4)==="-ms-"&&(s=s.slice(1)),s=s.replace(vC,OC))),n[s]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,s=new Ot("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=S0+"#cannot-parse-style-attribute",s}return n}function P0(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,l;for(;++s<i.length;){const o=Lg(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=l}else r=Lg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return dp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Sa(e)}function Sa(e,t){const n=new Ot("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=S0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function IC(e){const t={};let n;for(n in e)dp.call(e,n)&&(t[FC(n)]=e[n]);return t}function FC(e){if(e.slice(0,2)==="--")return e;let t=e.replace(yC,DC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function DC(e){return"-"+e.toLowerCase()}function OC(e,t){return t.toUpperCase()}const Wc={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"]},_C={};function Zu(e,t){const n=_C,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return T0(e,r,i)}function T0(e,t,n){if($C(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 _g(e.children,t,n)}return Array.isArray(e)?_g(e,t,n):""}function _g(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=T0(e[i],t,n);return r.join("")}function $C(e){return!!(e&&typeof e=="object")}const $g=document.createElement("i");function pp(e){const t="&"+e+";";$g.innerHTML=t;const n=$g.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hn(e,t,n,r){const i=e.length;let s=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<r.length;)l=r.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function En(e,t){return e.length>0?(Hn(e,e.length,0,t),e):t}const Bg={}.hasOwnProperty;function L0(e){const t={};let n=-1;for(;++n<e.length;)BC(t,e[n]);return t}function BC(e,t){let n;for(n in t){const i=(Bg.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){Bg.call(i,l)||(i[l]=[]);const o=s[l];UC(i[l],Array.isArray(o)?o:o?[o]:[])}}}function UC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Hn(e,0,0,r)}function M0(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 Vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const St=Si(/[A-Za-z]/),Ct=Si(/[\dA-Za-z]/),qC=Si(/[#-'*+\--9=?A-Z^-~]/);function wu(e){return e!==null&&(e<32||e===127)}const Mh=Si(/\d/),HC=Si(/[\dA-Fa-f]/),R0=Si(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<-2}function $e(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const ec=Si(new RegExp("\\p{P}|\\p{S}","u")),as=Si(/\s/);function Si(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&Ct(e.charCodeAt(n+1))&&Ct(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(l=String.fromCharCode(s,o),i=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ze(e,t,n,r){const i=r?r-1:1/0;let s=0;return l;function l(u){return je(u)?(e.enter(n),o(u)):t(u)}function o(u){return je(u)&&s++<i?(e.consume(u),o):(e.exit(n),t(u))}}function z0(e,t,n,r,i,s){let l=0;return o;function o(d){return je(d)?(e.enter(r),u(d)):c(d)}function u(d){return je(d)&&l<s?(e.consume(d),l++,u):(e.exit(r),c(d))}function c(d){return l>=i?t(d):n(d)}}const VC={tokenize:WC};function WC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ze(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return de(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),l)}}let ku=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Ug(this,t,n,r,!1)}addBefore(t,n,r){Ug(this,t,n,r,!0)}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 r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}};function Ug(e,t,n,r,i){if(n===0&&r.length===0)return;const s=e.index.get(t);if(s){s[1]+=n,i?(r.push(...s[2]),s[2]=r):s[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}const QC={tokenize:KC},qg={tokenize:GC};function KC(e){const t=this,n=[];let r=0,i,s,l;return o;function o(v){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const j=t.events.length;let E=j,k;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){k=t.events[E][1].end;break}y(r);let S=j;for(;S<t.events.length;)t.events[S][1].end={...k},S++;const M=new ku;return M.add(E+1,0,t.events.slice(j)),M.add(j,S-j,[]),M.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return m(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qg,d,h)(v)}function d(v){return i&&x(),y(r),p(v)}function h(v){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,m(v)}function p(v){return t.containerState={},e.attempt(qg,f,m)(v)}function f(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function m(v){if(v===null){i&&x(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return de(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,j){const E=t.sliceStream(v);if(j&&E.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<l&&(!i.events[k][1].end||i.events[k][1].end.offset>l))return;const S=t.events.length;let M=S,F,C;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(F){C=t.events[M][1].end;break}F=!0}for(y(r),k=S;k<t.events.length;)t.events[k][1].end={...C},k++;const O=new ku;O.add(M+1,0,t.events.slice(S)),O.add(S,k-S,[]),O.consume(t.events)}}function y(v){let j=n.length;for(;j-- >v;){const E=n[j];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function GC(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yi(e){if(e===null||$e(e)||as(e))return 1;if(ec(e))return 2}function tc(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Rh={name:"attention",resolveAll:YC,tokenize:XC};function YC(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;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;const s=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,l={...e[i][1].end},o={...e[n][1].start};Hg(l,-s),Hg(o,s);const u={type:s>1?"strongSequence":"emphasisSequence",start:l,end:{...e[i][1].end}},c={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},d={type:s>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},h={type:s>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=En(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=En(r,[["enter",h,t],["enter",u,t],["exit",u,t],["enter",d,t]]),r=En(r,tc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=En(r,[["exit",d,t],["enter",c,t],["exit",c,t],["exit",h,t]]);let p=0;e[n][1].end.offset-e[n][1].start.offset&&(p=2,r=En(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),Hn(e,i-1,n-i+3,r),n=i+r.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function XC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yi(r);let s;return l;function l(u){return s=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===s)return e.consume(u),o;const c=e.exit("attentionSequence"),d=yi(u),h=!d||d===2&&i||n.includes(u)&&u!==42&&u!==95,p=!i||i===2&&d||n.includes(r)&&r!==42&&r!==95;return c._open=!!(s===42?h:h&&(i||!p)),c._close=!!(s===42?p:p&&(d||!h)),t(u)}}function Hg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const JC={name:"autolink",tokenize:ZC};function ZC(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return St(f)?(e.consume(f),l):f===64?n(f):c(f)}function l(f){return f===43||f===45||f===46||Ct(f)?(r=1,o(f)):c(f)}function o(f){return f===58?(e.consume(f),r=0,u):(f===43||f===45||f===46||Ct(f))&&r++<32?(e.consume(f),o):(r=0,c(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||wu(f)?n(f):(e.consume(f),u)}function c(f){return f===64?(e.consume(f),d):qC(f)?(e.consume(f),c):n(f)}function d(f){return Ct(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||Ct(f))&&r++<63){const m=f===45?p:h;return e.consume(f),m}return n(f)}}const Va={partial:!0,tokenize:eE};function eE(e,t,n){return r;function r(s){return je(s)?ze(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||de(s)?t(s):n(s)}}const A0={continuation:{tokenize:nE},exit:rE,name:"blockQuote",tokenize:tE};function tE(e,t,n){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return je(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function nE(e,t,n){const r=this;return i;function i(l){return je(l)?ze(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(A0,t,n)(l)}}function rE(e){e.exit("blockQuote")}const I0={name:"characterEscape",tokenize:iE};function iE(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return R0(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const F0={name:"characterReference",tokenize:sE};function sE(e,t,n){const r=this;let i=0,s,l;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,l=Ct,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=HC,d):(e.enter("characterReferenceValue"),s=7,l=Mh,d(h))}function d(h){if(h===59&&i){const p=e.exit("characterReferenceValue");return l===Ct&&!pp(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&i++<s?(e.consume(h),d):n(h)}}const zh={partial:!0,tokenize:lE};function lE(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Vg={concrete:!0,name:"codeFenced",tokenize:aE};function aE(e,t,n){const r=this,i={partial:!0,tokenize:E};let s=0,l=0,o;return u;function u(k){return c(k)}function c(k){const S=r.events[r.events.length-1];return s=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(l++,e.consume(k),d):l<3?n(k):(e.exit("codeFencedFenceSequence"),je(k)?ze(e,h,"whitespace")(k):h(k))}function h(k){return k===null||de(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(zh,g,j)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,f,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),p)}function f(k){return k===null||de(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(e.consume(k),m)}function g(k){return e.attempt(i,j,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return s>0&&je(k)?ze(e,x,"linePrefix",s+1)(k):x(k)}function x(k){return k===null||de(k)?e.check(zh,g,j)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||de(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function j(k){return e.exit("codeFenced"),t(k)}function E(k,S,M){let F=0;return C;function C($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),O}function O($){return k.enter("codeFencedFence"),je($)?ze(k,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):I($)}function I($){return $===o?(k.enter("codeFencedFenceSequence"),Q($)):M($)}function Q($){return $===o?(F++,k.consume($),Q):F>=l?(k.exit("codeFencedFenceSequence"),je($)?ze(k,q,"whitespace")($):q($)):M($)}function q($){return $===null||de($)?(k.exit("codeFencedFence"),S($)):M($)}}}const Qc={name:"codeIndented",tokenize:uE},oE={partial:!0,tokenize:cE};function uE(e,t,n){return r;function r(o){return e.enter("codeIndented"),z0(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?l(o):de(o)?e.attempt(oE,i,l)(o):(e.enter("codeFlowValue"),s(o))}function s(o){return o===null||de(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),s)}function l(o){return e.exit("codeIndented"),t(o)}}function cE(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):de(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):z0(e,t,s,"linePrefix",4,4)(l)}function s(l){return de(l)?i(l):n(l)}}const dE={name:"codeText",previous:fE,resolve:hE,tokenize:pE};function hE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pE(e,t,n){let r=0,i,s;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):de(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||de(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class mE{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 r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Fl(this.left,r),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),Fl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fl(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);Fl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fl(this.left,n.reverse())}}}function Fl(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 D0(e){const t={};let n=-1,r,i,s,l,o,u,c;const d=new mE(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,gE(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(l=d.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return Hn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function gE(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],c={};let d,h,p=-1,f=n,m=0,g=0;const w=[g];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(g=p+1,w.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):w.pop(),p=w.length;p--;){const y=o.slice(w[p],w[p+1]),x=s.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),p=-1;++p<u.length;)c[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return c}const xE={resolve:vE,tokenize:wE},yE={partial:!0,tokenize:kE};function vE(e){return D0(e),e}function wE(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):de(o)?e.check(yE,l,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kE(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ze(e,s,"linePrefix")}function s(l){if(l===null||de(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function O0(e,t,n,r,i,s,l,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),p):y===null||y===32||y===41||wu(y)?n(y):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(y))}function p(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||de(y)?n(y):(e.consume(y),y===92?m:f)}function m(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function g(y){return!d&&(y===null||y===41||$e(y))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(y)):d<c&&y===40?(e.consume(y),d++,g):y===41?(e.consume(y),d--,g):y===null||y===32||y===40||wu(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function _0(e,t,n,r,i,s){const l=this;let o=0,u;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!u||f===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):de(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||de(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!je(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function $0(e,t,n,r,i,s){let l;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(s),c(p))}function c(p){return p===l?(e.exit(s),u(l)):p===null?n(p):de(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ze(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||de(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:d)}function h(p){return p===l||p===92?(e.consume(p),d):d(p)}}function ea(e,t){let n;return r;function r(i){return de(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):je(i)?ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bE={name:"definition",tokenize:NE},jE={partial:!0,tokenize:SE};function NE(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),l(f)}function l(f){return _0.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return $e(f)?ea(e,c)(f):c(f)}function c(f){return O0(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(jE,h,h)(f)}function h(f){return je(f)?ze(e,p,"whitespace")(f):p(f)}function p(f){return f===null||de(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function SE(e,t,n){return r;function r(o){return $e(o)?ea(e,i)(o):n(o)}function i(o){return $0(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return je(o)?ze(e,l,"whitespace")(o):l(o)}function l(o){return o===null||de(o)?t(o):n(o)}}const CE={name:"hardBreakEscape",tokenize:EE};function EE(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return de(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const PE={name:"headingAtx",resolve:TE,tokenize:LE};function TE(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};Hn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])}return e}function LE(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||$e(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||de(d)?(e.exit("atxHeading"),t(d)):je(d)?ze(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||$e(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const B0=["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"],Ah=["pre","script","style","textarea"],ME={concrete:!0,name:"htmlFlow",resolveTo:zE,tokenize:AE},RE={partial:!0,tokenize:IE};function zE(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 AE(e,t,n){const r=this;let i,s,l,o,u;return c;function c(T){return d(T)}function d(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),s=!0,g):T===63?(e.consume(T),i=3,r.interrupt?t:N):St(T)?(e.consume(T),l=String.fromCharCode(T),w):n(T)}function p(T){return T===45?(e.consume(T),i=2,f):T===91?(e.consume(T),i=5,o=0,m):St(T)?(e.consume(T),i=4,r.interrupt?t:N):n(T)}function f(T){return T===45?(e.consume(T),r.interrupt?t:N):n(T)}function m(T){const Te="CDATA[";return T===Te.charCodeAt(o++)?(e.consume(T),o===Te.length?r.interrupt?t:I:m):n(T)}function g(T){return St(T)?(e.consume(T),l=String.fromCharCode(T),w):n(T)}function w(T){if(T===null||T===47||T===62||$e(T)){const Te=T===47,De=l.toLowerCase();return!Te&&!s&&Ah.includes(De)?(i=1,r.interrupt?t(T):I(T)):B0.includes(l.toLowerCase())?(i=6,Te?(e.consume(T),y):r.interrupt?t(T):I(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?x(T):v(T))}return T===45||Ct(T)?(e.consume(T),l+=String.fromCharCode(T),w):n(T)}function y(T){return T===62?(e.consume(T),r.interrupt?t:I):n(T)}function x(T){return je(T)?(e.consume(T),x):C(T)}function v(T){return T===47?(e.consume(T),C):T===58||T===95||St(T)?(e.consume(T),j):je(T)?(e.consume(T),v):C(T)}function j(T){return T===45||T===46||T===58||T===95||Ct(T)?(e.consume(T),j):E(T)}function E(T){return T===61?(e.consume(T),k):je(T)?(e.consume(T),E):v(T)}function k(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),u=T,S):je(T)?(e.consume(T),k):M(T)}function S(T){return T===u?(e.consume(T),u=null,F):T===null||de(T)?n(T):(e.consume(T),S)}function M(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||$e(T)?E(T):(e.consume(T),M)}function F(T){return T===47||T===62||je(T)?v(T):n(T)}function C(T){return T===62?(e.consume(T),O):n(T)}function O(T){return T===null||de(T)?I(T):je(T)?(e.consume(T),O):n(T)}function I(T){return T===45&&i===2?(e.consume(T),G):T===60&&i===1?(e.consume(T),Y):T===62&&i===4?(e.consume(T),ue):T===63&&i===3?(e.consume(T),N):T===93&&i===5?(e.consume(T),H):de(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(RE,ye,Q)(T)):T===null||de(T)?(e.exit("htmlFlowData"),Q(T)):(e.consume(T),I)}function Q(T){return e.check(zh,q,ye)(T)}function q(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return T===null||de(T)?Q(T):(e.enter("htmlFlowData"),I(T))}function G(T){return T===45?(e.consume(T),N):I(T)}function Y(T){return T===47?(e.consume(T),l="",z):I(T)}function z(T){if(T===62){const Te=l.toLowerCase();return Ah.includes(Te)?(e.consume(T),ue):I(T)}return St(T)&&l.length<8?(e.consume(T),l+=String.fromCharCode(T),z):I(T)}function H(T){return T===93?(e.consume(T),N):I(T)}function N(T){return T===62?(e.consume(T),ue):T===45&&i===2?(e.consume(T),N):I(T)}function ue(T){return T===null||de(T)?(e.exit("htmlFlowData"),ye(T)):(e.consume(T),ue)}function ye(T){return e.exit("htmlFlow"),t(T)}}function IE(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Va,t,n)}}const FE={name:"htmlText",tokenize:DE};function DE(e,t,n){const r=this;let i,s,l;return o;function o(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),E):N===63?(e.consume(N),v):St(N)?(e.consume(N),M):n(N)}function c(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),s=0,m):St(N)?(e.consume(N),x):n(N)}function d(N){return N===45?(e.consume(N),f):n(N)}function h(N){return N===null?n(N):N===45?(e.consume(N),p):de(N)?(l=h,Y(N)):(e.consume(N),h)}function p(N){return N===45?(e.consume(N),f):h(N)}function f(N){return N===62?G(N):N===45?p(N):h(N)}function m(N){const ue="CDATA[";return N===ue.charCodeAt(s++)?(e.consume(N),s===ue.length?g:m):n(N)}function g(N){return N===null?n(N):N===93?(e.consume(N),w):de(N)?(l=g,Y(N)):(e.consume(N),g)}function w(N){return N===93?(e.consume(N),y):g(N)}function y(N){return N===62?G(N):N===93?(e.consume(N),y):g(N)}function x(N){return N===null||N===62?G(N):de(N)?(l=x,Y(N)):(e.consume(N),x)}function v(N){return N===null?n(N):N===63?(e.consume(N),j):de(N)?(l=v,Y(N)):(e.consume(N),v)}function j(N){return N===62?G(N):v(N)}function E(N){return St(N)?(e.consume(N),k):n(N)}function k(N){return N===45||Ct(N)?(e.consume(N),k):S(N)}function S(N){return de(N)?(l=S,Y(N)):je(N)?(e.consume(N),S):G(N)}function M(N){return N===45||Ct(N)?(e.consume(N),M):N===47||N===62||$e(N)?F(N):n(N)}function F(N){return N===47?(e.consume(N),G):N===58||N===95||St(N)?(e.consume(N),C):de(N)?(l=F,Y(N)):je(N)?(e.consume(N),F):G(N)}function C(N){return N===45||N===46||N===58||N===95||Ct(N)?(e.consume(N),C):O(N)}function O(N){return N===61?(e.consume(N),I):de(N)?(l=O,Y(N)):je(N)?(e.consume(N),O):F(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,Q):de(N)?(l=I,Y(N)):je(N)?(e.consume(N),I):(e.consume(N),q)}function Q(N){return N===i?(e.consume(N),i=void 0,$):N===null?n(N):de(N)?(l=Q,Y(N)):(e.consume(N),Q)}function q(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||$e(N)?F(N):(e.consume(N),q)}function $(N){return N===47||N===62||$e(N)?F(N):n(N)}function G(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function Y(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return je(N)?ze(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):H(N)}function H(N){return e.enter("htmlTextData"),l(N)}}const mp={name:"labelEnd",resolveAll:BE,resolveTo:UE,tokenize:qE},OE={tokenize:HE},_E={tokenize:VE},$E={tokenize:WE};function BE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Hn(e,0,e.length,n),e}function UE(e,t){let n=e.length,r=0,i,s,l;for(;n--;){const d=e[n][1];if(i){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(i=n,d.type!=="labelLink")){r=2;break}}else d.type==="labelEnd"&&(s=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",o,t],["enter",u,t]],l=En(l,e.slice(i+1,i+r+3)),l=En(l,[["enter",c,t]]),l=En(l,tc(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),l=En(l,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),l=En(l,e.slice(s+1)),l=En(l,[["exit",o,t]]),Hn(e,i,e.length,l),e}function qE(e,t,n){const r=this,i=r._labelStarts;let s,l;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();s=i[i.length-1]}return o;function o(p){return s?s._inactive?h(p):(l=r.parser.defined.includes(Vn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(OE,d,l?d:h)(p):p===91?e.attempt(_E,d,l?c:h)(p):l?d(p):h(p)}function c(p){return e.attempt($E,d,h)(p)}function d(p){return i.pop(),t(p)}function h(p){return s._balanced=!0,n(p)}}function HE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return $e(h)?ea(e,s)(h):s(h)}function s(h){return h===41?d(h):O0(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return $e(h)?ea(e,u)(h):d(h)}function o(h){return n(h)}function u(h){return h===34||h===39||h===40?$0(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return $e(h)?ea(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function VE(e,t,n){const r=this;return i;function i(o){return _0.call(r,e,s,l,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function WE(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const QE={name:"labelStartImage",resolveAll:mp.resolveAll,tokenize:KE};function KE(e,t,n){const r=this;let i;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const GE={name:"labelStartLink",resolveAll:mp.resolveAll,tokenize:YE};function YE(e,t,n){const r=this;let i;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Kc={name:"lineEnding",tokenize:XE};function XE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const _o={name:"thematicBreak",tokenize:JE};function JE(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),l(c)}function l(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||de(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),je(c)?ze(e,o,"whitespace")(c):o(c))}}const Gt={continuation:{tokenize:n3},exit:i3,name:"list",tokenize:t3},ZE={partial:!0,tokenize:s3},e3={partial:!0,tokenize:r3};function t3(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Mh(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(_o,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Mh(f)&&++l<10?(e.consume(f),u):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Va,r.interrupt?n:d,e.attempt(ZE,p,h))}function d(f){return r.containerState.initialBlankLine=!0,s++,p(f)}function h(f){return je(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function n3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Va,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!je(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(e3,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(Gt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function r3(e,t,n){const r=this;return ze(e,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(s):n(s)}}function i3(e){e.exit(this.containerState.type)}function s3(e,t,n){const r=this;return ze(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!je(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Wg={name:"setextUnderline",resolveTo:l3,tokenize:a3};function l3(e,t){const n=new ku;let r=e.length,i,s,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!l&&e[r][1].type==="definition"&&(l=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(n.add(s,0,[["enter",o,t]]),n.add(l+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[l][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function a3(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),je(c)?ze(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||de(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const o3={tokenize:u3};function u3(e){const t=this,n=e.attempt(Va,r,e.attempt(this.parser.constructs.flowInitial,i,ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xE,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const c3={resolveAll:q0()},d3=U0("string"),h3=U0("text");function U0(e){return{resolveAll:q0(e==="text"?f3:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,l,o);return l;function l(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const h=i[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function q0(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function f3(e,t){const n=new ku;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],s=t.sliceStream(i);let l=s.length,o=-1,u=0,c;for(;l--;){const d=s[l];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(d===-2)c=!0,u++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const d={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):n.add(r,0,[["enter",d,t],["exit",d,t]])}r++}return n.consume(e),e}const p3={42:Gt,43:Gt,45:Gt,48:Gt,49:Gt,50:Gt,51:Gt,52:Gt,53:Gt,54:Gt,55:Gt,56:Gt,57:Gt,62:A0},m3={91:bE},g3={[-2]:Qc,[-1]:Qc,32:Qc},x3={35:PE,42:_o,45:[Wg,_o],60:ME,61:Wg,95:_o,96:Vg,126:Vg},y3={38:F0,92:I0},v3={[-5]:Kc,[-4]:Kc,[-3]:Kc,33:QE,38:F0,42:Rh,60:[JC,FE],91:GE,92:[CE,I0],93:mp,95:Rh,96:dE},w3={null:[Rh,c3]},k3={null:[42,95]},b3={null:[]},j3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:k3,contentInitial:m3,disable:b3,document:p3,flow:x3,flowInitial:g3,insideSpan:w3,string:y3,text:v3},Symbol.toStringTag,{value:"Module"}));function N3(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let l=[],o=[];const u={attempt:S(E),check:S(k),consume:x,enter:v,exit:j,interrupt:S(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=t.tokenize.call(c,u);return t.resolveAll&&s.push(t),c;function h(O){return l=En(l,O),w(),l[l.length-1]!==null?[]:(M(t,0),c.events=tc(s,c.events,c),c.events)}function p(O,I){return C3(f(O),I)}function f(O){return S3(l,O)}function m(){const{_bufferIndex:O,_index:I,line:Q,column:q,offset:$}=r;return{_bufferIndex:O,_index:I,line:Q,column:q,offset:$}}function g(O){i[O.line]=O.column,C()}function w(){for(;r._index<l.length;){const O=l[r._index];if(typeof O=="string"){const I=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<O.length;)y(O.charCodeAt(r._bufferIndex))}else y(O)}}function y(O){d=d(O)}function x(O){de(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,C()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=O}function v(O,I){const Q=I||{};return Q.type=O,Q.start=m(),c.events.push(["enter",Q,c]),o.push(Q),Q}function j(O){const I=o.pop();return I.end=m(),c.events.push(["exit",I,c]),I}function E(O,I){M(O,I.from)}function k(O,I){I.restore()}function S(O,I){return Q;function Q(q,$,G){let Y,z,H,N;return Array.isArray(q)?ye(q):"tokenize"in q?ye([q]):ue(q);function ue(ve){return Ne;function Ne(_t){const an=_t!==null&&ve[_t],Tt=_t!==null&&ve.null,Be=[...Array.isArray(an)?an:an?[an]:[],...Array.isArray(Tt)?Tt:Tt?[Tt]:[]];return ye(Be)(_t)}}function ye(ve){return Y=ve,z=0,ve.length===0?G:T(ve[z])}function T(ve){return Ne;function Ne(_t){return N=F(),H=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?De():ve.tokenize.call(I?Object.assign(Object.create(c),I):c,u,Te,De)(_t)}}function Te(ve){return O(H,N),$}function De(ve){return N.restore(),++z<Y.length?T(Y[z]):G}}}function M(O,I){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&Hn(c.events,I,c.events.length-I,O.resolve(c.events.slice(I),c)),O.resolveTo&&(c.events=O.resolveTo(c.events,c))}function F(){const O=m(),I=c.previous,Q=c.currentConstruct,q=c.events.length,$=Array.from(o);return{from:q,restore:G};function G(){r=O,c.previous=I,c.currentConstruct=Q,c.events.length=q,o=$,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function S3(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,s)];else{if(l=e.slice(n,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}s>0&&l.push(e[i].slice(0,s))}return l}function C3(e,t){let n=-1;const r=[];let i;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=`
470
- `;break}case-3:{l=`\r
471
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function E3(e){const r={constructs:L0([j3,...(e||{}).extensions||[]]),content:i(VC),defined:[],document:i(QC),flow:i(o3),lazy:{},string:i(d3),text:i(h3)};return r;function i(s){return l;function l(o){return N3(r,s,o)}}}function P3(e){for(;!D0(e););return e}const Qg=/[\0\t\n\r]/g;function T3(){let e=1,t="",n=!0,r;return i;function i(s,l,o){s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s));const u=[];let c=0;for(t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){Qg.lastIndex=c;const d=Qg.exec(s),h=d&&d.index!==void 0?d.index:s.length,p=s.charCodeAt(h);if(!d){t=s.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(s.slice(c,h)),e+=h-c),p){case 0:{u.push(65533),e++;break}case 9:{const f=Math.ceil(e/4)*4;for(u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const L3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M3(e){return e.replace(L3,R3)}function R3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return M0(n.slice(s?2:1),s?16:10)}return pp(n)||e}const H0={}.hasOwnProperty;function z3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),A3(n)(P3(E3(n).document().write(T3()(e,t,!0))))}function A3(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Yn),autolinkProtocol:C,autolinkEmail:C,atxHeading:l(Kn),blockQuote:l(Be),characterEscape:C,characterReference:C,codeFenced:l(lt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(lt,o),codeText:l(Rn,o),codeTextData:C,data:C,codeFlowValue:C,definition:l(zn),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Qt),hardBreakEscape:l(on),hardBreakTrailing:l(on),htmlFlow:l(Gn,o),htmlFlowData:C,htmlText:l(Gn,o),htmlTextData:C,image:l(xr),label:o,link:l(Yn),listItem:l(yr),listItemValue:f,listOrdered:l(Xn,p),listUnordered:l(Xn),paragraph:l(J),reference:Te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Kn),strong:l(Kt),thematicBreak:l(Jn)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Tt,autolinkProtocol:an,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:Ne,characterReference:_t,codeFenced:c(y),codeFencedFence:w,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(x),codeText:c(G),codeTextData:O,data:O,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(Q),hardBreakTrailing:c(Q),htmlFlow:c(q),htmlFlowData:O,htmlText:c($),htmlTextData:O,image:c(z),label:N,labelText:H,lineEnding:I,link:c(Y),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:De,resourceDestinationString:ue,resourceTitleString:ye,resource:T,setextHeading:c(F),setextHeadingLineSequence:M,setextHeadingText:S,strong:c(),thematicBreak:c()}};V0(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let U={type:"root",children:[],position:void 0};const he={stack:[U],tokenStack:[],config:t,enter:u,exit:d,buffer:o,resume:h,data:n},fe=[],ht=[];let Se=-1;for(;++Se<D.length;)if(ht.push(D[Se]),D[Se][1].type==="listOrdered"||D[Se][1].type==="listUnordered")if(D[Se][0]==="enter")fe.push(ht.length-1);else{const at=fe.pop();s(ht,at)}for(D=ht,Se=-1;++Se<D.length;){const at=t[D[Se][0]];D[Se][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...he,sliceSerialize:D[Se][2].sliceSerialize},D[Se][1]),H0.call(at,D[Se][1].type)&&at[D[Se][1].type].call({...he,sliceSerialize:D[Se][2].sliceSerialize},D[Se][1]),D[Se][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...he,sliceSerialize:D[Se][2].sliceSerialize},D[Se][1])}if(he.tokenStack.length>0){const at=he.tokenStack[he.tokenStack.length-1];(at[1]||Kg).call(he,void 0,at[0])}for(U.position={start:Br(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Br(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)U=t.transforms[Se](U)||U;return U}function i(D,U,he){let fe=-1;for(;++fe<D.length;)D[fe].call(U,he)}function s(D,U){const he=D.length-1;let fe=U-1,ht=-1,Se=!1,at,R,we,Je;const vn=[];for(;++fe<=he;){const bt=D[fe];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?ht++:ht--,Je=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(at&&!Je&&!ht&&!we&&(we=fe),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!ht&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||ht===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(at){let Zn=fe;for(R=void 0;Zn--;){const An=D[Zn];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;R&&(D[R][1].type="lineEndingBlank",Se=!0),An[1].type="lineEnding",R=Zn}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}we&&(!R||we<R)&&(at._spread=!0),at.end=Object.assign({},R?D[R][1].start:bt[1].end),vn.push({at:R||fe,event:["exit",at,bt[2]]})}if(bt[1].type==="listItemPrefix"){const Zn={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};at=Zn,vn.push({at:fe,event:["enter",Zn,bt[2]]}),we=void 0,Je=!0}}}const Ci=D.splice(U);let hs=0;for(fe=-1;++fe<Ci.length;){for(;hs<vn.length&&vn[hs].at===U+fe;)D.push(vn[hs++].event);D.push(Ci[fe])}D[U][1]._spread=Se}function l(D,U){return he;function he(fe){u.call(this,D(fe),fe),U&&U.call(this,fe)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(D,U,he){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([U,he||void 0]),D.position={start:Br(U.start),end:void 0}}function c(D){return U;function U(he){D&&D.call(this,he),d.call(this,he)}}function d(D,U){const he=this.stack.pop(),fe=this.tokenStack.pop();if(!fe)throw new Error("Cannot close `"+D.type+"` ("+Zl({start:D.start,end:D.end})+"): it’s not open");fe[0].type!==D.type&&(U?U.call(this,D,fe[0]):(fe[1]||Kg).call(this,D,fe[0])),he.position.end=Br(D.end)}function h(){return Zu(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function f(D){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){const D=this.resume(),U=this.stack[this.stack.length-1];U.lang=D}function g(){const D=this.resume(),U=this.stack[this.stack.length-1];U.meta=D}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const D=this.resume(),U=this.stack[this.stack.length-1];U.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const D=this.resume(),U=this.stack[this.stack.length-1];U.value=D.replace(/(\r?\n|\r)$/g,"")}function v(D){const U=this.resume(),he=this.stack[this.stack.length-1];he.label=U,he.identifier=Vn(this.sliceSerialize(D)).toLowerCase()}function j(){const D=this.resume(),U=this.stack[this.stack.length-1];U.title=D}function E(){const D=this.resume(),U=this.stack[this.stack.length-1];U.url=D}function k(D){const U=this.stack[this.stack.length-1];if(!U.depth){const he=this.sliceSerialize(D).length;U.depth=he}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function M(D){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function C(D){const he=this.stack[this.stack.length-1].children;let fe=he[he.length-1];(!fe||fe.type!=="text")&&(fe=vr(),fe.position={start:Br(D.start),end:void 0},he.push(fe)),this.stack.push(fe)}function O(D){const U=this.stack.pop();U.value+=this.sliceSerialize(D),U.position.end=Br(D.end)}function I(D){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=U.children[U.children.length-1];he.position.end=Br(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(C.call(this,D),O.call(this,D))}function Q(){this.data.atHardBreak=!0}function q(){const D=this.resume(),U=this.stack[this.stack.length-1];U.value=D}function $(){const D=this.resume(),U=this.stack[this.stack.length-1];U.value=D}function G(){const D=this.resume(),U=this.stack[this.stack.length-1];U.value=D}function Y(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=U,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function z(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=U,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function H(D){const U=this.sliceSerialize(D),he=this.stack[this.stack.length-2];he.label=M3(U),he.identifier=Vn(U).toLowerCase()}function N(){const D=this.stack[this.stack.length-1],U=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const fe=D.children;he.children=fe}else he.alt=U}function ue(){const D=this.resume(),U=this.stack[this.stack.length-1];U.url=D}function ye(){const D=this.resume(),U=this.stack[this.stack.length-1];U.title=D}function T(){this.data.inReference=void 0}function Te(){this.data.referenceType="collapsed"}function De(D){const U=this.resume(),he=this.stack[this.stack.length-1];he.label=U,he.identifier=Vn(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ve(D){this.data.characterReferenceType=D.type}function Ne(D){const U=this.sliceSerialize(D),he=this.data.characterReferenceType;let fe;he?(fe=M0(U,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=pp(U);const ht=this.stack[this.stack.length-1];ht.value+=fe}function _t(D){const U=this.stack.pop();U.position.end=Br(D.end)}function an(D){O.call(this,D);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(D)}function Tt(D){O.call(this,D);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(D)}function Be(){return{type:"blockquote",children:[],position:void 0}}function lt(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Rn(){return{type:"inlineCode",value:"",position:void 0}}function zn(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Qt(){return{type:"emphasis",children:[],position:void 0}}function Kn(){return{type:"heading",depth:0,children:[],position:void 0}}function on(){return{type:"break",position:void 0}}function Gn(){return{type:"html",value:"",position:void 0}}function xr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Yn(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Xn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[],position:void 0}}function yr(D){return{type:"listItem",spread:D._spread,checked:null,children:[],position:void 0}}function J(){return{type:"paragraph",children:[],position:void 0}}function Kt(){return{type:"strong",children:[],position:void 0}}function vr(){return{type:"text",value:"",position:void 0}}function Jn(){return{type:"thematicBreak",position:void 0}}}function Br(e){return{line:e.line,column:e.column,offset:e.offset}}function V0(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?V0(e,r):I3(e,r)}}function I3(e,t){let n;for(n in t)if(H0.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zl({start:t.start,end:t.end})+") is still open")}function F3(e){const t=this;t.parser=n;function n(r){return z3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function D3(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 O3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
472
- `}]}function _3(e,t){const n=t.value?t.value+`
473
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,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 $3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=wl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=s+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function q3(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 H3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function W0(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function V3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return W0(e,t);const i={src:wl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function W3(e,t){const n={src:wl(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Q3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function K3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return W0(e,t);const i={href:wl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function G3(e,t){const n={href:wl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Y3(e,t,n){const r=e.all(t),i=n?X3(n):Q0(t),s={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
474
- `}),d.type==="element"&&d.tagName==="p"&&!i?l.push(...d.children):l.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
475
- `});const c={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,c),e.applyData(t,c)}function X3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Q0(n[r])}return t}function Q0(e){const t=e.spread;return t??e.children.length>1}function J3(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];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(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Z3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function e4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function t4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n4(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=cp(t.children[1]),u=j0(t.children[t.children.length-1]);o&&u&&(l.position={start:o,end:u}),i.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function r4(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const h=t.children[u],p={},f=l?l[u]:void 0;f&&(p.align=f);let m={type:"element",tagName:s,properties:p,children:[]};h&&(m.children=e.all(h),e.patch(h,m),m=e.applyData(h,m)),c.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function i4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Gg=9,Yg=32;function s4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Xg(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Xg(t.slice(i),i>0,!1)),s.join("")}function Xg(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Gg||s===Yg;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Gg||s===Yg;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function l4(e,t){const n={type:"text",value:s4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function a4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const o4={blockquote:D3,break:O3,code:_3,delete:$3,emphasis:B3,footnoteReference:U3,heading:q3,html:H3,imageReference:V3,image:W3,inlineCode:Q3,linkReference:K3,link:G3,listItem:Y3,list:J3,paragraph:Z3,root:e4,strong:t4,table:n4,tableCell:i4,tableRow:r4,text:l4,thematicBreak:a4,toml:vo,yaml:vo,definition:vo,footnoteDefinition:vo};function vo(){}const K0=-1,nc=0,ta=1,bu=2,gp=3,xp=4,yp=5,vp=6,G0=7,Y0=8,{defineProperty:u4}=Object,X0=typeof self=="object"?self:globalThis,Jg=(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 X0[e](t)},c4=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,l]=t[i];switch(s){case nc:case K0:return n(l,i);case ta:{const o=n([],i);for(const u of l)o.push(r(u));return o}case bu:{const o=n({},i);for(const[u,c]of l){const d=r(u),h=r(c);d==="__proto__"?u4(o,d,{value:h,configurable:!0,enumerable:!0,writable:!0}):o[d]=h}return o}case gp:return n(new Date(l),i);case xp:{const{source:o,flags:u}=l;return n(new RegExp(o,u),i)}case yp:{const o=n(new Map,i);for(const[u,c]of l)o.set(r(u),r(c));return o}case vp:{const o=n(new Set,i);for(const u of l)o.add(r(u));return o}case G0:{const{name:o,message:u}=l;return n(typeof X0[o]=="function"?Jg(o,u):new Error(u),i)}case Y0:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}case"-0":return-0}return n(Jg(s,l),i)};return r},Zg=e=>c4(new Map,e)(0),Ri="",{toString:d4}={},{keys:h4,is:f4}=Object,Dl=e=>{const t=typeof e;if(t!=="object"||!e)return[nc,t];const n=d4.call(e).slice(8,-1);switch(n){case"Array":return[ta,Ri];case"Object":return[bu,Ri];case"Date":return[gp,Ri];case"RegExp":return[xp,Ri];case"Map":return[yp,Ri];case"Set":return[vp,Ri];case"DataView":return[ta,n]}return n.includes("Array")?[ta,n]:e instanceof Error?[G0,e.name||"Error"]:[bu,n]},wo=([e,t])=>e===nc&&(t==="function"||t==="symbol"),p4=(e,t,n,r)=>{const i=(l,o)=>{const u=r.push(l)-1;return n.set(o,u),u},s=l=>{if(n.has(l))return n.get(l);let[o,u]=Dl(l);switch(o){case nc:{let d=l;switch(u){case"bigint":o=Y0,d=l.toString();break;case"number":if(!l&&f4(l,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([K0],l)}return i([o,d],l)}case ta:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const d=[],h=i([o,d],l);for(const p of l)d.push(s(p));return h}case bu:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const d=[],h=i([o,d],l);for(const p of h4(l))(e||!wo(Dl(l[p])))&&d.push([s(p),s(l[p])]);return h}case gp:return i([o,isNaN(l.getTime())?Ri:l.toISOString()],l);case xp:{const{source:d,flags:h}=l;return i([o,{source:d,flags:h}],l)}case yp:{const d=[],h=i([o,d],l);for(const[p,f]of l)(e||!(wo(Dl(p))||wo(Dl(f))))&&d.push([s(p),s(f)]);return h}case vp:{const d=[],h=i([o,d],l);for(const p of l)(e||!wo(Dl(p)))&&d.push(s(p));return h}}const{message:c}=l;return i([o,{name:u,message:c}],l)};return s},ex=(e,{json:t,lossy:n}={})=>{const r=[];return p4(!(t||n),!!t,new Map,r)(e),r},ju=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Zg(ex(e,t)):structuredClone(e):(e,t)=>Zg(ex(e,t));function m4(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 g4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function x4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||m4,r=e.options.footnoteBackLabel||g4,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),h=String(c.identifier).toUpperCase(),p=wl(h.toLowerCase());let f=0;const m=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++f<=g;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const x=w.children[w.children.length-1];x&&x.type==="text"?x.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(c,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ju(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
476
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
477
- `}]}}const rc=function(e){if(e==null)return k4;if(typeof e=="function")return ic(e);if(typeof e=="object")return Array.isArray(e)?y4(e):v4(e);if(typeof e=="string")return w4(e);throw new Error("Expected function, string, or object as test")};function y4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rc(e[n]);return ic(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function v4(e){const t=e;return ic(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function w4(e){return ic(t);function t(n){return n&&n.type===e}}function ic(e){return t;function t(n,r,i){return!!(b4(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function k4(){return!0}function b4(e){return e!==null&&typeof e=="object"&&"type"in e}const J0=[],j4=!0,na=!1,Ih="skip";function Fh(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,s,l,o,u;if(typeof n=="function"||n&&typeof n=="object"?(s=t,l=n,r&&(i=!1)):(l=t,n&&(i=!1)),typeof l=="function")o=l;else if(l&&typeof l=="object"){if(!(l.enter===null||l.enter===void 0))if(typeof l.enter=="function")o=l.enter;else throw new Error("Unexpected value `"+l.enter+"` for `visitors.enter`, expected optional visitor");if(typeof l.exit=="function")u=l.exit;else throw new Error("Unexpected value `"+l.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+l+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=rc(s),d=i?1:-1;h(e,void 0,[])();function h(p,f,m){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(p.type+(y?"<"+y+">":""))+")"})}return w;function w(){const y=!s||c(p,f,m[m.length-1]||void 0);let x=J0;if(o&&y&&(x=tx(o(p,m,f)),x[0]===na))return x;if("children"in p&&p.children){const v=p;if(v.children&&x[0]!==Ih){let j=(i?-1:v.children.length)+d;const E=[...m,v];for(;j>-1&&j<v.children.length;){const k=v.children[j],S=h(k,j,E)();if(S[0]===na)return S;j=typeof S[1]=="number"?S[1]:j+d}}}if(u&&y){const v=tx(u(p,m,f));if(v[0]===Ih)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===na||typeof v[1]=="number")return v}return x}}}function tx(e){return Array.isArray(e)?e:typeof e=="number"?[j4,e]:e==null?J0:[e]}function sc(e,t,n,r){let i,s,l;s=t,l=n,typeof s=="function"?Fh(e,i,Dh(s),l):Fh(e,i,N4(s),l)}function N4(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?Dh(e.enter):e.enter,exit:typeof e.exit=="function"?Dh(e.exit):e.exit}}function Dh(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const Oh={}.hasOwnProperty,S4={};function C4(e,t){const n=t||S4,r=new Map,i=new Map,s=new Map,l={...o4,...n.handlers},o={all:c,applyData:P4,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:l,one:u,options:n,patch:E4,wrap:L4};return sc(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),o;function u(d,h){const p=d.type,f=o.handlers[p];if(Oh.call(o.handlers,p)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:g,...w}=d,y=ju(w);return y.children=o.all(d),y}return ju(d)}return(o.options.unknownHandler||T4)(o,d,h)}function c(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const m=o.one(p[f],d);if(m){if(f&&p[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=nx(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=nx(g.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function E4(e,t){e.position&&(t.position=gC(e))}function P4(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,ju(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function T4(e,t){const n=t.data||{},r="value"in t&&!(Oh.call(n,"hProperties")||Oh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function L4(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
478
- `});++r<e.length;)r&&n.push({type:"text",value:`
479
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
480
- `}),n}function nx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rx(e,t){const n=C4(e,t),r=n.one(e,void 0),i=x4(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
481
- `},i),s}function M4(e,t){return e&&"run"in e?async function(n,r){const i=rx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return rx(n,{file:r,...e||t})}}function ix(e){if(e)throw e}var $o=Object.prototype.hasOwnProperty,Z0=Object.prototype.toString,sx=Object.defineProperty,lx=Object.getOwnPropertyDescriptor,ax=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Z0.call(t)==="[object Array]"},ox=function(t){if(!t||Z0.call(t)!=="[object Object]")return!1;var n=$o.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&$o.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||$o.call(t,i)},ux=function(t,n){sx&&n.name==="__proto__"?sx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},cx=function(t,n){if(n==="__proto__")if($o.call(t,n)){if(lx)return lx(t,n).value}else return;return t[n]},R4=function e(){var t,n,r,i,s,l,o=arguments[0],u=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=cx(o,n),i=cx(t,n),o!==i&&(d&&i&&(ox(i)||(s=ax(i)))?(s?(s=!1,l=r&&ax(r)?r:[]):l=r&&ox(r)?r:{},ux(o,{name:n,newValue:e(d,l,i)})):typeof i<"u"&&ux(o,{name:n,newValue:i}));return o};const Gc=Uh(R4);function _h(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 z4(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(u,...c){const d=e[++s];let h=-1;if(u){l(u);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,d?A4(d,o)(...c):l(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function A4(e,t){let n;return r;function r(...l){const o=e.length>l.length;let u;o&&l.push(i);try{u=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(l,...o){n||(n=!0,t(l,...o))}function s(l){i(null,l)}}const rr={basename:I4,dirname:F4,extname:D4,join:O4,sep:"/"};function I4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wa(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else l<0&&(s=!0,l=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function F4(e){if(Wa(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function D4(e){Wa(e);let t=e.length,n=-1,r=0,i=-1,s=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function O4(...e){let t=-1,n;for(;++t<e.length;)Wa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_4(n)}function _4(e){Wa(e);const t=e.codePointAt(0)===47;let n=$4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $4(e,t){let n="",r=0,i=-1,s=0,l=-1,o,u;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,s=0;continue}}else if(n.length>0){n="",r=0,i=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s>-1?s++:s=-1}return n}function Wa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const B4={cwd:U4};function U4(){return"/"}function $h(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function q4(e){if(typeof e=="string")e=new URL(e);else if(!$h(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 H4(e)}function H4(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Yc=["history","path","basename","stem","extname","dirname"];class ew{constructor(t){let n;t?$h(t)?n={path:t}:typeof t=="string"||V4(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":B4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Yc.length;){const s=Yc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Yc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?rr.basename(this.path):void 0}set basename(t){Jc(t,"basename"),Xc(t,"basename"),this.path=rr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?rr.dirname(this.path):void 0}set dirname(t){dx(this.basename,"dirname"),this.path=rr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?rr.extname(this.path):void 0}set extname(t){if(Xc(t,"extname"),dx(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=rr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){$h(t)&&(t=q4(t)),Jc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?rr.basename(this.path,this.extname):void 0}set stem(t){Jc(t,"stem"),Xc(t,"stem"),this.path=rr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ot(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xc(e,t){if(e&&e.includes(rr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+rr.sep+"`")}function Jc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function dx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function V4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const W4=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Q4={}.hasOwnProperty;class wp extends W4{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=z4()}copy(){const t=new wp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Gc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(td("data",this.frozen),this.namespace[t]=n,this):Q4.call(this.namespace,t)&&this.namespace[t]||void 0:t?(td("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,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ko(t),r=this.parser||this.Parser;return Zc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zc("process",this.parser||this.Parser),ed("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,l){const o=ko(t),u=r.parse(o);r.run(u,o,function(d,h,p){if(d||!h||!p)return c(d);const f=h,m=r.stringify(f,p);Y4(m)?p.value=m:p.result=m,c(d,p)});function c(d,h){d||!h?l(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Zc("processSync",this.parser||this.Parser),ed("processSync",this.compiler||this.Compiler),this.process(t,i),fx("processSync","process",n),r;function i(s,l){n=!0,ix(s),r=l}}run(t,n,r){hx(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(l,o){const u=ko(n);i.run(t,u,c);function c(d,h,p){const f=h||t;d?o(d):l?l(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),fx("runSync","run",r),i;function s(l,o){ix(l),i=o,r=!0}}stringify(t,n){this.freeze();const r=ko(n),i=this.compiler||this.Compiler;return ed("stringify",i),hx(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(td("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...h]=c;u(d,h)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))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");o(c.plugins),c.settings&&(i.settings=Gc(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const h=c[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...d]);else if(d.length>0){let[f,...m]=d;const g=r[p][1];_h(g)&&_h(f)&&(f=Gc(!0,g,f)),r[p]=[c,f,...m]}}}}const K4=new wp().freeze();function Zc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ed(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function td(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 hx(e){if(!_h(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ko(e){return G4(e)?e:new ew(e)}function G4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Y4(e){return typeof e=="string"||X4(e)}function X4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J4="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",px=[],mx={allowDangerousHtml:!0},Z4=/^(https?|ircs?|mailto|xmpp)$/i,e5=[{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 tw(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,l=e.disallowedElements,o=e.rehypePlugins||px,u=e.remarkPlugins||px,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mx}:mx,d=e.skipHtml,h=e.unwrapDisallowed,p=e.urlTransform||t5,f=K4().use(F3).use(u).use(M4,c).use(o),m=new ew;typeof r=="string"&&(m.value=r);for(const x of e5)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+J4+x.id,void 0);const g=f.parse(m);let w=f.runSync(g,m);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),sc(w,y),bC(w,{Fragment:a.Fragment,components:s,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function y(x,v,j){if(x.type==="raw"&&j&&typeof v=="number")return d?j.children.splice(v,1):j.children[v]={type:"text",value:x.value},v;if(x.type==="element"){let E;for(E in Wc)if(Object.hasOwn(Wc,E)&&Object.hasOwn(x.properties,E)){const k=x.properties[E],S=Wc[E];(S===null||S.includes(x.tagName))&&(x.properties[E]=p(String(k||""),E,x))}}if(x.type==="element"){let E=t?!t.includes(x.tagName):l?l.includes(x.tagName):!1;if(!E&&n&&typeof v=="number"&&(E=!n(x,v,j)),E&&j&&typeof v=="number")return h&&x.children?j.children.splice(v,1,...x.children):j.children.splice(v,1),v}}}function t5(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||Z4.test(e.slice(0,t))?e:""}function gx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function n5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function r5(e,t,n){const i=rc((n||{}).ignore||[]),s=i5(t);let l=-1;for(;++l<s.length;)Fh(e,o);function o(c,d,h){if(c.type==="text"&&typeof h=="number")return u(c,d,h);if(i(c,h,d[d.length-1]))return Ih}function u(c,d,h){const p=d[d.length-1],f=s[l][0],m=s[l][1];let g=0,w=!1,y=[];f.lastIndex=0;let x=f.exec(c.value);for(;x;){const j=x.index,E={index:x.index,input:x.input,stack:[...d,c]};let k=m(...x,E);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1)f.lastIndex=j+1;else{if(g!==j&&v({type:"text",value:c.value.slice(g,j)}),Array.isArray(k))for(const S of k)v(S);else k&&v(k);g=j+x[0].length,w=!0}if(!f.global)break;x=f.exec(c.value)}return w?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),p.children.splice(h,1,...y)):y=[c],h+y.length;function v(j){const E=y[y.length-1];E&&E.type==="text"&&j.type==="text"?E.value+=j.value:y.push(j)}}}function i5(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([s5(i[0]),l5(i[1])])}return t}function s5(e){return typeof e=="string"?new RegExp(n5(e),"g"):e}function l5(e){return typeof e=="function"?e:function(){return e}}const nd="phrasing",rd=["autolink","link","image","label"];function a5(){return{transforms:[p5],enter:{literalAutolink:u5,literalAutolinkEmail:id,literalAutolinkHttp:id,literalAutolinkWww:id},exit:{literalAutolink:f5,literalAutolinkEmail:h5,literalAutolinkHttp:c5,literalAutolinkWww:d5}}}function o5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:nd,notInConstruct:rd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:nd,notInConstruct:rd},{character:":",before:"[ps]",after:"\\/",inConstruct:nd,notInConstruct:rd}]}}function u5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function id(e){this.config.enter.autolinkProtocol.call(this,e)}function c5(e){this.config.exit.autolinkProtocol.call(this,e)}function d5(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 h5(e){this.config.exit.autolinkEmail.call(this,e)}function f5(e){this.exit(e)}function p5(e){r5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,m5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),g5]],{ignore:["link","linkReference"]})}function m5(e,t,n,r,i){let s="";if(!nw(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!x5(n)))return!1;const l=y5(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function g5(e,t,n,r){return!nw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function x5(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 y5(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=gx(e,"(");let s=gx(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function nw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||as(n)||ec(n))&&(!t||n!==47)}rw.peek=E5;function v5(){this.buffer()}function w5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function k5(){this.buffer()}function b5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function j5(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function N5(e){this.exit(e)}function S5(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function C5(e){this.exit(e)}function E5(){return"["}function rw(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),l(),s+=i.move("]"),s}function P5(){return{enter:{gfmFootnoteCallString:v5,gfmFootnoteCall:w5,gfmFootnoteDefinitionLabelString:k5,gfmFootnoteDefinition:b5},exit:{gfmFootnoteCallString:j5,gfmFootnoteCall:N5,gfmFootnoteDefinitionLabelString:S5,gfmFootnoteDefinition:C5}}}function T5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:rw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,l){const o=s.createTracker(l);let u=o.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
482
- `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?iw:L5))),c(),u}}function L5(e,t,n){return t===0?e:iw(e,t,n)}function iw(e,t,n){return(n?"":" ")+e}const M5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kp.attention=F5;kp.peek=D5;function R5(){return{canContainEols:["delete"],enter:{strikethrough:A5},exit:{strikethrough:I5}}}function z5(){return{handlers:{delete:kp},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:M5}]}}function A5(e){this.enter({type:"delete",children:[],position:void 0},e)}function I5(e){this.exit(e)}function kp(e,t,n,r){const i=n.createTracker(r),s=n.stack.includes("strikethrough")?"~":"~~",l=n.enter("strikethrough");let o=i.move(s);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(s),l(),o}function F5(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function D5(){return"~"}function O5(e){return e.length}function _5(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||O5,s=[],l=[],o=[],u=[];let c=0,d=-1;for(;++d<e.length;){const g=[],w=[];let y=-1;for(e[d].length>c&&(c=e[d].length);++y<e[d].length;){const x=$5(e[d][y]);if(n.alignDelimiters!==!1){const v=i(x);w[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}g.push(x)}l[d]=g,o[d]=w}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)s[h]=xx(r[h]);else{const g=xx(r);for(;++h<c;)s[h]=g}h=-1;const p=[],f=[];for(;++h<c;){const g=s[h];let w="",y="";g===99?(w=":",y=":"):g===108?w=":":g===114&&(y=":");let x=n.alignDelimiters===!1?1:Math.max(1,u[h]-w.length-y.length);const v=w+"-".repeat(x)+y;n.alignDelimiters!==!1&&(x=w.length+x+y.length,x>u[h]&&(u[h]=x),f[h]=x),p[h]=v}l.splice(1,0,p),o.splice(1,0,f),d=-1;const m=[];for(;++d<l.length;){const g=l[d],w=o[d],y=n.fillRows===!1?Math.max(1,l[d===1?0:d].length):c;h=-1;const x=[];for(;++h<y;){const v=g[h]||"";let j="",E="";if(n.alignDelimiters!==!1){const k=u[h]-(w[h]||0),S=s[h];if(S===114)j=" ".repeat(k);else if(S===99){const M=k/2;k%2?(j=" ".repeat(M+.5),E=" ".repeat(M-.5)):(j=" ".repeat(M),E=j)}else E=" ".repeat(k)}n.delimiterStart!==!1&&!h&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&x.push(" "),n.alignDelimiters!==!1&&x.push(j),x.push(v),n.alignDelimiters!==!1&&x.push(E),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||h!==y-1)&&x.push("|")}m.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return m.join(`
483
- `)}function $5(e){return e==null?"":String(e)}function xx(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 B5=rc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U5(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),q5);return i(),l}function q5(e,t,n){return">"+(n?"":" ")+e}function H5(e,t){return yx(e,t.inConstruct,!0)&&!yx(e,t.notInConstruct,!1)}function yx(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function vx(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const s=n.unsafe[i];if(s.character===`
484
- `&&!s.before&&!s.after&&H5(n.stack,s))return/[\t ]/.test(r.before)?"":" "}return`\\
485
- `}function V5(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>l&&(l=s):s=1,i=r+t.length,r=n.indexOf(t,i);return l}function W5(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Q5(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 K5(e,t,n,r){const i=Q5(n),s=e.value||"";if(W5(e,n)){const h=n.enter("codeIndented"),p=n.indentLines(s,G5);return h(),p}const l=n.createTracker(r),o=i.repeat(Math.max(V5(s,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let d=l.move(o);if(e.lang){const h=n.enter(`codeFencedLang${c}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${c}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
486
- `,encode:["`"],...l.current()})),h()}return d+=l.move(`
487
- `),s&&(d+=l.move(s+`
488
- `)),d+=l.move(o),u(),d}function G5(e,t,n){return(n?"":" ")+e}function bp(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 Y5(e,t,n,r){const i=bp(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
489
- `,...u.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),l(),c}function X5(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 Nu(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function _s(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function sw(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wx(e,t,n){const r=yi(e),i=yi(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function J5(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:St(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,s=e.charCodeAt(i);if(!St(s))return;for(;s===45||Ct(s);)s=e.charCodeAt(++i);const l=e.slice(r,i).toLowerCase();return!n&&s!==47&&Ah.includes(l)?1:B0.includes(l)?6:7}const Z5=new Map([["*",!1],["_",!0]]);function eP(e,t,n){const r=new Set;for(const s of e){const l=n.get(s);if(l&&s.attention&&t.some(o=>o.attention===s.attention))for(const o of l.tokens)r.add(o.attention)}const i=[];for(const s of e)s.attention&&r.delete(s.attention)&&i.push(s.attention);return i.reverse(),i}function lw(e,t,n){const r=[],i=new Map,s=new Map;let l=0;for(;l<e.length;){if(!e[l].attention){l++;continue}const o=e[l].value.charAt(0),u=Z5.get(o);let c=l+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const d=l?e[l-1].value:t,h=yi(d.charCodeAt(d.length-1)),p=yi((c<e.length?e[c].value:n).charCodeAt(0)),f=!p||p===2&&!!h,m=!h||h===2&&!!p,g={tokens:e.slice(l,c),markers:[],start:0,end:0,open:u?f&&(!!h||!m):f,close:u?m&&(!!p||!f):m,split:u!==void 0};for(const w of g.tokens){i.set(w,[...g.tokens]),s.set(w,g);let y=w.value.length;for(;y--;)g.markers.push(w)}g.end=g.markers.length,r.push(g),l=c}for(nP(r,i),l=-1;++l<e.length;){const o=i.get(e[l]);if(o)return{attention:eP(e,o,s),index:l}}}function bo(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?Nu(n.value):_s(n.value),i=sw(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let s=n.value.slice(0,n.value.length-r.length),l=0;for(;s.charCodeAt(s.length-1-l)===92;)l++;l%2&&(s+="\\"),n.value=s+i}}function tP(e,t,n,r,i){for(const s of n.attention){const l=t.get(s)||s.sequences[0];for(const o of s.sequences){if(o===l)continue;const u=new Map(t);u.set(s,o);const c=Np(e,u,r,i),d=lw(c,r,i);if(!d||d.index>n.index)return{chosen:u,mistake:d,tokens:c}}}}function nP(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let s=n.get(i);s||(s=[],n.set(i,s));let l=r.close?s.length:0;for(;l--&&r.start<r.end;){const o=s[l],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const d=r.split?u>1&&c>1?2:1:c,h=o.markers.slice(o.end-d,o.end),p=r.markers.slice(r.start,r.start+d),f=h[0],m=p[0];if(f===h[d-1]&&f.value.length===d&&m===p[d-1]&&m.value.length===d&&f.attention===m.attention)t.delete(f),t.delete(m);else{const g=[...new Set([...h,...p])];for(const w of g){const y=t.get(w);y&&y.push(...g)}}o.end-=d,r.start+=d,o.start===o.end&&s.splice(l,1),l=s.length}r.open&&r.start<r.end&&s.push(r)}}function rP(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!R0(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const s of n)r.push(i.repeat(s))}return r}function iP(e,t,n){const r=t.indexStack,i=e.children||[],s=[];let l=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++l<i.length;){const c=i[l];let d;if(r[r.length-1]=l,l+1<i.length){let f=t.handle.handlers[i[l+1].type];f&&f.peek&&(f=f.peek),d=f?Nu(f(i[l+1],e,t,{before:"",after:"",...u.current()})):""}else d=n.after;const h=s[s.length-1];typeof h=="string"&&(o==="\r"||o===`
490
- `)&&c.type==="html"&&J5(c.value)!==7&&(s[s.length-1]=h.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(lc(s,n.before,n.after)));const p=t.handle.handlers[c.type];if(p&&p.attention){const f=jp(c,p.attention,t,u);s.push(f),o=_s(f.sequences[0])}else{const f=t.handle(c,e,t,{...u.current(),after:d,before:o});if(!f)continue;u.move(f),s.push(f),o=_s(f)}}return r.pop(),s}function jp(e,t,n,r){const{construct:i,markers:s,sizes:l}=t(e,n),o=rP(e.type,s,l),u=o[0],c=n.enter(i);r.move(u);const d=iP(e,n,{...r.current(),before:u,after:u});return r.move(lc(d,u,u)),r.move(u),c(),{children:d,sequences:o}}function Np(e,t,n,r){const i=[];let s,l=_s(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};s&&s===Nu(u)&&bo([v],!0),s=void 0,i.push(v),v.value&&(l=_s(v.value));continue}const c=t.get(u)||u.sequences[0],d=c.charAt(0),h=e[o+1],p=l,f=Nu(h===void 0?r:typeof h=="string"?h:t.get(h)||h.sequences[0]),m=Np(u.children,t,c,c),g=m.length>0?m[0].value:"",w=wx(p.charCodeAt(p.length-1),g.charCodeAt(0),d);w.inside&&bo(m,!0);const y=m.length>0?_s(m[m.length-1].value):"",x=wx(f.charCodeAt(0),y.charCodeAt(y.length-1),d);x.inside&&bo(m,!1),w.outside&&p!==`
491
- `&&p!=="\r"&&bo(i,!1),x.outside&&(s=f),i.push({value:c,attention:u},...m,{value:c,attention:u}),l=c.charAt(c.length-1)}return i}function lc(e,t,n){let r=new Map;const i=Np(e,r,t,n);let s=i,l=lw(s,t,n);for(;l;){const u=tP(e,r,l,t,n);if(!u){s=i;break}r=u.chosen,s=u.tokens,l=u.mistake}let o="";for(const u of s)o+=u.value;return o}Sp.attention=aw;Sp.peek=sP;function Sp(e,t,n,r){const i=n.enter("phrasing"),s=jp(e,aw,n,n.createTracker(r)),l=lc([s],r.before,r.after);return i(),l}function aw(e,t){return{construct:"emphasis",markers:X5(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function sP(e,t,n){return n.options.emphasis||"*"}function lP(e,t){let n=!1;return sc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,na}),!!((!e.depth||e.depth<3)&&Zu(e)&&(t.options.setext||n))}function aP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(lP(e,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
492
- `,after:`
493
- `});return p(),h(),f+`
494
- `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
495
- `))+1))}const l="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
496
- `,...s.current()});const d=c.charCodeAt(0);return(d===9||d===32)&&(c=sw(d)+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),u(),o(),c}ow.peek=oP;function ow(e){return e.value||""}function oP(){return"<"}uw.peek=uP;function uw(e,t,n,r){const i=bp(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),l(),c}function uP(){return"!"}cw.peek=cP;function cw(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),l();const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"}),l=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return l(),n.stack=d,s(),i==="full"||!c||c!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function cP(){return"!"}dw.peek=dP;function dw(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const l=n.unsafe[s],o=n.compilePattern(l);if(!l.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function dP(){return"`"}function hw(e,t){const n=Zu(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))}fw.peek=hP;function fw(e,t,n,r){const i=bp(n),s=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);if(hw(e,n)){const m=n.stack;n.stack=m.filter(function(y){return y!=="phrasing"});const g=n.enter("autolink");let w=l.move("<");return w+=l.move(n.containerPhrasing(e,{before:w,after:">",...l.current()})),w+=l.move(">"),g(),n.stack=m,w}const o=n.enter("link");let u=n.enter("label"),c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"](",...l.current()});c+=l.move(d),u(),c+=l.move("](");const h=/[\0- \u007F]/.test(e.url),p=r.before.charAt(r.before.length-1);let f=e.title||void 0;if(!f&&!h&&(p===`
497
- `||p==="\r")){let m=0;for(;m<d.length&&d.charCodeAt(m)!==93;)m+=d.charCodeAt(m)===92?2:1;d.charCodeAt(m+1)===58&&(f="")}return!e.url&&typeof f=="string"||h?(u=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(u=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:typeof f=="string"?" ":")",...l.current()}))),u(),typeof f=="string"&&(u=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(f,{before:c,after:i,...l.current()})),c+=l.move(i),u()),c+=l.move(")"),o(),c}function hP(e,t,n){return hw(e,n)?"<":"["}pw.peek=fP;function pw(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),l();const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"}),l=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return l(),n.stack=d,s(),i==="full"||!c||c!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function fP(){return"["}function Cp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pP(e){const t=Cp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function mP(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 mw(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 gP(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?mP(n):Cp(n);const o=e.ordered?l==="."?")":".":pP(n);let u=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&d&&(!d.children||!d.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&&(u=!0),mw(n)===l&&d){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=s,i(),c}function xP(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 yP(e,t,n,r){const i=xP(n);let s=n.bulletCurrent||Cp(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(l-s.length)),o.shift(l);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return u(),c;function d(h,p,f){return p?(f?"":" ".repeat(l))+h:(f?s:s+" ".repeat(l-s.length))+h}}function vP(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,r);return s(),i(),l}function wP(e,t,n,r){if(!e.children.some(function(o){return B5(o)}))return n.containerFlow(e,r);const s=n.enter("phrasing"),l=n.containerPhrasing(e,r);return s(),l}function kP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ep.attention=gw;Ep.peek=bP;function Ep(e,t,n,r){const i=n.enter("phrasing"),s=jp(e,gw,n,n.createTracker(r)),l=lc([s],r.before,r.after);return i(),l}function gw(e,t){return{construct:"strong",markers:kP(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function bP(e,t,n){return n.options.strong||"*"}function jP(e,t,n,r){const i=t?t.children:[],s=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[s+1],beforeNode:i[s-1]})}function NP(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 SP(e,t,n){const r=(mw(n)+(n.options.ruleSpaces?" ":"")).repeat(NP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const xw={blockquote:U5,break:vx,code:K5,definition:Y5,emphasis:Sp,hardBreak:vx,heading:aP,html:ow,image:uw,imageReference:cw,inlineCode:dw,link:fw,linkReference:pw,list:gP,listItem:yP,paragraph:vP,root:wP,strong:Ep,text:jP,thematicBreak:SP};function CP(){return{enter:{table:EP,tableData:kx,tableHeader:kx,tableRow:TP},exit:{codeText:LP,table:PP,tableData:sd,tableHeader:sd,tableRow:sd}}}function EP(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function PP(e){this.exit(e),this.data.inTable=void 0}function TP(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function sd(e){this.exit(e)}function kx(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function LP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function MP(e,t){return t==="|"?t:e}function RP(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,s=n?" ":"|";return{handlers:{inlineCode:p,table:l,tableCell:u,tableRow:o},join:[zP],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
498
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function l(f,m,g,w){const y=d(f,g,w),x=y[0];if(x){let v=f.align?f.align.length:0,j=-1;if(!v)for(;++j<y.length;)y[j].length>v&&(v=y[j].length);for(;x.length<v;)x.push("")}return c(y,f.align)}function o(f,m,g,w){const y=h(f,g,w),x=c([y]);return x.slice(0,x.indexOf(`
499
- `))}function u(f,m,g,w){const y=g.enter("tableCell"),x=g.enter("phrasing"),v=g.containerPhrasing(f,{...w,before:s,after:s});return x(),y(),v}function c(f,m){return _5(f,{align:m,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function d(f,m,g){const{children:w}=f;let y=-1;const x=[],v=m.enter("table");for(;++y<w.length;)x[y]=h(w[y],m,g);return v(),x}function h(f,m,g){const{children:w}=f;let y=-1;const x=[],v=m.enter("tableRow");for(;++y<w.length;)x[y]=u(w[y],f,m,g);return v(),x}function p(f,m,g){const w=xw.inlineCode(f,m,g);if(!g.stack.includes("tableCell"))return w;const y=[];let x=0,v=w.indexOf("|");for(;v!==-1;){let j=v;for(;j>x&&w.charCodeAt(j-1)===92;)j--;y.push(w.slice(x,v)),(v-j)%2===0&&y.push("\\"),x=v,v=w.indexOf("|",v+1)}return y.push(w.slice(x)),y.join("")}}function zP(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&AP(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function AP(e,t){let n=!1;return sc(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,na}),!!((!e.depth||e.depth<3)&&Zu(e)&&(t.options.setext||n))}function IP(){return{exit:{taskListCheckValueChecked:bx,taskListCheckValueUnchecked:bx,paragraph:DP}}}function FP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OP}}}function bx(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function DP(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 r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,l;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function OP(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(l);let u=xw.listItem(e,t,n,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(d){return d+l}}function _P(){return[a5(),P5(),R5(),CP(),IP()]}function $P(e){return{extensions:[o5(),T5(e),z5(),RP(e),FP()]}}const BP={tokenize:QP,partial:!0},yw={tokenize:KP,partial:!0},vw={tokenize:GP,partial:!0},ww={tokenize:YP,partial:!0},UP={tokenize:XP,partial:!0},kw={name:"wwwAutolink",tokenize:VP,previous:jw},bw={name:"protocolAutolink",tokenize:WP,previous:Nw},_r={name:"emailAutolink",tokenize:HP,previous:Sw},gr={};function qP(){return{text:gr}}let Pi=48;for(;Pi<123;)gr[Pi]=_r,Pi++,Pi===58?Pi=65:Pi===91&&(Pi=97);gr[43]=_r;gr[45]=_r;gr[46]=_r;gr[95]=_r;gr[72]=[_r,bw];gr[104]=[_r,bw];gr[87]=[_r,kw];gr[119]=[_r,kw];function HP(e,t,n){const r=this;let i,s;return l;function l(h){return!Bh(h)||!Sw.call(r,r.previous)||Pp(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return Bh(h)?(e.consume(h),o):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(UP,d,c)(h):h===45||h===95||Ct(h)?(s=!0,e.consume(h),u):d(h)}function c(h){return e.consume(h),i=!0,u}function d(h){return s&&i&&St(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function VP(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!jw.call(r,r.previous)||Pp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BP,e.attempt(yw,e.attempt(vw,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function WP(e,t,n){const r=this;let i="",s=!1;return l;function l(h){return(h===72||h===104)&&Nw.call(r,r.previous)&&!Pp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(St(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),s?c:(s=!0,u)):n(h)}function c(h){return h===null||wu(h)||$e(h)||as(h)||ec(h)?n(h):e.attempt(yw,e.attempt(vw,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function QP(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function KP(e,t,n){let r,i,s;return l;function l(c){return c===46||c===95?e.check(ww,u,o)(c):c===null||$e(c)||as(c)||c!==45&&ec(c)?u(c):(s=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),l}function u(c){return i||r||!s?n(c):t(c)}}function GP(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<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(ww,t,s)(l):l===null||$e(l)||as(l)?t(l):(e.consume(l),i)}function s(l){return l===41&&r++,e.consume(l),i}}function YP(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||$e(o)||as(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||$e(o)||as(o)?t(o):r(o)}function s(o){return St(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):St(o)?(e.consume(o),l):n(o)}}function XP(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ct(s)?n(s):t(s)}}function jw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$e(e)}function Nw(e){return!St(e)}function Sw(e){return!(e===47||Bh(e))}function Bh(e){return e===43||e===45||e===46||e===95||Ct(e)}function Pp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JP={tokenize:lT,partial:!0};function ZP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rT,continuation:{tokenize:iT},exit:sT}},text:{91:{name:"gfmFootnoteCall",tokenize:nT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eT,resolveTo:tT}}}}function eT(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!l||!l._balanced)return n(u);const c=Vn(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function tT(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 r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.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)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function nT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!l||h===null||h===91||$e(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Vn(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return $e(h)||(l=!0),s++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function rT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,o;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(l>999||m===93&&!o||m===null||m===91||$e(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Vn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $e(m)||(o=!0),l++,e.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),ze(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function iT(e,t,n){return e.check(Va,t,e.attempt(JP,t,n))}function sT(e){e.exit("gfmFootnoteDefinition")}function lT(e,t,n){const r=this;return ze(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function aT(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let c=u;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[u][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[u][1].end)},h={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",d,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&Hn(p,p.length,0,tc(f,l.slice(c+1,u),o)),Hn(p,p.length,0,[["exit",h,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",d,o]]),Hn(l,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function s(l,o,u){const c=this.previous,d=this.events;let h=0;return p;function p(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?u(m):(l.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const g=yi(c);if(m===126)return h>1?u(m):(l.consume(m),h++,f);if(h<2&&!n)return u(m);const w=l.exit("strikethroughSequenceTemporary"),y=yi(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,o(m)}}}class oT{constructor(){this.map=[],this.index=new Map}add(t,n,r){uT(this,t,n,r)}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 r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}}function uT(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}function cT(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dT(){return{flow:{null:{name:"table",tokenize:hT,resolveAll:fT}}}}function hT(e,t,n){const r=this;let i=0,s=0,l;return o;function o(C){let O=r.events.length-1;for(;O>-1;){const{type:q}=r.events[O][1];if(q==="lineEnding"||q==="linePrefix")O--;else break}const I=O>-1?r.events[O][1].type:null,Q=I==="tableHead"||I==="tableRow"?k:u;return Q===k&&r.parser.lazy[r.now().line]?n(C):Q(C)}function u(C){return e.enter("tableHead"),e.enter("tableRow"),c(C)}function c(C){return C===124||(l=!0,s+=1),d(C)}function d(C){return C===null?n(C):de(C)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),f):n(C):je(C)?ze(e,d,"whitespace")(C):(s+=1,l&&(l=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),l=!0,d):(e.enter("data"),h(C)))}function h(C){return C===null||C===124||$e(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?p:h)}function p(C){return C===92||C===124?(e.consume(C),h):h(C)}function f(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),l=!1,je(C)?ze(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):m(C))}function m(C){return C===45||C===58?w(C):C===124?(l=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):E(C)}function g(C){return je(C)?ze(e,w,"whitespace")(C):w(C)}function w(C){return C===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),y):C===45?(s+=1,y(C)):C===null||de(C)?j(C):E(C)}function y(C){return C===45?(e.enter("tableDelimiterFiller"),x(C)):E(C)}function x(C){return C===45?(e.consume(C),x):C===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return je(C)?ze(e,j,"whitespace")(C):j(C)}function j(C){return C===124?m(C):C===null||de(C)?!l||i!==s?E(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):E(C)}function E(C){return n(C)}function k(C){return e.enter("tableRow"),S(C)}function S(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),S):C===null||de(C)?(e.exit("tableRow"),t(C)):je(C)?ze(e,S,"whitespace")(C):(e.enter("data"),M(C))}function M(C){return C===null||C===124||$e(C)?(e.exit("data"),S(C)):(e.consume(C),C===92?F:M)}function F(C){return C===92||C===124?(e.consume(C),M):M(C)}}function fT(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],o=!1,u=0,c,d,h;const p=new oT;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(jx(p,t,u,c,d),d=void 0,u=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",d,t]])),i=m.type==="tableDelimiterRow"?2:d?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],h=jo(p,t,s,i,void 0,h),s=[0,0,0,0]),l[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],h=jo(p,t,s,i,void 0,h)),s=l,l=[s[1],n,0,0])):m.type==="tableHead"?(o=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,s[1]!==0?(l[0]=l[1],h=jo(p,t,s,i,n,h)):l[1]!==0&&(h=jo(p,t,l,i,n,h)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&jx(p,t,u,c,d),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=cT(t.events,n))}return e}function jo(e,t,n,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},vs(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const u=vs(t.events,n[1]);if(s={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=vs(t.events,n[2]),d=vs(t.events,n[3]),h={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},vs(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function jx(e,t,n,r,i){const s=[],l=vs(t.events,n);i&&(i.end=Object.assign({},l),s.push(["exit",i,t])),r.end=Object.assign({},l),s.push(["exit",r,t]),e.add(n+1,0,s)}function vs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pT={name:"tasklistCheck",tokenize:gT};function mT(){return{text:{91:pT}}}function gT(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return $e(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return de(u)?t(u):je(u)?e.check({tokenize:xT},t,n)(u):n(u)}}function xT(e,t,n){return ze(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function yT(e){return L0([qP(),ZP(),aT(e),dT(),mT()])}const vT={};function wT(e){const t=this,n=e||vT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(yT(n)),s.push(_P()),l.push($P(n))}let kT=null;const bT=()=>kT??(kT=dl(()=>import("./index-DM-V8yrZ.js"),[])),jT={sh:"bash",yml:"yaml",ts:"typescript",js:"javascript",py:"python"};function NT(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ST({lang:e,code:t}){const[n,r]=b.useState(`<pre><code>${NT(t)}</code></pre>`);return b.useEffect(()=>{let i=!0;const s=jT[e]??e;return bT().then(async l=>{const o=await l.codeToHtml(t,{lang:s in l.bundledLanguages?s:"text",themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1});i&&r(o)}).catch(()=>{}),()=>{i=!1}},[e,t]),a.jsx("div",{dangerouslySetInnerHTML:{__html:n}})}const CT={background:"#fdf6e3",mainBkg:"#eee8d5",primaryColor:"#eee8d5",primaryTextColor:"#586e75",primaryBorderColor:"#268bd2",nodeBorder:"#268bd2",lineColor:"#839496",secondaryColor:"#eee8d5",tertiaryColor:"#eee8d5",textColor:"#586e75",edgeLabelBackground:"#fdf6e3",clusterBkg:"#eee8d5",clusterBorder:"#ddd6c1",fontSize:"14px"},ET={background:"#1f1f1f",mainBkg:"#2a2d2e",primaryColor:"#2a2d2e",primaryTextColor:"#cccccc",primaryBorderColor:"#3794ff",nodeBorder:"#3794ff",lineColor:"#9d9d9d",secondaryColor:"#2a2d2e",tertiaryColor:"#2a2d2e",textColor:"#cccccc",edgeLabelBackground:"#1f1f1f",clusterBkg:"#2a2d2e",clusterBorder:"#2b2b2b",fontSize:"14px"};let PT=null;const TT=()=>PT??(PT=dl(()=>import("./mermaid.core-QonkHgY_.js").then(e=>e.b6),[]).then(e=>e.default));function LT({code:e}){const t=b.useId().replace(/[^a-zA-Z0-9]/g,""),n=sk(),[r,i]=b.useState(""),[s,l]=b.useState(!1);b.useEffect(()=>{let c=!0;return TT().then(async d=>{d.initialize({startOnLoad:!1,theme:"base",securityLevel:"strict",fontFamily:"system-ui, -apple-system, Segoe UI, Ubuntu, sans-serif",themeVariables:n?ET:CT,flowchart:{useMaxWidth:!0,curve:"basis",nodeSpacing:30,rankSpacing:40,padding:8,htmlLabels:!0}});try{const h=await d.render(`m${t}${n?"d":"l"}`,e);c&&(i(h.svg),l(!1))}catch{c&&l(!0)}}),()=>{c=!1}},[e,n,t]);const[o,u]=b.useState(!1);return b.useEffect(()=>{if(!o)return;const c=d=>{d.key==="Escape"&&u(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[o]),s?a.jsx("pre",{children:e}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative my-6",children:[a.jsx("div",{className:"md-figure flex cursor-zoom-in justify-center rounded-md border border-line bg-panel p-4",title:"Click to enlarge",onClick:()=>u(!0),dangerouslySetInnerHTML:{__html:r}}),a.jsx("span",{className:"pointer-events-none absolute right-3 top-2 text-[11px] text-muted",children:"click to enlarge"})]}),o&&a.jsx("div",{className:"fixed inset-0 z-50 grid cursor-zoom-out place-items-center bg-ink/40 p-6 backdrop-blur-sm",onClick:()=>u(!1),children:a.jsx("div",{className:"md-figure-big max-h-full max-w-full overflow-auto rounded-md border border-line bg-panel p-6",onClick:c=>c.stopPropagation(),dangerouslySetInnerHTML:{__html:r}})})]})}function Cw(e){return e.split(/(```[\s\S]*?```|`[^`\n]*`)/g).map((t,n)=>n%2?t:t.replace(/ -> /g," → ")).join("")}const MT=/\blines?\s+(\d+(?:\s*(?:[-–]|to|,|and)\s*\d+)*)/gi,RT=/(\d+)|([-–]|to|,|and)/gi;function Nx(e){return/^[a-z]+$/i.test(e)?` ${e} `:e===","?", ":e}function zT(e){return e.split(/(```[\s\S]*?```|`[^`\n]*`)/g).map((t,n)=>n%2?t:t.replace(MT,(r,i)=>{var u;const s=r.slice(0,r.length-i.length),l=[...i.matchAll(RT)];let o="";for(let c=0;c<l.length;c++){const d=l[c][1];if(!d)continue;const h=l[c+1];if(h&&!h[1]&&/^(-|–|to)$/i.test(h[2]??"")&&((u=l[c+2])!=null&&u[1])){const f=l[c+2][1];o+=`[${d}${Nx(h[2])}${f}](codeline:${d}-${f})`,c+=2}else o+=`[${d}](codeline:${d}-${d})`,h&&(o+=Nx(h[2]))}return s+o})).join("")}const Ew=[wT],Pw=b.createContext(void 0),AT={code({className:e,children:t,...n}){var i;const r=(i=/language-(\w+)/.exec(e??""))==null?void 0:i[1];return r==="mermaid"?a.jsx(LT,{code:String(t).trim()}):r?a.jsx(ST,{lang:r,code:String(t).replace(/\n$/,"")}):a.jsx("code",{className:e,...n,children:t})},pre({children:e}){var r;const t=Array.isArray(e)?e[0]:e;return(((r=t==null?void 0:t.props)==null?void 0:r.className)??"").includes("language-")?a.jsx(a.Fragment,{children:e}):a.jsx("pre",{children:e})},a:function({href:t,children:n}){const r=b.useContext(Pw),i=r&&/^codeline:(\d+)-(\d+)$/.exec(t??"");return i?a.jsx("button",{type:"button",className:"codeline",onClick:()=>r(Number(i[1]),Number(i[2])),children:n}):a.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:n})}},IT=e=>e,Xi=b.memo(function({children:t,className:n,onLineClick:r}){const i=b.useMemo(()=>Cw(t),[t]);return a.jsx("div",{className:n?`prose-g ${n}`:"prose-g",children:a.jsx(Pw.Provider,{value:r,children:a.jsx(tw,{remarkPlugins:Ew,urlTransform:r?IT:void 0,components:AT,children:i})})})}),FT={p:({children:e})=>a.jsxs(a.Fragment,{children:[e," "]}),a:({href:e,children:t})=>a.jsx("a",{href:e,target:"_blank",rel:"noreferrer",children:t})},ur=b.memo(function({children:t,className:n}){const r=b.useMemo(()=>Cw(t),[t]);return a.jsx("span",{className:n?`md-inline ${n}`:"md-inline",children:a.jsx(tw,{remarkPlugins:Ew,components:FT,children:r})})});function DT({trace:e,onStep:t}){const{rel:n}=it(),[r,i]=b.useState(0),s=e.steps[r],l=r>0?e.steps[r-1].state:{};b.useEffect(()=>{t(s.file,s.line)},[r]);const o=[...new Set([...Object.keys(l),...Object.keys(s.state)])];return a.jsxs("div",{className:"card overflow-hidden",tabIndex:0,onKeyDown:u=>{u.key==="ArrowRight"&&i(c=>Math.min(e.steps.length-1,c+1)),u.key==="ArrowLeft"&&i(c=>Math.max(0,c-1))},children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-raised/60 px-4 py-2 text-xs",children:[a.jsx(a2,{className:"h-3.5 w-3.5 text-accent"}),a.jsx("span",{className:"text-muted",children:"Input"}),a.jsx("code",{className:"font-mono",children:e.input})]}),a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[a.jsx("button",{className:"rounded-md border border-line p-1 hover:bg-raised disabled:opacity-40",disabled:r===0,onClick:()=>i(r-1),"aria-label":"Previous step",children:a.jsx(mu,{className:"h-4 w-4"})}),a.jsx("input",{type:"range",min:0,max:e.steps.length-1,value:r,onChange:u=>i(Number(u.target.value)),className:"flex-1 accent-[rgb(var(--accent))]"}),a.jsx("button",{className:"rounded-md border border-line p-1 hover:bg-raised disabled:opacity-40",disabled:r===e.steps.length-1,onClick:()=>i(r+1),"aria-label":"Next step",children:a.jsx(ba,{className:"h-4 w-4"})}),a.jsxs("span",{className:"w-16 text-right font-mono text-xs text-muted",children:[r+1,"/",e.steps.length]})]}),a.jsxs("div",{className:"px-4 pb-1 text-[14.5px]",children:[s.file&&a.jsxs("span",{className:"mr-2 font-mono text-[12px] text-accent",children:[n(s.file),s.line?`:${s.line}`:""]}),s.note]}),a.jsx("table",{className:"m-4 mt-2 w-[calc(100%-2rem)] text-[13.5px]",children:a.jsx("tbody",{children:o.map(u=>{const c=l[u],d=s.state[u],h=c!==d;return a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-1 pr-3 font-mono text-muted",children:u}),a.jsxs("td",{className:le("py-1 font-mono",h&&r>0&&"text-accent"),children:[d??a.jsx("span",{className:"text-muted line-through",children:c}),h&&r>0&&c!==void 0&&d!==void 0&&a.jsxs("span",{className:"ml-2 text-[12px] text-muted",children:["was ",c]})]})]},u)})})}),a.jsx("div",{className:"border-t border-line px-4 py-1.5 text-[12px] text-muted",children:"Arrow keys step when this box has focus. Changed values are coloured."})]})}function OT(e){return e.startLine&&e.endLine?[e.startLine,e.endLine]:e.line?[Math.max(1,e.line-3),e.line+6]:null}function Ti({icon:e,children:t,aside:n}){return a.jsxs("div",{className:"mb-5 mt-16 flex items-center gap-3",children:[a.jsxs("h2",{className:"flex items-center gap-2 text-[22px] font-semibold tracking-[-0.015em]",children:[e&&a.jsx("span",{className:"text-muted [&>svg]:h-[18px] [&>svg]:w-[18px]",children:e}),t]}),n&&a.jsx("div",{className:"ml-auto",children:n})]})}function _T(){const{id:e=""}=Or(),{project:t,rel:n,selected:r,setOpenFile:i,setSelected:s}=it(),l=gt(),o=mn(),u=mn(),c=mn(),[d,h]=b.useState(""),[p,f]=b.useState(!0),[m,g]=b.useState(null),[w,y]=b.useState(null),[x,v]=b.useState("all"),[j,E]=b.useState(0),k=xe({queryKey:["lens",t.id,e],queryFn:()=>me(`/projects/${t.id}/lenses/${e}`)}),S=k.data,M=b.useMemo(()=>[...new Set([...(S==null?void 0:S.deepDives)??[],...((S==null?void 0:S.followUps)??[]).flatMap(z=>z.deepDives)].map(z=>z.file).filter(z=>!!z))],[S]),F=Fj({queries:M.map(z=>({queryKey:["file",t.id,z],queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(z)}`),staleTime:6e4}))}),C=b.useMemo(()=>new Map(M.map((z,H)=>{var N;return[z,(N=F[H])==null?void 0:N.data]})),[M,F]);if(k.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!S)return a.jsx(Ft,{title:"Lens not found"});const O=(z,H)=>{z&&g({file:z,line:H})},I=z=>{s([z]),i(z),l(`/p/${t.id}/explore`)},Q=r.filter(z=>!S.files.includes(z)),q=()=>c.run(`/projects/${t.id}/lenses/${S.id}/more`,{question:d,files:p?Q:[]},()=>{h(""),k.refetch()}),$=S.deepDives,G=x==="all"?$.map((z,H)=>[z,H]):$[j]?[[$[j],j]]:[],Y=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("article",{className:"lens py-10",children:[a.jsxs(ft,{to:`/p/${t.id}/library`,className:"inline-flex items-center gap-1 text-[13px] text-muted hover:text-ink",children:[a.jsx(Vf,{className:"h-3.5 w-3.5"})," Library"]}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[a.jsxs(ke,{tone:"accent",children:[S.kind," lens"]}),S.depth&&S.depth!=="standard"&&a.jsx(ke,{children:S.depth}),S.diff&&a.jsxs(ke,{tone:"warn",children:["change ",S.diff.base,"..",S.diff.head||"working tree"]}),a.jsx("span",{className:"text-[13px] text-muted",children:It(S.createdAt)}),a.jsxs("a",{href:`/api/projects/${t.id}/lenses/${S.id}/export`,className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-[13px] text-muted hover:bg-raised hover:text-ink",title:"Download as markdown",children:[a.jsx(Kf,{className:"h-3.5 w-3.5"})," .md"]})]}),a.jsx("h1",{className:"mt-4 text-[36px] font-bold leading-[1.1] tracking-[-0.02em]",children:S.title}),a.jsx("p",{className:"mt-3 text-[16.5px] leading-relaxed text-muted",children:S.question}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[S.files.slice(0,6).map(z=>a.jsxs("button",{onClick:()=>O(z),title:n(z),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-ink/5 px-2 py-1 font-mono text-[12px] text-muted hover:text-accent",children:[a.jsx(ol,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:hr(n(z),64)})]},z)),S.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",S.files.length-6," more"]})]}),S.changed.length>0&&a.jsxs("div",{className:"mt-6 flex items-center gap-3 rounded-md border border-warn/40 bg-warn/8 px-4 py-3 text-[14px]",children:[a.jsx(e2,{className:"h-4 w-4 shrink-0 text-warn"}),a.jsxs("div",{className:"min-w-0 flex-1",children:["The code changed since this lens was made (",S.changed.map(z=>n(z)).join(", "),"). It may be out of date."]}),a.jsx(Z,{size:"sm",icon:a.jsx(o2,{className:"h-3.5 w-3.5"}),disabled:u.busy,onClick:()=>u.run(`/projects/${t.id}/lenses/${S.id}/refresh`,{},z=>l(`/p/${t.id}/lens/${z.resultId}`,{replace:!0})),children:"Refresh"})]}),u.busy&&u.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"lens",elapsed:u.elapsed})}),u.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:u.error,onClose:u.clearError})}),a.jsxs("div",{className:"mt-10 border-l-[3px] border-accent py-1 pl-5",children:[a.jsx("div",{className:"text-[11.5px] font-semibold uppercase tracking-[0.08em] text-accent",children:"The idea in one sentence"}),a.jsx("p",{className:"read-lead mt-2",children:a.jsx(ur,{children:S.tldr||S.summary})})]}),S.whyItMatters&&a.jsxs("p",{className:"read mt-6",children:[a.jsx("strong",{children:"Why it matters."})," ",a.jsx(ur,{children:S.whyItMatters})]}),S.tldr&&S.summary&&a.jsx("div",{className:"mt-5",children:a.jsx(Xi,{children:S.summary})}),S.sketch&&a.jsxs("div",{className:"mt-8 rounded-md bg-raised/70 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[15px] font-semibold",children:[a.jsx($1,{className:"h-4 w-4 text-accent"})," ",S.diff?"Your prediction":"Your take",", and where it differs"]}),a.jsxs("p",{className:"read mt-3 italic text-muted",children:["“",S.sketch,"”"]}),S.differences&&S.differences.length>0&&a.jsx("ul",{className:"read mt-4 space-y-2",children:S.differences.map((z,H)=>a.jsxs("li",{className:"flex gap-2.5",children:[a.jsx("span",{className:"mt-0.5 text-accent",children:"→"}),a.jsx("span",{children:a.jsx(ur,{children:z})})]},H))})]}),S.concepts.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{icon:a.jsx(Wf,{className:"h-5 w-5"}),children:"Words you need first"}),a.jsx("div",{className:"wide lens-concepts grid gap-5",children:S.concepts.map(z=>a.jsx($T,{c:z,onShow:()=>O(z.file,z.line),onCard:()=>y({kind:"concept",front:`What is "${z.term}" in this code, and why does it matter?`,back:z.explain,file:z.file??S.files[0],source:{lensId:S.id}})},z.term))})]}),S.trace&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{children:"Trace a run"}),a.jsx("div",{className:"wide",children:a.jsx(DT,{trace:S.trace,onStep:(z,H)=>O(z??S.files[0],H)})})]}),S.intuition&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{icon:a.jsx(Gf,{className:"h-5 w-5"}),children:"The intuition"}),a.jsx(Xi,{children:S.intuition})]}),$.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(Ti,{aside:a.jsx(qt,{value:x,onChange:z=>{v(z),E(0)},options:[{value:"all",label:"All steps"},{value:"step",label:"One at a time"}]}),children:["Walkthrough ",a.jsxs("span",{className:"text-[15px] font-normal text-muted",children:["· ",$.length," steps"]})]}),x==="step"&&a.jsx("div",{className:"mb-6 flex items-center gap-1.5",children:$.map((z,H)=>a.jsx("button",{title:z.title,onClick:()=>E(H),className:le("h-1.5 flex-1 rounded-full transition",H<j?"bg-accent/50":H===j?"bg-accent":"bg-line")},H))}),a.jsx("ol",{className:"space-y-12 [&>li+li]:border-t [&>li+li]:border-line [&>li+li]:pt-10",children:G.map(([z,H])=>a.jsx(Sx,{d:z,n:H+1,text:z.file?C.get(z.file):void 0,rel:n,onShow:O},H))}),x==="step"&&a.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(mu,{className:"h-4 w-4"}),disabled:j===0,onClick:()=>E(j-1),children:"Back"}),a.jsxs("span",{className:"text-[13px] text-muted",children:["Step ",j+1," of ",$.length]}),a.jsxs(Z,{size:"sm",variant:j<$.length-1?"primary":"secondary",disabled:j===$.length-1,onClick:()=>E(j+1),children:["Next ",a.jsx(ba,{className:"h-4 w-4"})]})]})]}),S.gotchas&&S.gotchas.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{icon:a.jsx(Zf,{className:"h-5 w-5"}),children:"Gotchas"}),a.jsx("ul",{className:"read space-y-3",children:S.gotchas.map((z,H)=>a.jsxs("li",{className:"flex gap-3",children:[a.jsx("span",{className:"mt-[0.55em] h-1.5 w-1.5 shrink-0 rounded-full bg-warn"}),a.jsx("span",{children:a.jsx(ur,{children:z})})]},H))})]}),S.nextSteps&&S.nextSteps.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{icon:a.jsx(Bu,{className:"h-5 w-5"}),children:"Read next"}),a.jsx("div",{className:"space-y-2",children:S.nextSteps.map(z=>a.jsxs("button",{onClick:()=>I(z.file),className:"card flex w-full items-start gap-3 px-4 py-3 text-left transition hover:border-accent/40",children:[a.jsx(ol,{className:"mt-1 h-4 w-4 shrink-0 text-accent"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block font-mono text-[13px]",children:n(z.file)}),a.jsx("span",{className:"read block text-muted",children:a.jsx(ur,{children:z.why})})]})]},z.file))})]}),(S.followUps??[]).length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Ti,{icon:a.jsx(Kj,{className:"h-5 w-5"}),children:"Follow-ups"}),a.jsx("div",{className:"space-y-14",children:S.followUps.map((z,H)=>a.jsxs("div",{children:[a.jsxs("div",{className:"border-l-[3px] border-accent/60 py-1 pl-5",children:[a.jsxs("div",{className:"text-[11.5px] font-semibold uppercase tracking-[0.08em] text-accent",children:["You asked · ",It(z.at)]}),a.jsx("p",{className:"read mt-1 font-medium",children:z.question}),z.files.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:z.files.map(N=>a.jsxs("button",{onClick:()=>O(N),title:n(N),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-ink/5 px-2 py-0.5 font-mono text-[11.5px] text-muted hover:text-accent",children:["+ ",a.jsx("span",{className:"truncate",children:hr(n(N),64)})]},N))})]}),a.jsx("div",{className:"mt-5",children:a.jsx(Xi,{children:z.answer})}),z.deepDives.length>0&&a.jsx("ol",{className:"mt-10 space-y-12 [&>li+li]:border-t [&>li+li]:border-line [&>li+li]:pt-10",children:z.deepDives.map((N,ue)=>a.jsx(Sx,{d:N,n:ue+1,text:N.file?C.get(N.file):void 0,rel:n,onShow:O},ue))})]},H))})]}),a.jsxs("section",{className:"mt-16 rounded-md border border-line p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[17px] font-semibold",children:[a.jsx(Zm,{className:"h-4 w-4 text-accent"})," Ask more about this"]}),a.jsx("p",{className:"read mt-1 text-muted",children:"The answer is added to this lens, not a new one. New terms and gotchas join the lists above."}),a.jsx("textarea",{className:"input mt-4 min-h-[84px] resize-y text-[14px]",placeholder:"e.g. How would this change if the caller were an IAM user instead of a role? Ctrl+Enter to send.",value:d,onChange:z=>h(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.ctrlKey||z.metaKey)&&d.trim()&&!c.busy&&q()}}),Q.length>0&&a.jsxs("label",{className:"mt-2 flex cursor-pointer items-center gap-2 text-[13px] text-muted",children:[a.jsx("input",{type:"checkbox",checked:p,onChange:z=>f(z.target.checked)}),"Also use ",Q.length===1?hr(n(Q[0]),48):`the ${Q.length} ticked files`," as context"]}),a.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[a.jsx(Z,{variant:"primary",icon:a.jsx(Zm,{className:"h-4 w-4"}),disabled:c.busy||!d.trim(),onClick:q,children:"Add to lens"}),Q.length===0&&a.jsx("span",{className:"text-[12.5px] text-muted",children:"Tick files in Explore to add them as extra context."})]}),c.busy&&c.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"lens",elapsed:c.elapsed})}),c.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:c.error,onClose:c.clearError})})]}),a.jsxs("section",{className:"mt-16 rounded-md border border-line bg-raised/40 p-6",children:[a.jsx("div",{className:"text-[17px] font-semibold",children:"Did it land?"}),a.jsx("p",{className:"read mt-1 text-muted",children:"Reading feels like understanding. A quiz on the same files tells you if it is."}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[a.jsx(Z,{variant:"primary",icon:a.jsx(Oa,{className:"h-4 w-4"}),disabled:o.busy,onClick:()=>o.run(`/projects/${t.id}/quizzes`,{lensId:S.id,files:S.files,diff:S.diff},z=>l(`/p/${t.id}/quiz/${z.resultId}`)),children:"Quiz me on this"}),a.jsx(Z,{variant:"ghost",icon:a.jsx(fr,{className:"h-4 w-4"}),onClick:async()=>{await ls(`/projects/${t.id}/lenses/${S.id}`),l(`/p/${t.id}/library`)},children:"Archive"})]}),o.busy&&o.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:o.elapsed})}),o.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:o.error,onClose:o.clearError})}),w&&a.jsx(Ua,{initial:w,onClose:()=>y(null)})]})]})});return a.jsx(Qn,{id:"lens-file",collapsible:!0,startCollapsed:!0,openSignal:m,side:"right",initial:520,min:320,max:900,className:"h-full",left:Y,right:a.jsx(yl,{file:m==null?void 0:m.file,line:m==null?void 0:m.line,empty:"Click a file, a step or a line link to see the whole file here."})})}function $T({c:e,onShow:t,onCard:n}){var o;const[r,i]=b.useState(!1),s=e.explain.length+(((o=e.example)==null?void 0:o.length)??0)>340,l=u=>a.jsxs(a.Fragment,{children:[a.jsx("p",{className:le("read-sm mt-2",u&&"line-clamp-5"),children:a.jsx(ur,{children:e.explain})}),e.example&&a.jsxs("div",{className:le("read-sm mt-3 rounded-lg bg-raised/70 px-3.5 py-2.5 text-muted",u&&"max-h-[9.5rem] overflow-hidden"),children:[a.jsx("div",{className:"mb-1 text-[11.5px] font-semibold uppercase tracking-[0.08em] text-ink/70",children:"Example"}),a.jsx(BT,{text:e.example})]})]});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"card group flex flex-col p-5 transition duration-150 hover:-translate-y-0.5 hover:border-accent/40 hover:shadow-soft",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("div",{className:"flex-1 text-[16px] font-semibold tracking-tight",children:e.term}),e.file&&a.jsx("button",{className:"rounded bg-raised px-1.5 py-0.5 font-mono text-[11.5px] text-muted hover:text-accent",onClick:t,title:"Show in the code",children:e.line?`line ${e.line}`:"code"}),a.jsx("button",{className:"self-center text-muted opacity-0 transition hover:text-accent group-hover:opacity-100",title:"Make a review card",onClick:n,children:a.jsx(Ar,{className:"h-4 w-4"})}),a.jsx("button",{className:le("self-center text-muted transition hover:text-accent",s?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Open to read","aria-label":"Open to read",onClick:()=>i(!0),children:a.jsx(i2,{className:"h-4 w-4"})})]}),l(s),s&&a.jsx("button",{className:"mt-2 self-start text-[12.5px] text-accent hover:underline",onClick:()=>i(!0),children:"Read all"})]}),r&&a.jsx(Xu,{wide:!0,title:e.term,onClose:()=>i(!1),footer:a.jsxs(a.Fragment,{children:[e.file&&a.jsx(Z,{size:"sm",variant:"ghost",onClick:()=>{i(!1),t()},children:"Show in the code"}),a.jsx(Z,{size:"sm",onClick:()=>{i(!1),n()},children:"Make a review card"})]}),children:a.jsx("div",{className:"[&_.read-sm]:!text-[16px] [&_.read-sm]:!leading-[1.65]",children:l(!1)})})]})}function BT({text:e}){const t=e.split(/(`[^`]{36,}`)/g).filter(n=>n.replace(/[\s.,;:]+/g,""));return a.jsx(a.Fragment,{children:t.map((n,r)=>/^`[^`]{36,}`$/.test(n)?a.jsx("pre",{className:"my-2 whitespace-pre-wrap break-words rounded-md border border-line/70 bg-panel px-3 py-2 font-mono text-[12.5px] leading-[1.6] text-ink",children:n.slice(1,-1)},r):a.jsx("p",{children:a.jsx(ur,{children:n})},r))})}function UT(e){return e.split("/").slice(-2).join("/")}function qT(e,t,n){const r=s=>{var l;return((l=/^\s*/.exec(s))==null?void 0:l[0].length)??0},i=r(e[n-1]??"");for(let s=t;s>=Math.max(1,t-25);s--){const l=e[s-1]??"";if(!l.trim())continue;if(/^\s*(def |async def |class |@|function |export |const |func |fn |pub |public |private )/.test(l)&&r(l)<=i||r(l)===0)return s}return t}function Sx({d:e,n:t,text:n,rel:r,onShow:i}){const[s,l]=b.useState(!1),o=OT(e),u=b.useMemo(()=>{if(!n||!o)return null;const d=n.text.split(`
500
- `),h=Math.min(o[1],d.length),p=qT(d,Math.min(o[0],d.length),e.line??o[0]),f=d.slice(p-1,h),m=Math.min(...f.filter(w=>w.trim()).map(w=>{var y;return((y=/^\s*/.exec(w))==null?void 0:y[0].length)??0})),g=f.map(w=>w.slice(Number.isFinite(m)?m:0)).join(`
501
- `);return{first:p,last:h,body:g}},[n,o==null?void 0:o[0],o==null?void 0:o[1],e.line]),c=b.useMemo(()=>e.line?[{from:e.line,to:e.line,cls:"hl"}]:[],[e.line]);return a.jsxs("li",{className:"lens-step",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("span",{className:"font-mono text-[13px] font-semibold tabular-nums text-accent/80",children:String(t).padStart(2,"0")}),a.jsx("h3",{className:"text-[18px] font-semibold leading-[1.3] tracking-tight",children:e.title})]}),a.jsx("div",{className:"mt-3",children:a.jsx(Xi,{children:e.body})})]}),u&&e.file&&a.jsxs("div",{className:"min-w-0 overflow-hidden rounded-md border border-line bg-panel",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line bg-raised/60 px-3 py-1.5 font-mono text-[12px] text-muted",children:[a.jsxs("span",{className:"truncate",title:r(e.file),children:[UT(r(e.file)),":",u.first,"–",u.last]}),a.jsx("button",{className:"shrink-0 font-sans hover:text-accent",onClick:()=>i(e.file,e.line),children:"open file"})]}),a.jsx("div",{className:"lens-step-code",children:a.jsx(qa,{text:u.body,lang:n.lang,firstLine:u.first,marks:c,onLineClick:d=>i(e.file,d)})})]}),e.pitfall&&a.jsxs("p",{className:"read-sm flex gap-2.5 rounded-r-lg border-l-[3px] border-warn bg-warn/5 px-4 py-3",children:[a.jsx(Zf,{className:"mt-[0.25em] h-4 w-4 shrink-0 text-warn"}),a.jsxs("span",{children:[a.jsx("strong",{children:"Pitfall."})," ",a.jsx(ur,{children:e.pitfall})]})]}),e.check&&a.jsxs("div",{className:"read-sm rounded-r-lg border-l-[3px] border-accent bg-accent/5 px-4 py-3",children:[a.jsxs("p",{children:[a.jsx("strong",{className:"text-accent",children:"Check yourself."})," ",a.jsx(ur,{children:e.check.q})]}),s?a.jsx("p",{className:"mt-3 border-t border-line/70 pt-3 text-ink/85",children:a.jsx(ur,{children:e.check.a})}):a.jsxs("button",{className:"mt-2 inline-flex items-center gap-1.5 font-sans text-[13px] text-muted hover:text-ink",onClick:()=>l(!0),children:[a.jsx(M1,{className:"h-3.5 w-3.5"})," Think first, then show the answer"]})]})]})}function HT(){const{id:e=""}=Or(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=xe({queryKey:["quiz",t.id,e],queryFn:()=>me(`/projects/${t.id}/quizzes/${e}`)}),[l,o]=b.useState({}),[u,c]=b.useState(!1),[d,h]=b.useState(null),[p,f]=b.useState(null),[m,g]=b.useState(null),w=mn(),y=xe({queryKey:["file",t.id,p==null?void 0:p.file],queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(p.file)}`),enabled:!!p}),x=s.data,v=(x==null?void 0:x.attempts)??[],j=v[v.length-1],E=u?void 0:d!==null?v[d]:j,k=`cognitune.quiz.${e}`;b.useEffect(()=>{try{const I=sessionStorage.getItem(k);I&&o(JSON.parse(I))}catch{}},[k]),b.useEffect(()=>{try{sessionStorage.setItem(k,JSON.stringify(l))}catch{}},[k,l]);const S=b.useMemo(()=>Object.values(l).filter(I=>I.answer.trim()).length,[l]);if(s.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!x)return a.jsx(Ft,{title:"Quiz not found"});const M=(I,Q)=>o(q=>({...q,[I]:{...q[I]??{qid:I,answer:"",sure:!1},...Q}})),F=()=>i.run(`/projects/${t.id}/quizzes/${x.id}/attempts`,{answers:Object.values(l)},()=>{c(!1),h(null),o({});try{sessionStorage.removeItem(k)}catch{}}),C=E?E.grades.filter(I=>{var Q;return I.verdict==="wrong"&&((Q=E.answers.find(q=>q.qid===I.qid))==null?void 0:Q.sure)}).length:0,O=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsxs(ft,{to:`/p/${t.id}/library`,className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",children:[a.jsx(Vf,{className:"h-3.5 w-3.5"})," Library"]}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[a.jsx(ke,{tone:"accent",children:"quiz"}),x.diff&&a.jsx(ke,{tone:"warn",children:"change"}),x.questions.some(I=>I.misconceptionId)&&a.jsxs(ke,{tone:"bad",children:[a.jsx(Gi,{className:"h-3 w-3"})," weak spots"]}),a.jsxs("a",{href:`/api/projects/${t.id}/quizzes/${x.id}/export`,className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs text-muted hover:bg-raised hover:text-ink",title:"Download as markdown",children:[a.jsx(Kf,{className:"h-3.5 w-3.5"})," .md"]}),a.jsxs("span",{className:"text-xs text-muted",children:[x.questions.length," questions · ",It(x.createdAt)]})]}),a.jsx("h1",{className:"mt-2 text-[20px] font-semibold leading-tight tracking-tight",children:x.title}),a.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[x.files.slice(0,6).map(I=>a.jsxs("button",{onClick:()=>f({file:I}),title:n(I),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px] hover:text-accent",children:[a.jsx(ol,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:hr(n(I),64)})]},I)),x.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",x.files.length-6," more"]})]}),E&&a.jsxs("div",{className:"card mt-6 flex flex-wrap items-center gap-4 p-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-muted",children:"Score"}),a.jsx("div",{className:"text-3xl",children:a.jsx(Na,{score:E.score})})]}),a.jsxs("div",{className:"text-sm text-muted",children:[E.grades.filter(I=>I.verdict==="right").length," right · ",E.grades.filter(I=>I.verdict==="partial").length," partial ·"," ",E.grades.filter(I=>I.verdict==="wrong").length," wrong",C>0&&a.jsxs("div",{className:"text-bad",children:[C," wrong while sure: the best ones to look at."]})]}),v.length>1&&a.jsx("div",{className:"ml-auto",children:a.jsx(qt,{value:d??v.length-1,onChange:I=>h(I),options:v.map((I,Q)=>({value:Q,label:`#${Q+1}`,title:`${Math.round(I.score*100)}% · ${It(I.at)}`}))})})]}),a.jsx("ol",{className:"mt-6 space-y-4",children:x.questions.map((I,Q)=>{const q=E==null?void 0:E.grades.find(Y=>Y.qid===I.id),$=E==null?void 0:E.answers.find(Y=>Y.qid===I.id),G=l[I.id];return a.jsxs("li",{className:le("card p-5",q&&(q.verdict==="right"?"border-good/30":q.verdict==="partial"?"border-warn/30":"border-bad/30")),children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-full bg-accent/10 text-sm font-semibold text-accent",children:Q+1}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-[16px] font-medium leading-snug",children:I.prompt}),I.file&&a.jsxs("button",{className:"mt-1 font-mono text-[12px] text-muted hover:text-accent",onClick:()=>f({file:I.file,line:I.line}),children:[n(I.file),I.line?`:${I.line}`:""]})]}),q&&a.jsx(a0,{v:q.verdict})]}),E?a.jsxs("div",{className:"mt-4 space-y-3 pl-10",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"label flex items-center gap-2",children:["Your answer ",$!=null&&$.sure?a.jsx(ke,{tone:"accent",children:"sure"}):a.jsx(ke,{children:"guess"})]}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:($==null?void 0:$.answer)||a.jsx("span",{className:"text-muted",children:"(no answer)"})})]}),(q==null?void 0:q.feedback)&&a.jsx("p",{className:"reading",children:q.feedback}),(q==null?void 0:q.modelAnswer)&&a.jsxs("div",{className:"reading rounded-lg border border-line px-4 py-3",children:[a.jsx("span",{className:"font-sans text-sm font-medium text-muted",children:"A good answer: "}),q.modelAnswer]}),(q==null?void 0:q.misconception)&&a.jsxs("div",{className:"flex gap-2 rounded-lg border border-bad/25 bg-bad/5 px-3 py-2 text-[14px]",children:[a.jsx(Gi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-bad"}),a.jsxs("span",{children:[a.jsx("span",{className:"font-medium",children:"Saved as a weak spot: "}),q.misconception]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I.focus&&a.jsxs("span",{className:"text-xs text-muted",children:["Tests: ",I.focus]}),q&&q.verdict!=="right"&&a.jsxs("span",{className:"ml-auto flex gap-1",children:[a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(Wu,{className:"h-3.5 w-3.5"}),disabled:w.busy,onClick:()=>w.run(`/projects/${t.id}/threads`,{files:x.files,text:`I got this quiz question ${q.verdict}:
502
-
503
- "${I.prompt}"
504
-
505
- My answer was: ${($==null?void 0:$.answer)||"(none)"}
506
-
507
- Help me see what I missed, without just telling me.`},Y=>r(`/p/${t.id}/tutor/${Y.resultId}`)),children:"Ask the tutor"}),a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(Ar,{className:"h-3.5 w-3.5"}),onClick:()=>g({kind:"miss",front:I.prompt,back:q.modelAnswer,file:I.file,line:I.line,source:{quizId:x.id,qid:I.id}}),children:"Card"})]})]})]}):a.jsxs("div",{className:"mt-4 pl-10",children:[a.jsx("textarea",{className:"input min-h-[88px] resize-y",placeholder:"Your answer, in your own words",value:(G==null?void 0:G.answer)??"",onChange:Y=>M(I.id,{answer:Y.target.value})}),a.jsx("div",{className:"mt-2 flex items-center gap-2",children:a.jsx(qt,{value:G!=null&&G.sure?"sure":"guess",onChange:Y=>M(I.id,{sure:Y==="sure"}),options:[{value:"guess",label:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(T1,{className:"h-3.5 w-3.5"}),"Guess"]})},{value:"sure",label:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ml,{className:"h-3.5 w-3.5"}),"Sure"]})}]})})]})]},I.id)})}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[E?a.jsx(Z,{variant:"primary",icon:a.jsx(Yf,{className:"h-4 w-4"}),onClick:()=>c(!0),children:"Try again"}):a.jsxs(a.Fragment,{children:[a.jsxs(Z,{variant:"primary",icon:a.jsx(U1,{className:"h-4 w-4"}),loading:i.busy,disabled:S===0,onClick:F,children:["Grade my answers (",S,"/",x.questions.length,")"]}),u&&a.jsx(Z,{variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]}),a.jsx(Z,{variant:"ghost",className:"ml-auto",icon:a.jsx(fr,{className:"h-4 w-4"}),onClick:async()=>{await ls(`/projects/${t.id}/quizzes/${x.id}`),r(`/p/${t.id}/library`)},children:"Archive"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"grade",elapsed:i.elapsed})}),w.busy&&w.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"tutor",elapsed:w.elapsed})}),w.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:w.error,onClose:w.clearError})}),m&&a.jsx(Ua,{initial:m,onClose:()=>g(null)}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})})]})});return p?a.jsx(Qn,{id:"quiz-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:O,right:a.jsxs("div",{className:"flex h-full flex-col bg-panel",children:[a.jsxs("div",{className:"flex items-center border-b border-line px-4 py-2 font-mono text-[13px] text-muted",children:[a.jsxs("span",{className:"flex-1 truncate",children:[n(p.file),p.line?`:${p.line}`:""]}),a.jsx("button",{className:"text-xs hover:text-ink",onClick:()=>f(null),children:"close"})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:y.data&&a.jsx(qa,{text:y.data.text,lang:y.data.lang,focusLine:p.line})})]})}):O}const ld=[{level:"understood",label:"Understood",tone:"good",text:"A check passed (quiz, teach-back 4+, walk, hunt, practice) on the code as it is now."},{level:"fading",label:"Fading",tone:"warn",text:"Understood, but nothing recalled for a while. A quick quiz or card keeps it."},{level:"stale",label:"Stale",tone:"warn",text:"You passed once, then the code changed. Check it again."},{level:"seen",label:"Seen",tone:"muted",text:"Touched by a lens or an activity, no pass yet."}],Cx={new:"bg-line/70",seen:"bg-accent/35",understood:"bg-good",fading:"bg-warn/60",stale:"bg-warn"};function Tw(e){return e.flatMap(t=>t.kind==="file"?[t.path]:Tw(t.children??[]))}function VT({files:e,levels:t,onOpen:n,rel:r}){const i=b.useMemo(()=>{const s=new Map;for(const l of e){const o=r(l),u=o.includes("/")?o.slice(0,o.lastIndexOf("/")):".";s.set(u,[...s.get(u)??[],l])}return[...s].sort((l,o)=>l[0].localeCompare(o[0]))},[e,r]);return a.jsxs("div",{className:"card mt-6 p-4",children:[a.jsx("div",{className:"mb-3 flex flex-wrap gap-3 text-[12px] text-muted",children:["understood","fading","stale","seen","new"].map(s=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:le("h-2.5 w-2.5 rounded-sm",Cx[s])}),s]},s))}),a.jsx("div",{className:"space-y-2",children:i.map(([s,l])=>a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-56 shrink-0 truncate pt-0.5 text-right font-mono text-[12px] text-muted",title:s,children:s}),a.jsx("div",{className:"flex flex-wrap gap-1",children:l.map(o=>a.jsx("button",{title:`${r(o)} · ${t.get(o)??"new"}`,onClick:()=>n(o),className:le("h-3.5 w-3.5 rounded-sm transition hover:scale-125 hover:ring-2 hover:ring-accent/50",Cx[t.get(o)??"new"])},o))})]},s))})]})}function WT(){const{project:e,rel:t,setOpenFile:n,setSelected:r}=it(),i=gt(),[s,l]=b.useState("all"),[o,u]=b.useState("table"),c=xe({queryKey:["progress",e.id],queryFn:()=>me(`/projects/${e.id}/progress`)}),d=xe({queryKey:["tree",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/tree`),enabled:o==="map"}),h=b.useMemo(()=>new Map((c.data??[]).map(w=>[w.path,w.level])),[c.data]),p=w=>{n(w),r([w]),i(`/p/${e.id}/explore`)},f=c.data??[],m=b.useMemo(()=>Object.fromEntries(ld.map(w=>[w.level,f.filter(y=>y.level===w.level).length])),[f]),g=s==="all"?f:f.filter(w=>w.level===s);return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-8",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Progress"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("p",{className:"flex-1 text-sm text-muted",children:"Reading feels like understanding. Only a passed check counts here."}),a.jsx(qt,{value:o,onChange:u,options:[{value:"table",label:"Table"},{value:"map",label:"Whole repo"}]})]}),a.jsx("div",{className:"mt-6 grid gap-3 sm:grid-cols-4",children:ld.map(w=>a.jsxs("button",{onClick:()=>l(s===w.level?"all":w.level),className:le("card p-4 text-left transition hover:border-accent/40",s===w.level&&"ring-2 ring-accent/30"),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium",children:w.label}),a.jsx(ke,{tone:w.tone,children:w.level})]}),a.jsx("div",{className:"mt-2 text-3xl font-semibold tabular-nums",children:m[w.level]??0}),a.jsx("div",{className:"mt-1 text-xs text-muted",children:w.text})]},w.level))}),o==="map"?d.data?a.jsx(VT,{files:Tw(d.data.slice(0,1)),levels:h,onOpen:p,rel:t}):null:f.length===0&&!c.isLoading?a.jsx(Ft,{icon:a.jsx(C1,{className:"h-6 w-6"}),title:"Nothing yet",children:"Make a lens or take a quiz in Explore. Files show up here as you go."}):a.jsxs("div",{className:"card mt-6 overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-3 border-b border-line px-4 py-2.5",children:[a.jsxs("span",{className:"text-sm font-medium",children:[g.length," files"]}),a.jsx("div",{className:"ml-auto",children:a.jsx(qt,{value:s,onChange:l,options:[{value:"all",label:"All"},...ld.map(w=>({value:w.level,label:w.label}))]})})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"text-left text-xs uppercase tracking-wide text-muted",children:a.jsxs("tr",{className:"border-b border-line",children:[a.jsx("th",{className:"px-4 py-2 font-medium",children:"File"}),a.jsx("th",{className:"px-4 py-2 font-medium",children:"Level"}),a.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Best quiz"}),a.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Lenses"}),a.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Quizzes"}),a.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Other"}),a.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Last recall"})]})}),a.jsx("tbody",{children:g.map(w=>a.jsxs("tr",{className:"cursor-pointer border-b border-line/60 last:border-0 hover:bg-raised",onClick:()=>p(w.path),children:[a.jsx("td",{className:"max-w-[360px] truncate px-4 py-2 font-mono text-[13.5px]",children:t(w.path)}),a.jsx("td",{className:"px-4 py-2",children:a.jsx(ke,{tone:w.level==="understood"?"good":w.level==="stale"||w.level==="fading"?"warn":"muted",children:w.level})}),a.jsx("td",{className:"px-4 py-2 text-right",children:w.bestScore===null?a.jsx("span",{className:"text-muted",children:"-"}):a.jsx(Na,{score:w.bestScore,size:"sm"})}),a.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-muted",children:w.lenses}),a.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-muted",children:w.quizzes}),a.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-muted",title:"practice, teach-back, walk, hunt",children:w.practices+w.other}),a.jsx("td",{className:"px-4 py-2 text-right text-xs text-muted",children:w.lastRetrieval?It(w.lastRetrieval):"-"})]},w.path))})]})]})]})})}const QT=[{id:"auto",label:"Auto",text:"Claude Code, then Codex, then Copilot, then API key."},{id:"claude",label:"Claude Code CLI",text:"claude -p with read-only tools. Default."},{id:"codex",label:"Codex CLI",text:"codex exec in the read-only sandbox."},{id:"copilot",label:"GitHub Copilot CLI",text:"copilot -p with only the read tool."},{id:"sdk",label:"Anthropic API key",text:"ANTHROPIC_API_KEY from the environment."},{id:"fake",label:"Demo",text:"Canned answers, no model."}],ra=e=>e<1024*1024?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function KT(){const e=Dt(),t=xe({queryKey:["storage"],queryFn:()=>me("/storage")}),n=xi({mutationFn:()=>Ni("/storage/prune"),onSuccess:i=>e.setQueryData(["storage"],i.usage)});if(!t.data)return null;const r=Math.max(1,...t.data.parts.map(i=>i.bytes));return a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(t2,{className:"h-4 w-4 text-accent"}),a.jsx("div",{className:"text-sm font-semibold",children:"Storage"}),a.jsx("span",{className:"text-sm text-muted",children:ra(t.data.totalBytes)}),a.jsx(Z,{size:"sm",className:"ml-auto shrink-0 whitespace-nowrap",loading:n.isPending,onClick:()=>n.mutate(),children:"Clean up now"})]}),a.jsx("div",{className:"mt-0.5 break-all font-mono text-[12px] text-muted",children:t.data.home}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Plain JSON files, one per item. Archived items and forgotten projects are removed after the keep time below, the reply cache keeps to its size, and long lists (quiz attempts, card history, tutor chats, jobs) are capped. Cleanup runs at start and every 6 hours."}),a.jsx("div",{className:"mt-3 space-y-1.5",children:t.data.parts.map(i=>a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("span",{className:"w-32 shrink-0 capitalize text-muted",children:i.name}),a.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-raised",children:a.jsx("div",{className:"h-full bg-accent/60",style:{width:`${i.bytes/r*100}%`}})}),a.jsxs("span",{className:"w-28 shrink-0 text-right tabular-nums text-muted",children:[ra(i.bytes)," · ",i.files," file",i.files===1?"":"s"]})]},i.name))}),a.jsx("div",{className:"mt-3 text-[12px] text-muted",children:n.data?`Removed ${n.data.removed} item${n.data.removed===1?"":"s"}, freed ${ra(n.data.freedBytes)}.`:t.data.lastPrune?`Last cleanup ${It(t.data.lastPrune.at)}: removed ${t.data.lastPrune.removed}.`:""}),a.jsx(GT,{})]})}function GT(){const e=Dt(),t=xe({queryKey:["storage-items"],queryFn:()=>me("/storage/items")}),[n,r]=b.useState(!1),[i,s]=b.useState(new Set),[l,o]=b.useState("all"),[u,c]=b.useState(!1),d=xi({mutationFn:()=>Ni("/storage/remove",{ids:[...i]}),onSuccess:x=>{e.setQueryData(["storage"],x.usage),e.invalidateQueries({queryKey:["storage-items"]}),e.invalidateQueries(),s(new Set),c(!1)}}),h=t.data??[],p=[...new Set(h.map(x=>x.group))].sort(),f=l==="all"?h:h.filter(x=>x.group===l),m=h.filter(x=>i.has(x.id)).reduce((x,v)=>x+v.bytes,0),g=f.length>0&&f.every(x=>i.has(x.id)),w=x=>s(v=>{const j=new Set(v);return j.has(x)?j.delete(x):j.add(x),j}),y=()=>s(x=>{const v=new Set(x);for(const j of f)g?v.delete(j.id):v.add(j.id);return v});return a.jsxs("div",{className:"mt-4 border-t border-line pt-4",children:[a.jsx("button",{className:"text-sm font-medium text-accent hover:underline",onClick:()=>r(!n),children:n?"Hide the list":`Choose what to remove (${h.length} items)`}),n&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("select",{className:"input h-8 w-auto py-0 text-xs",value:l,onChange:x=>o(x.target.value),children:[a.jsx("option",{value:"all",children:"All kinds"}),p.map(x=>a.jsx("option",{value:x,children:x},x))]}),a.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:y})," Select all shown"]}),a.jsxs("span",{className:"ml-auto text-xs text-muted",children:[i.size," selected · ",ra(m)]}),u?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-xs text-bad",children:"This cannot be undone."}),a.jsx(Z,{size:"sm",onClick:()=>c(!1),children:"Cancel"}),a.jsxs(Z,{size:"sm",variant:"danger",loading:d.isPending,onClick:()=>d.mutate(),children:["Remove ",i.size]})]}):a.jsx(Z,{size:"sm",variant:"danger",disabled:!i.size,onClick:()=>c(!0),children:"Remove selected"})]}),a.jsxs("ul",{className:"mt-3 max-h-[26rem] divide-y divide-line/60 overflow-auto rounded-lg border border-line",children:[f.map(x=>a.jsx("li",{children:a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-3 py-2 text-sm hover:bg-raised",children:[a.jsx("input",{type:"checkbox",className:"mt-1",checked:i.has(x.id),onChange:()=>w(x.id)}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block truncate",children:x.label}),a.jsxs("span",{className:"block text-[12px] text-muted",children:[x.group,x.project?` · ${x.project}`:""," · ",It(x.at)]})]}),a.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted",children:ra(x.bytes)})]})},x.id)),!f.length&&a.jsx("li",{className:"px-3 py-6 text-center text-sm text-muted",children:"Nothing here."})]}),d.error&&a.jsx(Ke,{error:d.error.message})]})]})}function YT(){const t=(xe({queryKey:["jobs"],queryFn:()=>me("/jobs")}).data??[]).slice(0,12);if(!t.length)return null;const n=r=>r.endedAt?Math.round((Date.parse(r.endedAt)-Date.parse(r.startedAt))/1e3):null;return a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(n2,{className:"h-4 w-4 text-accent"})," Recent model calls"]}),a.jsx("table",{className:"mt-3 w-full text-xs",children:a.jsx("tbody",{children:t.map(r=>a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-1.5 pr-3 font-medium",children:r.kind}),a.jsx("td",{className:le("py-1.5 pr-3",r.status==="failed"?"text-bad":r.status==="running"?"text-accent":"text-good"),children:r.status}),a.jsx("td",{className:"py-1.5 pr-3 tabular-nums text-muted",children:n(r)!==null?`${n(r)} s`:""}),a.jsx("td",{className:"max-w-[320px] truncate py-1.5 pr-3 text-muted",title:r.error,children:r.error??""}),a.jsx("td",{className:"py-1.5 text-right text-muted",children:It(r.startedAt)})]},r.id))})})]})}function xt({label:e,hint:t,children:n}){return a.jsxs("div",{className:"grid gap-1.5 py-4 sm:grid-cols-[220px_1fr] sm:gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:e}),t&&a.jsx("div",{className:"mt-0.5 text-xs text-muted",children:t})]}),a.jsx("div",{children:n})]})}function XT(){var p;const e=Dt(),t=xe({queryKey:["settings"],queryFn:()=>me("/settings")}),[n,r]=b.useState(null),{pref:i,setPref:s}=Zx(),{font:l,setFont:o}=lk();b.useEffect(()=>{t.data&&!n&&r(t.data.settings)},[t.data,n]);const u=xi({mutationFn:f=>jh("/settings",f),onSuccess:f=>{e.setQueryData(["settings"],f),e.invalidateQueries({queryKey:["health"]}),r(f.settings)}});if(!t.data||!n)return null;const c=(f,m)=>r({...n,[f]:m}),d=JSON.stringify(n)!==JSON.stringify(t.data.settings),h=((p=u.data)==null?void 0:p.agent)??t.data.agent;return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-10",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Settings"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:["Saved in ",a.jsxs("span",{className:"font-mono",children:[t.data.home,"/settings.json"]})]}),a.jsxs("div",{className:le("card mt-6 flex items-start gap-3 p-4",h.ready?"border-good/30":"border-bad/30"),children:[a.jsx("div",{className:le("grid h-9 w-9 shrink-0 place-items-center rounded-lg",h.ready?"bg-good/12 text-good":"bg-bad/12 text-bad"),children:a.jsx(Gj,{className:"h-[18px] w-[18px]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold",children:h.ready?`Model ready: ${h.name}`:"No model available"}),a.jsx("div",{className:"text-sm text-muted",children:h.detail})]})]}),a.jsxs("div",{className:"card mt-6 divide-y divide-line px-5",children:[a.jsx(xt,{label:"Theme",children:a.jsx(qt,{value:i,onChange:s,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]})}),a.jsx(xt,{label:"Reading font",hint:"For lessons, feedback and tutor replies. Buttons and labels stay in the system UI font.",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(qt,{value:l,onChange:o,options:[{value:"sans",label:"Sans"},{value:"serif",label:"Serif"}]}),a.jsx("span",{className:"reading text-muted",children:"Read the code, then explain it."})]})}),a.jsx(xt,{label:"Model access",hint:"CLIs use their own saved login, so cognitune never needs or stores a key. Auto picks the first one found.",children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:QT.map(f=>{var w;const m=(w=h.available)==null?void 0:w[f.id],g=n["agent.mode"]===f.id;return a.jsxs("button",{onClick:()=>c("agent.mode",f.id),className:le("rounded-lg border px-3 py-2 text-left transition",g?"border-accent/60 bg-accent/8 ring-1 ring-accent/30":"border-line hover:bg-raised"),children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[f.label,f.id!=="auto"&&f.id!=="fake"&&a.jsx("span",{className:le("ml-auto shrink-0 whitespace-nowrap rounded-full px-1.5 text-[11.5px]",m?"bg-good/12 text-good":"bg-raised text-muted"),children:m?"found":"not found"})]}),a.jsx("div",{className:"text-xs text-muted",children:f.text})]},f.id)})})}),a.jsx(xt,{label:"Claude",hint:"Command and model for the Claude Code CLI (model also used by the API key mode).",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.claudeCommand"],onChange:f=>c("agent.claudeCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.model"],onChange:f=>c("agent.model",f.target.value)})]})}),a.jsx(xt,{label:"Planning model",hint:"Plans every lens, quiz, walk, practice, bug hunt and path first (outline, steps, what each must cover). The model above then writes from that plan, in parts. Works with the Claude CLI and the API key; empty = the writer plans too.",children:a.jsx("input",{className:"input font-mono",placeholder:"same as the writer",value:n["agent.planModel"],onChange:f=>c("agent.planModel",f.target.value)})}),a.jsx(xt,{label:"Plan first",hint:"On: plan, then write in parts (slower, much better). Off: one model call per item.",children:a.jsx(qt,{value:n["generate.plan"]?"on":"off",onChange:f=>c("generate.plan",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Codex",hint:"Command and model for the OpenAI Codex CLI. Empty model = its default.",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.codexCommand"],onChange:f=>c("agent.codexCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.codexModel"],onChange:f=>c("agent.codexModel",f.target.value)})]})}),a.jsx(xt,{label:"Copilot",hint:"Command and model for the GitHub Copilot CLI. Empty model = its default.",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.copilotCommand"],onChange:f=>c("agent.copilotCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.copilotModel"],onChange:f=>c("agent.copilotModel",f.target.value)})]})}),a.jsx(xt,{label:"Timeout",hint:"Seconds per model call.",children:a.jsx("input",{type:"number",min:30,className:"input w-32",value:n["agent.timeoutSec"],onChange:f=>c("agent.timeoutSec",Number(f.target.value))})}),a.jsx(xt,{label:"Questions per quiz",children:a.jsx("input",{type:"number",min:1,max:10,className:"input w-32",value:n["quiz.questions"],onChange:f=>c("quiz.questions",Number(f.target.value))})}),a.jsx(xt,{label:"Pass mark",hint:"Share of points to count a file as understood (partial = half).",children:a.jsx("input",{type:"number",min:.1,max:1,step:.01,className:"input w-32",value:n["quiz.passMark"],onChange:f=>c("quiz.passMark",Number(f.target.value))})}),a.jsx(xt,{label:"Context size",hint:"Most bytes of code sent in one prompt.",children:a.jsx("input",{type:"number",min:1e4,step:1e4,className:"input w-40",value:n["context.maxBytes"],onChange:f=>c("context.maxBytes",Number(f.target.value))})}),a.jsx(xt,{label:"Cards from misses",hint:"Each wrong or partial quiz answer becomes a review card.",children:a.jsx(qt,{value:n["cards.fromMisses"]?"on":"off",onChange:f=>c("cards.fromMisses",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Fade after",hint:"Days without recall before an understood file shows as fading. 0 = never.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["progress.fadeDays"],onChange:f=>c("progress.fadeDays",Number(f.target.value))})}),a.jsx(xt,{label:"Notes in prompts",hint:"Send your margin notes on a file with its code, so lenses and the tutor can use them.",children:a.jsx(qt,{value:n["notes.inPrompts"]?"on":"off",onChange:f=>c("notes.inPrompts",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Keep archive",hint:"Days an archived item or forgotten project is kept before it is removed for good. 0 = forever.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["storage.archiveDays"],onChange:f=>c("storage.archiveDays",Number(f.target.value))})}),a.jsx(xt,{label:"Reply cache",hint:"Most MB of saved model replies (the same lens twice is free). Oldest go first.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["storage.cacheMB"],onChange:f=>c("storage.cacheMB",Number(f.target.value))})}),a.jsx(xt,{label:"Attempts per quiz",hint:"Older graded attempts are dropped; the best one is always kept.",children:a.jsx("input",{type:"number",min:1,className:"input w-32",value:n["storage.maxAttempts"],onChange:f=>c("storage.maxAttempts",Number(f.target.value))})})]}),u.error&&a.jsx("div",{className:"mt-4",children:a.jsx(Ke,{error:u.error.message})}),a.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[u.isSuccess&&!d&&a.jsxs("span",{className:"flex items-center gap-1 text-sm text-good",children:[a.jsx(Qf,{className:"h-4 w-4"})," Saved"]}),a.jsx(Z,{variant:"ghost",disabled:!d,onClick:()=>r(t.data.settings),children:"Reset"}),a.jsx(Z,{variant:"primary",disabled:!d,loading:u.isPending,onClick:()=>u.mutate(n),children:"Save"})]}),a.jsx(KT,{}),a.jsx(YT,{})]})})}function JT(){const{project:e,rel:t,setSelected:n,setOpenFile:r}=it(),i=gt(),s=mn(),l=xe({queryKey:["today",e.id],queryFn:()=>me(`/projects/${e.id}/today`)}),o=`/p/${e.id}`;if(l.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!l.data)return l.error?a.jsx("div",{className:"p-8",children:a.jsx(Ke,{error:l.error.message})}):null;const u=l.data,c=(d,h)=>{if(h==="review")return i(`${o}/review`);if(h==="weak")return s.run(`/projects/${e.id}/quizzes`,{files:[],weak:!0},f=>i(`${o}/quiz/${f.resultId}`));n(d),d[0]&&r(d[0]),i(`${o}/explore?do=${h==="teachback"?"teach":h}`)};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Today"}),a.jsx("span",{className:"text-sm text-muted",children:e.name}),u.streak>0&&a.jsxs(ke,{tone:"warn",className:"ml-auto",children:[a.jsx(Jj,{className:"h-3.5 w-3.5"})," ",u.streak," day",u.streak===1?"":"s"," in a row"]})]}),u.suggestion&&a.jsxs("div",{className:"card mt-6 flex items-center gap-4 border-accent/30 bg-accent/5 p-5",children:[a.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-md bg-accent/15 text-accent",children:a.jsx(Jf,{className:"h-5 w-5"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-accent",children:"Suggested next, about 10 minutes"}),a.jsx("div",{className:"mt-0.5 text-[16px]",children:u.suggestion.text})]}),a.jsx(Z,{variant:"primary",icon:a.jsx(Bu,{className:"h-4 w-4"}),disabled:s.busy,onClick:()=>c(u.suggestion.files,u.suggestion.activity),children:"Start"})]}),s.busy&&s.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:s.job.kind,elapsed:s.elapsed})}),s.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:s.error,onClose:s.clearError})}),a.jsxs("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Ar,{className:"h-4 w-4 text-accent"})," Review cards"]}),a.jsxs("div",{className:"mt-3 flex items-end gap-3",children:[a.jsx("div",{className:"text-4xl font-semibold tabular-nums",children:u.due}),a.jsxs("div",{className:"pb-1 text-sm text-muted",children:["due now",u.newCards?` · ${u.newCards} never seen`:""]})]}),a.jsx(Z,{className:"mt-4",size:"sm",disabled:!u.due,onClick:()=>i(`${o}/review`),children:"Start review"})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Gi,{className:"h-4 w-4 text-bad"})," Weak spots"]}),u.weak.length?a.jsx("ul",{className:"mt-3 space-y-2",children:u.weak.map(d=>a.jsxs("li",{className:"text-[14px] leading-snug",children:[d.text,a.jsxs("span",{className:"ml-1 text-[12px] text-muted",children:[d.file&&`· ${t(d.file)}`,d.seen>1&&` · seen ${d.seen}×`]})]},d.id))}):a.jsx("p",{className:"mt-3 text-sm text-muted",children:"None open. Wrong answers in quizzes, teach-backs and walkthroughs show up here."}),a.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[a.jsx(Z,{size:"sm",disabled:!u.weak.length||s.busy,onClick:()=>c([],"weak"),children:"Quiz my weak spots"}),u.weak.length>0&&a.jsx(ft,{to:`${o}/library?tab=weak`,className:"text-xs text-muted hover:text-ink",children:"manage"})]})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(p2,{className:"h-4 w-4 text-warn"})," Needs a refresh"]}),u.attention.length?a.jsx("ul",{className:"mt-3 space-y-1.5",children:u.attention.map(d=>a.jsxs("li",{className:"flex items-center gap-2 text-[14px]",children:[a.jsx("button",{className:"min-w-0 flex-1 truncate text-left font-mono text-[13px] hover:text-accent",onClick:()=>c([d.path],"quiz"),children:t(d.path)}),a.jsx(ke,{tone:"warn",children:d.level}),d.lastRetrieval&&a.jsx("span",{className:"text-[12px] text-muted",children:It(d.lastRetrieval)})]},d.path))}):a.jsx("p",{className:"mt-3 text-sm text-muted",children:"Nothing stale or fading. Files you passed come back here when the code changes or a few weeks go by."})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Xf,{className:"h-4 w-4 text-good"})," Learning path"]}),u.nextStop?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mt-3 text-xs text-muted",children:[u.nextStop.title," · stop ",u.nextStop.index+1]}),a.jsx("div",{className:"mt-0.5 text-[16px] font-medium",children:u.nextStop.stop.title}),a.jsx("p",{className:"mt-1 text-[14px] text-muted",children:u.nextStop.stop.why}),a.jsxs("div",{className:"mt-4 flex gap-2",children:[a.jsx(Z,{size:"sm",variant:"primary",onClick:()=>c(u.nextStop.stop.files,u.nextStop.stop.activity),children:"Do this stop"}),a.jsx(ft,{to:`${o}/paths/${u.nextStop.pathId}`,className:"inline-flex items-center text-xs text-muted hover:text-ink",children:"see the path"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"mt-3 text-sm text-muted",children:"A path is an ordered tour of the repo: where to start, what next, and how to check each stop."}),a.jsxs("div",{className:"mt-4 flex gap-2",children:[a.jsx(Z,{size:"sm",onClick:()=>i(`${o}/paths`),children:"Make a path"}),a.jsx(Z,{size:"sm",variant:"ghost",icon:a.jsx(_1,{className:"h-3.5 w-3.5"}),onClick:()=>i(`${o}/map`),children:"See the map"})]})]})]})]})]})})}const Ex=[{r:"again",label:"Again",key:"1",cls:"border-bad/40 text-bad hover:bg-bad/10"},{r:"hard",label:"Hard",key:"2",cls:"border-warn/40 text-warn hover:bg-warn/10"},{r:"good",label:"Good",key:"3",cls:"border-good/40 text-good hover:bg-good/10"},{r:"easy",label:"Easy",key:"4",cls:"border-accent/40 text-accent hover:bg-accent/10"}],ZT={miss:"from a quiz miss",concept:"concept",own:"your card"};function eL(){var E,k,S,M,F,C,O;const{project:e,rel:t}=it(),n=Dt(),r=xe({queryKey:["cards-due",e.id],queryFn:()=>me(`/projects/${e.id}/cards/due`)}),i=xe({queryKey:["cards",e.id],queryFn:()=>me(`/projects/${e.id}/cards`)}),[s,l]=b.useState(!1),[o,u]=b.useState(""),[c,d]=b.useState(0),[h,p]=b.useState(!1),[f,m]=b.useState(!1),g=(E=r.data)==null?void 0:E[0];b.useEffect(()=>{l(!1),u(""),m(!1)},[g==null?void 0:g.id]);const w=async I=>{g&&(await Ni(`/projects/${e.id}/cards/${g.id}/review`,{rating:I}),d(Q=>Q+1),await n.invalidateQueries({queryKey:["cards-due",e.id]}),n.invalidateQueries({queryKey:["today",e.id]}),n.invalidateQueries({queryKey:["cards",e.id]}))};if(b.useEffect(()=>{const I=Q=>{if(Q.target.closest("textarea, input"))return;Q.key===" "&&!s&&(Q.preventDefault(),l(!0));const q=Ex.find($=>$.key===Q.key);q&&s&&w(q.r)};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)}),r.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});const y=((k=i.data)==null?void 0:k.length)??0,x=((S=i.data)==null?void 0:S.filter(I=>I.suspended).length)??0,v=(M=i.data)==null?void 0:M.filter(I=>!I.suspended).map(I=>I.fsrs.due).sort()[0],j=a.jsxs("div",{className:"h-full overflow-auto",children:[a.jsxs("div",{className:"page",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Review"}),a.jsxs(ke,{tone:"accent",children:[((F=r.data)==null?void 0:F.length)??0," due"]}),c>0&&a.jsxs(ke,{tone:"good",children:[c," done"]}),a.jsx(Z,{size:"sm",variant:"ghost",className:"ml-auto",icon:a.jsx(B1,{className:"h-3.5 w-3.5"}),onClick:()=>p(!0),children:"New card"})]}),a.jsx("p",{className:"text-sm text-muted",children:"Recall before you reveal. Cards you know come back less often; cards you miss come back soon."}),g?a.jsxs("div",{className:"card mt-6 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[a.jsx(Ar,{className:"h-3.5 w-3.5"})," ",ZT[g.kind],g.file&&a.jsxs("button",{className:"ml-1 font-mono hover:text-accent",onClick:()=>m(I=>!I),children:[t(g.file),g.line?`:${g.line}`:""]}),a.jsx("span",{className:"ml-auto",children:g.fsrs.reps?`${g.fsrs.reps} reviews · ${g.fsrs.lapses} lapses`:"new"})]}),a.jsx("div",{className:"mt-3 text-[17px] font-medium leading-snug",children:g.front}),s?a.jsxs(a.Fragment,{children:[o.trim()&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"label",children:"You wrote"}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:o})]}),a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"label",children:"Answer"}),a.jsx("div",{className:"reading whitespace-pre-wrap rounded-lg border border-good/30 bg-good/5 px-4 py-3",children:g.back})]}),a.jsx("div",{className:"mt-5 grid grid-cols-4 gap-2",children:Ex.map(I=>a.jsxs("button",{onClick:()=>w(I.r),className:le("rounded-lg border px-2 py-2 text-center transition",I.cls),children:[a.jsxs("div",{className:"text-sm font-semibold",children:[I.label," ",a.jsx("span",{className:"kbd ml-0.5",children:I.key})]}),a.jsx("div",{className:"text-[12px] opacity-80",children:Sh(g.next[I.r])})]},I.r))}),a.jsxs("div",{className:"mt-3 flex items-center justify-end gap-4",children:[(((C=g.source)==null?void 0:C.lensId)||((O=g.source)==null?void 0:O.quizId))&&a.jsxs(ft,{className:"mr-auto inline-flex items-center gap-1 text-xs text-muted hover:text-accent",to:g.source.lensId?`/p/${e.id}/lens/${g.source.lensId}`:`/p/${e.id}/quiz/${g.source.quizId}`,title:"Open what this card was made from",children:[a.jsx(Yj,{className:"h-3.5 w-3.5"})," From ",g.source.lensId?"a lens":"a quiz"]}),a.jsxs("button",{className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",title:"Stop showing this card",onClick:async()=>{await Ba(`/projects/${e.id}/cards/${g.id}`,{suspended:!0}),n.invalidateQueries()},children:[a.jsx(L1,{className:"h-3.5 w-3.5"})," Pause this card"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-4 min-h-[88px]",placeholder:"Type your answer (optional), then reveal",value:o,onChange:I=>u(I.target.value)}),a.jsxs(Z,{variant:"primary",className:"mt-3",icon:a.jsx(M1,{className:"h-4 w-4"}),onClick:()=>l(!0),children:["Reveal ",a.jsx("span",{className:"kbd ml-1",children:"space"})]})]})]}):a.jsx(Ft,{icon:a.jsx(ml,{className:"h-6 w-6"}),title:c?"All done for now":"Nothing due",children:y?a.jsxs(a.Fragment,{children:["You have ",y," card",y===1?"":"s",x?` (${x} paused)`:"",".",v&&` The next one is due in ${Sh(v)}.`]}):a.jsx(a.Fragment,{children:"Cards come from quiz misses (on their own), lens concepts and your own. Take a quiz or make a card to start."})}),a.jsxs("p",{className:"mt-6 text-center text-xs text-muted",children:["All cards are in the ",a.jsx(ft,{className:"text-accent hover:underline",to:`/p/${e.id}/library?tab=cards`,children:"Library"}),"."]})]}),h&&a.jsx(Ua,{initial:{kind:"own"},onClose:()=>p(!1)})]});return!f||!(g!=null&&g.file)?j:a.jsx(Qn,{id:"review-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:j,right:a.jsx(yl,{file:g.file,line:g.line,onClose:()=>m(!1)})})}function Qa({to:e="library",label:t="Library"}){const{project:n}=it();return a.jsxs(ft,{to:`/p/${n.id}/${e}`,className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",children:[a.jsx(Vf,{className:"h-3.5 w-3.5"})," ",t]})}function ac(e){const{project:t}=it();return async n=>{await fetch(`/api/projects/${t.id}/${e}`,{method:"DELETE"}),n(`/p/${t.id}/library`)}}const tL=["","Mostly wrong or empty","Some right, big gaps","Right but shallow","Right, covers what matters","Right, with the why and the edges"];function nL(){const{id:e=""}=Or(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=ac(`teachbacks/${e}`),[l,o]=b.useState(null),[u,c]=b.useState(null),d=xe({queryKey:["teachback",t.id,e],queryFn:()=>me(`/projects/${t.id}/teachbacks/${e}`)});if(d.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!d.data)return a.jsx(Ft,{title:"Teach-back not found"});const h=d.data,p=h.grade,f=(g,w,y,x)=>w.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:`mb-2 flex items-center gap-1.5 text-sm font-semibold ${x}`,children:[y," ",g]}),a.jsx("ul",{className:"space-y-1.5",children:w.map((v,j)=>a.jsx("li",{className:"card reading px-4 py-2.5",children:v},j))})]}),m=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(Ju,{back:a.jsx(Qa,{}),badges:a.jsxs(a.Fragment,{children:[a.jsx(ke,{tone:"accent",children:"teach-back"}),a.jsx("span",{className:"text-xs text-muted",children:It(h.createdAt)})]}),title:"Your explanation",actions:a.jsx(Z,{variant:"ghost",size:"sm",icon:a.jsx(fr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})}),a.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[h.files.slice(0,6).map(g=>a.jsxs("button",{onClick:()=>o(g),title:n(g),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px] hover:text-accent",children:[a.jsx(ol,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:hr(n(g),64)})]},g)),h.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",h.files.length-6," more"]})]}),p&&a.jsxs("div",{className:"card mt-6 flex items-center gap-5 p-5",children:[a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:`text-4xl font-semibold ${p.score>=4?"text-good":p.score>=3?"text-warn":"text-bad"}`,children:[p.score,a.jsx("span",{className:"text-lg text-muted",children:"/5"})]})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:tL[p.score]}),a.jsx("div",{className:"text-sm text-muted",children:p.summary}),p.score>=4&&a.jsx("div",{className:"mt-1 text-xs text-good",children:"Counts as understood for these files."})]})]}),a.jsxs("section",{className:"mt-6",children:[a.jsx("div",{className:"label",children:"What you wrote"}),a.jsx("div",{className:"reading whitespace-pre-wrap rounded-lg bg-raised px-4 py-3",children:h.text})]}),p&&f("Wrong",p.wrong,a.jsx(E1,{className:"h-4 w-4"}),"text-bad"),p&&f("Missing",p.missing,a.jsx(P1,{className:"h-4 w-4"}),"text-warn"),p&&f("Right",p.right,a.jsx(ml,{className:"h-4 w-4"}),"text-good"),a.jsxs("section",{className:"mt-10 rounded-md border border-line bg-raised/50 p-5",children:[a.jsx("div",{className:"text-sm font-semibold",children:"Explain it again"}),a.jsx("p",{className:"mt-0.5 text-sm text-muted",children:"Close this page in your head: write it fresh, without copying the feedback."}),u===null?a.jsx(Z,{className:"mt-3",icon:a.jsx(Yf,{className:"h-4 w-4"}),onClick:()=>c(""),children:"Try again"}):a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-3 min-h-[160px]",value:u,onChange:g=>c(g.target.value),autoFocus:!0}),a.jsx(Z,{variant:"primary",className:"mt-2",icon:a.jsx(Hu,{className:"h-4 w-4"}),disabled:i.busy||u.trim().length<20,onClick:()=>i.run(`/projects/${t.id}/teachbacks`,{files:h.files,text:u,diff:h.diff},g=>{c(null),r(`/p/${t.id}/teach/${g.resultId}`)}),children:"Grade this one"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"teachback",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})})]})]})});return l?a.jsx(Qn,{id:"teach-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:m,right:a.jsx(yl,{file:l,onClose:()=>o(null)})}):m}const rL=["","nudge","hint","walk-through","answer"];function iL(){const{id:e=""}=Or(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=ac(`threads/${e}`),[l,o]=b.useState(""),[u,c]=b.useState(null),d=b.useRef(null),h=xe({queryKey:["thread",t.id,e],queryFn:()=>me(`/projects/${t.id}/threads/${e}`)}),p=h.data;if(b.useEffect(()=>{var y;(y=d.current)==null||y.scrollIntoView({behavior:"smooth"})},[p==null?void 0:p.messages.length,i.busy]),b.useEffect(()=>{p&&!u&&c({file:p.files[0]})},[p,u]),h.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!p)return a.jsx(Ft,{title:"Conversation not found"});const f=(y=!1)=>i.run(`/projects/${t.id}/threads/${p.id}/messages`,{text:l,tell:y},()=>o("")),m=(y,x)=>c(v=>({file:(v==null?void 0:v.file)??p.files[0],line:y,to:x})),g=a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-line bg-panel px-4 py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Qa,{}),a.jsx(Z,{variant:"ghost",size:"sm",className:"ml-auto",icon:a.jsx(fr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})]}),a.jsx("div",{className:"mt-0.5 truncate text-[13px] font-semibold",children:p.title}),a.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[p.files.slice(0,6).map(y=>a.jsxs("button",{onClick:()=>c({file:y}),title:n(y),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-1.5 py-0.5 font-mono text-[11.5px] hover:text-accent",children:[a.jsx(ol,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:hr(n(y),64)})]},y)),p.files.length>6&&a.jsxs("span",{className:"px-1 py-0.5 text-[11.5px] text-muted",children:["+",p.files.length-6," more"]})]})]}),a.jsxs("div",{className:"chat-area min-h-0 flex-1 overflow-auto px-[6%] py-3 [scrollbar-gutter:stable]",children:[p.messages.map((y,x)=>{const v=y.role==="user",j=x===0||p.messages[x-1].role!==y.role;return a.jsx("div",{className:le("flex",v?"justify-end":"justify-start",x>0&&(j?"mt-3":"mt-0.5")),children:a.jsxs("div",{className:le("chat-bubble",v?"chat-me":"chat-them",j&&"chat-first"),children:[!v&&y.hintLevel&&a.jsxs("div",{className:le("chat-label",y.hintLevel>=4?"text-warn":"text-accent"),children:[a.jsx(Gf,{className:"h-3 w-3"})," Tutor · ",rL[y.hintLevel]]}),v?a.jsxs("div",{className:"whitespace-pre-wrap",children:[y.text,a.jsx("span",{className:"chat-spacer"})]}):a.jsx(Xi,{className:"chat-msg",onLineClick:m,children:zT(y.text)}),a.jsx("span",{className:"chat-time",children:new Date(y.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},x)}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"tutor",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})}),a.jsx("div",{ref:d})]}),a.jsxs("div",{className:"flex items-end gap-2 border-t border-line bg-panel px-3 py-2",children:[a.jsx("textarea",{rows:1,className:"max-h-40 min-h-[36px] flex-1 resize-none rounded-lg bg-raised px-3 py-2 text-[14px] leading-[1.4] text-ink outline-none [field-sizing:content] placeholder:text-muted/70 focus:ring-1 focus:ring-accent/50",placeholder:"Your answer or next question — try first, each reply gives a bit more. Ctrl+Enter to send.",value:l,onChange:y=>o(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&l.trim()&&!i.busy&&f()}}),a.jsx(Z,{variant:"ghost",size:"md",className:"mb-[5px]",disabled:i.busy,onClick:()=>f(!0),children:"Just tell me"}),a.jsx("button",{className:"mb-[2px] grid h-8 w-8 shrink-0 place-items-center rounded-full bg-accent text-accent-ink transition hover:brightness-110 disabled:opacity-40",disabled:i.busy||!l.trim(),onClick:()=>f(),title:"Send (Ctrl+Enter)",children:a.jsx(U1,{className:"h-4 w-4"})})]})]}),w=u!=null&&u.to&&u.to!==u.line?[{from:u.line,to:u.to,cls:"hl"}]:void 0;return a.jsx(Qn,{id:"tutor-code",collapsible:!0,side:"right",initial:520,min:300,max:900,className:"h-full",left:g,right:a.jsx(yl,{file:u==null?void 0:u.file,line:u==null?void 0:u.line,marks:w})})}function sL(){const{id:e=""}=Or(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=ac(`walks/${e}`),l=xe({queryKey:["walk",t.id,e],queryFn:()=>me(`/projects/${t.id}/walks/${e}`)}),o=l.data,u=xe({queryKey:["file",t.id,o==null?void 0:o.file],enabled:!!o,queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(o.file)}`)}),c=o?Math.max(0,o.blocks.findIndex(S=>!S.verdict)):0,[d,h]=b.useState(null),p=d??c,[f,m]=b.useState(""),[g,w]=b.useState(!1);b.useEffect(()=>{m(""),w(!1)},[p]);const y=b.useMemo(()=>{const S=o==null?void 0:o.blocks[p];if(!S||!u.data)return null;const M=u.data.text.split(`
508
- `),F=M.slice(S.startLine-1,Math.min(S.endLine,M.length)),C=Math.min(...F.filter(O=>O.trim()).map(O=>{var I;return((I=/^\s*/.exec(O))==null?void 0:I[0].length)??0}));return F.map(O=>O.slice(Number.isFinite(C)?C:0)).join(`
509
- `)},[o,p,u.data]),x=b.useMemo(()=>o?[{from:o.blocks[p].startLine,to:o.blocks[p].endLine,cls:"block"}]:[],[o,p]);if(l.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!o)return a.jsx(Ft,{title:"Walkthrough not found"});const v=o.blocks[p],j=o.blocks.filter(S=>S.verdict).length,E=o.blocks.reduce((S,M)=>S+(M.verdict==="right"?1:M.verdict==="partial"?.5:0),0),k=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(Ju,{back:a.jsx(Qa,{}),badges:a.jsxs(a.Fragment,{children:[a.jsx(ke,{tone:"accent",children:"walkthrough"}),a.jsxs("span",{className:"text-xs text-muted",children:[j,"/",o.blocks.length," checked · ",It(o.createdAt)]})]}),title:a.jsx("span",{className:"font-mono text-[20px]",children:n(o.file)}),actions:a.jsx(Z,{variant:"ghost",size:"sm",icon:a.jsx(fr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})}),a.jsx("div",{className:"mt-5 flex gap-1",children:o.blocks.map((S,M)=>a.jsx("button",{title:S.title,onClick:()=>h(M),className:le("h-2 flex-1 rounded-full transition",S.verdict==="right"?"bg-good":S.verdict==="partial"?"bg-warn":S.verdict==="wrong"?"bg-bad":"bg-line",M===p&&"ring-2 ring-accent/40 ring-offset-2 ring-offset-bg")},M))}),a.jsxs("div",{className:"card mt-6 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:["Block ",p+1," of ",o.blocks.length," · lines ",v.startLine,"-",v.endLine,v.verdict&&a.jsx("span",{className:"ml-auto",children:a.jsx(a0,{v:v.verdict})})]}),a.jsx("h2",{className:"mt-1 text-lg font-semibold",children:v.title||`Block ${p+1}`}),a.jsx("p",{className:"reading mt-1 text-muted",children:v.why}),y!==null&&a.jsxs("div",{className:"mt-5 min-w-0 overflow-hidden rounded-md border border-line bg-panel",children:[a.jsxs("div",{className:"border-b border-line bg-raised/60 px-3 py-1.5 font-mono text-[12px] text-muted",children:[n(o.file).split("/").slice(-2).join("/"),":",v.startLine,"–",v.endLine]}),a.jsx("div",{className:"lens-step-code",children:a.jsx(qa,{text:y,lang:u.data.lang,firstLine:v.startLine})})]}),v.explain&&a.jsx("div",{className:"mt-5",children:a.jsx(Xi,{children:v.explain})}),v.example&&a.jsxs("div",{className:"mt-5 rounded-r-lg border-l-[3px] border-good bg-good/5 px-4 py-3",children:[a.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-good",children:[a.jsx(Gf,{className:"h-3.5 w-3.5"})," Try it with real values"]}),a.jsx(Xi,{children:v.example})]}),a.jsx("div",{className:"mt-5 rounded-lg border border-accent/25 bg-accent/5 p-3 text-[15.5px] font-medium",children:v.question}),v.verdict&&a.jsxs("div",{className:le("mt-4 space-y-2",g&&"opacity-70"),children:[g&&a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted",children:"Your last answer"}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:v.answer||a.jsx("span",{className:"text-muted",children:"(no answer)"})}),v.feedback&&a.jsx("p",{className:"reading",children:v.feedback}),v.verdict!=="right"&&!g&&!i.busy&&a.jsx(Z,{size:"sm",icon:a.jsx(Yf,{className:"h-3.5 w-3.5"}),onClick:()=>w(!0),children:"Try again"})]}),(!v.verdict||g)&&a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-4 min-h-[88px]",placeholder:g?"Answer again, in your own words (don't copy the feedback)":"Your answer, from the block on the right",value:f,onChange:S=>m(S.target.value),autoFocus:g}),a.jsx(Z,{variant:"primary",className:"mt-3",icon:a.jsx(Qf,{className:"h-4 w-4"}),disabled:i.busy||!f.trim(),onClick:()=>{h(p),i.run(`/projects/${t.id}/walks/${o.id}/blocks/${p}`,{answer:f},()=>{w(!1),m("")})},children:"Check"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"walkcheck",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})}),a.jsx("div",{className:"mt-5 flex justify-end",children:p<o.blocks.length-1&&a.jsx(Z,{size:"sm",icon:a.jsx(Bu,{className:"h-3.5 w-3.5"}),onClick:()=>h(p+1),children:"Next block"})})]}),j===o.blocks.length&&a.jsxs("div",{className:"card mt-6 flex items-center gap-3 border-good/30 p-4",children:[a.jsx(qu,{className:"h-5 w-5 text-good"}),a.jsxs("div",{className:"text-sm",children:["Walk done: ",Math.round(E/o.blocks.length*100),"% of the checks right. Next, try explaining the file in your own words (Teach) or hunt a bug in it."]})]})]})});return a.jsx(Qn,{id:"walk-code",collapsible:!0,side:"right",initial:560,min:320,max:960,className:"h-full",left:k,right:a.jsx(yl,{file:o.file,line:v.startLine,marks:x})})}const lL=["","easy","medium","hard"];function aL(){const{id:e=""}=Or(),{project:t,rel:n}=it(),r=gt(),i=Dt(),s=mn(),l=ac(`hunts/${e}`),o=xe({queryKey:["hunt",t.id,e],queryFn:()=>me(`/projects/${t.id}/hunts/${e}`)}),u=o.data,[c,d]=b.useState(null),[h,p]=b.useState(null),f=b.useRef();b.useEffect(()=>{u&&c===null&&d(u.marks)},[u,c]);const m=c??[],g=!!(u!=null&&u.grade),w=k=>{d(k),clearTimeout(f.current),f.current=setTimeout(()=>jh(`/projects/${t.id}/hunts/${e}/marks`,{marks:k}).catch(()=>{}),400)},y=k=>{if(g)return p(k);p(k),m.some(S=>S.line===k)||w([...m,{line:k,why:""}].sort((S,M)=>S.line-M.line))},x=b.useMemo(()=>{if(!u)return[];const k=m.map(S=>({from:S.line,to:S.line,cls:"marked"}));if(u.grade)for(const S of u.planted)S&&k.push({from:S.line,to:S.line,cls:"bug"});return k},[u,m]);if(o.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!u)return a.jsx(Ft,{title:"Bug hunt not found"});const v=u.grade,j=u.planted.length,E=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(Ju,{back:a.jsx(Qa,{}),badges:a.jsxs(a.Fragment,{children:[a.jsxs(ke,{tone:"bad",children:[a.jsx(Uu,{className:"h-3 w-3"})," bug hunt · ",lL[u.level]]}),a.jsxs("span",{className:"text-xs text-muted",children:[j," bug",j===1?"":"s"," planted · ",It(u.createdAt)]})]}),title:a.jsx("span",{className:"font-mono text-[20px]",children:n(u.file)}),actions:a.jsx(Z,{variant:"ghost",size:"sm",icon:a.jsx(fr,{className:"h-3.5 w-3.5"}),onClick:()=>l(r),children:"Archive"})}),!v&&a.jsxs("p",{className:"mt-3 text-sm text-muted",children:["The code on the right is a copy with ",j," planted bug",j===1?"":"s",". Click a line you think is wrong, then say what it breaks. Your folder is not touched."]}),v&&a.jsxs("div",{className:"card mt-6 flex flex-wrap items-center gap-4 p-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-muted",children:"Score"}),a.jsx("div",{className:"text-3xl",children:a.jsx(Na,{score:v.score})})]}),a.jsxs("div",{className:"text-sm text-muted",children:[v.found.length," found · ",v.missed.length," missed · ",v.falseAlarms.length," false alarm",v.falseAlarms.length===1?"":"s"]})]}),!v&&a.jsxs("section",{className:"mt-6 space-y-2",children:[a.jsxs("div",{className:"label",children:["Your marks · ",m.length]}),m.map((k,S)=>a.jsxs("div",{className:"card p-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>p(k.line),children:["line ",k.line]}),a.jsx("button",{className:"ml-auto text-muted hover:text-bad","aria-label":"Remove mark",onClick:()=>w(m.filter(M=>M.line!==k.line)),children:a.jsx(pr,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{className:"input mt-2",placeholder:"What is wrong, and what does it break?",value:k.why,onChange:M=>w(m.map((F,C)=>C===S?{...F,why:M.target.value}:F))})]},k.line)),!m.length&&a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"No marks yet. Click a line in the code."}),a.jsx(Z,{variant:"primary",className:"mt-2",icon:a.jsx(gl,{className:"h-4 w-4"}),disabled:s.busy||!m.length,onClick:async()=>{clearTimeout(f.current),await jh(`/projects/${t.id}/hunts/${e}/marks`,{marks:m}),s.run(`/projects/${t.id}/hunts/${e}/grade`,{},()=>i.invalidateQueries({queryKey:["hunt",t.id,e]}))},children:"Check my hunt"})]}),v&&a.jsxs(a.Fragment,{children:[v.found.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-good",children:[a.jsx(ml,{className:"h-4 w-4"})," Found"]}),v.found.map(k=>a.jsx(Px,{h:u,line:k.line,what:k.what,feedback:k.feedback,onShow:p},k.line))]}),v.missed.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-bad",children:[a.jsx(P1,{className:"h-4 w-4"})," Missed"]}),v.missed.map(k=>a.jsx(Px,{h:u,line:k.line,what:k.what,onShow:p},k.line))]}),v.falseAlarms.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-warn",children:[a.jsx(E1,{className:"h-4 w-4"})," False alarms"]}),v.falseAlarms.map(k=>a.jsxs("div",{className:"card mb-2 p-3 text-[14.5px]",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>p(k.line),children:["line ",k.line]}),a.jsx("div",{className:"mt-1",children:k.feedback||"This line is fine."})]},k.line))]})]}),s.busy&&s.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"huntgrade",elapsed:s.elapsed})}),s.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:s.error,onClose:s.clearError})})]})});return a.jsx(Qn,{id:"hunt-code",collapsible:!0,side:"right",initial:600,min:320,max:1e3,className:"h-full",left:E,right:a.jsx(yl,{file:u.file,text:u.text,title:`${n(u.file)} (copy with bugs)`,line:h,marks:x,onLineClick:y})})}function Px({h:e,line:t,what:n,feedback:r,onShow:i}){const s=e.planted.find(l=>(l==null?void 0:l.line)===t);return a.jsxs("div",{className:"card mb-2 p-3 text-[14.5px]",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>i(t),children:["line ",t]}),s&&a.jsxs("div",{className:"mt-2 overflow-x-auto rounded-md bg-raised font-mono text-[13px]",children:[a.jsxs("div",{className:"whitespace-pre px-2 py-1 text-bad",children:["bug ",s.buggy.trim()]}),a.jsxs("div",{className:"whitespace-pre px-2 py-1 text-good",children:["real ",s.original.trim()]})]}),a.jsx("div",{className:"mt-2",children:n}),r&&a.jsx("div",{className:"mt-1 text-muted",children:r})]})}const oL={lens:"Read a lens",walk:"Walk through",quiz:"Quiz",teachback:"Teach back"},uL={lens:"Start the lens",walk:"Start the walk",quiz:"Start the quiz",teachback:"Start the teach-back"};function cL(){var l;const{project:e}=it(),t=gt(),n=mn(),[r,i]=b.useState(""),s=xe({queryKey:["paths",e.id],queryFn:()=>me(`/projects/${e.id}/paths`)});return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Learning paths"}),a.jsx("p",{className:"text-sm text-muted",children:"An ordered tour of the repo: where to start, what next, and how to check each stop. Stops tick off as you do them."}),a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsx("div",{className:"label",children:"What do you want to be able to do? (optional)"}),a.jsx("input",{className:"input",placeholder:"e.g. change how retries work, or review PRs to the scheduler",value:r,onChange:o=>i(o.target.value)}),a.jsx(Z,{variant:"primary",className:"mt-3",icon:a.jsx(Jf,{className:"h-4 w-4"}),disabled:n.busy,onClick:()=>n.run(`/projects/${e.id}/paths`,{goal:r},o=>t(`/p/${e.id}/paths/${o.resultId}`)),children:"Make a path"}),n.busy&&n.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"path",elapsed:n.elapsed})}),n.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:n.error,onClose:n.clearError})})]}),a.jsx("div",{className:"mt-6 space-y-2",children:(l=s.data)==null?void 0:l.map(o=>{const u=o.done.filter(Boolean).length;return a.jsxs(ft,{to:`/p/${e.id}/paths/${o.id}`,className:"card flex items-center gap-3 p-4 transition hover:border-accent/40",children:[a.jsx(Xf,{className:"h-5 w-5 text-good"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium",children:o.title}),a.jsxs("div",{className:"text-xs text-muted",children:[o.stops.length," stops · ",It(o.createdAt)]})]}),a.jsx("div",{className:"h-1.5 w-28 overflow-hidden rounded-full bg-line",children:a.jsx("div",{className:"h-full bg-good",style:{width:`${u/o.stops.length*100}%`}})}),a.jsxs("span",{className:"w-10 text-right text-xs tabular-nums text-muted",children:[u,"/",o.stops.length]})]},o.id)})})]})})}function dL(){const{id:e=""}=Or(),{project:t,rel:n,setSelected:r,setOpenFile:i}=it(),s=gt(),l=Dt(),o=xe({queryKey:["path",t.id,e],queryFn:()=>me(`/projects/${t.id}/paths/${e}`)}),u=xi({mutationFn:f=>Ba(`/projects/${t.id}/paths/${e}`,{stops:f}),onSuccess:f=>l.setQueryData(["path",t.id,e],f)});if(o.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!o.data)return a.jsx(Ft,{title:"Path not found"});const c=o.data,d=c.done.findIndex(f=>!f),h=(f,m)=>{const g=[...c.stops],[w]=g.splice(f,1);g.splice(f+m,0,w),u.mutate(g)},p=f=>{r(f.files),i(f.files[0]),s(`/p/${t.id}/explore?do=${f.activity==="teachback"?"teach":f.activity}`)};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(Ju,{back:a.jsx(Qa,{to:"paths",label:"Paths"}),badges:a.jsxs(a.Fragment,{children:[a.jsx(ke,{tone:"good",children:"path"}),a.jsxs("span",{className:"text-xs text-muted",children:[c.done.filter(Boolean).length,"/",c.stops.length," done · ",It(c.createdAt)]})]}),title:c.title,actions:a.jsx(Z,{variant:"ghost",size:"sm",icon:a.jsx(fr,{className:"h-3.5 w-3.5"}),onClick:async()=>{await ls(`/projects/${t.id}/paths/${c.id}`),s(`/p/${t.id}/paths`)},children:"Archive"})}),a.jsx("ol",{className:"relative mt-8 space-y-3 border-l-2 border-line pl-6",children:c.stops.map((f,m)=>a.jsxs("li",{className:"relative",children:[a.jsx("span",{className:le("absolute -left-[35px] top-4 grid h-5 w-5 place-items-center rounded-full bg-bg",c.done[m]?"text-good":m===d?"text-accent":"text-muted"),children:c.done[m]?a.jsx(ml,{className:"h-5 w-5"}):a.jsx(Vj,{className:"h-5 w-5"})}),a.jsxs("div",{className:le("card group p-4",m===d&&"ring-1 ring-accent/40"),children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"text-xs text-muted",children:["Stop ",m+1," · ",oL[f.activity]??f.activity]}),a.jsx("div",{className:"font-medium",children:f.title})]}),a.jsxs("div",{className:"flex gap-0.5 opacity-0 transition group-hover:opacity-100",children:[a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-ink disabled:opacity-30",disabled:m===0,onClick:()=>h(m,-1),"aria-label":"Move up",children:a.jsx(S1,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-ink disabled:opacity-30",disabled:m===c.stops.length-1,onClick:()=>h(m,1),"aria-label":"Move down",children:a.jsx(Bj,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-bad",onClick:()=>u.mutate(c.stops.filter((g,w)=>w!==m)),"aria-label":"Remove stop",children:a.jsx(pr,{className:"h-3.5 w-3.5"})})]})]}),a.jsx("p",{className:"mt-1 text-[14.5px] text-muted",children:f.why}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[f.files.map(g=>a.jsx("span",{className:"rounded bg-raised px-1.5 py-0.5 font-mono text-[12px]",children:n(g)},g)),a.jsx(Z,{size:"sm",variant:m===d?"primary":"secondary",className:"ml-auto",onClick:()=>p(f),children:c.done[m]?"Do it again":uL[f.activity]??"Start"})]})]})]},`${m}-${f.title}`))})]})})}const hL=b.lazy(()=>dl(()=>import("./Map-pFoOaroM.js"),[]).then(e=>({default:e.MapPage}))),fL=b.lazy(()=>dl(()=>import("./Practice-DJ_GeEEw.js").then(e=>e.K),[]).then(e=>({default:e.PracticePage})));ty();const pL=new Ej({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function mL(){return a.jsx(Ft,{title:"Project not found",action:a.jsx(Z,{onClick:()=>location.href="/",children:"Back to projects"}),children:"It may have been removed from the list. Open its folder again."})}function gL(){const{pid:e=""}=Or();return a.jsx(hS,{pid:e,fallback:a.jsx(mL,{}),children:a.jsx(i0,{})},e)}const xL=ON([{element:a.jsx(dS,{}),children:[{path:"/",element:a.jsx(pS,{})},{path:"/settings",element:a.jsx(XT,{})},{path:"/help",element:a.jsx(tS,{})},{path:"/p/:pid",element:a.jsx(gL,{}),children:[{index:!0,element:a.jsx(TN,{to:"today",replace:!0})},{path:"today",element:a.jsx(JT,{})},{path:"explore",element:a.jsx(ES,{})},{path:"review",element:a.jsx(eL,{})},{path:"map",element:a.jsx(b.Suspense,{fallback:null,children:a.jsx(hL,{})})},{path:"paths",element:a.jsx(cL,{})},{path:"paths/:id",element:a.jsx(dL,{})},{path:"teach/:id",element:a.jsx(nL,{})},{path:"tutor/:id",element:a.jsx(iL,{})},{path:"walk/:id",element:a.jsx(sL,{})},{path:"hunt/:id",element:a.jsx(aL,{})},{path:"changes",element:a.jsx(OS,{})},{path:"library",element:a.jsx(BS,{})},{path:"progress",element:a.jsx(WT,{})},{path:"lens/:id",element:a.jsx(_T,{})},{path:"quiz/:id",element:a.jsx(HT,{})},{path:"practice/:id",element:a.jsx(b.Suspense,{fallback:null,children:a.jsx(fL,{})})}]},{path:"*",element:a.jsx(Ft,{title:"Page not found"})}]}]);r1(document.getElementById("root")).render(a.jsx(b.StrictMode,{children:a.jsx(zj,{client:pL,children:a.jsx(WN,{router:xL})})}));export{Vf as A,ke as B,Qf as C,ol as D,Ft as E,ap as F,jh as G,QS as H,up as I,sn as J,rC as K,ft as L,_1 as M,eC as N,US as O,iC as P,gx as Q,Yf as R,kt as S,fr as T,a0 as V,dl as _,gt as a,xe as b,vL as c,Qn as d,me as e,X as f,Uh as g,Or as h,Dt as i,a as j,sk as k,mn as l,qa as m,It as n,Gf as o,le as p,Ke as q,b as r,hr as s,FS as t,it as u,Z as v,U1 as w,M1 as x,ls as y,F1 as z};