@dendelion/paper-camp 0.13.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/app/assets/index-2ahHj0hk.js +7 -0
  2. package/dist/app/assets/index-2ahHj0hk.js.map +1 -0
  3. package/dist/app/assets/{index-CPoqe3xq.js → index-BSp1FE97.js} +2 -2
  4. package/dist/app/assets/{index-CPoqe3xq.js.map → index-BSp1FE97.js.map} +1 -1
  5. package/dist/app/assets/{index-ChVvOU5G.js → index-BTyua-6D.js} +3 -3
  6. package/dist/app/assets/{index-ChVvOU5G.js.map → index-BTyua-6D.js.map} +1 -1
  7. package/dist/app/assets/{index-CvQKE4RC.js → index-Bi4fur5H.js} +2 -2
  8. package/dist/app/assets/{index-CvQKE4RC.js.map → index-Bi4fur5H.js.map} +1 -1
  9. package/dist/app/assets/index-Bo0V9-3F.js +2 -0
  10. package/dist/app/assets/index-Bo0V9-3F.js.map +1 -0
  11. package/dist/app/assets/index-Cz9HEIaO.js +2 -0
  12. package/dist/app/assets/index-Cz9HEIaO.js.map +1 -0
  13. package/dist/app/assets/{index-jTvzs7JN.js → index-DKjtMMrA.js} +2 -2
  14. package/dist/app/assets/{index-jTvzs7JN.js.map → index-DKjtMMrA.js.map} +1 -1
  15. package/dist/app/assets/main-BW24wv9K.js +207 -0
  16. package/dist/app/assets/main-BW24wv9K.js.map +1 -0
  17. package/dist/app/assets/main-C-ynmROL.css +1 -0
  18. package/dist/app/assets/{sidebar-section-X7KA8eUz.js → sidebar-section-BHLbvk_X.js} +2 -2
  19. package/dist/app/assets/{sidebar-section-X7KA8eUz.js.map → sidebar-section-BHLbvk_X.js.map} +1 -1
  20. package/dist/app/index.html +6 -6
  21. package/dist/app/toolbar.js +11684 -0
  22. package/dist/app/toolbar.js.map +1 -0
  23. package/dist/chunks/dev-port.CEt1H9LA.js +35 -0
  24. package/dist/chunks/dev-port.CEt1H9LA.js.map +1 -0
  25. package/dist/chunks/{scaffold.DTcLEZRV.js → parked-questions.BoAnCnQA.js} +827 -725
  26. package/dist/chunks/parked-questions.BoAnCnQA.js.map +1 -0
  27. package/dist/cli/index.js +9165 -8877
  28. package/dist/cli/index.js.map +1 -1
  29. package/dist/core/index.d.ts +2 -0
  30. package/dist/core/index.d.ts.map +1 -1
  31. package/dist/core/index.js +83 -75
  32. package/dist/core/parked-questions.d.ts +6 -0
  33. package/dist/core/parked-questions.d.ts.map +1 -0
  34. package/dist/core/parked-questions.test.d.ts +2 -0
  35. package/dist/core/parked-questions.test.d.ts.map +1 -0
  36. package/dist/core/parse/parser.d.ts.map +1 -1
  37. package/dist/core/parse/schemas.d.ts +9 -0
  38. package/dist/core/parse/schemas.d.ts.map +1 -1
  39. package/dist/core/readers.d.ts.map +1 -1
  40. package/dist/core/release-notes.d.ts +4 -0
  41. package/dist/core/release-notes.d.ts.map +1 -0
  42. package/dist/core/release-notes.test.d.ts +2 -0
  43. package/dist/core/release-notes.test.d.ts.map +1 -0
  44. package/dist/core/serialize/serializer.d.ts +1 -0
  45. package/dist/core/serialize/serializer.d.ts.map +1 -1
  46. package/dist/core/thread.d.ts +8 -0
  47. package/dist/core/thread.d.ts.map +1 -1
  48. package/dist/core/thread.test.d.ts +2 -0
  49. package/dist/core/thread.test.d.ts.map +1 -0
  50. package/dist/core/trail.d.ts +6 -0
  51. package/dist/core/trail.d.ts.map +1 -1
  52. package/dist/types/index.d.ts +54 -2
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/index.js +15 -13
  55. package/dist/types/index.js.map +1 -1
  56. package/dist/vite/index.d.ts +8 -0
  57. package/dist/vite/index.d.ts.map +1 -0
  58. package/dist/vite/index.js +49 -0
  59. package/dist/vite/index.js.map +1 -0
  60. package/dist/vite/index.test.d.ts +2 -0
  61. package/dist/vite/index.test.d.ts.map +1 -0
  62. package/dist/vite/proxy.d.ts +7 -0
  63. package/dist/vite/proxy.d.ts.map +1 -0
  64. package/dist/vite/proxy.test.d.ts +2 -0
  65. package/dist/vite/proxy.test.d.ts.map +1 -0
  66. package/dist/vite.d.ts +6 -0
  67. package/package.json +16 -4
  68. package/dist/app/assets/index-CSirjtoU.js +0 -2
  69. package/dist/app/assets/index-CSirjtoU.js.map +0 -1
  70. package/dist/app/assets/index-D7DjxVq7.js +0 -2
  71. package/dist/app/assets/index-D7DjxVq7.js.map +0 -1
  72. package/dist/app/assets/main-CZ1b3UwB.css +0 -1
  73. package/dist/app/assets/main-CezpONOg.js +0 -207
  74. package/dist/app/assets/main-CezpONOg.js.map +0 -1
  75. package/dist/chunks/scaffold.DTcLEZRV.js.map +0 -1
@@ -1,207 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D7DjxVq7.js","assets/sidebar-section-X7KA8eUz.js","assets/index-CSirjtoU.js","assets/tokens-C3C44lLs.js","assets/index-ChVvOU5G.js","assets/index-jTvzs7JN.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Xl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nv={exports:{}},Kc={},Iv={exports:{}},re={};/**
3
- * @license React
4
- * react.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var fa=Symbol.for("react.element"),WS=Symbol.for("react.portal"),HS=Symbol.for("react.fragment"),GS=Symbol.for("react.strict_mode"),KS=Symbol.for("react.profiler"),qS=Symbol.for("react.provider"),YS=Symbol.for("react.context"),QS=Symbol.for("react.forward_ref"),XS=Symbol.for("react.suspense"),JS=Symbol.for("react.memo"),ZS=Symbol.for("react.lazy"),sg=Symbol.iterator;function eC(e){return e===null||typeof e!="object"?null:(e=sg&&e[sg]||e["@@iterator"],typeof e=="function"?e:null)}var Av={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mv=Object.assign,Lv={};function Ai(e,t,n){this.props=e,this.context=t,this.refs=Lv,this.updater=n||Av}Ai.prototype.isReactComponent={};Ai.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")};Ai.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dv(){}Dv.prototype=Ai.prototype;function Qh(e,t,n){this.props=e,this.context=t,this.refs=Lv,this.updater=n||Av}var Xh=Qh.prototype=new Dv;Xh.constructor=Qh;Mv(Xh,Ai.prototype);Xh.isPureReactComponent=!0;var ig=Array.isArray,Fv=Object.prototype.hasOwnProperty,Jh={current:null},Ov={key:!0,ref:!0,__self:!0,__source:!0};function zv(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Fv.call(t,r)&&!Ov.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:fa,type:e,key:i,ref:o,props:s,_owner:Jh.current}}function tC(e,t){return{$$typeof:fa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zh(e){return typeof e=="object"&&e!==null&&e.$$typeof===fa}function nC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var og=/\/+/g;function Lu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?nC(""+e.key):t.toString(36)}function kl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case fa:case WS:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Lu(o,0):r,ig(s)?(n="",e!=null&&(n=e.replace(og,"$&/")+"/"),kl(s,t,n,"",function(u){return u})):s!=null&&(Zh(s)&&(s=tC(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(og,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",ig(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Lu(i,a);o+=kl(i,t,n,l,s)}else if(l=eC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Lu(i,a++),o+=kl(i,t,n,l,s);else if(i==="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 o}function Ma(e,t,n){if(e==null)return e;var r=[],s=0;return kl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function rC(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 dt={current:null},_l={transition:null},sC={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:_l,ReactCurrentOwner:Jh};function Bv(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Ma,forEach:function(e,t,n){Ma(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ma(e,function(){t++}),t},toArray:function(e){return Ma(e,function(t){return t})||[]},only:function(e){if(!Zh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Ai;re.Fragment=HS;re.Profiler=KS;re.PureComponent=Qh;re.StrictMode=GS;re.Suspense=XS;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sC;re.act=Bv;re.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=Mv({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Jh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Fv.call(t,l)&&!Ov.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:fa,type:e.type,key:s,ref:i,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:YS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qS,_context:e},e.Consumer=e};re.createElement=zv;re.createFactory=function(e){var t=zv.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:QS,render:e}};re.isValidElement=Zh;re.lazy=function(e){return{$$typeof:ZS,_payload:{_status:-1,_result:e},_init:rC}};re.memo=function(e,t){return{$$typeof:JS,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=_l.transition;_l.transition={};try{e()}finally{_l.transition=t}};re.unstable_act=Bv;re.useCallback=function(e,t){return dt.current.useCallback(e,t)};re.useContext=function(e){return dt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};re.useEffect=function(e,t){return dt.current.useEffect(e,t)};re.useId=function(){return dt.current.useId()};re.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return dt.current.useMemo(e,t)};re.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};re.useRef=function(e){return dt.current.useRef(e)};re.useState=function(e){return dt.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return dt.current.useTransition()};re.version="18.3.1";Iv.exports=re;var _=Iv.exports;const xi=Gc(_);/**
11
- * @license React
12
- * react-jsx-runtime.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var iC=_,oC=Symbol.for("react.element"),aC=Symbol.for("react.fragment"),lC=Object.prototype.hasOwnProperty,cC=iC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uC={key:!0,ref:!0,__self:!0,__source:!0};function $v(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)lC.call(t,r)&&!uC.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:oC,type:e,key:i,ref:o,props:s,_owner:cC.current}}Kc.Fragment=aC;Kc.jsx=$v;Kc.jsxs=$v;Nv.exports=Kc;var f=Nv.exports,Vv={exports:{}},Ft={},Uv={exports:{}},Wv={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */(function(e){function t(L,$){var C=L.length;L.push($);e:for(;0<C;){var V=C-1>>>1,q=L[V];if(0<s(q,$))L[V]=$,L[C]=q,C=V;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var $=L[0],C=L.pop();if(C!==$){L[0]=C;e:for(var V=0,q=L.length,N=q>>>1;V<N;){var le=2*(V+1)-1,fe=L[le],ue=le+1,Pt=L[ue];if(0>s(fe,C))ue<q&&0>s(Pt,fe)?(L[V]=Pt,L[ue]=C,V=ue):(L[V]=fe,L[le]=C,V=le);else if(ue<q&&0>s(Pt,C))L[V]=Pt,L[ue]=C,V=ue;else break e}}return $}function s(L,$){var C=L.sortIndex-$.sortIndex;return C!==0?C:L.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,h=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=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(L){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=L)r(u),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(u)}}function k(L){if(y=!1,v(L),!m)if(n(l)!==null)m=!0,z(S);else{var $=n(u);$!==null&&B(k,$.startTime-L)}}function S(L,$){m=!1,y&&(y=!1,g(P),P=-1),p=!0;var C=h;try{for(v($),d=n(l);d!==null&&(!(d.expirationTime>$)||L&&!I());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var q=V(d.expirationTime<=$);$=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(l)&&r(l),v($)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var le=n(u);le!==null&&B(k,le.startTime-$),N=!1}return N}finally{d=null,h=C,p=!1}}var b=!1,j=null,P=-1,T=5,E=-1;function I(){return!(e.unstable_now()-E<T)}function M(){if(j!==null){var L=e.unstable_now();E=L;var $=!0;try{$=j(!0,L)}finally{$?O():(b=!1,j=null)}}else b=!1}var O;if(typeof x=="function")O=function(){x(M)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,R=A.port2;A.port1.onmessage=M,O=function(){R.postMessage(null)}}else O=function(){w(M,0)};function z(L){j=L,b||(b=!0,O())}function B(L,$){P=w(function(){L(e.unstable_now())},$)}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(L){L.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,z(S))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var C=h;h=$;try{return L()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,$){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var C=h;h=L;try{return $()}finally{h=C}},e.unstable_scheduleCallback=function(L,$,C){var V=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?V+C:V):C=V,L){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=C+q,L={id:c++,callback:$,priorityLevel:L,startTime:C,expirationTime:q,sortIndex:-1},C>V?(L.sortIndex=C,t(u,L),n(l)===null&&L===n(u)&&(y?(g(P),P=-1):y=!0,B(k,C-V))):(L.sortIndex=q,t(l,L),m||p||(m=!0,z(S))),L},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(L){var $=h;return function(){var C=h;h=$;try{return L.apply(this,arguments)}finally{h=C}}}})(Wv);Uv.exports=Wv;var dC=Uv.exports;/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var fC=_,Dt=dC;function U(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 Hv=new Set,Bo={};function Ts(e,t){vi(e,t),vi(e+"Capture",t)}function vi(e,t){for(Bo[e]=t,e=0;e<t.length;e++)Hv.add(t[e])}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uf=Object.prototype.hasOwnProperty,hC=/^[: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]*$/,ag={},lg={};function pC(e){return uf.call(lg,e)?!0:uf.call(ag,e)?!1:hC.test(e)?lg[e]=!0:(ag[e]=!0,!1)}function mC(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 gC(e,t,n,r){if(t===null||typeof t>"u"||mC(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 ft(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ft(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){Je[e]=new ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var ep=/[\-:]([a-z])/g;function tp(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(ep,tp);Je[t]=new ft(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(ep,tp);Je[t]=new ft(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(ep,tp);Je[t]=new ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function np(e,t,n,r){var s=Je.hasOwnProperty(t)?Je[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(gC(t,n,s,r)&&(n=null),r||s===null?pC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var rr=fC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,La=Symbol.for("react.element"),Ks=Symbol.for("react.portal"),qs=Symbol.for("react.fragment"),rp=Symbol.for("react.strict_mode"),df=Symbol.for("react.profiler"),Gv=Symbol.for("react.provider"),Kv=Symbol.for("react.context"),sp=Symbol.for("react.forward_ref"),ff=Symbol.for("react.suspense"),hf=Symbol.for("react.suspense_list"),ip=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),qv=Symbol.for("react.offscreen"),cg=Symbol.iterator;function Yi(e){return e===null||typeof e!="object"?null:(e=cg&&e[cg]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Du;function yo(e){if(Du===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Du=t&&t[1]||""}return`
35
- `+Du+e}var Fu=!1;function Ou(e,t){if(!e||Fu)return"";Fu=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
36
- `),i=r.stack.split(`
37
- `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
38
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Fu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yo(e):""}function yC(e){switch(e.tag){case 5:return yo(e.type);case 16:return yo("Lazy");case 13:return yo("Suspense");case 19:return yo("SuspenseList");case 0:case 2:case 15:return e=Ou(e.type,!1),e;case 11:return e=Ou(e.type.render,!1),e;case 1:return e=Ou(e.type,!0),e;default:return""}}function pf(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 qs:return"Fragment";case Ks:return"Portal";case df:return"Profiler";case rp:return"StrictMode";case ff:return"Suspense";case hf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kv:return(e.displayName||"Context")+".Consumer";case Gv:return(e._context.displayName||"Context")+".Provider";case sp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ip:return t=e.displayName||null,t!==null?t:pf(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return pf(e(t))}catch{}}return null}function xC(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 pf(t);case 8:return t===rp?"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 zr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vC(e){var t=Yv(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Da(e){e._valueTracker||(e._valueTracker=vC(e))}function Qv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yv(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(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 mf(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ug(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zr(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 Xv(e,t){t=t.checked,t!=null&&np(e,"checked",t,!1)}function gf(e,t){Xv(e,t);var n=zr(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")?yf(e,t.type,n):t.hasOwnProperty("defaultValue")&&yf(e,t.type,zr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dg(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 yf(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xo=Array.isArray;function ci(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+zr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function xf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(xo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:zr(n)}}function Jv(e,t){var n=zr(t.value),r=zr(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 hg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Zv(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 vf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fa,e1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fa=Fa||document.createElement("div"),Fa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $o(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _o={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},wC=["Webkit","ms","Moz","O"];Object.keys(_o).forEach(function(e){wC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_o[t]=_o[e]})});function t1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_o.hasOwnProperty(e)&&_o[e]?(""+t).trim():t+"px"}function n1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=t1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var bC=je({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 wf(e,t){if(t){if(bC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function bf(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 kf=null;function op(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _f=null,ui=null,di=null;function pg(e){if(e=ma(e)){if(typeof _f!="function")throw Error(U(280));var t=e.stateNode;t&&(t=Jc(t),_f(e.stateNode,e.type,t))}}function r1(e){ui?di?di.push(e):di=[e]:ui=e}function s1(){if(ui){var e=ui,t=di;if(di=ui=null,pg(e),t)for(e=0;e<t.length;e++)pg(t[e])}}function i1(e,t){return e(t)}function o1(){}var zu=!1;function a1(e,t,n){if(zu)return e(t,n);zu=!0;try{return i1(e,t,n)}finally{zu=!1,(ui!==null||di!==null)&&(o1(),s1())}}function Vo(e,t){var n=e.stateNode;if(n===null)return null;var r=Jc(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(U(231,t,typeof n));return n}var Sf=!1;if(Jn)try{var Qi={};Object.defineProperty(Qi,"passive",{get:function(){Sf=!0}}),window.addEventListener("test",Qi,Qi),window.removeEventListener("test",Qi,Qi)}catch{Sf=!1}function kC(e,t,n,r,s,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var So=!1,Zl=null,ec=!1,Cf=null,_C={onError:function(e){So=!0,Zl=e}};function SC(e,t,n,r,s,i,o,a,l){So=!1,Zl=null,kC.apply(_C,arguments)}function CC(e,t,n,r,s,i,o,a,l){if(SC.apply(this,arguments),So){if(So){var u=Zl;So=!1,Zl=null}else throw Error(U(198));ec||(ec=!0,Cf=u)}}function Rs(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 l1(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 mg(e){if(Rs(e)!==e)throw Error(U(188))}function PC(e){var t=e.alternate;if(!t){if(t=Rs(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return mg(s),e;if(i===r)return mg(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function c1(e){return e=PC(e),e!==null?u1(e):null}function u1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=u1(e);if(t!==null)return t;e=e.sibling}return null}var d1=Dt.unstable_scheduleCallback,gg=Dt.unstable_cancelCallback,jC=Dt.unstable_shouldYield,EC=Dt.unstable_requestPaint,Le=Dt.unstable_now,TC=Dt.unstable_getCurrentPriorityLevel,ap=Dt.unstable_ImmediatePriority,f1=Dt.unstable_UserBlockingPriority,tc=Dt.unstable_NormalPriority,RC=Dt.unstable_LowPriority,h1=Dt.unstable_IdlePriority,qc=null,Rn=null;function NC(e){if(Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(qc,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:MC,IC=Math.log,AC=Math.LN2;function MC(e){return e>>>=0,e===0?32:31-(IC(e)/AC|0)|0}var Oa=64,za=4194304;function vo(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 nc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=vo(a):(i&=o,i!==0&&(r=vo(i)))}else o=n&~s,o!==0?r=vo(o):i!==0&&(r=vo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&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-fn(t),s=1<<n,r|=e[n],t&=~s;return r}function LC(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 DC(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-fn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=LC(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Pf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function p1(){var e=Oa;return Oa<<=1,!(Oa&4194240)&&(Oa=64),e}function Bu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ha(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=n}function FC(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 s=31-fn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function lp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-fn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ce=0;function m1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var g1,cp,y1,x1,v1,jf=!1,Ba=[],Tr=null,Rr=null,Nr=null,Uo=new Map,Wo=new Map,wr=[],OC="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 yg(e,t){switch(e){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wo.delete(t.pointerId)}}function Xi(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ma(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function zC(e,t,n,r,s){switch(t){case"focusin":return Tr=Xi(Tr,e,t,n,r,s),!0;case"dragenter":return Rr=Xi(Rr,e,t,n,r,s),!0;case"mouseover":return Nr=Xi(Nr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Uo.set(i,Xi(Uo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Wo.set(i,Xi(Wo.get(i)||null,e,t,n,r,s)),!0}return!1}function w1(e){var t=us(e.target);if(t!==null){var n=Rs(t);if(n!==null){if(t=n.tag,t===13){if(t=l1(n),t!==null){e.blockedOn=t,v1(e.priority,function(){y1(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 Sl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ef(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);kf=r,n.target.dispatchEvent(r),kf=null}else return t=ma(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function xg(e,t,n){Sl(e)&&n.delete(t)}function BC(){jf=!1,Tr!==null&&Sl(Tr)&&(Tr=null),Rr!==null&&Sl(Rr)&&(Rr=null),Nr!==null&&Sl(Nr)&&(Nr=null),Uo.forEach(xg),Wo.forEach(xg)}function Ji(e,t){e.blockedOn===t&&(e.blockedOn=null,jf||(jf=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,BC)))}function Ho(e){function t(s){return Ji(s,e)}if(0<Ba.length){Ji(Ba[0],e);for(var n=1;n<Ba.length;n++){var r=Ba[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Tr!==null&&Ji(Tr,e),Rr!==null&&Ji(Rr,e),Nr!==null&&Ji(Nr,e),Uo.forEach(t),Wo.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);)w1(n),n.blockedOn===null&&wr.shift()}var fi=rr.ReactCurrentBatchConfig,rc=!0;function $C(e,t,n,r){var s=ce,i=fi.transition;fi.transition=null;try{ce=1,up(e,t,n,r)}finally{ce=s,fi.transition=i}}function VC(e,t,n,r){var s=ce,i=fi.transition;fi.transition=null;try{ce=4,up(e,t,n,r)}finally{ce=s,fi.transition=i}}function up(e,t,n,r){if(rc){var s=Ef(e,t,n,r);if(s===null)Qu(e,t,r,sc,n),yg(e,r);else if(zC(s,e,t,n,r))r.stopPropagation();else if(yg(e,r),t&4&&-1<OC.indexOf(e)){for(;s!==null;){var i=ma(s);if(i!==null&&g1(i),i=Ef(e,t,n,r),i===null&&Qu(e,t,r,sc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Qu(e,t,r,null,n)}}var sc=null;function Ef(e,t,n,r){if(sc=null,e=op(r),e=us(e),e!==null)if(t=Rs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=l1(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 sc=e,null}function b1(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(TC()){case ap:return 1;case f1:return 4;case tc:case RC:return 16;case h1:return 536870912;default:return 16}default:return 16}}var kr=null,dp=null,Cl=null;function k1(){if(Cl)return Cl;var e,t=dp,n=t.length,r,s="value"in kr?kr.value:kr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Cl=s.slice(e,1<r?1-r:void 0)}function Pl(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 $a(){return!0}function vg(){return!1}function Ot(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$a:vg,this.isPropagationStopped=vg,this}return je(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=$a)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$a)},persist:function(){},isPersistent:$a}),t}var Mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fp=Ot(Mi),pa=je({},Mi,{view:0,detail:0}),UC=Ot(pa),$u,Vu,Zi,Yc=je({},pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hp,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!==Zi&&(Zi&&e.type==="mousemove"?($u=e.screenX-Zi.screenX,Vu=e.screenY-Zi.screenY):Vu=$u=0,Zi=e),$u)},movementY:function(e){return"movementY"in e?e.movementY:Vu}}),wg=Ot(Yc),WC=je({},Yc,{dataTransfer:0}),HC=Ot(WC),GC=je({},pa,{relatedTarget:0}),Uu=Ot(GC),KC=je({},Mi,{animationName:0,elapsedTime:0,pseudoElement:0}),qC=Ot(KC),YC=je({},Mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),QC=Ot(YC),XC=je({},Mi,{data:0}),bg=Ot(XC),JC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZC={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"},eP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eP[e])?!!t[e]:!1}function hp(){return tP}var nP=je({},pa,{key:function(e){if(e.key){var t=JC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ZC[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hp,charCode:function(e){return e.type==="keypress"?Pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rP=Ot(nP),sP=je({},Yc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kg=Ot(sP),iP=je({},pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hp}),oP=Ot(iP),aP=je({},Mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),lP=Ot(aP),cP=je({},Yc,{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}),uP=Ot(cP),dP=[9,13,27,32],pp=Jn&&"CompositionEvent"in window,Co=null;Jn&&"documentMode"in document&&(Co=document.documentMode);var fP=Jn&&"TextEvent"in window&&!Co,_1=Jn&&(!pp||Co&&8<Co&&11>=Co),_g=" ",Sg=!1;function S1(e,t){switch(e){case"keyup":return dP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ys=!1;function hP(e,t){switch(e){case"compositionend":return C1(t);case"keypress":return t.which!==32?null:(Sg=!0,_g);case"textInput":return e=t.data,e===_g&&Sg?null:e;default:return null}}function pP(e,t){if(Ys)return e==="compositionend"||!pp&&S1(e,t)?(e=k1(),Cl=dp=kr=null,Ys=!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 _1&&t.locale!=="ko"?null:t.data;default:return null}}var mP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Cg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mP[e.type]:t==="textarea"}function P1(e,t,n,r){r1(r),t=ic(t,"onChange"),0<t.length&&(n=new fp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Po=null,Go=null;function gP(e){F1(e,0)}function Qc(e){var t=Js(e);if(Qv(t))return e}function yP(e,t){if(e==="change")return t}var j1=!1;if(Jn){var Wu;if(Jn){var Hu="oninput"in document;if(!Hu){var Pg=document.createElement("div");Pg.setAttribute("oninput","return;"),Hu=typeof Pg.oninput=="function"}Wu=Hu}else Wu=!1;j1=Wu&&(!document.documentMode||9<document.documentMode)}function jg(){Po&&(Po.detachEvent("onpropertychange",E1),Go=Po=null)}function E1(e){if(e.propertyName==="value"&&Qc(Go)){var t=[];P1(t,Go,e,op(e)),a1(gP,t)}}function xP(e,t,n){e==="focusin"?(jg(),Po=t,Go=n,Po.attachEvent("onpropertychange",E1)):e==="focusout"&&jg()}function vP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qc(Go)}function wP(e,t){if(e==="click")return Qc(t)}function bP(e,t){if(e==="input"||e==="change")return Qc(t)}function kP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:kP;function Ko(e,t){if(mn(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 s=n[r];if(!uf.call(t,s)||!mn(e[s],t[s]))return!1}return!0}function Eg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tg(e,t){var n=Eg(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=Eg(n)}}function T1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?T1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R1(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function mp(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 _P(e){var t=R1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&T1(n.ownerDocument.documentElement,n)){if(r!==null&&mp(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Tg(n,i);var o=Tg(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 SP=Jn&&"documentMode"in document&&11>=document.documentMode,Qs=null,Tf=null,jo=null,Rf=!1;function Rg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rf||Qs==null||Qs!==Jl(r)||(r=Qs,"selectionStart"in r&&mp(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}),jo&&Ko(jo,r)||(jo=r,r=ic(Tf,"onSelect"),0<r.length&&(t=new fp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Qs)))}function Va(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xs={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionend:Va("Transition","TransitionEnd")},Gu={},N1={};Jn&&(N1=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function Xc(e){if(Gu[e])return Gu[e];if(!Xs[e])return e;var t=Xs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in N1)return Gu[e]=t[n];return e}var I1=Xc("animationend"),A1=Xc("animationiteration"),M1=Xc("animationstart"),L1=Xc("transitionend"),D1=new Map,Ng="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 Wr(e,t){D1.set(e,t),Ts(t,[e])}for(var Ku=0;Ku<Ng.length;Ku++){var qu=Ng[Ku],CP=qu.toLowerCase(),PP=qu[0].toUpperCase()+qu.slice(1);Wr(CP,"on"+PP)}Wr(I1,"onAnimationEnd");Wr(A1,"onAnimationIteration");Wr(M1,"onAnimationStart");Wr("dblclick","onDoubleClick");Wr("focusin","onFocus");Wr("focusout","onBlur");Wr(L1,"onTransitionEnd");vi("onMouseEnter",["mouseout","mouseover"]);vi("onMouseLeave",["mouseout","mouseover"]);vi("onPointerEnter",["pointerout","pointerover"]);vi("onPointerLeave",["pointerout","pointerover"]);Ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ts("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),jP=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function Ig(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,CC(r,t,void 0,e),e.currentTarget=null}function F1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Ig(s,a,u),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Ig(s,a,u),i=l}}}if(ec)throw e=Cf,ec=!1,Cf=null,e}function be(e,t){var n=t[Lf];n===void 0&&(n=t[Lf]=new Set);var r=e+"__bubble";n.has(r)||(O1(t,e,2,!1),n.add(r))}function Yu(e,t,n){var r=0;t&&(r|=4),O1(n,e,r,t)}var Ua="_reactListening"+Math.random().toString(36).slice(2);function qo(e){if(!e[Ua]){e[Ua]=!0,Hv.forEach(function(n){n!=="selectionchange"&&(jP.has(n)||Yu(n,!1,e),Yu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ua]||(t[Ua]=!0,Yu("selectionchange",!1,t))}}function O1(e,t,n,r){switch(b1(t)){case 1:var s=$C;break;case 4:s=VC;break;default:s=up}n=s.bind(null,t,n,e),s=void 0,!Sf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Qu(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=us(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}a1(function(){var u=i,c=op(n),d=[];e:{var h=D1.get(e);if(h!==void 0){var p=fp,m=e;switch(e){case"keypress":if(Pl(n)===0)break e;case"keydown":case"keyup":p=rP;break;case"focusin":m="focus",p=Uu;break;case"focusout":m="blur",p=Uu;break;case"beforeblur":case"afterblur":p=Uu;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":p=wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=HC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=oP;break;case I1:case A1:case M1:p=qC;break;case L1:p=lP;break;case"scroll":p=UC;break;case"wheel":p=uP;break;case"copy":case"cut":case"paste":p=QC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=kg}var y=(t&4)!==0,w=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var x=u,v;x!==null;){v=x;var k=v.stateNode;if(v.tag===5&&k!==null&&(v=k,g!==null&&(k=Vo(x,g),k!=null&&y.push(Yo(x,k,v)))),w)break;x=x.return}0<y.length&&(h=new p(h,m,null,n,c),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==kf&&(m=n.relatedTarget||n.fromElement)&&(us(m)||m[Zn]))break e;if((p||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?us(m):null,m!==null&&(w=Rs(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(y=wg,k="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=kg,k="onPointerLeave",g="onPointerEnter",x="pointer"),w=p==null?h:Js(p),v=m==null?h:Js(m),h=new y(k,x+"leave",p,n,c),h.target=w,h.relatedTarget=v,k=null,us(c)===u&&(y=new y(g,x+"enter",m,n,c),y.target=v,y.relatedTarget=w,k=y),w=k,p&&m)t:{for(y=p,g=m,x=0,v=y;v;v=Fs(v))x++;for(v=0,k=g;k;k=Fs(k))v++;for(;0<x-v;)y=Fs(y),x--;for(;0<v-x;)g=Fs(g),v--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Fs(y),g=Fs(g)}y=null}else y=null;p!==null&&Ag(d,h,p,y,!1),m!==null&&w!==null&&Ag(d,w,m,y,!0)}}e:{if(h=u?Js(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=yP;else if(Cg(h))if(j1)S=bP;else{S=vP;var b=xP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=wP);if(S&&(S=S(e,u))){P1(d,S,n,c);break e}b&&b(e,h,u),e==="focusout"&&(b=h._wrapperState)&&b.controlled&&h.type==="number"&&yf(h,"number",h.value)}switch(b=u?Js(u):window,e){case"focusin":(Cg(b)||b.contentEditable==="true")&&(Qs=b,Tf=u,jo=null);break;case"focusout":jo=Tf=Qs=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,Rg(d,n,c);break;case"selectionchange":if(SP)break;case"keydown":case"keyup":Rg(d,n,c)}var j;if(pp)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Ys?S1(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(_1&&n.locale!=="ko"&&(Ys||P!=="onCompositionStart"?P==="onCompositionEnd"&&Ys&&(j=k1()):(kr=c,dp="value"in kr?kr.value:kr.textContent,Ys=!0)),b=ic(u,P),0<b.length&&(P=new bg(P,e,null,n,c),d.push({event:P,listeners:b}),j?P.data=j:(j=C1(n),j!==null&&(P.data=j)))),(j=fP?hP(e,n):pP(e,n))&&(u=ic(u,"onBeforeInput"),0<u.length&&(c=new bg("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=j))}F1(d,t)})}function Yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ic(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Vo(e,n),i!=null&&r.unshift(Yo(e,i,s)),i=Vo(e,t),i!=null&&r.push(Yo(e,i,s))),e=e.return}return r}function Fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ag(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,s?(l=Vo(n,i),l!=null&&o.unshift(Yo(n,l,a))):s||(l=Vo(n,i),l!=null&&o.push(Yo(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var EP=/\r\n?/g,TP=/\u0000|\uFFFD/g;function Mg(e){return(typeof e=="string"?e:""+e).replace(EP,`
39
- `).replace(TP,"")}function Wa(e,t,n){if(t=Mg(t),Mg(e)!==t&&n)throw Error(U(425))}function oc(){}var Nf=null,If=null;function Af(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 Mf=typeof setTimeout=="function"?setTimeout:void 0,RP=typeof clearTimeout=="function"?clearTimeout:void 0,Lg=typeof Promise=="function"?Promise:void 0,NP=typeof queueMicrotask=="function"?queueMicrotask:typeof Lg<"u"?function(e){return Lg.resolve(null).then(e).catch(IP)}:Mf;function IP(e){setTimeout(function(){throw e})}function Xu(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ho(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ho(t)}function Ir(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 Dg(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 Li=Math.random().toString(36).slice(2),En="__reactFiber$"+Li,Qo="__reactProps$"+Li,Zn="__reactContainer$"+Li,Lf="__reactEvents$"+Li,AP="__reactListeners$"+Li,MP="__reactHandles$"+Li;function us(e){var t=e[En];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zn]||n[En]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Dg(e);e!==null;){if(n=e[En])return n;e=Dg(e)}return t}e=n,n=e.parentNode}return null}function ma(e){return e=e[En]||e[Zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Js(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function Jc(e){return e[Qo]||null}var Df=[],Zs=-1;function Hr(e){return{current:e}}function ke(e){0>Zs||(e.current=Df[Zs],Df[Zs]=null,Zs--)}function xe(e,t){Zs++,Df[Zs]=e.current,e.current=t}var Br={},st=Hr(Br),xt=Hr(!1),Ss=Br;function wi(e,t){var n=e.type.contextTypes;if(!n)return Br;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function vt(e){return e=e.childContextTypes,e!=null}function ac(){ke(xt),ke(st)}function Fg(e,t,n){if(st.current!==Br)throw Error(U(168));xe(st,t),xe(xt,n)}function z1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,xC(e)||"Unknown",s));return je({},n,r)}function lc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Br,Ss=st.current,xe(st,e),xe(xt,xt.current),!0}function Og(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=z1(e,t,Ss),r.__reactInternalMemoizedMergedChildContext=e,ke(xt),ke(st),xe(st,e)):ke(xt),xe(xt,n)}var Hn=null,Zc=!1,Ju=!1;function B1(e){Hn===null?Hn=[e]:Hn.push(e)}function LP(e){Zc=!0,B1(e)}function Gr(){if(!Ju&&Hn!==null){Ju=!0;var e=0,t=ce;try{var n=Hn;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hn=null,Zc=!1}catch(s){throw Hn!==null&&(Hn=Hn.slice(e+1)),d1(ap,Gr),s}finally{ce=t,Ju=!1}}return null}var ei=[],ti=0,cc=null,uc=0,Wt=[],Ht=0,Cs=null,qn=1,Yn="";function is(e,t){ei[ti++]=uc,ei[ti++]=cc,cc=e,uc=t}function $1(e,t,n){Wt[Ht++]=qn,Wt[Ht++]=Yn,Wt[Ht++]=Cs,Cs=e;var r=qn;e=Yn;var s=32-fn(r)-1;r&=~(1<<s),n+=1;var i=32-fn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,qn=1<<32-fn(t)+s|n<<s|r,Yn=i+e}else qn=1<<i|n<<s|r,Yn=e}function gp(e){e.return!==null&&(is(e,1),$1(e,1,0))}function yp(e){for(;e===cc;)cc=ei[--ti],ei[ti]=null,uc=ei[--ti],ei[ti]=null;for(;e===Cs;)Cs=Wt[--Ht],Wt[Ht]=null,Yn=Wt[--Ht],Wt[Ht]=null,qn=Wt[--Ht],Wt[Ht]=null}var Mt=null,It=null,Se=!1,dn=null;function V1(e,t){var n=Kt(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 zg(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,Mt=e,It=Ir(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Cs!==null?{id:qn,overflow:Yn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mt=e,It=null,!0):!1;default:return!1}}function Ff(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Of(e){if(Se){var t=It;if(t){var n=t;if(!zg(e,t)){if(Ff(e))throw Error(U(418));t=Ir(n.nextSibling);var r=Mt;t&&zg(e,t)?V1(r,n):(e.flags=e.flags&-4097|2,Se=!1,Mt=e)}}else{if(Ff(e))throw Error(U(418));e.flags=e.flags&-4097|2,Se=!1,Mt=e}}}function Bg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function Ha(e){if(e!==Mt)return!1;if(!Se)return Bg(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Af(e.type,e.memoizedProps)),t&&(t=It)){if(Ff(e))throw U1(),Error(U(418));for(;t;)V1(e,t),t=Ir(t.nextSibling)}if(Bg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){It=Ir(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}It=null}}else It=Mt?Ir(e.stateNode.nextSibling):null;return!0}function U1(){for(var e=It;e;)e=Ir(e.nextSibling)}function bi(){It=Mt=null,Se=!1}function xp(e){dn===null?dn=[e]:dn.push(e)}var DP=rr.ReactCurrentBatchConfig;function eo(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(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function Ga(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $g(e){var t=e._init;return t(e._payload)}function W1(e){function t(g,x){if(e){var v=g.deletions;v===null?(g.deletions=[x],g.flags|=16):v.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=Dr(g,x),g.index=0,g.sibling=null,g}function i(g,x,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<x?(g.flags|=2,x):v):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,v,k){return x===null||x.tag!==6?(x=id(v,g.mode,k),x.return=g,x):(x=s(x,v),x.return=g,x)}function l(g,x,v,k){var S=v.type;return S===qs?c(g,x,v.props.children,k,v.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&$g(S)===x.type)?(k=s(x,v.props),k.ref=eo(g,x,v),k.return=g,k):(k=Al(v.type,v.key,v.props,null,g.mode,k),k.ref=eo(g,x,v),k.return=g,k)}function u(g,x,v,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=od(v,g.mode,k),x.return=g,x):(x=s(x,v.children||[]),x.return=g,x)}function c(g,x,v,k,S){return x===null||x.tag!==7?(x=ys(v,g.mode,k,S),x.return=g,x):(x=s(x,v),x.return=g,x)}function d(g,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=id(""+x,g.mode,v),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case La:return v=Al(x.type,x.key,x.props,null,g.mode,v),v.ref=eo(g,null,x),v.return=g,v;case Ks:return x=od(x,g.mode,v),x.return=g,x;case yr:var k=x._init;return d(g,k(x._payload),v)}if(xo(x)||Yi(x))return x=ys(x,g.mode,v,null),x.return=g,x;Ga(g,x)}return null}function h(g,x,v,k){var S=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return S!==null?null:a(g,x,""+v,k);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case La:return v.key===S?l(g,x,v,k):null;case Ks:return v.key===S?u(g,x,v,k):null;case yr:return S=v._init,h(g,x,S(v._payload),k)}if(xo(v)||Yi(v))return S!==null?null:c(g,x,v,k,null);Ga(g,v)}return null}function p(g,x,v,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(v)||null,a(x,g,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case La:return g=g.get(k.key===null?v:k.key)||null,l(x,g,k,S);case Ks:return g=g.get(k.key===null?v:k.key)||null,u(x,g,k,S);case yr:var b=k._init;return p(g,x,v,b(k._payload),S)}if(xo(k)||Yi(k))return g=g.get(v)||null,c(x,g,k,S,null);Ga(x,k)}return null}function m(g,x,v,k){for(var S=null,b=null,j=x,P=x=0,T=null;j!==null&&P<v.length;P++){j.index>P?(T=j,j=null):T=j.sibling;var E=h(g,j,v[P],k);if(E===null){j===null&&(j=T);break}e&&j&&E.alternate===null&&t(g,j),x=i(E,x,P),b===null?S=E:b.sibling=E,b=E,j=T}if(P===v.length)return n(g,j),Se&&is(g,P),S;if(j===null){for(;P<v.length;P++)j=d(g,v[P],k),j!==null&&(x=i(j,x,P),b===null?S=j:b.sibling=j,b=j);return Se&&is(g,P),S}for(j=r(g,j);P<v.length;P++)T=p(j,g,P,v[P],k),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?P:T.key),x=i(T,x,P),b===null?S=T:b.sibling=T,b=T);return e&&j.forEach(function(I){return t(g,I)}),Se&&is(g,P),S}function y(g,x,v,k){var S=Yi(v);if(typeof S!="function")throw Error(U(150));if(v=S.call(v),v==null)throw Error(U(151));for(var b=S=null,j=x,P=x=0,T=null,E=v.next();j!==null&&!E.done;P++,E=v.next()){j.index>P?(T=j,j=null):T=j.sibling;var I=h(g,j,E.value,k);if(I===null){j===null&&(j=T);break}e&&j&&I.alternate===null&&t(g,j),x=i(I,x,P),b===null?S=I:b.sibling=I,b=I,j=T}if(E.done)return n(g,j),Se&&is(g,P),S;if(j===null){for(;!E.done;P++,E=v.next())E=d(g,E.value,k),E!==null&&(x=i(E,x,P),b===null?S=E:b.sibling=E,b=E);return Se&&is(g,P),S}for(j=r(g,j);!E.done;P++,E=v.next())E=p(j,g,P,E.value,k),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?P:E.key),x=i(E,x,P),b===null?S=E:b.sibling=E,b=E);return e&&j.forEach(function(M){return t(g,M)}),Se&&is(g,P),S}function w(g,x,v,k){if(typeof v=="object"&&v!==null&&v.type===qs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case La:e:{for(var S=v.key,b=x;b!==null;){if(b.key===S){if(S=v.type,S===qs){if(b.tag===7){n(g,b.sibling),x=s(b,v.props.children),x.return=g,g=x;break e}}else if(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&$g(S)===b.type){n(g,b.sibling),x=s(b,v.props),x.ref=eo(g,b,v),x.return=g,g=x;break e}n(g,b);break}else t(g,b);b=b.sibling}v.type===qs?(x=ys(v.props.children,g.mode,k,v.key),x.return=g,g=x):(k=Al(v.type,v.key,v.props,null,g.mode,k),k.ref=eo(g,x,v),k.return=g,g=k)}return o(g);case Ks:e:{for(b=v.key;x!==null;){if(x.key===b)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=s(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=od(v,g.mode,k),x.return=g,g=x}return o(g);case yr:return b=v._init,w(g,x,b(v._payload),k)}if(xo(v))return m(g,x,v,k);if(Yi(v))return y(g,x,v,k);Ga(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,v),x.return=g,g=x):(n(g,x),x=id(v,g.mode,k),x.return=g,g=x),o(g)):n(g,x)}return w}var ki=W1(!0),H1=W1(!1),dc=Hr(null),fc=null,ni=null,vp=null;function wp(){vp=ni=fc=null}function bp(e){var t=dc.current;ke(dc),e._currentValue=t}function zf(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 hi(e,t){fc=e,vp=ni=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(vp!==e)if(e={context:e,memoizedValue:t,next:null},ni===null){if(fc===null)throw Error(U(308));ni=e,fc.dependencies={lanes:0,firstContext:e}}else ni=ni.next=e;return t}var ds=null;function kp(e){ds===null?ds=[e]:ds.push(e)}function G1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,kp(t)):(n.next=s.next,s.next=n),t.interleaved=n,er(e,r)}function er(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 xr=!1;function _p(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K1(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 Qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,er(e,n)}return s=r.interleaved,s===null?(t.next=t,kp(r)):(t.next=s.next,s.next=t),r.interleaved=t,er(e,n)}function jl(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,lp(e,n)}}function Vg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 hc(e,t,n,r){var s=e.updateQueue;xr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,c=u=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=je({},d,h);break e;case 2:xr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(c===null&&(l=d),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);js|=o,e.lanes=o,e.memoizedState=d}}function Ug(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var ga={},Nn=Hr(ga),Xo=Hr(ga),Jo=Hr(ga);function fs(e){if(e===ga)throw Error(U(174));return e}function Sp(e,t){switch(xe(Jo,t),xe(Xo,e),xe(Nn,ga),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vf(t,e)}ke(Nn),xe(Nn,t)}function _i(){ke(Nn),ke(Xo),ke(Jo)}function q1(e){fs(Jo.current);var t=fs(Nn.current),n=vf(t,e.type);t!==n&&(xe(Xo,e),xe(Nn,n))}function Cp(e){Xo.current===e&&(ke(Nn),ke(Xo))}var Ce=Hr(0);function pc(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 Zu=[];function Pp(){for(var e=0;e<Zu.length;e++)Zu[e]._workInProgressVersionPrimary=null;Zu.length=0}var El=rr.ReactCurrentDispatcher,ed=rr.ReactCurrentBatchConfig,Ps=0,Pe=null,$e=null,We=null,mc=!1,Eo=!1,Zo=0,FP=0;function Ze(){throw Error(U(321))}function jp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mn(e[n],t[n]))return!1;return!0}function Ep(e,t,n,r,s,i){if(Ps=i,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,El.current=e===null||e.memoizedState===null?$P:VP,e=n(r,s),Eo){i=0;do{if(Eo=!1,Zo=0,25<=i)throw Error(U(301));i+=1,We=$e=null,t.updateQueue=null,El.current=UP,e=n(r,s)}while(Eo)}if(El.current=gc,t=$e!==null&&$e.next!==null,Ps=0,We=$e=Pe=null,mc=!1,t)throw Error(U(300));return e}function Tp(){var e=Zo!==0;return Zo=0,e}function _n(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Pe.memoizedState=We=e:We=We.next=e,We}function Jt(){if($e===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=We===null?Pe.memoizedState:We.next;if(t!==null)We=t,$e=e;else{if(e===null)throw Error(U(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},We===null?Pe.memoizedState=We=e:We=We.next=e}return We}function ea(e,t){return typeof t=="function"?t(e):t}function td(e){var t=Jt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=$e,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,u=i;do{var c=u.lane;if((Ps&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,Pe.lanes|=c,js|=c}u=u.next}while(u!==null&&u!==i);l===null?o=r:l.next=a,mn(r,t.memoizedState)||(gt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Pe.lanes|=i,js|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function nd(e){var t=Jt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);mn(i,t.memoizedState)||(gt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Y1(){}function Q1(e,t){var n=Pe,r=Jt(),s=t(),i=!mn(r.memoizedState,s);if(i&&(r.memoizedState=s,gt=!0),r=r.queue,Rp(Z1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,ta(9,J1.bind(null,n,r,s,t),void 0,null),He===null)throw Error(U(349));Ps&30||X1(n,t,s)}return s}function X1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function J1(e,t,n,r){t.value=n,t.getSnapshot=r,ew(t)&&tw(e)}function Z1(e,t,n){return n(function(){ew(t)&&tw(e)})}function ew(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mn(e,n)}catch{return!0}}function tw(e){var t=er(e,1);t!==null&&hn(t,e,1,-1)}function Wg(e){var t=_n();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:e},t.queue=e,e=e.dispatch=BP.bind(null,Pe,e),[t.memoizedState,e]}function ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.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 nw(){return Jt().memoizedState}function Tl(e,t,n,r){var s=_n();Pe.flags|=e,s.memoizedState=ta(1|t,n,void 0,r===void 0?null:r)}function eu(e,t,n,r){var s=Jt();r=r===void 0?null:r;var i=void 0;if($e!==null){var o=$e.memoizedState;if(i=o.destroy,r!==null&&jp(r,o.deps)){s.memoizedState=ta(t,n,i,r);return}}Pe.flags|=e,s.memoizedState=ta(1|t,n,i,r)}function Hg(e,t){return Tl(8390656,8,e,t)}function Rp(e,t){return eu(2048,8,e,t)}function rw(e,t){return eu(4,2,e,t)}function sw(e,t){return eu(4,4,e,t)}function iw(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 ow(e,t,n){return n=n!=null?n.concat([e]):null,eu(4,4,iw.bind(null,t,e),n)}function Np(){}function aw(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function lw(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cw(e,t,n){return Ps&21?(mn(n,t)||(n=p1(),Pe.lanes|=n,js|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=n)}function OP(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=ed.transition;ed.transition={};try{e(!1),t()}finally{ce=n,ed.transition=r}}function uw(){return Jt().memoizedState}function zP(e,t,n){var r=Lr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dw(e))fw(t,n);else if(n=G1(e,t,n,r),n!==null){var s=ct();hn(n,e,r,s),hw(n,t,r)}}function BP(e,t,n){var r=Lr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dw(e))fw(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,mn(a,o)){var l=t.interleaved;l===null?(s.next=s,kp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=G1(e,t,s,r),n!==null&&(s=ct(),hn(n,e,r,s),hw(n,t,r))}}function dw(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function fw(e,t){Eo=mc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lp(e,n)}}var gc={readContext:Xt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},$P={readContext:Xt,useCallback:function(e,t){return _n().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Hg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Tl(4194308,4,iw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tl(4,2,e,t)},useMemo:function(e,t){var n=_n();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_n();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=zP.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=_n();return e={current:e},t.memoizedState=e},useState:Wg,useDebugValue:Np,useDeferredValue:function(e){return _n().memoizedState=e},useTransition:function(){var e=Wg(!1),t=e[0];return e=OP.bind(null,e[1]),_n().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pe,s=_n();if(Se){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),He===null)throw Error(U(349));Ps&30||X1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Hg(Z1.bind(null,r,i,e),[e]),r.flags|=2048,ta(9,J1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_n(),t=He.identifierPrefix;if(Se){var n=Yn,r=qn;n=(r&~(1<<32-fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Zo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=FP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},VP={readContext:Xt,useCallback:aw,useContext:Xt,useEffect:Rp,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:sw,useMemo:lw,useReducer:td,useRef:nw,useState:function(){return td(ea)},useDebugValue:Np,useDeferredValue:function(e){var t=Jt();return cw(t,$e.memoizedState,e)},useTransition:function(){var e=td(ea)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:Y1,useSyncExternalStore:Q1,useId:uw,unstable_isNewReconciler:!1},UP={readContext:Xt,useCallback:aw,useContext:Xt,useEffect:Rp,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:sw,useMemo:lw,useReducer:nd,useRef:nw,useState:function(){return nd(ea)},useDebugValue:Np,useDeferredValue:function(e){var t=Jt();return $e===null?t.memoizedState=e:cw(t,$e.memoizedState,e)},useTransition:function(){var e=nd(ea)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:Y1,useSyncExternalStore:Q1,useId:uw,unstable_isNewReconciler:!1};function cn(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Bf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tu={isMounted:function(e){return(e=e._reactInternals)?Rs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ct(),s=Lr(e),i=Qn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Ar(e,i,s),t!==null&&(hn(t,e,s,r),jl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ct(),s=Lr(e),i=Qn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ar(e,i,s),t!==null&&(hn(t,e,s,r),jl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ct(),r=Lr(e),s=Qn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Ar(e,s,r),t!==null&&(hn(t,e,r,n),jl(t,e,r))}};function Gg(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Ko(n,r)||!Ko(s,i):!0}function pw(e,t,n){var r=!1,s=Br,i=t.contextType;return typeof i=="object"&&i!==null?i=Xt(i):(s=vt(t)?Ss:st.current,r=t.contextTypes,i=(r=r!=null)?wi(e,s):Br),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kg(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&&tu.enqueueReplaceState(t,t.state,null)}function $f(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},_p(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Xt(i):(i=vt(t)?Ss:st.current,s.context=wi(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Bf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&tu.enqueueReplaceState(s,s.state,null),hc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Si(e,t){try{var n="",r=t;do n+=yC(r),r=r.return;while(r);var s=n}catch(i){s=`
40
- Error generating stack: `+i.message+`
41
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function rd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Vf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WP=typeof WeakMap=="function"?WeakMap:Map;function mw(e,t,n){n=Qn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xc||(xc=!0,Jf=r),Vf(e,t)},n}function gw(e,t,n){n=Qn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Vf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Vf(e,t),typeof r!="function"&&(Mr===null?Mr=new Set([this]):Mr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function qg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WP;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=sj.bind(null,e,t,n),t.then(e,e))}function Yg(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 Qg(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Qn(-1,1),t.tag=2,Ar(n,t,1))),n.lanes|=1),e)}var HP=rr.ReactCurrentOwner,gt=!1;function ot(e,t,n,r){t.child=e===null?H1(t,null,n,r):ki(t,e.child,n,r)}function Xg(e,t,n,r,s){n=n.render;var i=t.ref;return hi(t,s),r=Ep(e,t,n,r,i,s),n=Tp(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,tr(e,t,s)):(Se&&n&&gp(t),t.flags|=1,ot(e,t,r,s),t.child)}function Jg(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!zp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,yw(e,t,i,r,s)):(e=Al(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ko,n(o,r)&&e.ref===t.ref)return tr(e,t,s)}return t.flags|=1,e=Dr(i,r),e.ref=t.ref,e.return=t,t.child=e}function yw(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Ko(i,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,tr(e,t,s)}return Uf(e,t,n,r,s)}function xw(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(si,Nt),Nt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(si,Nt),Nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,xe(si,Nt),Nt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,xe(si,Nt),Nt|=r;return ot(e,t,s,n),t.child}function vw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Uf(e,t,n,r,s){var i=vt(n)?Ss:st.current;return i=wi(t,i),hi(t,s),n=Ep(e,t,n,r,i,s),r=Tp(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,tr(e,t,s)):(Se&&r&&gp(t),t.flags|=1,ot(e,t,n,s),t.child)}function Zg(e,t,n,r,s){if(vt(n)){var i=!0;lc(t)}else i=!1;if(hi(t,s),t.stateNode===null)Rl(e,t),pw(t,n,r),$f(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Xt(u):(u=vt(n)?Ss:st.current,u=wi(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Kg(t,o,r,u),xr=!1;var h=t.memoizedState;o.state=h,hc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||xt.current||xr?(typeof c=="function"&&(Bf(t,n,c,r),l=t.memoizedState),(a=xr||Gg(t,n,a,r,h,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,K1(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:cn(t.type,a),o.props=u,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Xt(l):(l=vt(n)?Ss:st.current,l=wi(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Kg(t,o,r,l),xr=!1,h=t.memoizedState,o.state=h,hc(t,r,o,s);var m=t.memoizedState;a!==d||h!==m||xt.current||xr?(typeof p=="function"&&(Bf(t,n,p,r),m=t.memoizedState),(u=xr||Gg(t,n,u,r,h,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Wf(e,t,n,r,i,s)}function Wf(e,t,n,r,s,i){vw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Og(t,n,!1),tr(e,t,i);r=t.stateNode,HP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ki(t,e.child,null,i),t.child=ki(t,null,a,i)):ot(e,t,a,i),t.memoizedState=r.state,s&&Og(t,n,!0),t.child}function ww(e){var t=e.stateNode;t.pendingContext?Fg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fg(e,t.context,!1),Sp(e,t.containerInfo)}function ey(e,t,n,r,s){return bi(),xp(s),t.flags|=256,ot(e,t,n,r),t.child}var Hf={dehydrated:null,treeContext:null,retryLane:0};function Gf(e){return{baseLanes:e,cachePool:null,transitions:null}}function bw(e,t,n){var r=t.pendingProps,s=Ce.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),xe(Ce,s&1),e===null)return Of(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=su(o,r,0,null),e=ys(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Gf(n),t.memoizedState=Hf,e):Ip(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return GP(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Dr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Dr(a,i):(i=ys(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Gf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Hf,r}return i=e.child,e=i.sibling,r=Dr(i,{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 Ip(e,t){return t=su({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ka(e,t,n,r){return r!==null&&xp(r),ki(t,e.child,null,n),e=Ip(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function GP(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=rd(Error(U(422))),Ka(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=su({mode:"visible",children:r.children},s,0,null),i=ys(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ki(t,e.child,null,o),t.child.memoizedState=Gf(o),t.memoizedState=Hf,i);if(!(t.mode&1))return Ka(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=rd(i,r,void 0),Ka(e,t,o,r)}if(a=(o&e.childLanes)!==0,gt||a){if(r=He,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,er(e,s),hn(r,e,s,-1))}return Op(),r=rd(Error(U(421))),Ka(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=ij.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,It=Ir(s.nextSibling),Mt=t,Se=!0,dn=null,e!==null&&(Wt[Ht++]=qn,Wt[Ht++]=Yn,Wt[Ht++]=Cs,qn=e.id,Yn=e.overflow,Cs=t),t=Ip(t,r.children),t.flags|=4096,t)}function ty(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zf(e.return,t,n)}function sd(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function kw(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(ot(e,t,r.children,n),r=Ce.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&&ty(e,n,t);else if(e.tag===19)ty(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(xe(Ce,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&pc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),sd(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&pc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}sd(t,!0,n,null,i);break;case"together":sd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function tr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),js|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=Dr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function KP(e,t,n){switch(t.tag){case 3:ww(t),bi();break;case 5:q1(t);break;case 1:vt(t.type)&&lc(t);break;case 4:Sp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;xe(dc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(Ce,Ce.current&1),t.flags|=128,null):n&t.child.childLanes?bw(e,t,n):(xe(Ce,Ce.current&1),e=tr(e,t,n),e!==null?e.sibling:null);xe(Ce,Ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return kw(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),xe(Ce,Ce.current),r)break;return null;case 22:case 23:return t.lanes=0,xw(e,t,n)}return tr(e,t,n)}var _w,Kf,Sw,Cw;_w=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}};Kf=function(){};Sw=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,fs(Nn.current);var i=null;switch(n){case"input":s=mf(e,s),r=mf(e,r),i=[];break;case"select":s=je({},s,{value:void 0}),r=je({},r,{value:void 0}),i=[];break;case"textarea":s=xf(e,s),r=xf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=oc)}wf(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&be("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Cw=function(e,t,n,r){n!==r&&(t.flags|=4)};function to(e,t){if(!Se)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 et(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qP(e,t,n){var r=t.pendingProps;switch(yp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return vt(t.type)&&ac(),et(t),null;case 3:return r=t.stateNode,_i(),ke(xt),ke(st),Pp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ha(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dn!==null&&(th(dn),dn=null))),Kf(e,t),et(t),null;case 5:Cp(t);var s=fs(Jo.current);if(n=t.type,e!==null&&t.stateNode!=null)Sw(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return et(t),null}if(e=fs(Nn.current),Ha(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[En]=t,r[Qo]=i,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(s=0;s<wo.length;s++)be(wo[s],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":ug(r,i),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},be("invalid",r);break;case"textarea":fg(r,i),be("invalid",r)}wf(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),s=["children",""+a]):Bo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":Da(r),dg(r,i,!0);break;case"textarea":Da(r),hg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=oc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Zv(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[En]=t,e[Qo]=r,_w(e,t,!1,!1),t.stateNode=e;e:{switch(o=bf(n,r),n){case"dialog":be("cancel",e),be("close",e),s=r;break;case"iframe":case"object":case"embed":be("load",e),s=r;break;case"video":case"audio":for(s=0;s<wo.length;s++)be(wo[s],e);s=r;break;case"source":be("error",e),s=r;break;case"img":case"image":case"link":be("error",e),be("load",e),s=r;break;case"details":be("toggle",e),s=r;break;case"input":ug(e,r),s=mf(e,r),be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=je({},r,{value:void 0}),be("invalid",e);break;case"textarea":fg(e,r),s=xf(e,r),be("invalid",e);break;default:s=r}wf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?n1(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&e1(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&$o(e,l):typeof l=="number"&&$o(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&be("scroll",e):l!=null&&np(e,i,l,o))}switch(n){case"input":Da(e),dg(e,r,!1);break;case"textarea":Da(e),hg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+zr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ci(e,!!r.multiple,i,!1):r.defaultValue!=null&&ci(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=oc)}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 et(t),null;case 6:if(e&&t.stateNode!=null)Cw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=fs(Jo.current),fs(Nn.current),Ha(t)){if(r=t.stateNode,n=t.memoizedProps,r[En]=t,(i=r.nodeValue!==n)&&(e=Mt,e!==null))switch(e.tag){case 3:Wa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wa(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[En]=t,t.stateNode=r}return et(t),null;case 13:if(ke(Ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&It!==null&&t.mode&1&&!(t.flags&128))U1(),bi(),t.flags|=98560,i=!1;else if(i=Ha(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[En]=t}else bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;et(t),i=!1}else dn!==null&&(th(dn),dn=null),i=!0;if(!i)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||Ce.current&1?Ve===0&&(Ve=3):Op())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return _i(),Kf(e,t),e===null&&qo(t.stateNode.containerInfo),et(t),null;case 10:return bp(t.type._context),et(t),null;case 17:return vt(t.type)&&ac(),et(t),null;case 19:if(ke(Ce),i=t.memoizedState,i===null)return et(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)to(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=pc(e),o!==null){for(t.flags|=128,to(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(Ce,Ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Ci&&(t.flags|=128,r=!0,to(i,!1),t.lanes=4194304)}else{if(!r)if(e=pc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),to(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Se)return et(t),null}else 2*Le()-i.renderingStartTime>Ci&&n!==1073741824&&(t.flags|=128,r=!0,to(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,n=Ce.current,xe(Ce,r?n&1|2:n&1),t):(et(t),null);case 22:case 23:return Fp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nt&1073741824&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function YP(e,t){switch(yp(t),t.tag){case 1:return vt(t.type)&&ac(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _i(),ke(xt),ke(st),Pp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cp(t),null;case 13:if(ke(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ce),null;case 4:return _i(),null;case 10:return bp(t.type._context),null;case 22:case 23:return Fp(),null;case 24:return null;default:return null}}var qa=!1,nt=!1,QP=typeof WeakSet=="function"?WeakSet:Set,G=null;function ri(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function qf(e,t,n){try{n()}catch(r){Ne(e,t,r)}}var ny=!1;function XP(e,t){if(Nf=rc,e=R1(),mp(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,h=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===s&&(a=o),h===i&&++c===r&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(If={focusedElem:e,selectionRange:n},rc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;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 y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:cn(t.type,y),w);g.__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(U(163))}}catch(k){Ne(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=ny,ny=!1,m}function To(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&qf(t,n,i)}s=s.next}while(s!==r)}}function nu(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 Yf(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 Pw(e){var t=e.alternate;t!==null&&(e.alternate=null,Pw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[En],delete t[Qo],delete t[Lf],delete t[AP],delete t[MP])),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 jw(e){return e.tag===5||e.tag===3||e.tag===4}function ry(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jw(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 Qf(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=oc));else if(r!==4&&(e=e.child,e!==null))for(Qf(e,t,n),e=e.sibling;e!==null;)Qf(e,t,n),e=e.sibling}function Xf(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(Xf(e,t,n),e=e.sibling;e!==null;)Xf(e,t,n),e=e.sibling}var Ke=null,un=!1;function ir(e,t,n){for(n=n.child;n!==null;)Ew(e,t,n),n=n.sibling}function Ew(e,t,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(qc,n)}catch{}switch(n.tag){case 5:nt||ri(n,t);case 6:var r=Ke,s=un;Ke=null,ir(e,t,n),Ke=r,un=s,Ke!==null&&(un?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(un?(e=Ke,n=n.stateNode,e.nodeType===8?Xu(e.parentNode,n):e.nodeType===1&&Xu(e,n),Ho(e)):Xu(Ke,n.stateNode));break;case 4:r=Ke,s=un,Ke=n.stateNode.containerInfo,un=!0,ir(e,t,n),Ke=r,un=s;break;case 0:case 11:case 14:case 15:if(!nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&qf(n,t,o),s=s.next}while(s!==r)}ir(e,t,n);break;case 1:if(!nt&&(ri(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ne(n,t,a)}ir(e,t,n);break;case 21:ir(e,t,n);break;case 22:n.mode&1?(nt=(r=nt)||n.memoizedState!==null,ir(e,t,n),nt=r):ir(e,t,n);break;default:ir(e,t,n)}}function sy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new QP),t.forEach(function(r){var s=oj.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ke=a.stateNode,un=!1;break e;case 3:Ke=a.stateNode.containerInfo,un=!0;break e;case 4:Ke=a.stateNode.containerInfo,un=!0;break e}a=a.return}if(Ke===null)throw Error(U(160));Ew(i,o,s),Ke=null,un=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){Ne(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Tw(t,e),t=t.sibling}function Tw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nn(t,e),vn(e),r&4){try{To(3,e,e.return),nu(3,e)}catch(y){Ne(e,e.return,y)}try{To(5,e,e.return)}catch(y){Ne(e,e.return,y)}}break;case 1:nn(t,e),vn(e),r&512&&n!==null&&ri(n,n.return);break;case 5:if(nn(t,e),vn(e),r&512&&n!==null&&ri(n,n.return),e.flags&32){var s=e.stateNode;try{$o(s,"")}catch(y){Ne(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Xv(s,i),bf(a,o);var u=bf(a,i);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?n1(s,d):c==="dangerouslySetInnerHTML"?e1(s,d):c==="children"?$o(s,d):np(s,c,d,u)}switch(a){case"input":gf(s,i);break;case"textarea":Jv(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ci(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ci(s,!!i.multiple,i.defaultValue,!0):ci(s,!!i.multiple,i.multiple?[]:"",!1))}s[Qo]=i}catch(y){Ne(e,e.return,y)}}break;case 6:if(nn(t,e),vn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Ne(e,e.return,y)}}break;case 3:if(nn(t,e),vn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ho(t.containerInfo)}catch(y){Ne(e,e.return,y)}break;case 4:nn(t,e),vn(e);break;case 13:nn(t,e),vn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Lp=Le())),r&4&&sy(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(nt=(u=nt)||c,nn(t,e),nt=u):nn(t,e),vn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(G=e,c=e.child;c!==null;){for(d=G=c;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:To(4,h,h.return);break;case 1:ri(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){Ne(r,n,y)}}break;case 5:ri(h,h.return);break;case 22:if(h.memoizedState!==null){oy(d);continue}}p!==null?(p.return=h,G=p):oy(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=t1("display",o))}catch(y){Ne(e,e.return,y)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Ne(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:nn(t,e),vn(e),r&4&&sy(e);break;case 21:break;default:nn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(jw(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&($o(s,""),r.flags&=-33);var i=ry(e);Xf(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=ry(e);Qf(e,a,o);break;default:throw Error(U(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JP(e,t,n){G=e,Rw(e)}function Rw(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var s=G,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||qa;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||nt;a=qa;var u=nt;if(qa=o,(nt=l)&&!u)for(G=s;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?ay(s):l!==null?(l.return=o,G=l):ay(s);for(;i!==null;)G=i,Rw(i),i=i.sibling;G=s,qa=a,nt=u}iy(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,G=i):iy(e)}}function iy(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:nt||nu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!nt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:cn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ug(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ug(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ho(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}nt||t.flags&512&&Yf(t)}catch(h){Ne(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function oy(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function ay(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nu(4,t)}catch(l){Ne(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Ne(t,s,l)}}var i=t.return;try{Yf(t)}catch(l){Ne(t,i,l)}break;case 5:var o=t.return;try{Yf(t)}catch(l){Ne(t,o,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var ZP=Math.ceil,yc=rr.ReactCurrentDispatcher,Ap=rr.ReactCurrentOwner,Yt=rr.ReactCurrentBatchConfig,oe=0,He=null,ze=null,Xe=0,Nt=0,si=Hr(0),Ve=0,na=null,js=0,ru=0,Mp=0,Ro=null,mt=null,Lp=0,Ci=1/0,Wn=null,xc=!1,Jf=null,Mr=null,Ya=!1,_r=null,vc=0,No=0,Zf=null,Nl=-1,Il=0;function ct(){return oe&6?Le():Nl!==-1?Nl:Nl=Le()}function Lr(e){return e.mode&1?oe&2&&Xe!==0?Xe&-Xe:DP.transition!==null?(Il===0&&(Il=p1()),Il):(e=ce,e!==0||(e=window.event,e=e===void 0?16:b1(e.type)),e):1}function hn(e,t,n,r){if(50<No)throw No=0,Zf=null,Error(U(185));ha(e,n,r),(!(oe&2)||e!==He)&&(e===He&&(!(oe&2)&&(ru|=n),Ve===4&&br(e,Xe)),wt(e,r),n===1&&oe===0&&!(t.mode&1)&&(Ci=Le()+500,Zc&&Gr()))}function wt(e,t){var n=e.callbackNode;DC(e,t);var r=nc(e,e===He?Xe:0);if(r===0)n!==null&&gg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&gg(n),t===1)e.tag===0?LP(ly.bind(null,e)):B1(ly.bind(null,e)),NP(function(){!(oe&6)&&Gr()}),n=null;else{switch(m1(r)){case 1:n=ap;break;case 4:n=f1;break;case 16:n=tc;break;case 536870912:n=h1;break;default:n=tc}n=Ow(n,Nw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Nw(e,t){if(Nl=-1,Il=0,oe&6)throw Error(U(327));var n=e.callbackNode;if(pi()&&e.callbackNode!==n)return null;var r=nc(e,e===He?Xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=wc(e,r);else{t=r;var s=oe;oe|=2;var i=Aw();(He!==e||Xe!==t)&&(Wn=null,Ci=Le()+500,gs(e,t));do try{nj();break}catch(a){Iw(e,a)}while(!0);wp(),yc.current=i,oe=s,ze!==null?t=0:(He=null,Xe=0,t=Ve)}if(t!==0){if(t===2&&(s=Pf(e),s!==0&&(r=s,t=eh(e,s))),t===1)throw n=na,gs(e,0),br(e,r),wt(e,Le()),n;if(t===6)br(e,r);else{if(s=e.current.alternate,!(r&30)&&!ej(s)&&(t=wc(e,r),t===2&&(i=Pf(e),i!==0&&(r=i,t=eh(e,i))),t===1))throw n=na,gs(e,0),br(e,r),wt(e,Le()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:os(e,mt,Wn);break;case 3:if(br(e,r),(r&130023424)===r&&(t=Lp+500-Le(),10<t)){if(nc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ct(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Mf(os.bind(null,e,mt,Wn),t);break}os(e,mt,Wn);break;case 4:if(br(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-fn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ZP(r/1960))-r,10<r){e.timeoutHandle=Mf(os.bind(null,e,mt,Wn),r);break}os(e,mt,Wn);break;case 5:os(e,mt,Wn);break;default:throw Error(U(329))}}}return wt(e,Le()),e.callbackNode===n?Nw.bind(null,e):null}function eh(e,t){var n=Ro;return e.current.memoizedState.isDehydrated&&(gs(e,t).flags|=256),e=wc(e,t),e!==2&&(t=mt,mt=n,t!==null&&th(t)),e}function th(e){mt===null?mt=e:mt.push.apply(mt,e)}function ej(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!mn(i(),s))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 br(e,t){for(t&=~Mp,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-fn(t),r=1<<n;e[n]=-1,t&=~r}}function ly(e){if(oe&6)throw Error(U(327));pi();var t=nc(e,0);if(!(t&1))return wt(e,Le()),null;var n=wc(e,t);if(e.tag!==0&&n===2){var r=Pf(e);r!==0&&(t=r,n=eh(e,r))}if(n===1)throw n=na,gs(e,0),br(e,t),wt(e,Le()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,mt,Wn),wt(e,Le()),null}function Dp(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Ci=Le()+500,Zc&&Gr())}}function Es(e){_r!==null&&_r.tag===0&&!(oe&6)&&pi();var t=oe;oe|=1;var n=Yt.transition,r=ce;try{if(Yt.transition=null,ce=1,e)return e()}finally{ce=r,Yt.transition=n,oe=t,!(oe&6)&&Gr()}}function Fp(){Nt=si.current,ke(si)}function gs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,RP(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(yp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ac();break;case 3:_i(),ke(xt),ke(st),Pp();break;case 5:Cp(r);break;case 4:_i();break;case 13:ke(Ce);break;case 19:ke(Ce);break;case 10:bp(r.type._context);break;case 22:case 23:Fp()}n=n.return}if(He=e,ze=e=Dr(e.current,null),Xe=Nt=t,Ve=0,na=null,Mp=ru=js=0,mt=Ro=null,ds!==null){for(t=0;t<ds.length;t++)if(n=ds[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ds=null}return e}function Iw(e,t){do{var n=ze;try{if(wp(),El.current=gc,mc){for(var r=Pe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}mc=!1}if(Ps=0,We=$e=Pe=null,Eo=!1,Zo=0,Ap.current=null,n===null||n.return===null){Ve=1,na=t,ze=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Xe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Yg(o);if(p!==null){p.flags&=-257,Qg(p,o,a,i,t),p.mode&1&&qg(i,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){qg(i,u,t),Op();break e}l=Error(U(426))}}else if(Se&&a.mode&1){var w=Yg(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Qg(w,o,a,i,t),xp(Si(l,a));break e}}i=l=Si(l,a),Ve!==4&&(Ve=2),Ro===null?Ro=[i]:Ro.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=mw(i,l,t);Vg(i,g);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Mr===null||!Mr.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=gw(i,a,t);Vg(i,k);break e}}i=i.return}while(i!==null)}Lw(n)}catch(S){t=S,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function Aw(){var e=yc.current;return yc.current=gc,e===null?gc:e}function Op(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),He===null||!(js&268435455)&&!(ru&268435455)||br(He,Xe)}function wc(e,t){var n=oe;oe|=2;var r=Aw();(He!==e||Xe!==t)&&(Wn=null,gs(e,t));do try{tj();break}catch(s){Iw(e,s)}while(!0);if(wp(),oe=n,yc.current=r,ze!==null)throw Error(U(261));return He=null,Xe=0,Ve}function tj(){for(;ze!==null;)Mw(ze)}function nj(){for(;ze!==null&&!jC();)Mw(ze)}function Mw(e){var t=Fw(e.alternate,e,Nt);e.memoizedProps=e.pendingProps,t===null?Lw(e):ze=t,Ap.current=null}function Lw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=YP(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,ze=null;return}}else if(n=qP(n,t,Nt),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Ve===0&&(Ve=5)}function os(e,t,n){var r=ce,s=Yt.transition;try{Yt.transition=null,ce=1,rj(e,t,n,r)}finally{Yt.transition=s,ce=r}return null}function rj(e,t,n,r){do pi();while(_r!==null);if(oe&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(FC(e,i),e===He&&(ze=He=null,Xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ya||(Ya=!0,Ow(tc,function(){return pi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Yt.transition,Yt.transition=null;var o=ce;ce=1;var a=oe;oe|=4,Ap.current=null,XP(e,n),Tw(n,e),_P(If),rc=!!Nf,If=Nf=null,e.current=n,JP(n),EC(),oe=a,ce=o,Yt.transition=i}else e.current=n;if(Ya&&(Ya=!1,_r=e,vc=s),i=e.pendingLanes,i===0&&(Mr=null),NC(n.stateNode),wt(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(xc)throw xc=!1,e=Jf,Jf=null,e;return vc&1&&e.tag!==0&&pi(),i=e.pendingLanes,i&1?e===Zf?No++:(No=0,Zf=e):No=0,Gr(),null}function pi(){if(_r!==null){var e=m1(vc),t=Yt.transition,n=ce;try{if(Yt.transition=null,ce=16>e?16:e,_r===null)var r=!1;else{if(e=_r,_r=null,vc=0,oe&6)throw Error(U(331));var s=oe;for(oe|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(G=u;G!==null;){var c=G;switch(c.tag){case 0:case 11:case 15:To(8,c,i)}var d=c.child;if(d!==null)d.return=c,G=d;else for(;G!==null;){c=G;var h=c.sibling,p=c.return;if(Pw(c),c===u){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:To(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var x=e.current;for(G=x;G!==null;){o=G;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,G=v;else e:for(o=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:nu(9,a)}}catch(S){Ne(a,a.return,S)}if(a===o){G=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,G=k;break e}G=a.return}}if(oe=s,Gr(),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(qc,e)}catch{}r=!0}return r}finally{ce=n,Yt.transition=t}}return!1}function cy(e,t,n){t=Si(n,t),t=mw(e,t,1),e=Ar(e,t,1),t=ct(),e!==null&&(ha(e,1,t),wt(e,t))}function Ne(e,t,n){if(e.tag===3)cy(e,e,n);else for(;t!==null;){if(t.tag===3){cy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Mr===null||!Mr.has(r))){e=Si(n,e),e=gw(t,e,1),t=Ar(t,e,1),e=ct(),t!==null&&(ha(t,1,e),wt(t,e));break}}t=t.return}}function sj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ct(),e.pingedLanes|=e.suspendedLanes&n,He===e&&(Xe&n)===n&&(Ve===4||Ve===3&&(Xe&130023424)===Xe&&500>Le()-Lp?gs(e,0):Mp|=n),wt(e,t)}function Dw(e,t){t===0&&(e.mode&1?(t=za,za<<=1,!(za&130023424)&&(za=4194304)):t=1);var n=ct();e=er(e,t),e!==null&&(ha(e,t,n),wt(e,n))}function ij(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dw(e,n)}function oj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),Dw(e,n)}var Fw;Fw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xt.current)gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gt=!1,KP(e,t,n);gt=!!(e.flags&131072)}else gt=!1,Se&&t.flags&1048576&&$1(t,uc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rl(e,t),e=t.pendingProps;var s=wi(t,st.current);hi(t,n),s=Ep(null,t,r,e,s,n);var i=Tp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vt(r)?(i=!0,lc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_p(t),s.updater=tu,t.stateNode=s,s._reactInternals=t,$f(t,r,e,n),t=Wf(null,t,r,!0,i,n)):(t.tag=0,Se&&i&&gp(t),ot(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=lj(r),e=cn(r,e),s){case 0:t=Uf(null,t,r,e,n);break e;case 1:t=Zg(null,t,r,e,n);break e;case 11:t=Xg(null,t,r,e,n);break e;case 14:t=Jg(null,t,r,cn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:cn(r,s),Uf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:cn(r,s),Zg(e,t,r,s,n);case 3:e:{if(ww(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,K1(e,t),hc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Si(Error(U(423)),t),t=ey(e,t,r,n,s);break e}else if(r!==s){s=Si(Error(U(424)),t),t=ey(e,t,r,n,s);break e}else for(It=Ir(t.stateNode.containerInfo.firstChild),Mt=t,Se=!0,dn=null,n=H1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bi(),r===s){t=tr(e,t,n);break e}ot(e,t,r,n)}t=t.child}return t;case 5:return q1(t),e===null&&Of(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Af(r,s)?o=null:i!==null&&Af(r,i)&&(t.flags|=32),vw(e,t),ot(e,t,o,n),t.child;case 6:return e===null&&Of(t),null;case 13:return bw(e,t,n);case 4:return Sp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ki(t,null,r,n):ot(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:cn(r,s),Xg(e,t,r,s,n);case 7:return ot(e,t,t.pendingProps,n),t.child;case 8:return ot(e,t,t.pendingProps.children,n),t.child;case 12:return ot(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,xe(dc,r._currentValue),r._currentValue=o,i!==null)if(mn(i.value,o)){if(i.children===s.children&&!xt.current){t=tr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Qn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),zf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),zf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ot(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,hi(t,n),s=Xt(s),r=r(s),t.flags|=1,ot(e,t,r,n),t.child;case 14:return r=t.type,s=cn(r,t.pendingProps),s=cn(r.type,s),Jg(e,t,r,s,n);case 15:return yw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:cn(r,s),Rl(e,t),t.tag=1,vt(r)?(e=!0,lc(t)):e=!1,hi(t,n),pw(t,r,s),$f(t,r,s,n),Wf(null,t,r,!0,e,n);case 19:return kw(e,t,n);case 22:return xw(e,t,n)}throw Error(U(156,t.tag))};function Ow(e,t){return d1(e,t)}function aj(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 Kt(e,t,n,r){return new aj(e,t,n,r)}function zp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lj(e){if(typeof e=="function")return zp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sp)return 11;if(e===ip)return 14}return 2}function Dr(e,t){var n=e.alternate;return n===null?(n=Kt(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 Al(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")zp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case qs:return ys(n.children,s,i,t);case rp:o=8,s|=8;break;case df:return e=Kt(12,n,t,s|2),e.elementType=df,e.lanes=i,e;case ff:return e=Kt(13,n,t,s),e.elementType=ff,e.lanes=i,e;case hf:return e=Kt(19,n,t,s),e.elementType=hf,e.lanes=i,e;case qv:return su(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gv:o=10;break e;case Kv:o=9;break e;case sp:o=11;break e;case ip:o=14;break e;case yr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Kt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function ys(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function su(e,t,n,r){return e=Kt(22,e,r,t),e.elementType=qv,e.lanes=n,e.stateNode={isHidden:!1},e}function id(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function od(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cj(e,t,n,r,s){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=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Bp(e,t,n,r,s,i,o,a,l){return e=new cj(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_p(i),e}function uj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function zw(e){if(!e)return Br;e=e._reactInternals;e:{if(Rs(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(vt(n))return z1(e,n,t)}return t}function Bw(e,t,n,r,s,i,o,a,l){return e=Bp(n,r,!0,e,s,i,o,a,l),e.context=zw(null),n=e.current,r=ct(),s=Lr(n),i=Qn(r,s),i.callback=t??null,Ar(n,i,s),e.current.lanes=s,ha(e,s,r),wt(e,r),e}function iu(e,t,n,r){var s=t.current,i=ct(),o=Lr(s);return n=zw(n),t.context===null?t.context=n:t.pendingContext=n,t=Qn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ar(s,t,o),e!==null&&(hn(e,s,o,i),jl(e,s,o)),o}function bc(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 uy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $p(e,t){uy(e,t),(e=e.alternate)&&uy(e,t)}function dj(){return null}var $w=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vp(e){this._internalRoot=e}ou.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));iu(e,t,null,null)};ou.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){iu(null,e,null,null)}),t[Zn]=null}};function ou(e){this._internalRoot=e}ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=x1();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&&w1(e)}};function Up(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dy(){}function fj(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=bc(o);i.call(u)}}var o=Bw(t,r,e,0,null,!1,!1,"",dy);return e._reactRootContainer=o,e[Zn]=o.current,qo(e.nodeType===8?e.parentNode:e),Es(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=bc(l);a.call(u)}}var l=Bp(e,0,!1,null,null,!1,!1,"",dy);return e._reactRootContainer=l,e[Zn]=l.current,qo(e.nodeType===8?e.parentNode:e),Es(function(){iu(t,l,n,r)}),l}function lu(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=bc(o);a.call(l)}}iu(t,o,e,s)}else o=fj(n,t,e,s,r);return bc(o)}g1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=vo(t.pendingLanes);n!==0&&(lp(t,n|1),wt(t,Le()),!(oe&6)&&(Ci=Le()+500,Gr()))}break;case 13:Es(function(){var r=er(e,1);if(r!==null){var s=ct();hn(r,e,1,s)}}),$p(e,1)}};cp=function(e){if(e.tag===13){var t=er(e,134217728);if(t!==null){var n=ct();hn(t,e,134217728,n)}$p(e,134217728)}};y1=function(e){if(e.tag===13){var t=Lr(e),n=er(e,t);if(n!==null){var r=ct();hn(n,e,t,r)}$p(e,t)}};x1=function(){return ce};v1=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};_f=function(e,t,n){switch(t){case"input":if(gf(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 s=Jc(r);if(!s)throw Error(U(90));Qv(r),gf(r,s)}}}break;case"textarea":Jv(e,n);break;case"select":t=n.value,t!=null&&ci(e,!!n.multiple,t,!1)}};i1=Dp;o1=Es;var hj={usingClientEntryPoint:!1,Events:[ma,Js,Jc,r1,s1,Dp]},no={findFiberByHostInstance:us,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pj={bundleType:no.bundleType,version:no.version,rendererPackageName:no.rendererPackageName,rendererConfig:no.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=c1(e),e===null?null:e.stateNode},findFiberByHostInstance:no.findFiberByHostInstance||dj,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 Qa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qa.isDisabled&&Qa.supportsFiber)try{qc=Qa.inject(pj),Rn=Qa}catch{}}Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hj;Ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Up(t))throw Error(U(200));return uj(e,t,null,n)};Ft.createRoot=function(e,t){if(!Up(e))throw Error(U(299));var n=!1,r="",s=$w;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Bp(e,1,!1,null,null,n,!1,r,s),e[Zn]=t.current,qo(e.nodeType===8?e.parentNode:e),new Vp(t)};Ft.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(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=c1(t),e=e===null?null:e.stateNode,e};Ft.flushSync=function(e){return Es(e)};Ft.hydrate=function(e,t,n){if(!au(t))throw Error(U(200));return lu(null,e,t,!0,n)};Ft.hydrateRoot=function(e,t,n){if(!Up(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=$w;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Bw(t,null,e,1,n??null,s,!1,i,o),e[Zn]=t.current,qo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ou(t)};Ft.render=function(e,t,n){if(!au(t))throw Error(U(200));return lu(null,e,t,!1,n)};Ft.unmountComponentAtNode=function(e){if(!au(e))throw Error(U(40));return e._reactRootContainer?(Es(function(){lu(null,null,e,!1,function(){e._reactRootContainer=null,e[Zn]=null})}),!0):!1};Ft.unstable_batchedUpdates=Dp;Ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!au(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return lu(e,t,n,!1,r)};Ft.version="18.3.1-next-f1338f8080-20240426";function Vw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vw)}catch(e){console.error(e)}}Vw(),Vv.exports=Ft;var Ns=Vv.exports,Uw,fy=Ns;Uw=fy.createRoot,fy.hydrateRoot;var bo=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ad(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function mj(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{t(i)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function gj(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const Ww=!1;function ra(e){return e[e.length-1]}function yj(e){return typeof e=="function"}function Sr(e,t){return yj(e)?e(t):e}const xj=Object.prototype.hasOwnProperty,hy=Object.prototype.propertyIsEnumerable,vj=()=>Object.create(null),es=(e,t)=>Cr(e,t,vj);function Cr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=gy(e)&&gy(s);if(!i&&!(Pi(e)&&Pi(s)))return s;const o=i?e:py(e);if(!o)return s;const a=i?s:py(s);if(!a)return s;const l=o.length,u=a.length,c=i?new Array(u):n();let d=0;for(let h=0;h<u;h++){const p=i?h:a[h],m=e[p],y=s[p];if(m===y){c[p]=m,(i?h<l:xj.call(e,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[p]=y;continue}const w=Cr(m,y,n,r+1);c[p]=w,w===m&&d++}return l===u&&d===l?e:c}function py(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!hy.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!hy.call(e,s))return!1;r.push(s)}return r}function Pi(e){if(!my(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!my(n)||!n.hasOwnProperty("isPrototypeOf"))}function my(e){return Object.prototype.toString.call(e)==="[object Object]"}function gy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!xs(e[r],t[r],n))return!1;return!0}if(Pi(e)&&Pi(t)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const o in t)if((!r||t[o]!==void 0)&&!xs(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let i=0;for(const o in t)if((!r||t[o]!==void 0)&&(i++,i>s||!xs(e[o],t[o],n)))return!1;return s===i}return!1}function ji(e){let t,n;const r=new Promise((s,i)=>{t=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e==null||e(s)},r.reject=s=>{r.status="rejected",n(s)},r}function sa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function wj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function yy(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return wj(t)}const bj=["http:","https:","mailto:","tel:"];function kc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ro(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=yy(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+yy(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function kj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function _j(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Xn(){throw new Error("Invariant failed")}function ia(e){const t=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const o=t.get(i);if(o)return s(o),o.value},set(i,o){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(i);if(a)a.value=o,s(a);else{const l={key:i,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(i,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Pr=4,Hw=5;function Sj(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Wp(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,i=e.substring(t,s);if(!i||!i.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(i.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=Sj(i);if(o){const[a,l]=o,u=i.charCodeAt(a+1);if(u===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const c=a+3,d=l;if(c<d)return n[0]=3,n[1]=t+a,n[2]=t+c,n[3]=t+d,n[4]=t+l+1,n[5]=s,n}}else if(u===36){const c=a+1,d=a+2;return d===l?(n[0]=2,n[1]=t+a,n[2]=t+c,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+d,n[3]=t+l,n[4]=t+l+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function cu(e,t,n,r,s,i,o){var l,u,c,d,h,p,m,y,w,g,x,v,k;o==null||o(n);let a=r;{const S=n.fullPath??n.from,b=S.length,j=((l=n.options)==null?void 0:l.caseSensitive)??e,P=!!((c=(u=n.options)==null?void 0:u.params)!=null&&c.parse&&((h=(d=n.options)==null?void 0:d.skipRouteOnParseError)!=null&&h.params));for(;a<b;){const E=Wp(S,a,t);let I;const M=a,O=E[5];switch(a=O+1,i++,E[0]){case 0:{const A=S.substring(E[2],E[3]);if(j){const R=(p=s.static)==null?void 0:p.get(A);if(R)I=R;else{s.static??(s.static=new Map);const z=hs(n.fullPath??n.from);z.parent=s,z.depth=i,I=z,s.static.set(A,z)}}else{const R=A.toLowerCase(),z=(m=s.staticInsensitive)==null?void 0:m.get(R);if(z)I=z;else{s.staticInsensitive??(s.staticInsensitive=new Map);const B=hs(n.fullPath??n.from);B.parent=s,B.depth=i,I=B,s.staticInsensitive.set(R,B)}}break}case 1:{const A=S.substring(M,E[1]),R=S.substring(E[4],O),z=j&&!!(A||R),B=A?z?A:A.toLowerCase():void 0,L=R?z?R:R.toLowerCase():void 0,$=!P&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===B&&C.suffix===L));if($)I=$;else{const C=cd(1,n.fullPath??n.from,z,B,L);I=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const A=S.substring(M,E[1]),R=S.substring(E[4],O),z=j&&!!(A||R),B=A?z?A:A.toLowerCase():void 0,L=R?z?R:R.toLowerCase():void 0,$=!P&&((w=s.optional)==null?void 0:w.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===B&&C.suffix===L));if($)I=$;else{const C=cd(3,n.fullPath??n.from,z,B,L);I=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const A=S.substring(M,E[1]),R=S.substring(E[4],O),z=j&&!!(A||R),B=A?z?A:A.toLowerCase():void 0,L=R?z?R:R.toLowerCase():void 0,$=cd(2,n.fullPath??n.from,z,B,L);I=$,$.parent=s,$.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push($)}}s=I}if(P&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const E=hs(n.fullPath??n.from);E.kind=Hw,E.parent=s,i++,E.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(E),s=E}const T=(n.path||!n.children)&&!n.isRoot;if(T&&S.endsWith("/")){const E=hs(n.fullPath??n.from);E.kind=Pr,E.parent=s,i++,E.depth=i,s.index=E,s=E}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=P,s.parsingPriority=((k=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:k.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const S of n.children)cu(e,t,S,a,s,i,o)}function ld(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function vr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)vr(s);if(e.static)for(const s of e.static.values())vr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())vr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(ld);for(const s of e.dynamic)vr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(ld);for(const s of e.optional)vr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(ld);for(const s of e.wildcard)vr(s)}}function hs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function cd(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function Cj(e,t){const n=hs("/"),r=new Uint16Array(6);for(const s of e)cu(!1,r,s,1,n,0);vr(n),t.masksTree=n,t.flatCache=ia(1e3)}function Pj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=Hp(e,t.masksTree);return t.flatCache.set(e,r),r}function jj(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let o=s.singleCache.get(i);return o||(o=hs("/"),cu(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),Hp(r,o,n)}function Ej(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Hp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=Nj(i.route)),t.matchCache.set(r,i),i}function Tj(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Rj(e,t=!1,n){const r=hs(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return cu(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Xn(),i[l.id]=l,a!==0&&l.path){const u=Tj(l.fullPath);(!o[u]||l.fullPath.endsWith("/"))&&(o[u]=l)}a++}),vr(r),{processedTree:{segmentTree:r,singleCache:ia(1e3),matchCache:ia(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function Hp(e,t,n=!1){const r=e.split("/"),s=Aj(e,r,t,n);if(!s)return null;const[i]=Gw(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function Gw(e,t,n){var c,d,h,p,m,y,w,g,x,v;const r=Ij(n.node);let s=null;const i=Object.create(null);let o=((c=n.extract)==null?void 0:c.part)??0,a=((d=n.extract)==null?void 0:d.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,u=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,u++){const k=r[a];if(k.kind===Pr)break;if(k.kind===Hw){u--,o--,l--;continue}const S=t[o],b=l;if(S&&(l+=S.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const j=s[u],P=((m=k.prefix)==null?void 0:m.length)??0;if(j.charCodeAt(P)===123){const T=((y=k.suffix)==null?void 0:y.length)??0,E=j.substring(P+2,j.length-T-1),I=S.substring(P,S.length-T);i[E]=decodeURIComponent(I)}else{const T=j.substring(1);i[T]=decodeURIComponent(S)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=b-1;continue}s??(s=n.node.fullPath.split("/"));const j=s[u],P=((w=k.prefix)==null?void 0:w.length)??0,T=((g=k.suffix)==null?void 0:g.length)??0,E=j.substring(P+3,j.length-T-1),I=k.suffix||k.prefix?S.substring(P,S.length-T):S;I&&(i[E]=decodeURIComponent(I))}else if(k.kind===2){const j=k,P=e.substring(b+(((x=j.prefix)==null?void 0:x.length)??0),e.length-(((v=j.suffix)==null?void 0:v.length)??0)),T=decodeURIComponent(P);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:u}]}function Nj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ij(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Aj(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ra(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,u=null;for(;a.length;){const c=a.pop(),{node:d,index:h,skipped:p,depth:m,statics:y,dynamics:w,optionals:g}=c;let{extract:x,rawParams:v,parsedParams:k}=c;if(d.kind===2&&d.route&&!Ja(u,c))continue;if(d.skipOnParamError){if(!xy(e,t,c))continue;v=c.rawParams,x=c.extract,k=c.parsedParams}r&&d.route&&d.kind!==Pr&&Ja(l,c)&&(l=c);const S=h===o;if(S&&(d.route&&(!i||d.kind===Pr||d.kind===2)&&Ja(u,c)&&(u=c),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const b=S?void 0:t[h];let j;if(S&&d.index){const P={node:d.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k};let T=!0;if(d.index.skipOnParamError&&(xy(e,t,P)||(T=!1)),T){if(!w&&!g&&!p&&Mj(y,o))return P;Ja(u,P)&&(u=P)}}if(d.wildcard)for(let P=d.wildcard.length-1;P>=0;P--){const T=d.wildcard[P],{prefix:E,suffix:I}=T;if(!(E&&(S||!(T.caseSensitive?b:j??(j=b.toLowerCase())).startsWith(E)))){if(I){if(S)continue;const M=t.slice(h).join("/").slice(-I.length);if((T.caseSensitive?M:M.toLowerCase())!==I)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k})}}if(d.optional){const P=p|1<<m,T=m+1;for(let E=d.optional.length-1;E>=0;E--){const I=d.optional[E];a.push({node:I,index:h,skipped:P,depth:T,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k})}if(!S)for(let E=d.optional.length-1;E>=0;E--){const I=d.optional[E],{prefix:M,suffix:O}=I;if(M||O){const A=I.caseSensitive?b:j??(j=b.toLowerCase());if(M&&!A.startsWith(M)||O&&!A.endsWith(O))continue}a.push({node:I,index:h+1,skipped:p,depth:T,statics:y,dynamics:w,optionals:g+Xa(o,h),extract:x,rawParams:v,parsedParams:k})}}if(!S&&d.dynamic&&b)for(let P=d.dynamic.length-1;P>=0;P--){const T=d.dynamic[P],{prefix:E,suffix:I}=T;if(E||I){const M=T.caseSensitive?b:j??(j=b.toLowerCase());if(E&&!M.startsWith(E)||I&&!M.endsWith(I))continue}a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:w+Xa(o,h),optionals:g,extract:x,rawParams:v,parsedParams:k})}if(!S&&d.staticInsensitive){const P=d.staticInsensitive.get(j??(j=b.toLowerCase()));P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Xa(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k})}if(!S&&d.static){const P=d.static.get(b);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+Xa(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k})}if(d.pathless){const P=m+1;for(let T=d.pathless.length-1;T>=0;T--){const E=d.pathless[T];a.push({node:E,index:h,skipped:p,depth:P,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:k})}}}if(u)return u;if(r&&l){let c=l.index;for(let h=0;h<l.index;h++)c+=t[h].length;const d=c===e.length?"/":e.slice(c);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(d),l}return null}function Xa(e,t){return 2**(e-t-1)}function Mj(e,t){return e===2**(t-1)-1}function xy(e,t,n){try{const[r,s]=Gw(e,t,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,i),!0}catch{return null}}function Ja(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Pr)>(e.node.kind===Pr)||t.node.kind===Pr==(e.node.kind===Pr)&&t.depth>e.depth))):!0}function Ml(e){return Gp(e.filter(t=>t!==void 0).join("/"))}function Gp(e){return e.replace(/\/{2,}/g,"/")}function Kw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Fr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function qw(e){return Fr(Kw(e))}function _c(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Lj(e,t,n){return _c(e,n)===_c(t,n)}function Dj({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),i=!s&&t===".";let o;if(r){o=s?t:i?e:e+"\0"+t;const d=r.get(o);if(d)return d}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&ra(a)==="";)a.pop();const d=t.split("/");for(let h=0,p=d.length;h<p;h++){const m=d[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ra(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,u="";for(let d=0;d<a.length;d++){d>0&&(u+="/");const h=a[d];if(!h)continue;l=Wp(h,0,l);const p=l[0];if(p===0){u+=h;continue}const m=l[5],y=h.substring(0,l[1]),w=h.substring(l[4],m),g=h.substring(l[2],l[3]);p===1?u+=y||w?`${y}{$${g}}${w}`:`$${g}`:p===2?u+=y||w?`${y}{$}${w}`:"$":u+=`${y}{-$${g}}${w}`}u=Gp(u);const c=u||"/";return o&&r&&r.set(o,c),c}function Fj(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>t.get(i)??i)}function ud(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>wy(s,n)).join("/"):wy(r,n)}function vy({path:e,params:t,decoder:n,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const o=e.length;let a=0,l,u="";for(;a<o;){const c=a;l=Wp(e,c,l);const d=l[5];if(a=d+1,c===d)continue;const h=l[0];if(h===0){u+="/"+e.substring(c,d);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(c,l[1]),y=e.substring(l[4],d);if(!p){s=!0,(m||y)&&(u+="/"+m+y);continue}const w=ud("_splat",t,n);u+="/"+m+w+y;continue}if(h===1){const p=e.substring(l[2],l[3]);!s&&!(p in t)&&(s=!0),i[p]=t[p];const m=e.substring(c,l[1]),y=e.substring(l[4],d),w=ud(p,t,n)??"undefined";u+="/"+m+w+y;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const y=e.substring(c,l[1]),w=e.substring(l[4],d),g=ud(p,t,n)??"";u+="/"+y+g+w;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:i,interpolatedPath:u||"/",isMissingParams:s}}function wy(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function rt(e){return(e==null?void 0:e.isNotFound)===!0}function Oj(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const zj="tsr-scroll-restoration-v1_3";function Bj(){const e=Oj();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Pi(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=Sr(r,t)||t},persist:()=>{try{e.setItem(zj,JSON.stringify(t))}catch{}}}}const by=Bj(),$j=e=>e.state.__TSR_key||e.href;function Vj(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Za=!1;const so="window",ky="data-scroll-restoration-id";function Uj(e,t){if(!by)return;const n=by;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Za=!1;const r=e.options.getScrollRestorationKey||$j,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(Za||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(so,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var u;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(u=n.state)[a]||(u[a]={});for(const[c,d]of s){let h;if(c===so)h=so;else if(c.isConnected){const p=c.getAttribute(ky);h=p?`[${ky}="${p}"]`:Vj(c)}h&&(l[h]=d)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var d;const l=r(a.toLocation),u=e.options.scrollRestorationBehavior,c=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Za=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const y=h[m];if(!Pi(y))continue;const{scrollX:w,scrollY:g}=y;if(!(!Number.isFinite(w)||!Number.isFinite(g))){if(m===so)window.scrollTo({top:g,left:w,behavior:u}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=w,x.scrollTop=g,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const y=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(y){const w=document.getElementById(m);w&&w.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:u};if(window.scrollTo(y),c)for(const w of c){if(w===so)continue;const g=typeof w=="function"?w():document.querySelector(w);g&&g.scrollTo(y)}}}}finally{Za=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function Wj(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function dd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Hj(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=dd(s):Array.isArray(i)?i.push(dd(s)):n[r]=[i,dd(s)]}return n}const Gj=qj(JSON.parse),Kj=Yj(JSON.stringify,JSON.parse);function qj(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Hj(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function Yj(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const i=Wj(s,r);return i?`?${i}`:""}}const vs="__root__";function Qj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function yt(e){return e instanceof Response&&!!e.options}function Xj(e){return{input:({url:t})=>{for(const n of e)t=nh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Yw(e[n],t);return t}}}function Jj(e){const t=qw(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Ml(["/",t,o.pathname]),o)}}function nh(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Yw(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Zj(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,u=n(e.status),c=n(e.loadedAt),d=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),y=n(e.statusCode),w=n(e.redirect),g=n([]),x=n([]),v=n([]),k=r(()=>fd(o,g.get())),S=r(()=>fd(a,x.get())),b=r(()=>fd(l,v.get())),j=r(()=>g.get()[0]),P=r(()=>g.get().some(B=>{var L;return((L=o.get(B))==null?void 0:L.get().status)==="pending"})),T=r(()=>{var B;return{locationHref:p.get().href,resolvedLocationHref:(B=m.get())==null?void 0:B.href,status:u.get()}}),E=r(()=>({status:u.get(),loadedAt:c.get(),isLoading:d.get(),isTransitioning:h.get(),matches:k.get(),location:p.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:w.get()})),I=ia(64);function M(B){let L=I.get(B);return L||(L=r(()=>{const $=g.get();for(const C of $){const V=o.get(C);if(V&&V.routeId===B)return V.get()}}),I.set(B,L)),L}const O={status:u,loadedAt:c,isLoading:d,isTransitioning:h,location:p,resolvedLocation:m,statusCode:y,redirect:w,matchesId:g,pendingIds:x,cachedIds:v,matches:k,pendingMatches:S,cachedMatches:b,firstId:j,hasPending:P,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:E,getRouteMatchStore:M,setMatches:A,setPending:R,setCached:z};A(e.matches),i==null||i(O);function A(B){hd(B,o,g,n,s)}function R(B){hd(B,a,x,n,s)}function z(B){hd(B,l,v,n,s)}return O}function fd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function hd(e,t,n,r,s){const i=e.map(a=>a.id),o=new Set(i);s(()=>{for(const a of t.keys())o.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const u=r(a);u.routeId=a.routeId,t.set(a.id,u);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}_j(n.get(),i)||n.set(i)})}const rh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},eE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),uu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),ws=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let i=0;i<=s;i++){const o=e.matches[i];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},_y=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let i=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;i<0&&(i=s);for(let o=i;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?i:s},jr=(e,t,n)=>{var r,s,i;if(!(!yt(n)&&!rt(n)))throw yt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:yt(n)?"redirected":rt(n)?"notFound":o.status==="pending"?"success":o.status,context:ws(e,t.index),isFetching:!1,error:n})),rt(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),yt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Qw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Sy=(e,t,n)=>{const r=ws(e,n);e.updateMatch(t,s=>({...s,context:r}))},io=(e,t,n,r)=>{var a,l;const{id:s,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),jr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(u){n=u,jr(e,e.router.getMatch(s),n)}e.updateMatch(s,u=>{var c,d;return(c=u._nonReactive.beforeLoadPromise)==null||c.resolve(),u._nonReactive.beforeLoadPromise=void 0,(d=u._nonReactive.loadPromise)==null||d.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(n)&&!rt(n)&&(e.serialError??(e.serialError=n))},Xw=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!uu(e,t)&&(n.options.loader||n.options.beforeLoad||Zw(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{rh(e)},s);r._nonReactive.pendingTimeout=o}},tE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Xw(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&jr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},nE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=ji(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&io(e,n,o,"PARSE_PARAMS"),a&&io(e,n,a,"VALIDATE_SEARCH"),Xw(e,t,r,s);const l=new AbortController;let u=!1;const c=()=>{u||(u=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},d=()=>{var k;(k=s._nonReactive.beforeLoadPromise)==null||k.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{c(),d()});return}s._nonReactive.beforeLoadPromise=ji();const h={...ws(e,n,!1),...s.__routeContext},{search:p,params:m,cause:y}=s,w=uu(e,t),g={search:p,abortController:l,params:m,preload:w,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=k=>{if(k===void 0){e.router.batch(()=>{c(),d()});return}(yt(k)||rt(k))&&(c(),io(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{c(),e.updateMatch(t,S=>({...S,__beforeLoadContext:k})),d()})};let v;try{if(v=r.options.beforeLoad(g),sa(v))return c(),v.catch(k=>{io(e,n,k,"BEFORE_LOAD")}).then(x)}catch(k){c(),io(e,n,k,"BEFORE_LOAD")}x(v)},rE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>nE(e,n,t,s),a=()=>{if(Qw(e,n))return;const l=tE(e,n,s);return sa(l)?l.then(o):o()};return i()},sE=(e,t,n)=>{var i,o,a,l,u,c;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(c=(u=n.options).headers)==null?void 0:c.call(u,s)]).then(([d,h,p])=>({meta:d==null?void 0:d.meta,links:d==null?void 0:d.links,headScripts:d==null?void 0:d.scripts,headers:p,scripts:h,styles:d==null?void 0:d.styles}))},Jw=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:u}=e.router.getMatch(n),c=ws(e,r),d=uu(e,n);return{params:o,deps:a,preload:!!d,parentMatchPromise:i,abortController:l,context:c,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":u,route:s,...e.router.options.additionalContext}},Cy=async(e,t,n,r,s)=>{var i,o,a,l,u;try{const c=e.router.getMatch(n);try{(!(Ww??e.router.isServer)||c.ssr===!0)&&oa(s);const d=s.options.loader,h=typeof d=="function"?d:d==null?void 0:d.handler,p=h==null?void 0:h(Jw(e,t,n,r,s)),m=!!h&&sa(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),h){const w=m?await p:p;jr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,g=>({...g,loaderData:w}))}s._lazyPromise&&await s._lazyPromise;const y=c._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:ws(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let h=d;if((h==null?void 0:h.name)==="AbortError"){if(c.abortController.signal.aborted){(i=c._nonReactive.loaderPromise)==null||i.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:ws(e,r)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,rt(d)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),jr(e,e.router.getMatch(n),d);try{(u=(l=s.options).onError)==null||u.call(l,d)}catch(m){h=m,jr(e,e.router.getMatch(n),m)}!yt(h)&&!rt(h)&&await oa(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:ws(e,r),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(n);d&&(d._nonReactive.loaderPromise=void 0),jr(e,d,c)}},iE=async(e,t,n)=>{var p,m,y,w;async function r(g,x,v,k,S){const b=Date.now()-x.updatedAt,j=g?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,P=S.options.shouldReload,T=typeof P=="function"?P(Jw(e,t,s,n,S)):P,{status:E,invalid:I}=k,M=b>=j&&(!!e.forceStaleReload||k.cause==="enter"||v!==void 0&&v!==k.id);o=E==="success"&&(I||(T??M)),g&&S.options.preload===!1||(o&&!e.sync&&c?(a=!0,(async()=>{var O,A;try{await Cy(e,t,s,n,S);const R=e.router.getMatch(s);(O=R._nonReactive.loaderPromise)==null||O.resolve(),(A=R._nonReactive.loadPromise)==null||A.resolve(),R._nonReactive.loaderPromise=void 0,R._nonReactive.loadPromise=void 0}catch(R){yt(R)&&await e.router.navigate(R.options)}})()):E!=="success"||o?await Cy(e,t,s,n,S):Sy(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],u=l.options.loader,c=((typeof u=="function"||u==null?void 0:u.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Qw(e,s)){if(!e.router.getMatch(s))return e.matches[n];Sy(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],v=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(S=>S.routeId===i))==null?void 0:m.id,k=uu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&c)return g;await g._nonReactive.loaderPromise;const S=e.router.getMatch(s),b=S._nonReactive.error||S.error;b&&jr(e,S,b),S.status==="pending"&&await r(k,g,v,S,l)}else{const S=k&&!e.router.stores.matchStores.has(s),b=e.router.getMatch(s);b._nonReactive.loaderPromise=ji(),S!==b.preload&&e.updateMatch(s,j=>({...j,preload:S})),await r(k,g,v,b,l)}}const d=e.router.getMatch(s);a||((y=d._nonReactive.loaderPromise)==null||y.resolve(),(w=d._nonReactive.loadPromise)==null||w.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,a||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=a?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function Py(e){var h,p;const t=e,n=[];eE(t.router)&&rh(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=rE(t,m);sa(y)&&await y}catch(y){if(yt(y))throw y;if(rt(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?_y(t,r):void 0,o=r&&t.preload?0:i!==void 0?Math.min(i+1,s):s;let a,l;for(let m=0;m<o;m++)n.push(iE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const w=y.reason;if(yt(w))throw w;rt(w)?a??(a=w):l??(l=w)}if(l!==void 0)throw l}const u=a??(r&&!t.preload?r:void 0);let c=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const m=_y(t,u);m===void 0&&Xn();const y=t.matches[m],w=t.router.looseRoutesById[y.routeId],g=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!w.options.notFoundComponent&&g&&(w.options.notFoundComponent=g),u.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,v=>({...v,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),c=m,await oa(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await oa(m,["errorComponent"])}for(let m=0;m<=c;m++){const{id:y,routeId:w}=t.matches[m],g=t.router.looseRoutesById[w];try{const x=sE(t,y,g);if(x){const v=await x;t.updateMatch(y,k=>({...k,...v}))}}catch(x){console.error(`Error executing head for route ${w}:`,x)}}const d=rh(t);if(sa(d)&&await d,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function jy(e,t){const n=t.map(r=>{var s,i;return(i=(s=e.options[r])==null?void 0:s.preload)==null?void 0:i.call(s)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function oa(e,t=Ll){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Ll?(()=>{if(e._componentsPromise===void 0){const r=jy(e,Ll);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():jy(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Zw(e){var t;for(const n of Ll)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Ll=["component","errorComponent","pendingComponent","notFoundComponent"];var Or="__TSR_index",Ey="popstate",Ty="beforeunload";function oE(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var d,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],c=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&c)for(const p of u){const m=Sc(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(h=e.onBlocked)==null||h.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const u=t.state[Or];a=Ry(u+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const u=t.state[Or];a=Ry(u,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Or]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var c,d;const u=((c=e.getBlockers)==null?void 0:c.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(h=>h!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function Ry(e,t){t||(t={});const n=Kp();return{...t,key:n,__TSR_key:n,[Or]:e}}function aE(e){var P,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=E=>s=E,a=E=>E,l=()=>Sc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((P=t.history.state)!=null&&P.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const E=Kp();t.history.replaceState({[Or]:0,key:E,__TSR_key:E},"")}let u=l(),c,d=!1,h=!1,p=!1,m=!1;const y=()=>u;let w,g;const x=()=>{w&&(j._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),j._ignoreSubscribers=!1,w=void 0,g=void 0,c=void 0)},v=(E,I,M)=>{const O=a(I);g||(c=u),u=Sc(I,M),w={href:O,state:M,isPush:(w==null?void 0:w.isPush)||E==="push"},g||(g=Promise.resolve().then(()=>x()))},k=E=>{u=l(),j.notify({type:E})},S=async()=>{if(h){h=!1;return}const E=l(),I=E.state[Or]-u.state[Or],M=I===1,O=I===-1,A=!M&&!O||d;d=!1;const R=A?"GO":O?"BACK":"FORWARD",z=A?{type:"GO",index:I}:{type:O?"BACK":"FORWARD"};if(p)p=!1;else{const B=i();if(typeof document<"u"&&B.length){for(const L of B)if(await L.blockerFn({currentLocation:u,nextLocation:E,action:R})){h=!0,t.history.go(1),j.notify(z);return}}}u=l(),j.notify(z)},b=E=>{if(m){m=!1;return}let I=!1;const M=i();if(typeof document<"u"&&M.length)for(const O of M){const A=O.enableBeforeUnload??!0;if(A===!0){I=!0;break}if(typeof A=="function"&&A()===!0){I=!0;break}}if(I)return E.preventDefault(),E.returnValue=""},j=oE({getLocation:y,getLength:()=>t.history.length,pushState:(E,I)=>v("push",E,I),replaceState:(E,I)=>v("replace",E,I),back:E=>(E&&(p=!0),m=!0,t.history.back()),forward:E=>{E&&(p=!0),m=!0,t.history.forward()},go:E=>{d=!0,t.history.go(E)},createHref:E=>a(E),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ty,b,{capture:!0}),t.removeEventListener(Ey,S)},onBlocked:()=>{c&&u!==c&&(u=c)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ty,b,{capture:!0}),t.addEventListener(Ey,S),t.history.pushState=function(...E){const I=n.apply(t.history,E);return j._ignoreSubscribers||k("PUSH"),I},t.history.replaceState=function(...E){const I=r.apply(t.history,E);return j._ignoreSubscribers||k("REPLACE"),I},j}function lE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Sc(e,t){const n=lE(e),r=n.indexOf("#"),s=n.indexOf("?"),i=Kp();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[Or]:0,key:i,__TSR_key:i}}}function Kp(){return(Math.random()+1).toString(36).substring(7)}function mi(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var cE=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var c;const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,o=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Fj(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=aE()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let d;this.resolvePathCache=ia(1e3),d=this.buildRouteTree(),this.setRoutes(d)}if(!this.stores&&this.latestLocation){const d=this.getStoreConfig(this);this.batch=d.batch,this.stores=Zj(dE(this.latestLocation),d),Uj(this)}let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(i||s!==l||o!==u){this.basepath=l;const d=[],h=qw(l);h&&h!=="/"&&d.push(Jj({basepath:l})),u&&d.push(u),this.rewrite=d.length===0?void 0:d.length===1?d[0]:Xj(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((c=window.CSS)==null?void 0:c.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Rj(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&Cj(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:u,hash:c,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(u),x=this.options.stringifySearch(g);return{href:l+x+c,publicHref:l+x+c,pathname:ro(l).path,external:!1,searchStr:x,search:es(r==null?void 0:r.search,g),hash:ro(c.slice(1)).path,state:Cr(r==null?void 0:r.state,h)}}const p=new URL(d,this.origin),m=nh(this.rewrite,p),y=this.options.parseSearch(m.search),w=this.options.stringifySearch(y);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:d,pathname:ro(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:es(r==null?void 0:r.search,y),hash:ro(m.hash.slice(1)).path,state:Cr(r==null?void 0:r.state,h)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>Dj({base:n,to:Gp(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>fE({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var E,I;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,u=this.resolvePathWithBase(l,"."),c=a.search,d=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(u,`${i.to}`):this.resolvePathWithBase(u,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?d:Object.assign(d,Sr(i.params,d)),m=this.getMatchedRoutes(h);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(p).length>0)for(const M of y){const O=((E=M.options.params)==null?void 0:E.stringify)??M.options.stringifyParams;if(O)try{Object.assign(p,O(p))}catch{}}const w=n.leaveParams?h:ro(vy({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=c;if(n._includeValidateSearch&&((I=this.options.search)!=null&&I.strict)){const M={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(M,Dl(O.options.validateSearch,{...M,...g}))}catch{}}),g=M}g=hE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=es(c,g);const x=this.options.stringifySearch(g),v=i.hash===!0?o.hash:i.hash?Sr(i.hash,o.hash):void 0,k=v?`#${v}`:"";let S=i.state===!0?o.state:i.state?Sr(i.state,o.state):{};S=Cr(o.state,S);const b=`${w}${x}${k}`;let j,P,T=!1;if(this.rewrite){const M=new URL(b,this.origin),O=Yw(this.rewrite,M);j=M.href.replace(M.origin,""),O.origin!==this.origin?(P=O.href,T=!0):P=O.pathname+O.search+O.hash}else j=kj(b),P=j;return{publicHref:P,href:j,pathname:w,search:g,searchStr:x,state:S,hash:v??"",external:T,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const u=Object.create(null);if(this.options.routeMasks){const c=Pj(a.pathname,this.processedTree);if(c){Object.assign(u,c.rawParams);const{from:d,params:h,...p}=c.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?u:Object.assign(u,Sr(h,u));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(c=>{s.state[c]=this.latestLocation.state[c]});const u=xs(s.state,this.latestLocation.state);return l.forEach(c=>{delete s.state[c]}),u},o=Fr(this.latestLocation.href)===Fr(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=ji(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...c}=s;l&&(c={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...c,search:c.searchStr,state:{...c.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c.unmaskOnReload??this.options.unmaskOnReload??!1)&&(c.state.__tempKey=this.tempLocationKey)),c.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](c.publicHref,c.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const d=this.history.location.state.__TSR_index,h=Sc(a,{__TSR_index:n?d:d+1}),p=new URL(h.pathname,this.origin);l.to=nh(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const c=this.commitLocation({...u,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,u;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const d=this.buildLocation({to:n,...o});s=s??d.publicHref,i=i??d.publicHref}const c=!a&&i?i:s;if(kc(c,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const h of d)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const c=this.latestLocation,d=mi(c,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await Py({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===c.href,matches:this.stores.pendingMatches.get(),location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var w,g;let h=null,p=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),v=x.length,k=this.stores.matches.get();h=v?k.filter(j=>!this.stores.pendingMatchStores.has(j.id)):null;const S=new Set;for(const j of this.stores.pendingMatchStores.values())j.routeId&&S.add(j.routeId);const b=new Set;for(const j of this.stores.matchStores.values())j.routeId&&b.add(j.routeId);p=v?k.filter(j=>!S.has(j.routeId)):null,m=v?x.filter(j=>!b.has(j.routeId)):null,y=v?x.filter(j=>b.has(j.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(j=>j.status!=="error"&&j.status!=="notFound"&&j.status!=="redirected")]),this.clearExpiredCache())});for(const[x,v]of[[p,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const k of x)(g=(w=this.looseRoutesById[k.routeId].options)[v])==null||g.call(w,k)})})}})}catch(c){yt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):rt(c)&&(s=c);const d=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(d),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(mi(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(u=>u!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&kc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=oa,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...i,...this.stores.cachedIds.get()]),a=s.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return s=await Py({router:this,matches:s,location:r,preload:!0,updateMatch:(l,u)=>{i.has(l)?s=s.map(c=>c.id===l?u(c):c):this.updateMatch(l,u)}}),s}catch(l){if(yt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});rt(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=jj(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!xs(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?xs(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Kj,parseSearch:e.parseSearch??Gj,protocolAllowlist:e.protocolAllowlist??bj}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var d,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:Fr(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?mE(this.options.notFoundMode,o):void 0,u=new Array(o.length),c=new Map;for(const p of this.stores.matchStores.values())p.routeId&&c.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],y=u[p-1];let w,g,x;{const R=(y==null?void 0:y.search)??e.search,z=(y==null?void 0:y._strictSearch)??void 0;try{const B=Dl(m.options.validateSearch,{...R})??void 0;w={...R,...B},g={...z,...B},x=void 0}catch(B){let L=B;if(B instanceof Cc||(L=new Cc(B.message,{cause:B})),t!=null&&t.throwOnError)throw L;w=R,g={},x=L}}const v=((h=(d=m.options).loaderDeps)==null?void 0:h.call(d,{search:w}))??"",k=v?JSON.stringify(v):"",{interpolatedPath:S,usedParams:b}=vy({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),j=m.id+S+k,P=this.getMatch(j),T=c.get(m.id),E=(P==null?void 0:P._strictParams)??b;let I;if(!P)try{Ny(m,b,i,E)}catch(R){if(rt(R)||yt(R)?I=R:I=new uE(R.message,{cause:R}),t!=null&&t.throwOnError)throw I}Object.assign(s,E);const M=T?"stay":"enter";let O;if(P)O={...P,cause:M,params:(T==null?void 0:T.params)??s,_strictParams:E,search:es(T?T.search:P.search,w),_strictSearch:g};else{const R=m.options.loader||m.options.beforeLoad||m.lazyFn||Zw(m)?"pending":"success";O={id:j,ssr:m.options.ssr,index:p,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:E,pathname:S,updatedAt:Date.now(),search:T?es(T.search,w):w,_strictSearch:g,searchError:void 0,status:R,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:ji()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:T?Cr(T.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(O.globalNotFound=l===m.id),O.searchError=x;const A=this.getParentContext(y);O.context={...A,...O.__routeContext,...O.__beforeLoadContext},u[p]=O}for(let p=0;p<u.length;p++){const m=u[p],y=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),g=c.get(m.routeId);if(m.params=g?es(g.params,s):s,!w){const x=u[p-1],v=this.getParentContext(x);if(y.options.context){const k={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:u,routeId:y.id};m.__routeContext=y.options.context(k)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return u}matchRoutesLightweight(e){var c;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=ra(t),i={...e.search};for(const d of t)try{Object.assign(i,Dl(d.options.validateSearch,i))}catch{}const o=ra(this.stores.matchesId.get()),a=o&&((c=this.stores.matchStores.get(o))==null?void 0:c.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let u;if(l)u=a.params;else{const d=Object.assign(Object.create(null),n);for(const h of t)try{Ny(h,n,r??{},d)}catch{}u=d}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:u}}},Cc=class extends Error{},uE=class extends Error{};function dE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Dl(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Cc("Async validation not supported");if(n.issues)throw new Cc(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function fE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Fr(e);let i,o;const a=Ej(s,n,!0);return a&&(i=a.route,Object.assign(r,a.rawParams),o=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[t.__root__],routeParams:r,foundRoute:i,parsedParams:o}}function hE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return pE(n)(e,t,r??!1)}function pE(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let u=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(u=i.options.preSearchFilters.reduce((d,h)=>h(d),a));const c=l(u);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((d,h)=>h(d),c):c};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const u=l(a);if(!t._includeValidateSearch)return u;try{return{...u,...Dl(i.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:Sr(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:c=>r(i+1,c,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function mE(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return vs}function Ny(e,t,n,r){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const gE="Error preloading route! ☝️";var eb=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var l,u;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=vs:this.parentRoute||Xn();let s=r?vs:n==null?void 0:n.path;s&&s!=="/"&&(s=Kw(s));const i=(n==null?void 0:n.id)||s;let o=r?vs:Ml([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Ml(["/",o]));const a=o==="__root__"?"/":Ml([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=Fr(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Qj({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},yE=class extends eb{constructor(e){super(e)}};function xE(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function qp(e){const t=e.errorComponent??Yp;return f.jsx(vE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var vE=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Yp({error:e}){const[t,n]=_.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function wE({children:e,fallback:t=null}){return tb()?f.jsx(xi.Fragment,{children:e}):f.jsx(xi.Fragment,{children:t})}function tb(){return xi.useSyncExternalStore(bE,()=>!0,()=>!1)}function bE(){return()=>{}}var nb=_.createContext(null);function zt(e){return _.useContext(nb)}var du=_.createContext(void 0),kE=_.createContext(void 0),_e=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(_e||{});function _E({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(u,c,d){const h=c.depsTail;if(h!==void 0&&h.dep===u)return;const p=h!==void 0?h.nextDep:c.deps;if(p!==void 0&&p.dep===u){p.version=d,c.depsTail=p;return}const m=u.subsTail;if(m!==void 0&&m.version===d&&m.sub===c)return;const y=c.depsTail=u.subsTail={version:d,dep:u,sub:c,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=y),h!==void 0?h.nextDep=y:c.deps=y,m!==void 0?m.nextSub=y:u.subs=y}function s(u,c=u.sub){const d=u.dep,h=u.prevDep,p=u.nextDep,m=u.nextSub,y=u.prevSub;return p!==void 0?p.prevDep=h:c.depsTail=h,h!==void 0?h.nextDep=p:c.deps=p,m!==void 0?m.prevSub=y:d.subsTail=y,y!==void 0?y.nextSub=m:(d.subs=m)===void 0&&n(d),p}function i(u){let c=u.nextSub,d;e:do{const h=u.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(u,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&t(h),p&1){const m=h.subs;if(m!==void 0){const y=(u=m).nextSub;y!==void 0&&(d={value:c,prev:d},c=y);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function o(u,c){let d,h=0,p=!1;e:do{const m=u.dep,y=m.flags;if(c.flags&16)p=!0;else if((y&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((y&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=m.deps,c=m,++h;continue}if(!p){const w=u.nextDep;if(w!==void 0){u=w;continue}}for(;h--;){const w=c.subs,g=w.nextSub!==void 0;if(g?(u=d.value,d=d.prev):u=w,p){if(e(c)){g&&a(w),c=u.sub;continue}p=!1}else c.flags&=-33;c=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return p}while(!0)}function a(u){do{const c=u.sub,d=c.flags;(d&48)===32&&(c.flags=d|16,(d&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let d=c.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function SE(e,t,n){var i,o,a;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(o=r?e.error:t)==null?void 0:o.bind(s),complete:(a=r?e.complete:n)==null?void 0:a.bind(s)}}const sh=[];let Fl=0;const{link:Iy,unlink:CE,propagate:PE,checkDirty:rb,shallowPropagate:Ay}=_E({update(e){return e._update()},notify(e){sh[ih++]=e,e.flags&=~_e.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=_e.Mutable|_e.Dirty,Pc(e))}});let el=0,ih=0,Pn,oh=0;function sb(e){try{++oh,e()}finally{--oh||ib()}}function Pc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=CE(n,e)}function ib(){if(!(oh>0)){for(;el<ih;){const e=sh[el];sh[el++]=void 0,e.notify()}el=0,ih=0}}function My(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?_e.None:_e.Mutable,get(){return Pn!==void 0&&Iy(s,Pn,Fl),s._snapshot},subscribe(i){const o=SE(i),a={current:!1},l=jE(()=>{var u;s.get(),a.current?(u=o.next)==null||u.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=Pn,a=(t==null?void 0:t.compare)??Object.is;if(n)Pn=s,++Fl,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=_e.Mutable|_e.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,u)?(s._snapshot=u,!0):!1}finally{Pn=o,n&&(s.flags&=~_e.RecursedCheck),Pc(s)}}};return n?(s.flags=_e.Mutable|_e.Dirty,s.get=function(){const i=s.flags;if(i&_e.Dirty||i&_e.Pending&&rb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&Ay(o)}}else i&_e.Pending&&(s.flags=i&~_e.Pending);return Pn!==void 0&&Iy(s,Pn,Fl),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(PE(o),Ay(o),ib())}},s}function jE(e){const t=()=>{const r=Pn;Pn=n,++Fl,n.depsTail=void 0,n.flags=_e.Watching|_e.RecursedCheck;try{return e()}finally{Pn=r,n.flags&=~_e.RecursedCheck,Pc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:_e.Watching|_e.RecursedCheck,notify(){const r=this.flags;r&_e.Dirty||r&_e.Pending&&rb(this.deps,this)?t():this.flags=_e.Watching},stop(){this.flags=_e.None,this.depsTail=void 0,Pc(this)}};return t(),n}var ob={exports:{}},ab={},lb={exports:{}},cb={};/**
42
- * @license React
43
- * use-sync-external-store-shim.production.js
44
- *
45
- * Copyright (c) Meta Platforms, Inc. and affiliates.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- */var Ei=_;function EE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TE=typeof Object.is=="function"?Object.is:EE,RE=Ei.useState,NE=Ei.useEffect,IE=Ei.useLayoutEffect,AE=Ei.useDebugValue;function ME(e,t){var n=t(),r=RE({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return IE(function(){s.value=n,s.getSnapshot=t,pd(s)&&i({inst:s})},[e,n,t]),NE(function(){return pd(s)&&i({inst:s}),e(function(){pd(s)&&i({inst:s})})},[e]),AE(n),n}function pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!TE(e,n)}catch{return!0}}function LE(e,t){return t()}var DE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?LE:ME;cb.useSyncExternalStore=Ei.useSyncExternalStore!==void 0?Ei.useSyncExternalStore:DE;lb.exports=cb;var FE=lb.exports;/**
50
- * @license React
51
- * use-sync-external-store-shim/with-selector.production.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */var fu=_,OE=FE;function zE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BE=typeof Object.is=="function"?Object.is:zE,$E=OE.useSyncExternalStore,VE=fu.useRef,UE=fu.useEffect,WE=fu.useMemo,HE=fu.useDebugValue;ab.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=VE(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=WE(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return d=m}return d=p}if(m=d,BE(c,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(c=p,m):(c=p,d=y)}var u=!1,c,d,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var a=$E(e,i[0],i[1]);return UE(function(){o.hasValue=!0,o.value=a},[a]),HE(a),a};ob.exports=ab;var ub=ob.exports;const GE=Gc(ub);function KE(e,t){return e===t}function kt(e,t,n=KE){const r=_.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=_.useCallback(()=>e==null?void 0:e.get(),[e]);return ub.useSyncExternalStoreWithSelector(r,s,s,t,n)}var qE={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Is(e){const t=zt(),n=_.useContext(e.from?kE:du),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=_.useRef(void 0);return kt(s??qE,o=>{if((e.shouldThrow??!0)&&!o&&Xn(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Cr(i.current,a);return i.current=l,l}return a})}function db(e){return Is({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function fb(e){const{select:t,...n}=e;return Is({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Di(e){return Is({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Qp(e){return Is({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Zt(e){const t=zt();return _.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function hb(e){return Is({...e,select:t=>e.select?e.select(t.context):t.context})}function YE(e,t){const n=zt(),r=gj(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:u,preloadIntentProximity:c,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:m,viewTransition:y,children:w,target:g,disabled:x,style:v,className:k,onClick:S,onBlur:b,onFocus:j,onMouseEnter:P,onMouseLeave:T,onTouchStart:E,ignoreBlocker:I,params:M,search:O,hash:A,state:R,mask:z,reloadDocument:B,unsafeRelative:L,from:$,_fromLocation:C,...V}=e,q=tb(),N=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=kt(n.stores.location,de=>de,(de,D)=>de.href===D.href),fe=_.useMemo(()=>{const de={_fromLocation:le,...N};return n.buildLocation(de)},[n,le,N]),ue=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,Pt=fe.maskedLocation?fe.maskedLocation.external:fe.external,Ue=_.useMemo(()=>tT(ue,Pt,n.history,x),[x,Pt,ue,n.history]),Bt=_.useMemo(()=>{if(Ue!=null&&Ue.external)return kc(Ue.href,n.protocolAllowlist)?void 0:Ue.href;if(!nT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),kc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ue,n.protocolAllowlist]),yn=_.useMemo(()=>{if(Bt)return!1;if(o!=null&&o.exact){if(!Lj(le.pathname,fe.pathname,n.basepath))return!1}else{const de=_c(le.pathname,n.basepath),D=_c(fe.pathname,n.basepath);if(!(de.startsWith(D)&&(de.length===D.length||de[D.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!xs(le.search,fe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?q&&le.hash===fe.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,le,Bt,q,fe.hash,fe.pathname,fe.search,n.basepath]),Fn=yn?Sr(s,{})??QE:md,Ms=yn?md:Sr(i,{})??md,Ta=[k,Fn.className,Ms.className].filter(Boolean).join(" "),Ra=(v||Fn.style||Ms.style)&&{...v,...Fn.style,...Ms.style},[Na,Hi]=_.useState(!1),Gi=_.useRef(!1),sr=e.reloadDocument||Bt?!1:l??n.options.defaultPreload,Ls=u??n.options.defaultPreloadDelay??0,xn=_.useCallback(()=>{n.preloadRoute({...N,_builtLocation:fe}).catch(de=>{console.warn(de),console.warn(gE)})},[n,N,fe]);mj(r,_.useCallback(de=>{de!=null&&de.isIntersecting&&xn()},[xn]),eT,{disabled:!!x||sr!=="viewport"}),_.useEffect(()=>{Gi.current||!x&&sr==="render"&&(xn(),Gi.current=!0)},[x,xn,sr]);const Au=de=>{const D=de.currentTarget.getAttribute("target"),H=g!==void 0?g:D;if(!x&&!rT(de)&&!de.defaultPrevented&&(!H||H==="_self")&&de.button===0){de.preventDefault(),Ns.flushSync(()=>{Hi(!0)});const Z=n.subscribe("onResolved",()=>{Z(),Hi(!1)});n.navigate({...N,replace:h,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:y,ignoreBlocker:I})}};if(Bt)return{...V,ref:r,href:Bt,...w&&{children:w},...g&&{target:g},...x&&{disabled:x},...v&&{style:v},...k&&{className:k},...S&&{onClick:S},...b&&{onBlur:b},...j&&{onFocus:j},...P&&{onMouseEnter:P},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};const Ia=de=>{if(x||sr!=="intent")return;if(!Ls){xn();return}const D=de.currentTarget;if(oo.has(D))return;const H=setTimeout(()=>{oo.delete(D),xn()},Ls);oo.set(D,H)},Mu=de=>{x||sr!=="intent"||xn()},Aa=de=>{if(x||!sr||!Ls)return;const D=de.currentTarget,H=oo.get(D);H&&(clearTimeout(H),oo.delete(D))};return{...V,...Fn,...Ms,href:Ue==null?void 0:Ue.href,ref:r,onClick:Os([S,Au]),onBlur:Os([b,Aa]),onFocus:Os([j,Ia]),onMouseEnter:Os([P,Ia]),onMouseLeave:Os([T,Aa]),onTouchStart:Os([E,Mu]),disabled:!!x,target:g,...Ra&&{style:Ra},...Ta&&{className:Ta},...x&&XE,...yn&&JE,...q&&Na&&ZE}}var md={},QE={className:"active"},XE={role:"link","aria-disabled":!0},JE={"data-status":"active","aria-current":"page"},ZE={"data-transitioning":"transitioning"},oo=new WeakMap,eT={rootMargin:"100px"},Os=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function tT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function nT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var pb=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=YE(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return _.createElement("a",l,o)}return _.createElement(n,i,o)});function rT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var sT=class extends eb{constructor(e){super(e),this.useMatch=t=>Is({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>hb({...t,from:this.id}),this.useSearch=t=>Qp({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Di({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>fb({...t,from:this.id}),this.useLoaderData=t=>db({...t,from:this.id}),this.useNavigate=()=>Zt({from:this.fullPath}),this.Link=xi.forwardRef((t,n)=>f.jsx(pb,{ref:n,from:this.fullPath,...t}))}};function gn(e){return new sT(e)}var iT=class extends yE{constructor(e){super(e),this.useMatch=t=>Is({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>hb({...t,from:this.id}),this.useSearch=t=>Qp({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Di({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>fb({...t,from:this.id}),this.useLoaderData=t=>db({...t,from:this.id}),this.useNavigate=()=>Zt({from:this.fullPath}),this.Link=xi.forwardRef((t,n)=>f.jsx(pb,{ref:n,from:this.fullPath,...t}))}};function oT(e){return new iT(e)}function aT(e){const t=zt(),n=`not-found-${kt(t.stores.location,r=>r.pathname)}-${kt(t.stores.status,r=>r)}`;return f.jsx(qp,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(rt(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(rt(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function lT(){return f.jsx("p",{children:"Not Found"})}function Ws(e){return f.jsx(f.Fragment,{children:e.children})}function mb(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(lT,{})}function cT(e){return null}function uT(){return cT(zt()),null}var gb=_.memo(function({matchId:t}){const n=zt(),r=n.stores.matchStores.get(t);r||Xn();const s=kt(n.stores.loadedAt,o=>o),i=kt(r,o=>o);return f.jsx(dT,{router:n,matchId:t,resetKey:s,matchState:_.useMemo(()=>{var l;const o=i.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:a}},[i._displayPending,i.routeId,i.ssr,n.routesById])})});function dT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?f.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,u=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,c=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||c)&&(s.options.wrapInSuspense??i??(((y=s.options.errorComponent)==null?void 0:y.preload)||c))?_.Suspense:Ws,h=a?qp:Ws,p=u?aT:Ws;return f.jsxs(s.isRoot?s.options.shellComponent??Ws:Ws,{children:[f.jsx(du.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>n,errorComponent:a||Yp,onCatch:(w,g)=>{if(rt(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,g)},children:f.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!u||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!s.isRoot)throw w;return _.createElement(u,w)},children:c||r._displayPending?f.jsx(wE,{fallback:o,children:f.jsx(Ly,{matchId:t})}):f.jsx(Ly,{matchId:t})})})})}),r.parentRouteId===vs?f.jsxs(f.Fragment,{children:[f.jsx(fT,{resetKey:n}),e.options.scrollRestoration&&Ww?f.jsx(uT,{}):null]}):null]})}function fT({resetKey:e}){const t=zt(),n=_.useRef(void 0);return bo(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...mi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Ly=_.memo(function({matchId:t}){const n=zt(),r=(c,d)=>{var h;return((h=n.getMatch(c.id))==null?void 0:h._nonReactive[d])??c._nonReactive[d]},s=n.stores.matchStores.get(t);s||Xn();const i=kt(s,c=>c),o=i.routeId,a=n.routesById[o],l=_.useMemo(()=>{var d;const c=(d=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:d({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return c?JSON.stringify(c):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),u=_.useMemo(()=>{const c=a.options.component??n.options.defaultComponent;return c?f.jsx(c,{},l):f.jsx(yb,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const c=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const d=n.getMatch(i.id);if(d&&!d._nonReactive.minPendingPromise){const h=ji();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},c)}}throw r(i,"loadPromise")}if(i.status==="notFound")return rt(i.error)||Xn(),mb(n,a,i.error);if(i.status==="redirected")throw yt(i.error)||Xn(),r(i,"loadPromise");if(i.status==="error")throw i.error;return u}),yb=_.memo(function(){const t=zt(),n=_.useContext(du);let r,s=!1,i;{const u=n?t.stores.matchStores.get(n):void 0;[r,s]=kt(u,c=>[c==null?void 0:c.routeId,(c==null?void 0:c.globalNotFound)??!1]),i=kt(t.stores.matchesId,c=>c[c.findIndex(d=>d===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||Xn(),mb(t,o,void 0);if(!i)return null;const l=f.jsx(gb,{matchId:i});return r===vs?f.jsx(_.Suspense,{fallback:a,children:l}):l});function hT(){const e=zt(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),s=kt(e.stores.isLoading,d=>d),i=kt(e.stores.hasPending,d=>d),o=ad(s),a=s||n||i,l=ad(a),u=s||i,c=ad(u);return e.startTransition=d=>{r(!0),_.startTransition(()=>{d(),r(!1)})},_.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Fr(e.latestLocation.publicHref)!==Fr(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),bo(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),bo(()=>{o&&!s&&e.emit({type:"onLoad",...mi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),bo(()=>{c&&!u&&e.emit({type:"onBeforeRouteMount",...mi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,c,e]),bo(()=>{if(l&&!a){const d=mi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),sb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),d.hrefChanged&&xE(e)}},[a,l,e]),null}function pT(){const e=zt(),t=e.routesById[vs].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Ws:_.Suspense,{fallback:n,children:[f.jsx(hT,{}),f.jsx(mT,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function mT(){const e=zt(),t=kt(e.stores.firstId,s=>s),n=kt(e.stores.loadedAt,s=>s),r=t?f.jsx(gb,{matchId:t}):null;return f.jsx(du.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(qp,{getResetKey:()=>n,errorComponent:Yp,onCatch:void 0,children:r})})}var gT=e=>({createMutableStore:My,createReadonlyStore:My,batch:sb}),yT=e=>new xT(e),xT=class extends cE{constructor(e){super(e,gT)}};function vT({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(nb.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function wT({router:e,...t}){return f.jsx(vT,{router:e,...t,children:f.jsx(pT,{})})}function bT(e){const t=zt({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=_.useRef(void 0);return kt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Cr(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const kT="modulepreload",_T=function(e){return"/"+e},Dy={},Kr=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=_T(l),l in Dy)return;Dy[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":kT,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function ST(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const CT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jT={};function Fy(e,t){return(jT.jsx?PT:CT).test(e)}const ET=/[ \t\n\f\r]/g;function TT(e){return typeof e=="object"?e.type==="text"?Oy(e.value):!1:Oy(e)}function Oy(e){return e.replace(ET,"")===""}class ya{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ya.prototype.normal={};ya.prototype.property={};ya.prototype.space=void 0;function xb(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ya(n,r,t)}function ah(e){return e.toLowerCase()}class Ct{constructor(t,n){this.attribute=n,this.property=t}}Ct.prototype.attribute="";Ct.prototype.booleanish=!1;Ct.prototype.boolean=!1;Ct.prototype.commaOrSpaceSeparated=!1;Ct.prototype.commaSeparated=!1;Ct.prototype.defined=!1;Ct.prototype.mustUseProperty=!1;Ct.prototype.number=!1;Ct.prototype.overloadedBoolean=!1;Ct.prototype.property="";Ct.prototype.spaceSeparated=!1;Ct.prototype.space=void 0;let RT=0;const ee=As(),De=As(),lh=As(),W=As(),pe=As(),bs=As(),Rt=As();function As(){return 2**++RT}const ch=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:De,commaOrSpaceSeparated:Rt,commaSeparated:bs,number:W,overloadedBoolean:lh,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),gd=Object.keys(ch);class Xp extends Ct{constructor(t,n,r,s){let i=-1;if(super(t,n),zy(this,"space",s),typeof r=="number")for(;++i<gd.length;){const o=gd[i];zy(this,gd[i],(r&ch[o])===ch[o])}}}Xp.prototype.defined=!0;function zy(e,t,n){n&&(e[t]=n)}function Fi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Xp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ah(r)]=r,n[ah(i.attribute)]=r}return new ya(t,n,e.space)}const vb=Fi({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:De,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:pe,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:W,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:pe,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:De,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 wb(e,t){return t in e?e[t]:t}function bb(e,t){return wb(e,t.toLowerCase())}const NT=Fi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bs,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alpha:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:pe,autoFocus:ee,autoPlay:ee,blocking:pe,capture:null,charSet:null,checked:ee,cite:null,className:pe,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:De,controls:ee,controlsList:pe,coords:W|bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:lh,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,formTarget:null,headers:pe,height:W,hidden:lh,high:W,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:pe,itemRef:pe,itemScope:ee,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:W,pattern:null,ping:pe,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:pe,required:ee,reversed:ee,rows:W,rowSpan:W,sandbox:pe,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootCustomElementRegistry:ee,shadowRootDelegatesFocus:ee,shadowRootMode:null,shadowRootSerializable:ee,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:De,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:ee,useMap:null,value:De,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,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:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:De,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:ee,disablePictureInPicture:ee,disableRemotePlayback:ee,exportParts:bs,part:pe,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:bb}),IT=Fi({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:Rt,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:pe,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:ee,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:bs,g2:bs,glyphName:bs,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:Rt,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:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rt,rev:Rt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rt,requiredFeatures:Rt,requiredFonts:Rt,requiredFormats:Rt,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:Rt,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:Rt,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:Rt,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:wb}),kb=Fi({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()}}),_b=Fi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bb}),Sb=Fi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AT={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"},MT=/[A-Z]/g,By=/-[a-z]/g,LT=/^data[-\w.:]+$/i;function DT(e,t){const n=ah(t);let r=t,s=Ct;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LT.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(By,OT);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!By.test(i)){let o=i.replace(MT,FT);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Xp}return new s(r,t)}function FT(e){return"-"+e.toLowerCase()}function OT(e){return e.charAt(1).toUpperCase()}const zT=xb([vb,NT,kb,_b,Sb],"html"),Jp=xb([vb,IT,kb,_b,Sb],"svg");function BT(e){return e.join(" ").trim()}var Zp={},$y=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$T=/\n/g,VT=/^\s*/,UT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,WT=/^:\s*/,HT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,GT=/^[;\s]*/,KT=/^\s+|\s+$/g,qT=`
58
- `,Vy="/",Uy="*",cs="",YT="comment",QT="declaration";function XT(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 s(m){var y=m.match($T);y&&(n+=y.length);var w=m.lastIndexOf(qT);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),u(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function u(){l(VT)}function c(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=i();if(!(Vy!=e.charAt(0)||Uy!=e.charAt(1))){for(var y=2;cs!=e.charAt(y)&&(Uy!=e.charAt(y)||Vy!=e.charAt(y+1));)++y;if(y+=2,cs===e.charAt(y-1))return a("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:YT,comment:w})}}function h(){var m=i(),y=l(UT);if(y){if(d(),!l(WT))return a("property missing ':'");var w=l(HT),g=m({type:QT,property:Wy(y[0].replace($y,cs)),value:w?Wy(w[0].replace($y,cs)):cs});return l(GT),g}}function p(){var m=[];c(m);for(var y;y=h();)y!==!1&&(m.push(y),c(m));return m}return u(),p()}function Wy(e){return e?e.replace(KT,cs):cs}var JT=XT,ZT=Xl&&Xl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zp,"__esModule",{value:!0});Zp.default=t2;const e2=ZT(JT);function t2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,e2.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var hu={};Object.defineProperty(hu,"__esModule",{value:!0});hu.camelCase=void 0;var n2=/^--[a-zA-Z0-9_-]+$/,r2=/-([a-z])/g,s2=/^[^-]+$/,i2=/^-(webkit|moz|ms|o|khtml)-/,o2=/^-(ms)-/,a2=function(e){return!e||s2.test(e)||n2.test(e)},l2=function(e,t){return t.toUpperCase()},Hy=function(e,t){return"".concat(t,"-")},c2=function(e,t){return t===void 0&&(t={}),a2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(o2,Hy):e=e.replace(i2,Hy),e.replace(r2,l2))};hu.camelCase=c2;var u2=Xl&&Xl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},d2=u2(Zp),f2=hu;function uh(e,t){var n={};return!e||typeof e!="string"||(0,d2.default)(e,function(r,s){r&&s&&(n[(0,f2.camelCase)(r,t)]=s)}),n}uh.default=uh;var h2=uh;const p2=Gc(h2),Cb=Pb("end"),em=Pb("start");function Pb(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 m2(e){const t=em(e),n=Cb(e);if(t&&n)return{start:t,end:n}}function Io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gy(e.position):"start"in e||"end"in e?Gy(e):"line"in e||"column"in e?dh(e):""}function dh(e){return Ky(e&&e.line)+":"+Ky(e&&e.column)}function Gy(e){return dh(e&&e.start)+"-"+dh(e&&e.end)}function Ky(e){return e&&typeof e=="number"?e:1}class it extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Io(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}it.prototype.file="";it.prototype.name="";it.prototype.reason="";it.prototype.message="";it.prototype.stack="";it.prototype.column=void 0;it.prototype.line=void 0;it.prototype.ancestors=void 0;it.prototype.cause=void 0;it.prototype.fatal=void 0;it.prototype.place=void 0;it.prototype.ruleId=void 0;it.prototype.source=void 0;const tm={}.hasOwnProperty,g2=new Map,y2=/[A-Z]/g,x2=new Set(["table","tbody","thead","tfoot","tr"]),v2=new Set(["td","th"]),jb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function w2(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=E2(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=j2(n,t.jsx,t.jsxs)}const s={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"?Jp:zT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Eb(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Eb(e,t,n){if(t.type==="element")return b2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return k2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return S2(e,t,n);if(t.type==="mdxjsEsm")return _2(e,t);if(t.type==="root")return C2(e,t,n);if(t.type==="text")return P2(e,t)}function b2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Jp,e.schema=s),e.ancestors.push(t);const i=Rb(e,t.tagName,!1),o=T2(e,t);let a=rm(e,t);return x2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!TT(l):!0})),Tb(e,o,i,t),nm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function k2(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)}aa(e,t.position)}function _2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);aa(e,t.position)}function S2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Jp,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Rb(e,t.name,!0),o=R2(e,t),a=rm(e,t);return Tb(e,o,i,t),nm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function C2(e,t,n){const r={};return nm(r,rm(e,t)),e.create(t,e.Fragment,r,n)}function P2(e,t){return t.value}function Tb(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function j2(e,t,n){return r;function r(s,i,o,a){const u=Array.isArray(o.children)?n:t;return a?u(i,o,a):u(i,o)}}function E2(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=em(r);return t(s,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function T2(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&tm.call(t.properties,s)){const i=N2(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&v2.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function R2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else aa(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else aa(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function rm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:g2;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=s.get(l)||0;o=l+"-"+u,s.set(l,u+1)}}const a=Eb(e,i,o);a!==void 0&&n.push(a)}return n}function N2(e,t,n){const r=DT(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ST(n):BT(n)),r.property==="style"){let s=typeof n=="object"?n:I2(e,String(n));return e.stylePropertyNameCase==="css"&&(s=A2(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?AT[r.property]||r.property:r.attribute,n]}}function I2(e,t){try{return p2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new it("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=jb+"#cannot-parse-style-attribute",s}}function Rb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=Fy(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=Fy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return tm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);aa(e)}function aa(e,t){const n=new it("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=jb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function A2(e){const t={};let n;for(n in e)tm.call(e,n)&&(t[M2(n)]=e[n]);return t}function M2(e){let t=e.replace(y2,L2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function L2(e){return"-"+e.toLowerCase()}const yd={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"]},D2={};function F2(e,t){const n=D2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nb(e,r,s)}function Nb(e,t,n){if(O2(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 qy(e.children,t,n)}return Array.isArray(e)?qy(e,t,n):""}function qy(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Nb(e[s],t,n);return r.join("")}function O2(e){return!!(e&&typeof e=="object")}const Yy=document.createElement("i");function sm(e){const t="&"+e+";";Yy.innerHTML=t;const n=Yy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Mn(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Gt(e,t){return e.length>0?(Mn(e,e.length,0,t),e):t}const Qy={}.hasOwnProperty;function z2(e){const t={};let n=-1;for(;++n<e.length;)B2(t,e[n]);return t}function B2(e,t){let n;for(n in t){const s=(Qy.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){Qy.call(s,o)||(s[o]=[]);const a=i[o];$2(s[o],Array.isArray(a)?a:a?[a]:[])}}}function $2(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Mn(e,0,0,r)}function Ib(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 gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tn=qr(/[A-Za-z]/),At=qr(/[\dA-Za-z]/),V2=qr(/[#-'*+\--9=?A-Z^-~]/);function fh(e){return e!==null&&(e<32||e===127)}const hh=qr(/\d/),U2=qr(/[\dA-Fa-f]/),W2=qr(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const H2=qr(new RegExp("\\p{P}|\\p{S}","u")),G2=qr(/\s/);function qr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Oi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&At(e.charCodeAt(n+1))&&At(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const K2={tokenize:q2};function q2(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return J(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const Y2={tokenize:Q2},Xy={tokenize:X2};function Q2(e){const t=this,n=[];let r=0,s,i,o;return a;function a(v){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(v)}return u(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const k=t.events.length;let S=k,b;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){b=t.events[S][1].end;break}g(r);let j=k;for(;j<t.events.length;)t.events[j][1].end={...b},j++;return Mn(t.events,S+1,0,t.events.slice(k)),t.events.length=j,u(v)}return a(v)}function u(v){if(r===n.length){if(!s)return h(v);if(s.currentConstruct&&s.currentConstruct.concrete)return m(v);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xy,c,d)(v)}function c(v){return s&&x(),g(r),h(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(Xy,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){s&&x(),g(0),e.consume(v);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(v)}function y(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return J(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),y)}function w(v,k){const S=t.sliceStream(v);if(k&&S.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(S),t.parser.lazy[v.start.line]){let b=s.events.length;for(;b--;)if(s.events[b][1].start.offset<o&&(!s.events[b][1].end||s.events[b][1].end.offset>o))return;const j=t.events.length;let P=j,T,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(T){E=t.events[P][1].end;break}T=!0}for(g(r),b=j;b<t.events.length;)t.events[b][1].end={...E},b++;Mn(t.events,P+1,0,t.events.slice(j)),t.events.length=b}}function g(v){let k=n.length;for(;k-- >v;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=v}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function X2(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jy(e){if(e===null||bt(e)||G2(e))return 1;if(H2(e))return 2}function im(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ph={name:"attention",resolveAll:J2,tokenize:Z2};function J2(e,t){let n=-1,r,s,i,o,a,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Zy(d,-l),Zy(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Gt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Gt(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),u=Gt(u,im(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Gt(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Gt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Mn(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Z2(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Jy(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const u=e.exit("attentionSequence"),c=Jy(l),d=!c||c===2&&s||n.includes(l),h=!s||s===2&&c||n.includes(r);return u._open=!!(i===42?d:d&&(s||!h)),u._close=!!(i===42?h:h&&(c||!d)),t(l)}}function Zy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const eR={name:"autolink",tokenize:tR};function tR(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Tn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||At(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||At(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||fh(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),c):V2(p)?(e.consume(p),u):n(p)}function c(p){return At(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||At(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const pu={partial:!0,tokenize:nR};function nR(e,t,n){return r;function r(i){return ae(i)?ve(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||J(i)?t(i):n(i)}}const Ab={continuation:{tokenize:sR},exit:iR,name:"blockQuote",tokenize:rR};function rR(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function sR(e,t,n){const r=this;return s;function s(o){return ae(o)?ve(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Ab,t,n)(o)}}function iR(e){e.exit("blockQuote")}const Mb={name:"characterEscape",tokenize:oR};function oR(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return W2(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Lb={name:"characterReference",tokenize:aR};function aR(e,t,n){const r=this;let s=0,i,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,o=At,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=U2,c):(e.enter("characterReferenceValue"),i=7,o=hh,c(d))}function c(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===At&&!sm(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<i?(e.consume(d),c):n(d)}}const ex={partial:!0,tokenize:cR},tx={concrete:!0,name:"codeFenced",tokenize:lR};function lR(e,t,n){const r=this,s={partial:!0,tokenize:S};let i=0,o=0,a;return l;function l(b){return u(b)}function u(b){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(b)}function c(b){return b===a?(o++,e.consume(b),c):o<3?n(b):(e.exit("codeFencedFenceSequence"),ae(b)?ve(e,d,"whitespace")(b):d(b))}function d(b){return b===null||J(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(ex,y,k)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===null||J(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(b)):ae(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),h)}function p(b){return b===null||J(b)?d(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||J(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(b)):b===96&&b===a?n(b):(e.consume(b),m)}function y(b){return e.attempt(s,k,w)(b)}function w(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g}function g(b){return i>0&&ae(b)?ve(e,x,"linePrefix",i+1)(b):x(b)}function x(b){return b===null||J(b)?e.check(ex,y,k)(b):(e.enter("codeFlowValue"),v(b))}function v(b){return b===null||J(b)?(e.exit("codeFlowValue"),x(b)):(e.consume(b),v)}function k(b){return e.exit("codeFenced"),t(b)}function S(b,j,P){let T=0;return E;function E(R){return b.enter("lineEnding"),b.consume(R),b.exit("lineEnding"),I}function I(R){return b.enter("codeFencedFence"),ae(R)?ve(b,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):M(R)}function M(R){return R===a?(b.enter("codeFencedFenceSequence"),O(R)):P(R)}function O(R){return R===a?(T++,b.consume(R),O):T>=o?(b.exit("codeFencedFenceSequence"),ae(R)?ve(b,A,"whitespace")(R):A(R)):P(R)}function A(R){return R===null||J(R)?(b.exit("codeFencedFence"),j(R)):P(R)}}}function cR(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const xd={name:"codeIndented",tokenize:dR},uR={partial:!0,tokenize:fR};function dR(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),ve(e,i,"linePrefix",5)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):J(u)?e.attempt(uR,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||J(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function fR(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ve(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):J(o)?s(o):n(o)}}const hR={name:"codeText",previous:mR,resolve:pR,tokenize:gR};function pR(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function mR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gR(e,t,n){let r=0,s,i;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),s=0,c(d)):J(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||J(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),u)}function c(d){return d===96?(e.consume(d),s++,c):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",u(d))}}class yR{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&ao(this.left,r),i.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),ao(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ao(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);ao(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ao(this.left,n.reverse())}}}function ao(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 Db(e){const t={};let n=-1,r,s,i,o,a,l,u;const c=new yR(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,xR(c,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=c.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(c.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...c.get(s)[1].start},a=c.slice(s,n),a.unshift(r),c.splice(s,n-s+1,a))}}return Mn(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function xR(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,d,h=-1,p=n,m=0,y=0;const w=[y];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(y=h+1,w.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=a.slice(w[h],w[h+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const vR={resolve:bR,tokenize:kR},wR={partial:!0,tokenize:_R};function bR(e){return Db(e),e}function kR(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):J(a)?e.check(wR,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function _R(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ve(e,i,"linePrefix")}function i(o){if(o===null||J(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Fb(e,t,n,r,s,i,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||fh(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),h(g)):g===null||g===60||J(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!c&&(g===null||g===41||bt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):c<u&&g===40?(e.consume(g),c++,y):g===41?(e.consume(g),c--,y):g===null||g===32||g===40||fh(g)?n(g):(e.consume(g),g===92?w:y)}function w(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function Ob(e,t,n,r,s,i){const o=this;let a=0,l;return u;function u(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),c}function c(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):J(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||J(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function zb(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===o?(e.exit(i),l(o)):h===null?n(h):J(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ve(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===o||h===null||J(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:c)}function d(h){return h===o||h===92?(e.consume(h),c):c(h)}}function Ao(e,t){let n;return r;function r(s){return J(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ae(s)?ve(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const SR={name:"definition",tokenize:PR},CR={partial:!0,tokenize:jR};function PR(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return Ob.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=gi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return bt(p)?Ao(e,u)(p):u(p)}function u(p){return Fb(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(CR,d,d)(p)}function d(p){return ae(p)?ve(e,h,"whitespace")(p):h(p)}function h(p){return p===null||J(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function jR(e,t,n){return r;function r(a){return bt(a)?Ao(e,s)(a):n(a)}function s(a){return zb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ae(a)?ve(e,o,"whitespace")(a):o(a)}function o(a){return a===null||J(a)?t(a):n(a)}}const ER={name:"hardBreakEscape",tokenize:TR};function TR(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return J(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const RR={name:"headingAtx",resolve:NR,tokenize:IR};function NR(e,t){let n=e.length-2,r=3,s,i;return 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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Mn(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function IR(e,t,n){let r=0;return s;function s(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||bt(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||J(c)?(e.exit("atxHeading"),t(c)):ae(c)?ve(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||bt(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const AR=["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"],nx=["pre","script","style","textarea"],MR={concrete:!0,name:"htmlFlow",resolveTo:FR,tokenize:OR},LR={partial:!0,tokenize:BR},DR={partial:!0,tokenize:zR};function FR(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 OR(e,t,n){const r=this;let s,i,o,a,l;return u;function u(N){return c(N)}function c(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,y):N===63?(e.consume(N),s=3,r.interrupt?t:C):Tn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),s=2,p):N===91?(e.consume(N),s=5,a=0,m):Tn(N)?(e.consume(N),s=4,r.interrupt?t:C):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:C):n(N)}function m(N){const le="CDATA[";return N===le.charCodeAt(a++)?(e.consume(N),a===le.length?r.interrupt?t:M:m):n(N)}function y(N){return Tn(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||bt(N)){const le=N===47,fe=o.toLowerCase();return!le&&!i&&nx.includes(fe)?(s=1,r.interrupt?t(N):M(N)):AR.includes(o.toLowerCase())?(s=6,le?(e.consume(N),g):r.interrupt?t(N):M(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?x(N):v(N))}return N===45||At(N)?(e.consume(N),o+=String.fromCharCode(N),w):n(N)}function g(N){return N===62?(e.consume(N),r.interrupt?t:M):n(N)}function x(N){return ae(N)?(e.consume(N),x):E(N)}function v(N){return N===47?(e.consume(N),E):N===58||N===95||Tn(N)?(e.consume(N),k):ae(N)?(e.consume(N),v):E(N)}function k(N){return N===45||N===46||N===58||N===95||At(N)?(e.consume(N),k):S(N)}function S(N){return N===61?(e.consume(N),b):ae(N)?(e.consume(N),S):v(N)}function b(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,j):ae(N)?(e.consume(N),b):P(N)}function j(N){return N===l?(e.consume(N),l=null,T):N===null||J(N)?n(N):(e.consume(N),j)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||bt(N)?S(N):(e.consume(N),P)}function T(N){return N===47||N===62||ae(N)?v(N):n(N)}function E(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||J(N)?M(N):ae(N)?(e.consume(N),I):n(N)}function M(N){return N===45&&s===2?(e.consume(N),z):N===60&&s===1?(e.consume(N),B):N===62&&s===4?(e.consume(N),V):N===63&&s===3?(e.consume(N),C):N===93&&s===5?(e.consume(N),$):J(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(LR,q,O)(N)):N===null||J(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),M)}function O(N){return e.check(DR,A,q)(N)}function A(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),R}function R(N){return N===null||J(N)?O(N):(e.enter("htmlFlowData"),M(N))}function z(N){return N===45?(e.consume(N),C):M(N)}function B(N){return N===47?(e.consume(N),o="",L):M(N)}function L(N){if(N===62){const le=o.toLowerCase();return nx.includes(le)?(e.consume(N),V):M(N)}return Tn(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),L):M(N)}function $(N){return N===93?(e.consume(N),C):M(N)}function C(N){return N===62?(e.consume(N),V):N===45&&s===2?(e.consume(N),C):M(N)}function V(N){return N===null||J(N)?(e.exit("htmlFlowData"),q(N)):(e.consume(N),V)}function q(N){return e.exit("htmlFlow"),t(N)}}function zR(e,t,n){const r=this;return s;function s(o){return J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function BR(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(pu,t,n)}}const $R={name:"htmlText",tokenize:VR};function VR(e,t,n){const r=this;let s,i,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),S):C===63?(e.consume(C),v):Tn(C)?(e.consume(C),P):n(C)}function u(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),i=0,m):Tn(C)?(e.consume(C),x):n(C)}function c(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):J(C)?(o=d,B(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?z(C):C===45?h(C):d(C)}function m(C){const V="CDATA[";return C===V.charCodeAt(i++)?(e.consume(C),i===V.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),w):J(C)?(o=y,B(C)):(e.consume(C),y)}function w(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?z(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?z(C):J(C)?(o=x,B(C)):(e.consume(C),x)}function v(C){return C===null?n(C):C===63?(e.consume(C),k):J(C)?(o=v,B(C)):(e.consume(C),v)}function k(C){return C===62?z(C):v(C)}function S(C){return Tn(C)?(e.consume(C),b):n(C)}function b(C){return C===45||At(C)?(e.consume(C),b):j(C)}function j(C){return J(C)?(o=j,B(C)):ae(C)?(e.consume(C),j):z(C)}function P(C){return C===45||At(C)?(e.consume(C),P):C===47||C===62||bt(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),z):C===58||C===95||Tn(C)?(e.consume(C),E):J(C)?(o=T,B(C)):ae(C)?(e.consume(C),T):z(C)}function E(C){return C===45||C===46||C===58||C===95||At(C)?(e.consume(C),E):I(C)}function I(C){return C===61?(e.consume(C),M):J(C)?(o=I,B(C)):ae(C)?(e.consume(C),I):T(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):J(C)?(o=M,B(C)):ae(C)?(e.consume(C),M):(e.consume(C),A)}function O(C){return C===s?(e.consume(C),s=void 0,R):C===null?n(C):J(C)?(o=O,B(C)):(e.consume(C),O)}function A(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bt(C)?T(C):(e.consume(C),A)}function R(C){return C===47||C===62||bt(C)?T(C):n(C)}function z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function B(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return ae(C)?ve(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):$(C)}function $(C){return e.enter("htmlTextData"),o(C)}}const om={name:"labelEnd",resolveAll:GR,resolveTo:KR,tokenize:qR},UR={tokenize:YR},WR={tokenize:QR},HR={tokenize:XR};function GR(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Mn(e,0,e.length,n),e}function KR(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const l={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[o][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Gt(a,e.slice(i+1,i+r+3)),a=Gt(a,[["enter",c,t]]),a=Gt(a,im(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Gt(a,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),a=Gt(a,e.slice(o+1)),a=Gt(a,[["exit",l,t]]),Mn(e,i,e.length,a),e}function qR(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?d(h):(o=r.parser.defined.includes(gi(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(UR,c,o?c:d)(h):h===91?e.attempt(WR,c,o?u:d)(h):o?c(h):d(h)}function u(h){return e.attempt(HR,c,d)(h)}function c(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function YR(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return bt(d)?Ao(e,i)(d):i(d)}function i(d){return d===41?c(d):Fb(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return bt(d)?Ao(e,l)(d):c(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?zb(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return bt(d)?Ao(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function QR(e,t,n){const r=this;return s;function s(a){return Ob.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(gi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function XR(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const JR={name:"labelStartImage",resolveAll:om.resolveAll,tokenize:ZR};function ZR(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const eN={name:"labelStartLink",resolveAll:om.resolveAll,tokenize:tN};function tN(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const vd={name:"lineEnding",tokenize:nN};function nN(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Ol={name:"thematicBreak",tokenize:rN};function rN(e,t,n){let r=0,s;return i;function i(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,a(u)}function a(u){return u===s?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||J(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ae(u)?ve(e,a,"whitespace")(u):a(u))}}const pt={continuation:{tokenize:aN},exit:cN,name:"list",tokenize:oN},sN={partial:!0,tokenize:uN},iN={partial:!0,tokenize:lN};function oN(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:hh(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Ol,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return hh(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(pu,r.interrupt?n:c,e.attempt(sN,h,d))}function c(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function aN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(pu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iN,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function lN(e,t,n){const r=this;return ve(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function cN(e){e.exit(this.containerState.type)}function uN(e,t,n){const r=this;return ve(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!ae(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const rx={name:"setextUnderline",resolveTo:dN,tokenize:fN};function dN(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function fN(e,t,n){const r=this;let s;return i;function i(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===s?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ae(u)?ve(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||J(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const hN={tokenize:pN};function pN(e){const t=this,n=e.attempt(pu,r,e.attempt(this.parser.constructs.flowInitial,s,ve(e,e.attempt(this.parser.constructs.flow,s,e.attempt(vR,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const mN={resolveAll:$b()},gN=Bb("string"),yN=Bb("text");function Bb(e){return{resolveAll:$b(e==="text"?xN:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(c){return u(c)?i(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const d=s[c];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function $b(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function xN(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,o=-1,a=0,l;for(;i--;){const u=s[i];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const vN={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Ab},wN={91:SR},bN={[-2]:xd,[-1]:xd,32:xd},kN={35:RR,42:Ol,45:[rx,Ol],60:MR,61:rx,95:Ol,96:tx,126:tx},_N={38:Lb,92:Mb},SN={[-5]:vd,[-4]:vd,[-3]:vd,33:JR,38:Lb,42:ph,60:[eR,$R],91:eN,92:[ER,Mb],93:om,95:ph,96:hR},CN={null:[ph,mN]},PN={null:[42,95]},jN={null:[]},EN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PN,contentInitial:wN,disable:jN,document:vN,flow:kN,flowInitial:bN,insideSpan:CN,string:_N,text:SN},Symbol.toStringTag,{value:"Module"}));function TN(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 s={},i=[];let o=[],a=[];const l={attempt:j(S),check:j(b),consume:x,enter:v,exit:k,interrupt:j(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(I){return o=Gt(o,I),w(),o[o.length-1]!==null?[]:(P(t,0),u.events=im(i,u.events,u),u.events)}function h(I,M){return NN(p(I),M)}function p(I){return RN(o,I)}function m(){const{_bufferIndex:I,_index:M,line:O,column:A,offset:R}=r;return{_bufferIndex:I,_index:M,line:O,column:A,offset:R}}function y(I){s[I.line]=I.column,E()}function w(){let I;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(I){c=c(I)}function x(I){J(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,E()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=I}function v(I,M){const O=M||{};return O.type=I,O.start=m(),u.events.push(["enter",O,u]),a.push(O),O}function k(I){const M=a.pop();return M.end=m(),u.events.push(["exit",M,u]),M}function S(I,M){P(I,M.from)}function b(I,M){M.restore()}function j(I,M){return O;function O(A,R,z){let B,L,$,C;return Array.isArray(A)?q(A):"tokenize"in A?q([A]):V(A);function V(ue){return Pt;function Pt(Ue){const Bt=Ue!==null&&ue[Ue],yn=Ue!==null&&ue.null,Fn=[...Array.isArray(Bt)?Bt:Bt?[Bt]:[],...Array.isArray(yn)?yn:yn?[yn]:[]];return q(Fn)(Ue)}}function q(ue){return B=ue,L=0,ue.length===0?z:N(ue[L])}function N(ue){return Pt;function Pt(Ue){return C=T(),$=ue,ue.partial||(u.currentConstruct=ue),ue.name&&u.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(M?Object.assign(Object.create(u),M):u,l,le,fe)(Ue)}}function le(ue){return I($,C),R}function fe(ue){return C.restore(),++L<B.length?N(B[L]):z}}}function P(I,M){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Mn(u.events,M,u.events.length-M,I.resolve(u.events.slice(M),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function T(){const I=m(),M=u.previous,O=u.currentConstruct,A=u.events.length,R=Array.from(a);return{from:A,restore:z};function z(){r=I,u.previous=M,u.currentConstruct=O,u.events.length=A,a=R,E()}}function E(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function RN(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function NN(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
59
- `;break}case-3:{o=`\r
60
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function IN(e){const r={constructs:z2([EN,...(e||{}).extensions||[]]),content:s(K2),defined:[],document:s(Y2),flow:s(hN),lazy:{},string:s(gN),text:s(yN)};return r;function s(i){return o;function o(a){return TN(r,i,a)}}}function AN(e){for(;!Db(e););return e}const sx=/[\0\t\n\r]/g;function MN(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let u,c,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(sx.lastIndex=d,u=sx.exec(i),h=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(h),!u){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),p){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const LN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DN(e){return e.replace(LN,FN)}function FN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Ib(n.slice(i?2:1),i?16:10)}return sm(n)||e}const Vb={}.hasOwnProperty;function ON(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),zN(n)(AN(IN(n).document().write(MN()(e,t,!0))))}function zN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ls),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(Na),blockQuote:i(yn),characterEscape:T,characterReference:T,codeFenced:i(Fn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(Fn,o),codeText:i(Ms,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(Ta),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ra),hardBreakEscape:i(Hi),hardBreakTrailing:i(Hi),htmlFlow:i(Gi,o),htmlFlowData:T,htmlText:i(Gi,o),htmlTextData:T,image:i(sr),label:o,link:i(Ls),listItem:i(Au),listItemValue:h,listOrdered:i(xn,d),listUnordered:i(xn),paragraph:i(Ia),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Na),strong:i(Mu),thematicBreak:i(de)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Bt,autolinkProtocol:Ue,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,characterReference:Pt,codeFenced:l(w),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:l(g),codeText:l(R),codeTextData:E,data:E,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l(O),htmlFlowData:E,htmlText:l(A),htmlTextData:E,image:l(B),label:$,labelText:L,lineEnding:I,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:C,resourceTitleString:V,resource:q,setextHeading:l(P),setextHeadingLineSequence:j,setextHeadingText:b,strong:l(),thematicBreak:l()}};Ub(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const Z={stack:[H],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:c,data:n},se=[];let he=-1;for(;++he<D.length;)if(D[he][1].type==="listOrdered"||D[he][1].type==="listUnordered")if(D[he][0]==="enter")se.push(he);else{const tn=se.pop();he=s(D,tn,he)}for(he=-1;++he<D.length;){const tn=t[D[he][0]];Vb.call(tn,D[he][1].type)&&tn[D[he][1].type].call(Object.assign({sliceSerialize:D[he][2].sliceSerialize},Z),D[he][1])}if(Z.tokenStack.length>0){const tn=Z.tokenStack[Z.tokenStack.length-1];(tn[1]||ix).call(Z,void 0,tn[0])}for(H.position={start:or(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:or(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)H=t.transforms[he](H)||H;return H}function s(D,H,Z){let se=H-1,he=-1,tn=!1,Zr,On,Ki,qi;for(;++se<=Z;){const jt=D[se];switch(jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{jt[0]==="enter"?he++:he--,qi=void 0;break}case"lineEndingBlank":{jt[0]==="enter"&&(Zr&&!qi&&!he&&!Ki&&(Ki=se),qi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qi=void 0}if(!he&&jt[0]==="enter"&&jt[1].type==="listItemPrefix"||he===-1&&jt[0]==="exit"&&(jt[1].type==="listUnordered"||jt[1].type==="listOrdered")){if(Zr){let Ds=se;for(On=void 0;Ds--;){const zn=D[Ds];if(zn[1].type==="lineEnding"||zn[1].type==="lineEndingBlank"){if(zn[0]==="exit")continue;On&&(D[On][1].type="lineEndingBlank",tn=!0),zn[1].type="lineEnding",On=Ds}else if(!(zn[1].type==="linePrefix"||zn[1].type==="blockQuotePrefix"||zn[1].type==="blockQuotePrefixWhitespace"||zn[1].type==="blockQuoteMarker"||zn[1].type==="listItemIndent"))break}Ki&&(!On||Ki<On)&&(Zr._spread=!0),Zr.end=Object.assign({},On?D[On][1].start:jt[1].end),D.splice(On||se,0,["exit",Zr,jt[2]]),se++,Z++}if(jt[1].type==="listItemPrefix"){const Ds={type:"listItem",_spread:!1,start:Object.assign({},jt[1].start),end:void 0};Zr=Ds,D.splice(se,0,["enter",Ds,jt[2]]),se++,Z++,Ki=void 0,qi=!0}}}return D[H][1]._spread=tn,Z}function i(D,H){return Z;function Z(se){a.call(this,D(se),se),H&&H.call(this,se)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(D,H,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,Z||void 0]),D.position={start:or(H.start),end:void 0}}function l(D){return H;function H(Z){D&&D.call(this,Z),u.call(this,Z)}}function u(D,H){const Z=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(H?H.call(this,D,se[0]):(se[1]||ix).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+Io({start:D.start,end:D.end})+"): it’s not open");Z.position.end=or(D.end)}function c(){return F2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),H=this.stack[this.stack.length-1];H.lang=D}function m(){const D=this.resume(),H=this.stack[this.stack.length-1];H.meta=D}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=gi(this.sliceSerialize(D)).toLowerCase()}function v(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function k(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function S(D){const H=this.stack[this.stack.length-1];if(!H.depth){const Z=this.sliceSerialize(D).length;H.depth=Z}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function j(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function T(D){const Z=this.stack[this.stack.length-1].children;let se=Z[Z.length-1];(!se||se.type!=="text")&&(se=Aa(),se.position={start:or(D.start),end:void 0},Z.push(se)),this.stack.push(se)}function E(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=or(D.end)}function I(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=H.children[H.children.length-1];Z.position.end=or(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(T.call(this,D),E.call(this,D))}function M(){this.data.atHardBreak=!0}function O(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function A(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function R(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function z(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function B(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function L(D){const H=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=DN(H),Z.identifier=gi(H).toLowerCase()}function $(){const D=this.stack[this.stack.length-1],H=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const se=D.children;Z.children=se}else Z.alt=H}function C(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function V(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function le(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=gi(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function fe(D){this.data.characterReferenceType=D.type}function ue(D){const H=this.sliceSerialize(D),Z=this.data.characterReferenceType;let se;Z?(se=Ib(H,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=sm(H);const he=this.stack[this.stack.length-1];he.value+=se}function Pt(D){const H=this.stack.pop();H.position.end=or(D.end)}function Ue(D){E.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function Bt(D){E.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function yn(){return{type:"blockquote",children:[]}}function Fn(){return{type:"code",lang:null,meta:null,value:""}}function Ms(){return{type:"inlineCode",value:""}}function Ta(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ra(){return{type:"emphasis",children:[]}}function Na(){return{type:"heading",depth:0,children:[]}}function Hi(){return{type:"break"}}function Gi(){return{type:"html",value:""}}function sr(){return{type:"image",title:null,url:"",alt:null}}function Ls(){return{type:"link",title:null,url:"",children:[]}}function xn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Au(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Ia(){return{type:"paragraph",children:[]}}function Mu(){return{type:"strong",children:[]}}function Aa(){return{type:"text",value:""}}function de(){return{type:"thematicBreak"}}}function or(e){return{line:e.line,column:e.column,offset:e.offset}}function Ub(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ub(e,r):BN(e,r)}}function BN(e,t){let n;for(n in t)if(Vb.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"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ix(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Io({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Io({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Io({start:t.start,end:t.end})+") is still open")}function $N(e){const t=this;t.parser=n;function n(r){return ON(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VN(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 UN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
61
- `}]}function WN(e,t){const n=t.value?t.value+`
62
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function HN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KN(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Oi(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function qN(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 YN(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wb(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function QN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wb(e,t);const s={src:Oi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function XN(e,t){const n={src:Oi(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 JN(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 ZN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wb(e,t);const s={href:Oi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function eI(e,t){const n={href:Oi(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 tI(e,t,n){const r=e.all(t),s=n?nI(n):Hb(t),i={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(s||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
63
- `}),c.type==="element"&&c.tagName==="p"&&!s?o.push(...c.children):o.push(c)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
64
- `});const u={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,u),e.applyData(t,u)}function nI(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=Hb(n[r])}return t}function Hb(e){const t=e.spread;return t??e.children.length>1}function rI(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function sI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aI(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=em(t.children[1]),l=Cb(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function lI(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const d=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function cI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ox=9,ax=32;function uI(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(lx(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(lx(t.slice(s),s>0,!1)),i.join("")}function lx(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===ox||i===ax;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===ox||i===ax;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function dI(e,t){const n={type:"text",value:uI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const hI={blockquote:VN,break:UN,code:WN,delete:HN,emphasis:GN,footnoteReference:KN,heading:qN,html:YN,imageReference:QN,image:XN,inlineCode:JN,linkReference:ZN,link:eI,listItem:tI,list:rI,paragraph:sI,root:iI,strong:oI,table:aI,tableCell:cI,tableRow:lI,text:dI,thematicBreak:fI,toml:tl,yaml:tl,definition:tl,footnoteDefinition:tl};function tl(){}const Gb=-1,mu=0,Mo=1,jc=2,am=3,lm=4,cm=5,um=6,Kb=7,qb=8,pI=typeof self=="object"?self:globalThis,cx=(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 pI[e](t)},mI=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case mu:case Gb:return n(o,s);case Mo:{const a=n([],s);for(const l of o)a.push(r(l));return a}case jc:{const a=n({},s);for(const[l,u]of o)a[r(l)]=r(u);return a}case am:return n(new Date(o),s);case lm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case cm:{const a=n(new Map,s);for(const[l,u]of o)a.set(r(l),r(u));return a}case um:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case Kb:{const{name:a,message:l}=o;return n(cx(a,l),s)}case qb:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(cx(i,o),s)};return r},ux=e=>mI(new Map,e)(0),zs="",{toString:gI}={},{keys:yI}=Object,lo=e=>{const t=typeof e;if(t!=="object"||!e)return[mu,t];const n=gI.call(e).slice(8,-1);switch(n){case"Array":return[Mo,zs];case"Object":return[jc,zs];case"Date":return[am,zs];case"RegExp":return[lm,zs];case"Map":return[cm,zs];case"Set":return[um,zs];case"DataView":return[Mo,n]}return n.includes("Array")?[Mo,n]:n.includes("Error")?[Kb,n]:[jc,n]},nl=([e,t])=>e===mu&&(t==="function"||t==="symbol"),xI=(e,t,n,r)=>{const s=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},i=o=>{if(n.has(o))return n.get(o);let[a,l]=lo(o);switch(a){case mu:{let c=o;switch(l){case"bigint":a=qb,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return s([Gb],o)}return s([a,c],o)}case Mo:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),s([l,[...h]],o)}const c=[],d=s([a,c],o);for(const h of o)c.push(i(h));return d}case jc:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const c=[],d=s([a,c],o);for(const h of yI(o))(e||!nl(lo(o[h])))&&c.push([i(h),i(o[h])]);return d}case am:return s([a,o.toISOString()],o);case lm:{const{source:c,flags:d}=o;return s([a,{source:c,flags:d}],o)}case cm:{const c=[],d=s([a,c],o);for(const[h,p]of o)(e||!(nl(lo(h))||nl(lo(p))))&&c.push([i(h),i(p)]);return d}case um:{const c=[],d=s([a,c],o);for(const h of o)(e||!nl(lo(h)))&&c.push(i(h));return d}}const{message:u}=o;return s([a,{name:l,message:u}],o)};return i},dx=(e,{json:t,lossy:n}={})=>{const r=[];return xI(!(t||n),!!t,new Map,r)(e),r},Ec=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ux(dx(e,t)):structuredClone(e):(e,t)=>ux(dx(e,t));function vI(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 wI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||vI,r=e.options.footnoteBackLabel||wI,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),d=String(u.identifier).toUpperCase(),h=Oi(d.toLowerCase());let p=0;const m=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const w=c[c.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 c.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Ec(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
65
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
66
- `}]}}const Yb=function(e){if(e==null)return CI;if(typeof e=="function")return gu(e);if(typeof e=="object")return Array.isArray(e)?kI(e):_I(e);if(typeof e=="string")return SI(e);throw new Error("Expected function, string, or object as test")};function kI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Yb(e[n]);return gu(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function _I(e){const t=e;return gu(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function SI(e){return gu(t);function t(n){return n&&n.type===e}}function gu(e){return t;function t(n,r,s){return!!(PI(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function CI(){return!0}function PI(e){return e!==null&&typeof e=="object"&&"type"in e}const Qb=[],jI=!0,fx=!1,EI="skip";function TI(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=Yb(s),o=r?-1:1;a(e,void 0,[])();function a(l,u,c){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Qb,m,y,w;if((!t||i(l,u,c[c.length-1]||void 0))&&(p=RI(n(l,c)),p[0]===fx))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==EI)for(y=(r?g.children.length:-1)+o,w=c.concat(g);y>-1&&y<g.children.length;){const x=g.children[y];if(m=a(x,y,w)(),m[0]===fx)return m;y=typeof m[1]=="number"?m[1]:y+o}}return p}}}function RI(e){return Array.isArray(e)?e:typeof e=="number"?[jI,e]:e==null?Qb:[e]}function Xb(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),TI(e,i,a,s);function a(l,u){const c=u[u.length-1],d=c?c.children.indexOf(l):void 0;return o(l,d,c)}}const mh={}.hasOwnProperty,NI={};function II(e,t){const n=t||NI,r=new Map,s=new Map,i=new Map,o={...hI,...n.handlers},a={all:u,applyData:MI,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:AI,wrap:DI};return Xb(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const d=c.type==="definition"?r:s,h=String(c.identifier).toUpperCase();d.has(h)||d.set(h,c)}}),a;function l(c,d){const h=c.type,p=a.handlers[h];if(mh.call(a.handlers,h)&&p)return p(a,c,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in c){const{children:y,...w}=c,g=Ec(w);return g.children=a.all(c),g}return Ec(c)}return(a.options.unknownHandler||LI)(a,c,d)}function u(c){const d=[];if("children"in c){const h=c.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],c);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=hx(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=hx(y.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function AI(e,t){e.position&&(t.position=m2(e))}function MI(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,Ec(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function LI(e,t){const n=t.data||{},r="value"in t&&!(mh.call(n,"hProperties")||mh.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 DI(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
67
- `});++r<e.length;)r&&n.push({type:"text",value:`
68
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
69
- `}),n}function hx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function px(e,t){const n=II(e,t),r=n.one(e,void 0),s=bI(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
70
- `},s),i}function FI(e,t){return e&&"run"in e?async function(n,r){const s=px(n,{file:r,...t});await e.run(s,r)}:function(n,r){return px(n,{file:r,...e||t})}}function mx(e){if(e)throw e}var zl=Object.prototype.hasOwnProperty,Jb=Object.prototype.toString,gx=Object.defineProperty,yx=Object.getOwnPropertyDescriptor,xx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Jb.call(t)==="[object Array]"},vx=function(t){if(!t||Jb.call(t)!=="[object Object]")return!1;var n=zl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&zl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||zl.call(t,s)},wx=function(t,n){gx&&n.name==="__proto__"?gx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},bx=function(t,n){if(n==="__proto__")if(zl.call(t,n)){if(yx)return yx(t,n).value}else return;return t[n]},OI=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=bx(a,n),s=bx(t,n),a!==s&&(c&&s&&(vx(s)||(i=xx(s)))?(i?(i=!1,o=r&&xx(r)?r:[]):o=r&&vx(r)?r:{},wx(a,{name:n,newValue:e(c,o,s)})):typeof s<"u"&&wx(a,{name:n,newValue:s}));return a};const wd=Gc(OI);function gh(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 zI(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...u){const c=e[++i];let d=-1;if(l){o(l);return}for(;++d<s.length;)(u[d]===null||u[d]===void 0)&&(u[d]=s[d]);s=u,c?BI(c,a)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function BI(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return s(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Sn={basename:$I,dirname:VI,extname:UI,join:WI,sep:"/"};function $I(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xa(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function VI(e){if(xa(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 UI(e){xa(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function WI(...e){let t=-1,n;for(;++t<e.length;)xa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":HI(n)}function HI(e){xa(e);const t=e.codePointAt(0)===47;let n=GI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GI(e,t){let n="",r=0,s=-1,i=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function xa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const KI={cwd:qI};function qI(){return"/"}function yh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YI(e){if(typeof e=="string")e=new URL(e);else if(!yh(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 QI(e)}function QI(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const bd=["history","path","basename","stem","extname","dirname"];class Zb{constructor(t){let n;t?yh(t)?n={path:t}:typeof t=="string"||XI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":KI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bd.length;){const i=bd[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)bd.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Sn.basename(this.path):void 0}set basename(t){_d(t,"basename"),kd(t,"basename"),this.path=Sn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sn.dirname(this.path):void 0}set dirname(t){kx(this.basename,"dirname"),this.path=Sn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sn.extname(this.path):void 0}set extname(t){if(kd(t,"extname"),kx(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=Sn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){yh(t)&&(t=YI(t)),_d(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sn.basename(this.path,this.extname):void 0}set stem(t){_d(t,"stem"),kd(t,"stem"),this.path=Sn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new it(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function kd(e,t){if(e&&e.includes(Sn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sn.sep+"`")}function _d(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function XI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JI=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},ZI={}.hasOwnProperty;class dm extends JI{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=zI()}copy(){const t=new dm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(wd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pd("data",this.frozen),this.namespace[t]=n,this):ZI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pd("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=rl(t),r=this.parser||this.Parser;return Sd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sd("process",this.parser||this.Parser),Cd("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=rl(t),l=r.parse(a);r.run(l,a,function(c,d,h){if(c||!d||!h)return u(c);const p=d,m=r.stringify(p,h);nA(m)?h.value=m:h.result=m,u(c,h)});function u(c,d){c||!d?o(c):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Sd("processSync",this.parser||this.Parser),Cd("processSync",this.compiler||this.Compiler),this.process(t,s),Sx("processSync","process",n),r;function s(i,o){n=!0,mx(i),r=o}}run(t,n,r){_x(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const l=rl(n);s.run(t,l,u);function u(c,d,h){const p=d||t;c?a(c):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),Sx("runSync","run",r),s;function i(o,a){mx(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=rl(n),s=this.compiler||this.Compiler;return Cd("stringify",s),_x(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Pd("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...d]=u;l(c,d)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))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");a(u.plugins),u.settings&&(s.settings=wd(!0,s.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const d=u[c];i(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===u){h=d;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[p,...m]=c;const y=r[h][1];gh(y)&&gh(p)&&(p=wd(!0,y,p)),r[h]=[u,p,...m]}}}}const eA=new dm().freeze();function Sd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pd(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 _x(e){if(!gh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rl(e){return tA(e)?e:new Zb(e)}function tA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nA(e){return typeof e=="string"||rA(e)}function rA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cx=[],Px={allowDangerousHtml:!0},iA=/^(https?|ircs?|mailto|xmpp)$/i,oA=[{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:"className",id:"remove-classname"},{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 aA(e){const t=lA(e),n=cA(e);return uA(t.runSync(t.parse(n),n),e)}function lA(e){const t=e.rehypePlugins||Cx,n=e.remarkPlugins||Cx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Px}:Px;return eA().use($N).use(n).use(FI,r).use(t)}function cA(e){const t=e.children||"",n=new Zb;return typeof t=="string"&&(n.value=t),n}function uA(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||dA;for(const c of oA)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+sA+c.id,void 0);return Xb(e,u),w2(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,d,h){if(c.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:c.value},d;if(c.type==="element"){let p;for(p in yd)if(Object.hasOwn(yd,p)&&Object.hasOwn(c.properties,p)){const m=c.properties[p],y=yd[p];(y===null||y.includes(c.tagName))&&(c.properties[p]=l(String(m||""),p,c))}}if(c.type==="element"){let p=n?!n.includes(c.tagName):i?i.includes(c.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(c,d,h)),p&&h&&typeof d=="number")return a&&c.children?h.children.splice(d,1,...c.children):h.children.splice(d,1),d}}}function dA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||iA.test(e.slice(0,t))?e:""}const jd=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,fA={p:({children:e})=>f.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>f.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>f.jsx("h1",{className:jd("text-lg"),children:e}),h2:({children:e})=>f.jsx("h2",{className:jd("text-[1.3rem]"),children:e}),h3:({children:e})=>f.jsx("h3",{className:jd("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>f.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>f.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>f.jsx("pre",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-md py-3 px-4 overflow-x-auto mb-4",children:e}),ul:({children:e})=>f.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>f.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>f.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>f.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},ek=({children:e})=>f.jsx(aA,{components:fA,children:e}),hA={},jx=e=>{let t;const n=new Set,r=(c,d)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const p=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(hA?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,l);return l},pA=e=>e?jx(e):jx,tk={},{useDebugValue:mA}=xi,{useSyncExternalStoreWithSelector:gA}=GE;let Ex=!1;const yA=e=>e;function xA(e,t=yA,n){(tk?"production":void 0)!=="production"&&n&&!Ex&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ex=!0);const r=gA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return mA(r),r}const vA=e=>{(tk?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?pA(e):e,n=(r,s)=>xA(t,r,s);return Object.assign(n,t),n},wA=e=>vA,nk=async()=>{const e=await fetch("/api/capabilities");return e.ok?(await e.json()).capabilities:null},bA=async()=>{const e=await fetch("/api/agent/auth-status");return e.ok?await e.json():null},$W=async()=>{try{const e=await fetch("/api/connections");return e.ok?(await e.json()).connections:null}catch{return null}},VW=async e=>{try{const t=await fetch(`/api/connections/connect?id=${encodeURIComponent(e)}`,{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},rk=async()=>{try{const e=await fetch("/api/config");return e.ok?e.json():null}catch{return null}},UW=async e=>{try{const t=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},kA=async()=>{try{const e=await fetch("/api/icon");if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},WW=async e=>{try{return(await fetch("/api/icon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},_A=async()=>{try{const e=await fetch("/api/package-name");return e.ok?e.json():null}catch{return null}},Dn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},SA=async()=>(await fetch("/api/agent/status")).json(),CA=async()=>(await fetch("/api/agent/reconcile-queue")).json(),PA=async(e,t)=>{const n=await fetch("/api/agent/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await Dn(n)},jA=async(e,t)=>{const n=await fetch("/api/agent/launch-audit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Dn(n)},EA=async(e,t)=>{const n=await fetch("/api/agent/launch-reconcile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Dn(n)},TA=async(e,t)=>{const n=await fetch("/api/agent/launch-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Dn(n)},RA=async(e,t)=>{const n=await fetch("/api/agent/launch-extend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Dn(n)},NA=async e=>{const t=await fetch("/api/agent/launch-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await Dn(t)},IA=async()=>{const e=await fetch("/api/agent/launch-reconcile-all",{method:"POST"});await Dn(e)},AA=async e=>{const t=await fetch("/api/agent/launch-run-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Dn(t)},MA=async e=>{const t=await fetch("/api/agent/launch-fix-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Dn(t)},LA=async(e,t)=>{const n=await fetch("/api/agent/feedback-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to send message");return r},DA=async(e,t)=>{const n=await fetch("/api/agent/feedback-undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,commitSha:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to undo edit");return r},FA=async e=>{const t=await fetch("/api/agent/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await Dn(t,"Stop failed")},OA=async()=>(await fetch("/api/agent/login-relay/start",{method:"POST"})).json(),zA=async()=>(await fetch("/api/agent/login-relay/status")).json(),BA=async()=>{await fetch("/api/agent/login-relay/cancel",{method:"POST"})};function In(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function ar(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let $A=0;const Tx=()=>`preview-${++$A}`;function VA(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:In(e,bA,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await SA();e({agentStatus:n});const r=t().pendingReconcile,s=r?n.find(o=>o.taskKind==="reconcile"&&o.planId===r.planId):void 0;r&&s&&(s.status==="done"?(await t().loadPlans(),e(o=>({reconcileQueue:[...o.reconcileQueue,{...r,previewId:Tx()}],pendingReconcile:null}))):s.status==="error"&&e({pendingReconcile:null}));const i=n.find(o=>o.taskKind==="batch-reconcile");if((i==null?void 0:i.status)==="done"&&!t().batchReconcileConsumed){const o=await CA();o&&o.length>0&&(await t().loadPlans(),e(a=>({reconcileQueue:[...a.reconcileQueue,...o.map(l=>({planId:l.planId,before:l.before,previewId:Tx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:ar(t,PA),launchPlanAudit:ar(t,jA),launchPlanReconcile:async(n,r,s)=>{const i=t().pendingReconcile;if(i)throw new Error(i.planId===n?"A reconcile is already in progress for this plan":"A reconcile is already in progress for another plan");if(t().reconcileQueue.some(o=>o.planId===n))throw new Error("Review the pending reconcile for this plan first");e({pendingReconcile:{planId:n,before:s}});try{await EA(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:ar(t,TA),launchIdeaExtend:ar(t,RA),launchBatchReconcile:ar(t,async()=>{e({batchReconcileConsumed:!1}),await IA()}),launchSuggestIdeas:ar(t,NA),launchRunAll:ar(t,AA),launchFixReview:ar(t,MA),stopAgent:async n=>{try{await FA(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await OA();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:In(e,zA,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await BA()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const UA=async()=>(await fetch("/api/tasks")).json(),HW=async e=>{const t=await fetch(`/api/tasks/output?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},WA=async()=>(await fetch("/api/suggestions")).json(),HA=async e=>{const t=await fetch("/api/suggestions/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},GA=async e=>{const t=await fetch("/api/suggestions/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},KA=async()=>(await fetch("/api/docs")).json(),qA=async()=>{const e=await fetch("/api/roadmap");if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},YA=async(e,t,n,r)=>{const s=await fetch("/api/roadmap/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(i.error)}return s.json()},GW=async(e,t,n)=>{const r=await fetch("/api/roadmap/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},KW=async(e,t,n)=>{const r=await fetch("/api/roadmap/candidates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},QA=async()=>(await fetch("/api/consistency")).json(),sk=async()=>(await fetch("/api/ideas")).json(),XA=async()=>(await fetch("/api/archivable-ideas")).json(),JA=async e=>{const t=await fetch("/api/ideas/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},ZA=async e=>{const t=await fetch("/api/ideas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create idea");return n.id},ik=async(e,t)=>{const n=await fetch("/api/ideas/check-overlap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},eM=async()=>{const e=await fetch("/api/ideas/prioritise",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},ok=async()=>(await fetch("/api/plans")).json(),tM=async e=>{await fetch("/api/plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},nM=async(e,t)=>{const n=await fetch(`/api/plans?title=${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}};function rM(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await KA();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const s=["MAIN.md","README.md"].find(i=>n.files.some(o=>o.name===i));s&&e({activeDocTitle:s})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n})}}function sM(e,t){return{ideaEntries:[],loadIdeas:In(e,sk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:In(e,XA,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await JA(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}const Tc=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/864e5);return n<=0?"today":n===1?"yesterday":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`},ak=e=>{if(e.length===0)return null;const t=e.filter(n=>n.done).length;return{done:t,total:e.length,pct:Math.round(t/e.length*100)}},lk=e=>ak(e.phases),Rx=e=>{var t;return((t=lk(e))==null?void 0:t.pct)??null},iM=e=>ak([...e.phases,...e.fixes??[]]),fm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,hm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:fm(e.id,t)?"in-progress":e.status,oM=(e,t)=>{if(e)return e.find(n=>n.status==="in-progress"||n.status==="review")};function Ed(e,t){const n=e.split(/(\s+)/).filter(c=>c!==""),r=t.split(/(\s+)/).filter(c=>c!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let c=s-1;c>=0;c--)for(let d=i-1;d>=0;d--)o[c][d]=n[c]===r[d]?o[c+1][d+1]+1:Math.max(o[c+1][d],o[c][d+1]);const a=[];let l=0,u=0;for(;l<s&&u<i;)n[l]===r[u]?(a.push({type:"same",text:n[l]}),l++,u++):o[l+1][u]>=o[l][u+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[u]}),u++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;u<i;)a.push({type:"added",text:r[u]}),u++;return aM(a)}function aM(e){const t=[];for(const n of e){const r=t[t.length-1];r&&r.type===n.type?r.text+=n.text:t.push({...n})}return t}const lM=["idea","planned","in-progress","review","done","dropped"],cM=["feat","fix","chore","docs","refactor"],uM=["claude-code","opencode"],ck={"claude-code":"Claude Code",opencode:"OpenCode"},qW={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},YW={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"}},dM=["in-progress","review","planned","idea"],fM=["open"],pm={statuses:dM,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:fM,subject:null},Nx={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},sl=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},Ix=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Ax=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Td=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Mx=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Lo=(e,t)=>t===null||e===t,mm=(e,t,n,r="asc")=>{if(n==="order")return e.order!==void 0&&t.order!==void 0?(r==="desc"?-1:1)*(e.order-t.order):e.order!==void 0?-1:t.order!==void 0?1:Ix(e)-Ix(t);const s=(()=>{switch(n){case"status":{const i=Nx[e.status]-Nx[t.status];return i!==0?i:sl(t)-sl(e)}case"updated":return sl(t)-sl(e);case"title":return e.title.localeCompare(t.title);case"id":return Ax(e)-Ax(t);case"progress":return(Rx(t)??-1)-(Rx(e)??-1);default:return 0}})();return r==="desc"?-s:s},xh=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},Bl=(e,t=pm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=xh(e.filter(a=>Mx(a,n)&&Td(a,t.search)&&Lo(a.subject,t.subject)),a=>[a.status]);for(const a of lM)s[a]??(s[a]=0);const i=xh(e.filter(a=>r.has(a.status)&&Td(a,t.search)&&Lo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Mx(a,n)&&Td(a,t.search)&&Lo(a.subject,t.subject)).sort((a,l)=>mm(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},hM=["open","done","dropped"],pM={open:"idea",done:"done",dropped:"dropped"},Rd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},mM=e=>e.type==="plan"?e.plan.subject:e.idea.subject,gM=(e,t)=>{var a;const n=[],r=new Map,s=[];for(const l of e){const u=mM(l);if(!u||t&&!t.includes(u)){s.push(l);continue}r.has(u)||(n.push(u),r.set(u,[])),(a=r.get(u))==null||a.push(l)}const o=(t?t.filter(l=>r.has(l)):n).map(l=>({subject:l,rows:r.get(l)??[]}));return s.length>0&&o.push({subject:null,rows:s}),o},Lx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:pM[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order}:{...(e.children.length>0?[...e.children].sort((n,r)=>mm(n,r,"status"))[0]:void 0)??{status:"idea",created:e.idea.created??"",tags:[],body:e.idea.body,phases:[]},title:e.idea.title,id:e.idea.id??void 0,order:e.idea.order},yM=(e,t,n=pm)=>{const{statusCounts:r,tagCounts:s}=Bl(e,n),i=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,u=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else u.push(p);const c=new Set(n.noteStatuses),d=xh(i.filter(p=>Rd(p,n.search)),p=>[p.status??"open"]);for(const p of hM)d[p]??(d[p]=0);const h=Bl(u,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],y=Bl(m,n).rows;!Lo(p.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Rd(p,n.search))||h.push({type:"idea-group",idea:p,children:y})}for(const p of i)c.has(p.status??"open")&&Rd(p,n.search)&&Lo(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>mm(Lx(p),Lx(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:r,tagCounts:s,noteStatusCounts:d}},xM=.2,vM=5,uk=3,dk=2,fk=1,wM=uk+dk+fk,bM=new Set(["a","an","the","and","or","of","to","in","on","for","is","at","with","this","that","it","as","be","by","are","was","were","from","into","so","but","not","its"]),il=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!bM.has(n));return new Set(t)},Nd=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function kM(e,t,n={}){const{threshold:r=xM,limit:s=vM}=n,i=il(e);if(i.size===0)return[];const o=[];for(const a of t){const l=il(a.title),u=il(a.body),c=il((a.tags??[]).join(" ")),h=(Nd(i,l)*uk+Nd(i,c)*dk+Nd(i,u)*fk)/(i.size*wM);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const _M=e=>{if(!e.file)return;const t=e.line_start??e.line;if(!t)return e.file;const n=e.line_end&&e.line_end!==t?`-${e.line_end}`:"";return`${e.file}:${t}${n}`},SM=(e,t)=>{const n=e.description??e.title??e.summary;if(!(n!=null&&n.trim()))throw new Error(`Finding ${t+1} has no description/title/summary`);const r=[_M(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},CM=e=>{let t;try{t=JSON.parse(e)}catch{throw new Error("Not valid JSON")}const n=Array.isArray(t)?t:Array.isArray(t==null?void 0:t.findings)?t.findings:null;if(!n)throw new Error('Expected a JSON array of findings, or an object with a "findings" array');if(n.length===0)throw new Error("No findings to add");return n.map((r,s)=>SM(r,s))};function PM(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:In(e,ok,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:pm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}async function Yr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const jM=async()=>{const e=await fetch("/api/git/status");return await Yr(e,"Failed to load git status"),e.json()},QW=async()=>{const e=await fetch("/api/git/diff");return await Yr(e,"Failed to load diff"),(await e.json()).files},hk=async(e,t,n)=>{const r=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Yr(r,"Commit failed")},EM=async()=>{const e=await fetch("/api/git/push",{method:"POST"});await Yr(e,"Push failed")},pk=async e=>{const t=await fetch("/api/git/suggest-commit-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Yr(t,"Failed to suggest a commit message"),t.json()},TM=async()=>{const e=await fetch("/api/git/sync",{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Yr(e,"Sync failed"),{ok:!0}},RM=async()=>{const e=await fetch("/api/git/pull",{method:"POST"});await Yr(e,"Pull failed")},NM=async()=>{const e=await fetch("/api/git/fix-divergence",{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Yr(e,"Fix failed"),{ok:!0}},IM=async e=>{const t=await fetch("/api/git/resolve-conflict",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});try{return await t.json()}catch{return{ok:!1,error:`Unexpected response (status ${t.status})`}}},AM=async e=>{const t=await fetch("/api/git/branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch},MM=async()=>(await fetch("/api/status")).json(),LM=async e=>{await fetch(`/api/status/check?name=${e}`,{method:"POST"})},DM=async()=>{await fetch("/api/status/fix",{method:"POST"})},FM=async()=>{const e=await fetch("/api/refresh",{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function OM(e,t){return{status:null,refreshing:!1,loadStatus:In(e,MM,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await FM().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runCheck:async n=>{try{await LM(n)}catch{}},fixQuality:async()=>{try{await DM()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:s}=t();if(s)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const i=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await pk(i);return await hk(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:In(e,QA,n=>({consistency:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await jM();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:In(e,nk,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function zM(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:In(e,WA,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await HA(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await GA(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await YA(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await eM();return await t().refreshAll(),n}}}function BM(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:In(e,UA,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const F=wA()((e,t)=>({...PM(e),...sM(e,t),...zM(e,t),...BM(e),...rM(e,t),...OM(e,t),...VA(e,t)})),gm=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Qr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),$M=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},VM=e=>e.capabilities.filter(t=>t.status!=="ok").length,UM=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1};function WM(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function mk(e){var t,n,r,s;return{qualityStatus:WM([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function gk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=gk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function HM(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=gk(e))&&(r&&(r+=" "),r+=t);return r}const ym="-",GM=e=>{const t=qM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ym);return a[0]===""&&a.length!==1&&a.shift(),yk(a,t)||KM(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},yk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?yk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(ym);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Dx=/^\[(.+)\]$/,KM=e=>{if(Dx.test(e)){const t=Dx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return QM(Object.entries(e.classGroups),n).forEach(([i,o])=>{vh(o,r,i,t)}),r},vh=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Fx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(YM(s)){vh(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{vh(o,Fx(t,i),n,r)})})},Fx=(e,t)=>{let n=e;return t.split(ym).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},YM=e=>e.isThemeGetter,QM=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,XM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},xk="!",JM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let u=0,c=0,d;for(let w=0;w<a.length;w++){let g=a[w];if(u===0){if(g===s&&(r||a.slice(w,w+i)===t)){l.push(a.slice(c,w)),c=w+i;continue}if(g==="/"){d=w;continue}}g==="["?u++:g==="]"&&u--}const h=l.length===0?a:a.substring(c),p=h.startsWith(xk),m=p?h.substring(1):h,y=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},ZM=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},eL=e=>({cache:XM(e.cacheSize),parseClassName:JM(e),...GM(e)}),tL=/\s+/,nL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(tL);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){a=u+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=u+(a.length>0?" "+a:a);continue}m=!1}const w=ZM(c).join(":"),g=d?w+xk:w,x=g+y;if(i.includes(x))continue;i.push(x);const v=s(y,m);for(let k=0;k<v.length;++k){const S=v[k];i.push(g+S)}a=u+(a.length>0?" "+a:a)}return a};function rL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vk(t))&&(r&&(r+=" "),r+=n);return r}const vk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vk(e[r]))&&(n&&(n+=" "),n+=t);return n};function sL(e,...t){let n,r,s,i=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=eL(u),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=nL(l,n);return s(l,c),c}return function(){return i(rL.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wk=/^\[(?:([a-z-]+):)?(.+)\]$/i,iL=/^\d+\/\d+$/,oL=new Set(["px","full","screen"]),aL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bn=e=>yi(e)||oL.has(e)||iL.test(e),lr=e=>zi(e,"length",vL),yi=e=>!!e&&!Number.isNaN(Number(e)),Id=e=>zi(e,"number",yi),co=e=>!!e&&Number.isInteger(Number(e)),fL=e=>e.endsWith("%")&&yi(e.slice(0,-1)),te=e=>wk.test(e),cr=e=>aL.test(e),hL=new Set(["length","size","percentage"]),pL=e=>zi(e,hL,bk),mL=e=>zi(e,"position",bk),gL=new Set(["image","url"]),yL=e=>zi(e,gL,bL),xL=e=>zi(e,"",wL),uo=()=>!0,zi=(e,t,n)=>{const r=wk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},vL=e=>lL.test(e)&&!cL.test(e),bk=()=>!1,wL=e=>uL.test(e),bL=e=>dL.test(e),kL=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),r=we("brightness"),s=we("borderColor"),i=we("borderRadius"),o=we("borderSpacing"),a=we("borderWidth"),l=we("contrast"),u=we("grayscale"),c=we("hueRotate"),d=we("invert"),h=we("gap"),p=we("gradientColorStops"),m=we("gradientColorStopPositions"),y=we("inset"),w=we("margin"),g=we("opacity"),x=we("padding"),v=we("saturate"),k=we("scale"),S=we("sepia"),b=we("skew"),j=we("space"),P=we("translate"),T=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",te,t],M=()=>[te,t],O=()=>["",Bn,lr],A=()=>["auto",yi,te],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",te],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[yi,te];return{cacheSize:500,separator:":",theme:{colors:[uo],spacing:[Bn,lr],blur:["none","",cr,te],brightness:V(),borderColor:[e],borderRadius:["none","","full",cr,te],borderSpacing:M(),borderWidth:O(),contrast:V(),grayscale:$(),hueRotate:V(),invert:$(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[fL,lr],inset:I(),margin:I(),opacity:V(),padding:M(),saturate:V(),scale:V(),sepia:$(),skew:V(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[cr]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),te]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",co,te]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",co,te]}],"grid-cols":[{"grid-cols":[uo]}],"col-start-end":[{col:["auto",{span:["full",co,te]},te]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[uo]}],"row-start-end":[{row:["auto",{span:[co,te]},te]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[cr]},cr]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cr,lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Id]}],"font-family":[{font:[uo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",te]}],"line-clamp":[{"line-clamp":["none",yi,Id]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bn,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bn,lr]}],"underline-offset":[{"underline-offset":["auto",Bn,te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),mL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Bn,te]}],"outline-w":[{outline:[Bn,lr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Bn,lr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cr,xL]}],"shadow-color":[{shadow:[uo]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",cr,te]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[co,te]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Bn,lr,Id]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},_L=sL(kL);function Ad(e,t,n){if(e&&e.length){const[r,s]=t,i=Math.PI/180*n,o=Math.cos(i),a=Math.sin(i);for(const l of e){const[u,c]=l;l[0]=(u-r)*o-(c-s)*a+r,l[1]=(u-r)*a+(c-s)*o+s}}}function SL(e,t){return e[0]===t[0]&&e[1]===t[1]}function CL(e,t,n,r=1){const s=n,i=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(s)for(const u of o)Ad(u,a,s);const l=function(u,c,d){const h=[];for(const x of u){const v=[...x];SL(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&h.push(v)}const p=[];c=Math.max(c,.1);const m=[];for(const x of h)for(let v=0;v<x.length-1;v++){const k=x[v],S=x[v+1];if(k[1]!==S[1]){const b=Math.min(k[1],S[1]);m.push({ymin:b,ymax:Math.max(k[1],S[1]),x:b===k[1]?k[0]:S[0],islope:(S[0]-k[0])/(S[1]-k[1])})}}if(m.sort((x,v)=>x.ymin<v.ymin?-1:x.ymin>v.ymin?1:x.x<v.x?-1:x.x>v.x?1:x.ymax===v.ymax?0:(x.ymax-v.ymax)/Math.abs(x.ymax-v.ymax)),!m.length)return p;let y=[],w=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)x=v;m.splice(0,x+1).forEach(v=>{y.push({s:w,edge:v})})}if(y=y.filter(x=>!(x.edge.ymax<=w)),y.sort((x,v)=>x.edge.x===v.edge.x?0:(x.edge.x-v.edge.x)/Math.abs(x.edge.x-v.edge.x)),(d!==1||g%c==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const v=x+1;if(v>=y.length)break;const k=y[x].edge,S=y[v].edge;p.push([[Math.round(k.x),w],[Math.round(S.x),w]])}w+=d,y.forEach(x=>{x.edge.x=x.edge.x+d*x.edge.islope}),g++}return p}(o,i,r);if(s){for(const u of o)Ad(u,a,-s);(function(u,c,d){const h=[];u.forEach(p=>h.push(...p)),Ad(h,c,d)})(l,a,-s)}return l}function va(e,t){var n;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=s),CL(e,s,r,i||1)}class xm{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=va(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],n));return r}}function yu(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class PL extends xm{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=va(t,Object.assign({},n,{hachureGap:r})),i=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(i),l=.5*r*Math.sin(i);for(const[u,c]of s)yu([u,c])&&o.push([[u[0]-a,u[1]+l],[...c]],[[u[0]+a,u[1]-l],[...c]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class jL extends xm{fillPolygons(t,n){const r=this._fillPolygons(t,n),s=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,s);return r.ops=r.ops.concat(i.ops),r}}class EL{constructor(t){this.helper=t}fillPolygons(t,n){const r=va(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let s=n.hachureGap;s<0&&(s=4*n.strokeWidth),s=Math.max(s,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const o=s/4;for(const a of t){const l=yu(a),u=l/s,c=Math.ceil(u)-1,d=l-c*s,h=(a[0][0]+a[1][0])/2-s/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<c;m++){const y=p+d+m*s,w=h-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(w,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class TL{constructor(t){this.helper=t}fillPolygons(t,n){const r=va(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,s=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,i=[];return t.forEach(o=>{const a=yu(o),l=Math.floor(a/(r+s)),u=(a+s-l*(r+s))/2;let c=o[0],d=o[1];c[0]>d[0]&&(c=o[1],d=o[0]);const h=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let p=0;p<l;p++){const m=p*(r+s),y=m+r,w=[c[0]+m*Math.cos(h)+u*Math.cos(h),c[1]+m*Math.sin(h)+u*Math.sin(h)],g=[c[0]+y*Math.cos(h)+u*Math.cos(h),c[1]+y*Math.sin(h)+u*Math.sin(h)];i.push(...this.helper.doubleLineOps(w[0],w[1],g[0],g[1],n))}}),i}}class RL{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,s=n.zigzagOffset<0?r:n.zigzagOffset,i=va(t,n=Object.assign({},n,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(i,s,n)}}zigzagLines(t,n,r){const s=[];return t.forEach(i=>{const o=yu(i),a=Math.round(o/(2*n));let l=i[0],u=i[1];l[0]>u[0]&&(l=i[1],u=i[0]);const c=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;d<a;d++){const h=2*d*n,p=2*(d+1)*n,m=Math.sqrt(2*Math.pow(n,2)),y=[l[0]+h*Math.cos(c),l[1]+h*Math.sin(c)],w=[l[0]+p*Math.cos(c),l[1]+p*Math.sin(c)],g=[y[0]+m*Math.cos(c+Math.PI/4),y[1]+m*Math.sin(c+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],w[0],w[1],r))}}),s}}const ht={};class NL{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const IL=0,Md=1,Ox=2,ol={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Ld(e,t){return e.type===t}function vm(e){const t=[],n=function(o){const a=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:IL,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Md,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Ox,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Ld(i,Ox);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return vm("M0,0"+e);s++,o=ol[i.text],r=i.text}else Ld(i,Md)?o=ol[r]:(s++,o=ol[i.text],r=i.text);if(!(s+o<n.length))throw new Error("Path data ended short");for(let l=s;l<s+o;l++){const u=n[l];if(!Ld(u,Md))throw new Error("Param not a number: "+r+","+u.text);a[a.length]=+u.text}if(typeof ol[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),s+=o,i=n[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function kk(e){let t=0,n=0,r=0,s=0;const i=[];for(const{key:o,data:a}of e)switch(o){case"M":i.push({key:"M",data:[...a]}),[t,n]=a,[r,s]=a;break;case"m":t+=a[0],n+=a[1],i.push({key:"M",data:[t,n]}),r=t,s=n;break;case"L":i.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((u,c)=>c%2?u+n:u+t);i.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":i.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((u,c)=>c%2?u+n:u+t);i.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":i.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],i.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":i.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((u,c)=>c%2?u+n:u+t);i.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":i.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=s}return i}function _k(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:u,data:c}of e){switch(u){case"M":t.push({key:"M",data:[...c]}),[r,s]=c,[i,o]=c;break;case"C":t.push({key:"C",data:[...c]}),r=c[4],s=c[5],a=c[2],l=c[3];break;case"L":t.push({key:"L",data:[...c]}),[r,s]=c;break;case"H":r=c[0],t.push({key:"L",data:[r,s]});break;case"V":s=c[0],t.push({key:"L",data:[r,s]});break;case"S":{let d=0,h=0;n==="C"||n==="S"?(d=r+(r-a),h=s+(s-l)):(d=r,h=s),t.push({key:"C",data:[d,h,...c]}),a=c[0],l=c[1],r=c[2],s=c[3];break}case"T":{const[d,h]=c;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const y=r+2*(p-r)/3,w=s+2*(m-s)/3,g=d+2*(p-d)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[y,w,g,x,d,h]}),a=p,l=m,r=d,s=h;break}case"Q":{const[d,h,p,m]=c,y=r+2*(d-r)/3,w=s+2*(h-s)/3,g=p+2*(d-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[y,w,g,x,p,m]}),a=d,l=h,r=p,s=m;break}case"A":{const d=Math.abs(c[0]),h=Math.abs(c[1]),p=c[2],m=c[3],y=c[4],w=c[5],g=c[6];d===0||h===0?(t.push({key:"C",data:[r,s,w,g,w,g]}),r=w,s=g):(r!==w||s!==g)&&(Sk(r,s,w,g,d,h,p,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=w,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=u}return t}function fo(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Sk(e,t,n,r,s,i,o,a,l,u){const c=(d=o,Math.PI*d/180);var d;let h=[],p=0,m=0,y=0,w=0;if(u)[p,m,y,w]=u;else{[e,t]=fo(e,t,-c),[n,r]=fo(n,r,-c);const O=(e-n)/2,A=(t-r)/2;let R=O*O/(s*s)+A*A/(i*i);R>1&&(R=Math.sqrt(R),s*=R,i*=R);const z=s*s,B=i*i,L=z*B-z*A*A-B*O*O,$=z*A*A+B*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(L/$));y=C*s*A/i+(e+n)/2,w=C*-i*O/s+(t+r)/2,p=Math.asin(parseFloat(((t-w)/i).toFixed(9))),m=Math.asin(parseFloat(((r-w)/i).toFixed(9))),e<y&&(p=Math.PI-p),n<y&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let g=m-p;if(Math.abs(g)>120*Math.PI/180){const O=m,A=n,R=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Sk(n=y+s*Math.cos(m),r=w+i*Math.sin(m),A,R,s,i,o,0,l,[m,O,y,w])}g=m-p;const x=Math.cos(p),v=Math.sin(p),k=Math.cos(m),S=Math.sin(m),b=Math.tan(g/4),j=4/3*s*b,P=4/3*i*b,T=[e,t],E=[e+j*v,t-P*x],I=[n+j*S,r-P*k],M=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],u)return[E,I,M].concat(h);{h=[E,I,M].concat(h);const O=[];for(let A=0;A<h.length;A+=3){const R=fo(h[A][0],h[A][1],c),z=fo(h[A+1][0],h[A+1][1],c),B=fo(h[A+2][0],h[A+2][1],c);O.push([R[0],R[1],z[0],z[1],B[0],B[1]])}return O}}const AL={randOffset:function(e,t){return Q(e,t)},randOffsetWithRange:function(e,t,n){return Rc(e,t,n)},ellipse:function(e,t,n,r,s){const i=Pk(n,r,s);return wh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return $r(e,t,n,r,s,!0)}};function Ck(e,t,n,r,s){return{type:"path",ops:$r(e,t,n,r,s)}}function $l(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...$r(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...$r(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Ck(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function ML(e,t,n,r,s){return function(i,o){return $l(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function zx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=al(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:al(n[0],1.5*(1+.22*t.roughness),Vx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=al(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:al(o,1.5*(1+.22*t.roughness),Vx(t));for(const u of a)u.op!=="move"&&r.push(u);for(const u of l)u.op!=="move"&&s.push(u)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function Pk(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/s;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=Q(o*l,n),a+=Q(a*l,n),{increment:i,rx:o,ry:a}}function wh(e,t,n,r){const[s,i]=Ux(r.increment,e,t,r.rx,r.ry,1,r.increment*Rc(.1,Rc(.4,1,n),n),n);let o=Nc(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=Ux(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Nc(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function Bx(e,t,n,r,s,i,o,a,l){const u=e,c=t;let d=Math.abs(n/2),h=Math.abs(r/2);d+=Q(.01*d,l),h+=Q(.01*h,l);let p=s,m=i;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const y=2*Math.PI/l.curveStepCount,w=Math.min(y/2,(m-p)/2),g=Wx(w,u,c,d,h,p,m,1,l);if(!l.disableMultiStroke){const x=Wx(w,u,c,d,h,p,m,1.5,l);g.push(...x)}return o&&(a?g.push(...$r(u,c,u+d*Math.cos(p),c+h*Math.sin(p),l),...$r(u,c,u+d*Math.cos(m),c+h*Math.sin(m),l)):g.push({op:"lineTo",data:[u,c]},{op:"lineTo",data:[u+d*Math.cos(p),c+h*Math.sin(p)]})),{type:"path",ops:g}}function $x(e,t){const n=_k(kk(vm(e))),r=[];let s=[0,0],i=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":i=[a[0],a[1]],s=[a[0],a[1]];break;case"L":r.push(...$r(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,u,c,d,h,p]=a;r.push(...LL(l,u,c,d,h,p,i,t)),i=[h,p];break}case"Z":r.push(...$r(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Dd(e,t){const n=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+Q(s,t),r[0][1]+Q(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+Q(s,t),r[o][1]+Q(s,t)]})}}return{type:"fillPath",ops:n}}function Bs(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!ht[s])switch(s){case"zigzag":ht[s]||(ht[s]=new PL(r));break;case"cross-hatch":ht[s]||(ht[s]=new jL(r));break;case"dots":ht[s]||(ht[s]=new EL(r));break;case"dashed":ht[s]||(ht[s]=new TL(r));break;case"zigzag-line":ht[s]||(ht[s]=new RL(r));break;default:s="hachure",ht[s]||(ht[s]=new xm(r))}return ht[s]}(t,AL).fillPolygons(e,t)}function Vx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function jk(e){return e.randomizer||(e.randomizer=new NL(e.seed||0)),e.randomizer.next()}function Rc(e,t,n,r=1){return n.roughness*r*(jk(n)*(t-e)+e)}function Q(e,t,n=1){return Rc(-e,e,t,n)}function $r(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=bh(e,t,n,r,s,!0,!1);if(o)return a;const l=bh(e,t,n,r,s,!0,!0);return a.concat(l)}function bh(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let u=1;u=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=s.maxRandomnessOffset||0;c*c*100>a&&(c=l/10);const d=c/2,h=.2+.2*jk(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=Q(p,s,u),m=Q(m,s,u);const y=[],w=()=>Q(d,s,u),g=()=>Q(c,s,u),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:w()),t+(x?0:w())]}):y.push({op:"move",data:[e+(x?0:Q(c,s,u)),t+(x?0:Q(c,s,u))]}),o?y.push({op:"bcurveTo",data:[p+e+(n-e)*h+w(),m+t+(r-t)*h+w(),p+e+2*(n-e)*h+w(),m+t+2*(r-t)*h+w(),n+(x?0:w()),r+(x?0:w())]}):y.push({op:"bcurveTo",data:[p+e+(n-e)*h+g(),m+t+(r-t)*h+g(),p+e+2*(n-e)*h+g(),m+t+2*(r-t)*h+g(),n+(x?0:g()),r+(x?0:g())]}),y}function al(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+Q(t,n),e[0][1]+Q(t,n)]),r.push([e[0][0]+Q(t,n),e[0][1]+Q(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+Q(t,n),e[s][1]+Q(t,n)]),s===e.length-1&&r.push([e[s][0]+Q(t,n),e[s][1]+Q(t,n)]);return Nc(r,null,n)}function Nc(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...bh(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function Ux(e,t,n,r,s,i,o,a){const l=[],u=[];if(a.roughness===0){e/=4,u.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let c=0;c<=2*Math.PI;c+=e){const d=[t+r*Math.cos(c),n+s*Math.sin(c)];l.push(d),u.push(d)}u.push([t+r*Math.cos(0),n+s*Math.sin(0)]),u.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const c=Q(.5,a)-Math.PI/2;u.push([Q(i,a)+t+.9*r*Math.cos(c-e),Q(i,a)+n+.9*s*Math.sin(c-e)]);const d=2*Math.PI+c-.01;for(let h=c;h<d;h+=e){const p=[Q(i,a)+t+r*Math.cos(h),Q(i,a)+n+s*Math.sin(h)];l.push(p),u.push(p)}u.push([Q(i,a)+t+r*Math.cos(c+2*Math.PI+.5*o),Q(i,a)+n+s*Math.sin(c+2*Math.PI+.5*o)]),u.push([Q(i,a)+t+.98*r*Math.cos(c+o),Q(i,a)+n+.98*s*Math.sin(c+o)]),u.push([Q(i,a)+t+.9*r*Math.cos(c+.5*o),Q(i,a)+n+.9*s*Math.sin(c+.5*o)])}return[u,l]}function Wx(e,t,n,r,s,i,o,a,l){const u=i+Q(.1,l),c=[];c.push([Q(a,l)+t+.9*r*Math.cos(u-e),Q(a,l)+n+.9*s*Math.sin(u-e)]);for(let d=u;d<=o;d+=e)c.push([Q(a,l)+t+r*Math.cos(d),Q(a,l)+n+s*Math.sin(d)]);return c.push([t+r*Math.cos(o),n+s*Math.sin(o)]),c.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Nc(c,null,l)}function LL(e,t,n,r,s,i,o,a){const l=[],u=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const d=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:Q(u[0],a)),o[1]+(h?0:Q(u[0],a))]}),c=h?[s,i]:[s+Q(u[p],a),i+Q(u[p],a)],l.push({op:"bcurveTo",data:[e+Q(u[p],a),t+Q(u[p],a),n+Q(u[p],a),r+Q(u[p],a),c[0],c[1]]});return l}function ho(e){return[...e]}function Hx(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(ho(e[0]),ho(e[1]),ho(e[2]),ho(e[2]));else{const s=[];s.push(e[0],e[0]);for(let a=1;a<e.length;a++)s.push(e[a]),a===e.length-1&&s.push(e[a]);const i=[],o=1-t;r.push(ho(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Vl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function DL(e,t,n){const r=Vl(t,n);if(r===0)return Vl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Vl(e,as(t,n,s))}function as(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function kh(e,t,n,r){const s=r||[];if(function(a,l){const u=a[l+0],c=a[l+1],d=a[l+2],h=a[l+3];let p=3*c[0]-2*u[0]-h[0];p*=p;let m=3*c[1]-2*u[1]-h[1];m*=m;let y=3*d[0]-2*h[0]-u[0];y*=y;let w=3*d[1]-2*h[1]-u[1];return w*=w,p<y&&(p=y),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Vl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],u=e[t+1],c=e[t+2],d=e[t+3],h=as(l,u,.5),p=as(u,c,.5),m=as(c,d,.5),y=as(h,p,.5),w=as(p,m,.5),g=as(y,w,.5);kh([l,h,y,g],0,n,s),kh([g,w,m,d],0,n,s)}var i,o;return s}function FL(e,t){return Ic(e,0,e.length,t)}function Ic(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,u=1;for(let c=t+1;c<n-1;++c){const d=DL(e[c],o,a);d>l&&(l=d,u=c)}return Math.sqrt(l)>r?(Ic(e,t,u+1,r,i),Ic(e,u,n,r,i)):(i.length||i.push(o),i.push(a)),i}function Fd(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)kh(e,3*i,t,r);return n&&n>0?Ic(r,0,r.length,n):r}const Et="none";let Ac=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[Ck(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=ML(t,n,r,s,o);if(o.fill){const u=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(Dd([u],o)):a.push(Bs([u],o))}return o.stroke!==Et&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Pk(r,s,o),u=wh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const c=wh(t,n,o,l).opset;c.type="fillPath",a.push(c)}else a.push(Bs([u.estimatedPoints],o));return o.stroke!==Et&&a.push(u.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[$l(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const u=this._o(l),c=[],d=Bx(t,n,r,s,i,o,a,!0,u);if(a&&u.fill)if(u.fillStyle==="solid"){const h=Object.assign({},u);h.disableMultiStroke=!0;const p=Bx(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",c.push(p)}else c.push(function(h,p,m,y,w,g,x){const v=h,k=p;let S=Math.abs(m/2),b=Math.abs(y/2);S+=Q(.01*S,x),b+=Q(.01*b,x);let j=w,P=g;for(;j<0;)j+=2*Math.PI,P+=2*Math.PI;P-j>2*Math.PI&&(j=0,P=2*Math.PI);const T=(P-j)/x.curveStepCount,E=[];for(let I=j;I<=P;I+=T)E.push([v+S*Math.cos(I),k+b*Math.sin(I)]);return E.push([v+S*Math.cos(P),k+b*Math.sin(P)]),E.push([v,k]),Bs([E],x)}(t,n,r,s,i,o,u));return u.stroke!==Et&&c.push(d),this._d("arc",c,u)}curve(t,n){const r=this._o(n),s=[],i=zx(t,r);if(r.fill&&r.fill!==Et)if(r.fillStyle==="solid"){const o=zx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const u of l)u.length<3?o.push(...u):u.length===3?o.push(...Fd(Hx([u[0],u[0],u[1],u[2]]),10,(1+r.roughness)/2)):o.push(...Fd(Hx(u),10,(1+r.roughness)/2))}o.length&&s.push(Bs([o],r))}return r.stroke!==Et&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=$l(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Dd([t],r)):s.push(Bs([t],r))),r.stroke!==Et&&s.push(i),this._d("polygon",s,r)}path(t,n){const r=this._o(n),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==Et,o=r.stroke!==Et,a=!!(r.simplification&&r.simplification<1),l=function(c,d,h){const p=_k(kk(vm(c))),m=[];let y=[],w=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...Fd(g,d)),g=[]},v=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:S,data:b}of p)switch(S){case"M":v(),w=[b[0],b[1]],y.push(w);break;case"L":x(),y.push([b[0],b[1]]);break;case"C":if(!g.length){const j=y.length?y[y.length-1]:w;g.push([j[0],j[1]])}g.push([b[0],b[1]]),g.push([b[2],b[3]]),g.push([b[4],b[5]]);break;case"Z":x(),y.push([w[0],w[1]])}if(v(),!h)return m;const k=[];for(const S of m){const b=FL(S,h);b.length&&k.push(b)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),u=$x(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const c=$x(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else s.push(Dd(l,r));else s.push(Bs(l,r));return o&&(a?l.forEach(c=>{s.push($l(c,!1,r))}):s.push(u)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Et};break;case"fillPath":o={d:this.opsToPath(i),stroke:Et,strokeWidth:0,fill:r.fill||Et};break;case"fillSketch":o=this.fillSketch(i,r)}o&&s.push(o)}return s}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Et,strokeWidth:r,fill:Et}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},OL=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ac(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const u=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(u),u}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const ll="http://www.w3.org/2000/svg";class zL{constructor(t,n){this.svg=t,this.gen=new Ac(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(ll,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(ll,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(ll,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,a,r)}l&&i.appendChild(l)}return i}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const i=t.createElementNS(ll,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const u=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(u)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var BL={canvas:(e,t)=>new OL(e,t),svg:(e,t)=>new zL(e,t),generator:e=>new Ac(e),newSeed:()=>Ac.newSeed()};const wm=_.createContext({});function bm(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const $L=typeof window<"u",Ek=$L?_.useLayoutEffect:_.useEffect,xu=_.createContext(null);function km(e,t){e.indexOf(t)===-1&&e.push(t)}function Mc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ln=(e,t,n)=>n>t?t:n<e?e:n;let _m=()=>{};const Vr={},Tk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Rk=e=>typeof e=="object"&&e!==null,Nk=e=>/^0[^.\s]+$/u.test(e);function Ik(e){let t;return()=>(t===void 0&&(t=e()),t)}const Qt=e=>e,wa=(...e)=>e.reduce((t,n)=>r=>n(t(r))),la=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Sm{constructor(){this.subscriptions=[]}add(t){return km(this.subscriptions,t),()=>Mc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Lt=e=>e*1e3,qt=e=>e/1e3,Ak=(e,t)=>t?e*(1e3/t):0,Mk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,VL=1e-7,UL=12;function WL(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Mk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>VL&&++a<UL);return o}function ba(e,t,n,r){if(e===t&&n===r)return Qt;const s=i=>WL(i,0,1,e,n);return i=>i===0||i===1?i:Mk(s(i),t,r)}const Lk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Dk=e=>t=>1-e(1-t),Fk=ba(.33,1.53,.69,.99),Cm=Dk(Fk),Ok=Lk(Cm),zk=e=>e>=1?1:(e*=2)<1?.5*Cm(e):.5*(2-Math.pow(2,-10*(e-1))),Pm=e=>1-Math.sin(Math.acos(e)),Bk=Dk(Pm),$k=Lk(Pm),HL=ba(.42,0,1,1),GL=ba(0,0,.58,1),Vk=ba(.42,0,.58,1),KL=e=>Array.isArray(e)&&typeof e[0]!="number",Uk=e=>Array.isArray(e)&&typeof e[0]=="number",qL={linear:Qt,easeIn:HL,easeInOut:Vk,easeOut:GL,circIn:Pm,circInOut:$k,circOut:Bk,backIn:Cm,backInOut:Ok,backOut:Fk,anticipate:zk},YL=e=>typeof e=="string",Gx=e=>{if(Uk(e)){_m(e.length===4);const[t,n,r,s]=e;return ba(t,n,r,s)}else if(YL(e))return qL[e];return e},cl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function QL(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,d=!1,h=!1)=>{const m=h&&s?n:r;return d&&o.add(c),m.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,s){i=!0;return}s=!0;const d=n;n=r,r=d,n.forEach(l),n.clear(),s=!1,i&&(i=!1,u.process(c))}};return u}const XL=40;function Wk(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=cl.reduce((v,k)=>(v[k]=QL(i),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:h,render:p,postRender:m}=o,y=()=>{const v=Vr.useManualTiming,k=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,XL),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},w=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:cl.reduce((v,k)=>{const S=o[k];return v[k]=(b,j=!1,P=!1)=>(n||w(),S.schedule(b,j,P)),v},{}),cancel:v=>{for(let k=0;k<cl.length;k++)o[cl[k]].cancel(v)},state:s,steps:o}}const{schedule:ge,cancel:Ur,state:qe,steps:Od}=Wk(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qt,!0);let Ul;function JL(){Ul=void 0}const at={now:()=>(Ul===void 0&&at.set(qe.isProcessing||Vr.useManualTiming?qe.timestamp:performance.now()),Ul),set:e=>{Ul=e,queueMicrotask(JL)}},Hk=e=>t=>typeof t=="string"&&t.startsWith(e),Gk=Hk("--"),ZL=Hk("var(--"),jm=e=>ZL(e)?eD.test(e.split("/*")[0].trim()):!1,eD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Kx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ca={...Bi,transform:e=>Ln(0,1,e)},ul={...Bi,default:1},Do=e=>Math.round(e*1e5)/1e5,Em=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tD(e){return e==null}const nD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Tm=(e,t)=>n=>!!(typeof n=="string"&&nD.test(n)&&n.startsWith(e)||t&&!tD(n)&&Object.prototype.hasOwnProperty.call(n,t)),Kk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Em);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},rD=e=>Ln(0,255,e),zd={...Bi,transform:e=>Math.round(rD(e))},ps={test:Tm("rgb","red"),parse:Kk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zd.transform(e)+", "+zd.transform(t)+", "+zd.transform(n)+", "+Do(ca.transform(r))+")"};function sD(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const _h={test:Tm("#"),parse:sD,transform:ps.transform},ka=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Un=ka("deg"),An=ka("%"),K=ka("px"),iD=ka("vh"),oD=ka("vw"),qx={...An,parse:e=>An.parse(e)/100,transform:e=>An.transform(e*100)},ii={test:Tm("hsl","hue"),parse:Kk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+An.transform(Do(t))+", "+An.transform(Do(n))+", "+Do(ca.transform(r))+")"},Oe={test:e=>ps.test(e)||_h.test(e)||ii.test(e),parse:e=>ps.test(e)?ps.parse(e):ii.test(e)?ii.parse(e):_h.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ps.transform(e):ii.transform(e),getAnimatableNone:e=>{const t=Oe.parse(e);return t.alpha=0,Oe.transform(t)}},aD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Em))==null?void 0:t.length)||0)+(((n=e.match(aD))==null?void 0:n.length)||0)>0}const qk="number",Yk="color",cD="var",uD="var(",Yx="${}",dD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ti(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(dD,l=>(Oe.test(l)?(r.color.push(i),s.push(Yk),n.push(Oe.parse(l))):l.startsWith(uD)?(r.var.push(i),s.push(cD),n.push(l)):(r.number.push(i),s.push(qk),n.push(parseFloat(l))),++i,Yx)).split(Yx);return{values:n,split:a,indexes:r,types:s}}function fD(e){return Ti(e).values}function Qk({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===qk?s+=Do(r[i]):o===Yk?s+=Oe.transform(r[i]):s+=r[i]}return s}}function hD(e){return Qk(Ti(e))}const pD=e=>typeof e=="number"?0:Oe.test(e)?Oe.getAnimatableNone(e):e,mD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:pD(e);function gD(e){const t=Ti(e);return Qk(t)(t.values.map((r,s)=>mD(r,t.split[s])))}const pn={test:lD,parse:fD,createTransformer:hD,getAnimatableNone:gD};function Bd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Bd(l,a,e+1/3),i=Bd(l,a,e),o=Bd(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Lc(e,t){return n=>n>0?t:e}const me=(e,t,n)=>e+(t-e)*n,$d=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},xD=[_h,ps,ii],vD=e=>xD.find(t=>t.test(e));function Qx(e){const t=vD(e);if(!t)return!1;let n=t.parse(e);return t===ii&&(n=yD(n)),n}const Xx=(e,t)=>{const n=Qx(e),r=Qx(t);if(!n||!r)return Lc(e,t);const s={...n};return i=>(s.red=$d(n.red,r.red,i),s.green=$d(n.green,r.green,i),s.blue=$d(n.blue,r.blue,i),s.alpha=me(n.alpha,r.alpha,i),ps.transform(s))},Sh=new Set(["none","hidden"]);function wD(e,t){return Sh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function bD(e,t){return n=>me(e,t,n)}function Rm(e){return typeof e=="number"?bD:typeof e=="string"?jm(e)?Lc:Oe.test(e)?Xx:SD:Array.isArray(e)?Xk:typeof e=="object"?Oe.test(e)?Xx:kD:Lc}function Xk(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Rm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function kD(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Rm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function _D(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const SD=(e,t)=>{const n=pn.createTransformer(t),r=Ti(e),s=Ti(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Sh.has(e)&&!s.values.length||Sh.has(t)&&!r.values.length?wD(e,t):wa(Xk(_D(r,s),s.values),n):Lc(e,t)};function Jk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?me(e,t,n):Rm(e)(e,t)}const CD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>Ur(t),now:()=>qe.isProcessing?qe.timestamp:at.now()}},Zk=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Dc=2e4;function Nm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Dc;)t+=n,r=e.next(t);return t>=Dc?1/0:t}function PD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Nm(r),Dc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:qt(s)}}const Re={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ch(e,t){return e*Math.sqrt(1-t*t)}const jD=12;function ED(e,t,n){let r=n;for(let s=1;s<jD;s++)r=r-e(r)/t(r);return r}const Vd=.001;function TD({duration:e=Re.duration,bounce:t=Re.bounce,velocity:n=Re.velocity,mass:r=Re.mass}){let s,i,o=1-t;o=Ln(Re.minDamping,Re.maxDamping,o),e=Ln(Re.minDuration,Re.maxDuration,qt(e)),o<1?(s=u=>{const c=u*o,d=c*e,h=c-n,p=Ch(u,o),m=Math.exp(-d);return Vd-h/p*m},i=u=>{const d=u*o*e,h=d*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),y=Ch(Math.pow(u,2),o);return(-s(u)+Vd>0?-1:1)*((h-p)*m)/y}):(s=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Vd+c*d},i=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=ED(s,i,a);if(e=Lt(e),isNaN(l))return{stiffness:Re.stiffness,damping:Re.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const RD=["duration","bounce"],ND=["stiffness","damping","mass"];function Jx(e,t){return t.some(n=>e[n]!==void 0)}function ID(e){let t={velocity:Re.velocity,stiffness:Re.stiffness,damping:Re.damping,mass:Re.mass,isResolvedFromDuration:!1,...e};if(!Jx(e,ND)&&Jx(e,RD))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ln(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Re.mass,stiffness:s,damping:i}}else{const n=TD({...e,velocity:0});t={...t,...n,mass:Re.mass},t.isResolvedFromDuration=!0}return t}function Fc(e=Re.visualDuration,t=Re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:d,velocity:h,isResolvedFromDuration:p}=ID({...n,velocity:-qt(n.velocity||0)}),m=h||0,y=u/(2*Math.sqrt(l*c)),w=o-i,g=qt(Math.sqrt(l/c)),x=Math.abs(w)<5;r||(r=x?Re.restSpeed.granular:Re.restSpeed.default),s||(s=x?Re.restDelta.granular:Re.restDelta.default);let v,k,S,b,j,P;if(y<1)S=Ch(g,y),b=(m+y*g*w)/S,v=E=>{const I=Math.exp(-y*g*E);return o-I*(b*Math.sin(S*E)+w*Math.cos(S*E))},j=y*g*b+w*S,P=y*g*w-b*S,k=E=>Math.exp(-y*g*E)*(j*Math.sin(S*E)+P*Math.cos(S*E));else if(y===1){v=I=>o-Math.exp(-g*I)*(w+(m+g*w)*I);const E=m+g*w;k=I=>Math.exp(-g*I)*(g*E*I-m)}else{const E=g*Math.sqrt(y*y-1);v=A=>{const R=Math.exp(-y*g*A),z=Math.min(E*A,300);return o-R*((m+y*g*w)*Math.sinh(z)+E*w*Math.cosh(z))/E};const I=(m+y*g*w)/E,M=y*g*I-w*E,O=y*g*w-I*E;k=A=>{const R=Math.exp(-y*g*A),z=Math.min(E*A,300);return R*(M*Math.sinh(z)+O*Math.cosh(z))}}const T={calculatedDuration:p&&d||null,velocity:E=>Lt(k(E)),next:E=>{if(!p&&y<1){const M=Math.exp(-y*g*E),O=Math.sin(S*E),A=Math.cos(S*E),R=o-M*(b*O+w*A),z=Lt(M*(j*O+P*A));return a.done=Math.abs(z)<=r&&Math.abs(o-R)<=s,a.value=a.done?o:R,a}const I=v(E);if(p)a.done=E>=d;else{const M=Lt(k(E));a.done=Math.abs(M)<=r&&Math.abs(o-I)<=s}return a.value=a.done?o:I,a},toString:()=>{const E=Math.min(Nm(T),Dc),I=Zk(M=>T.next(E*M).value,E,30);return E+"ms "+I},toTransition:()=>{}};return T}Fc.applyToOptions=e=>{const t=PD(e,100,Fc);return e.ease=t.ease,e.duration=Lt(t.duration),e.type="keyframes",e};const AD=5;function e_(e,t,n){const r=Math.max(t-AD,0);return Ak(n-e(r),t-r)}function Ph({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],h={done:!1,value:d},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*t;const w=d+y,g=o===void 0?w:o(w);g!==w&&(y=g-d);const x=P=>-y*Math.exp(-P/r),v=P=>g+x(P),k=P=>{const T=x(P),E=v(P);h.done=Math.abs(T)<=u,h.value=h.done?g:E};let S,b;const j=P=>{p(h.value)&&(S=P,b=Fc({keyframes:[h.value,m(h.value)],velocity:e_(v,P,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return j(0),{calculatedDuration:null,next:P=>{let T=!1;return!b&&S===void 0&&(T=!0,k(P),j(P)),S!==void 0&&P>=S?b.next(P-S):(!T&&k(P),h)}}}function MD(e,t,n){const r=[],s=n||Vr.mix||Jk,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Qt:t;a=wa(l,a)}r.push(a)}return r}function LD(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_m(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=MD(t,r,s),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const h=la(e[d],e[d+1],c);return a[d](h)};return n?c=>u(Ln(e[0],e[i-1],c)):u}function DD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=la(0,t,r);e.push(me(n,1,s))}}function FD(e){const t=[0];return DD(t,e.length-1),t}function OD(e,t){return e.map(n=>n*t)}function zD(e,t){return e.map(()=>t||Vk).splice(0,e.length-1)}function Fo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=KL(r)?r.map(Gx):Gx(r),i={done:!1,value:t[0]},o=OD(n&&n.length===t.length?n:FD(t),e),a=LD(o,t,{ease:Array.isArray(s)?s:zD(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const BD=e=>e!==null;function vu(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(BD),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const $D={decay:Ph,inertia:Ph,tween:Fo,keyframes:Fo,spring:Fc};function t_(e){typeof e.type=="string"&&(e.type=$D[e.type])}class Im{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const VD=e=>e/100;class Oc extends Im{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==at.now()&&this.tick(at.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;t_(t);const{type:n=Fo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Fo;l!==Fo&&typeof a[0]!="number"&&(this.mixKeyframes=wa(VD,Jk(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Nm(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:h,repeatDelay:p,type:m,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,k=r;if(d){const P=Math.min(this.currentTime,s)/a;let T=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&T--,T=Math.min(T,d+1),!!(T%2)&&(h==="reverse"?(E=1-E,p&&(E-=p/a)):h==="mirror"&&(k=o)),v=Ln(0,1,E)*a}let S;x?(this.delayState.value=c[0],S=this.delayState):S=k.next(v),i&&!x&&(S.value=i(S.value));let{done:b}=S;!x&&l!==null&&(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return j&&m!==Ph&&(S.value=vu(c,this.options,w,this.speed)),y&&y(S.value),j&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return qt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qt(t)}get time(){return qt(this.currentTime)}set time(t){t=Lt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return e_(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(at.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=qt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=CD,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(at.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function UD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ms=e=>e*180/Math.PI,jh=e=>{const t=ms(Math.atan2(e[1],e[0]));return Eh(t)},WD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jh,rotateZ:jh,skewX:e=>ms(Math.atan(e[1])),skewY:e=>ms(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Eh=e=>(e=e%360,e<0&&(e+=360),e),Zx=jh,e0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),t0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),HD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:e0,scaleY:t0,scale:e=>(e0(e)+t0(e))/2,rotateX:e=>Eh(ms(Math.atan2(e[6],e[5]))),rotateY:e=>Eh(ms(Math.atan2(-e[2],e[0]))),rotateZ:Zx,rotate:Zx,skewX:e=>ms(Math.atan(e[4])),skewY:e=>ms(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Th(e){return e.includes("scale")?1:0}function Rh(e,t){if(!e||e==="none")return Th(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=HD,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=WD,s=a}if(!s)return Th(t);const i=r[t],o=s[1].split(",").map(KD);return typeof i=="function"?i(o):o[i]}const GD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Rh(n,t)};function KD(e){return parseFloat(e.trim())}const $i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vi=new Set([...$i,"pathRotation"]),n0=e=>e===Bi||e===K,qD=new Set(["x","y","z"]),YD=$i.filter(e=>!qD.has(e));function QD(e){const t=[];return YD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Er={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Rh(t,"x"),y:(e,{transform:t})=>Rh(t,"y")};Er.translateX=Er.x;Er.translateY=Er.y;const ks=new Set;let Nh=!1,Ih=!1,Ah=!1;function n_(){if(Ih){const e=Array.from(ks).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=QD(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ih=!1,Nh=!1,ks.forEach(e=>e.complete(Ah)),ks.clear()}function r_(){ks.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ih=!0)})}function XD(){Ah=!0,r_(),n_(),Ah=!1}class Am{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ks.add(this),Nh||(Nh=!0,ge.read(r_),ge.resolveKeyframes(n_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}UD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ks.delete(this)}cancel(){this.state==="scheduled"&&(ks.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const JD=e=>e.startsWith("--");function s_(e,t,n){JD(t)?e.style.setProperty(t,n):e.style[t]=n}const ZD={};function i_(e,t){const n=Ik(e);return()=>ZD[t]??n()}const e3=i_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),o_=i_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ko=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,r0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ko([0,.65,.55,1]),circOut:ko([.55,0,1,.45]),backIn:ko([.31,.01,.66,-.59]),backOut:ko([.33,1.53,.69,.99])};function a_(e,t){if(e)return typeof e=="function"?o_()?Zk(e,t):"ease-out":Uk(e)?ko(e):Array.isArray(e)?e.map(n=>a_(n,t)||r0.easeOut):r0[e]}function t3(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=a_(a,s);Array.isArray(d)&&(c.easing=d);const h={delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(c,h)}function l_(e){return typeof e=="function"&&"applyToOptions"in e}function n3({type:e,...t}){return l_(e)&&o_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class c_ extends Im{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,_m(typeof t.type!="string");const u=n3(t);this.animation=t3(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=vu(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),s_(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return qt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qt(t)}get time(){return qt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Lt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&e3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Qt):s(this)}}const u_={anticipate:zk,backInOut:Ok,circInOut:$k};function r3(e){return e in u_}function s3(e){typeof e.ease=="string"&&r3(e.ease)&&(e.ease=u_[e.ease])}const Ud=10;class i3 extends c_{constructor(t){s3(t),t_(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Oc({...o,autoplay:!1}),l=Math.max(Ud,at.now()-this.startTime),u=Ln(0,Ud,l-Ud),c=a.sample(l).value,{name:d}=this.options;i&&d&&s_(i,d,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const s0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(pn.test(e)||e==="0")&&!e.startsWith("url("));function o3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function a3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=s0(s,t),a=s0(i,t);return!o||!a?!1:o3(e)||(n==="spring"||l_(n))&&r}function Mh(e){e.duration=0,e.type="keyframes"}const d_=new Set(["opacity","clipPath","filter","transform"]),l3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function c3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&l3.test(e[t]))return!0;return!1}const u3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),d3=Ik(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function f3(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=t.owner.getProps();return d3()&&n&&(d_.has(n)||u3.has(n)&&c3(a))&&(n!=="transform"||!c)&&!u&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const h3=40;class p3 extends Im{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...d}){var m;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=at.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:u,element:c,...d},p=(c==null?void 0:c.KeyframeResolver)||Am;this.keyframeResolver=new p(a,(y,w,g)=>this.onKeyframesResolved(y,w,h,!g),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=at.now();let d=!0;a3(t,i,o,a)||(d=!1,(Vr.instantAnimations||!l)&&(c==null||c(vu(t,r,n))),t[0]=t[t.length-1],Mh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=d&&!u&&f3(p),y=(x=(g=p.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let w;if(m)try{w=new i3({...p,element:y})}catch{w=new Oc(p)}else w=new Oc(p);w.finished.then(()=>{this.notifyFinished()}).catch(Qt),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),XD()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function f_(e,t,n,r=0,s=1){const i=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const i0=30,m3=e=>!isNaN(parseFloat(e));class g3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=at.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=at.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=m3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Sm);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=at.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>i0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,i0);return Ak(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ri(e,t){return new g3(e,t)}function h_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Mm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?h_(n,e):n}const y3={type:"spring",stiffness:500,damping:25,restSpeed:10},x3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),v3={type:"keyframes",duration:.8},w3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},b3=(e,{keyframes:t})=>t.length>2?v3:Vi.has(e)?e.startsWith("scale")?x3(t[1]):y3:w3,k3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function _3(e){for(const t in e)if(!k3.has(t))return!0;return!1}const Lm=(e,t,n,r={},s,i)=>o=>{const a=Mm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Lt(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};_3(a)||Object.assign(c,b3(e,c)),c.duration&&(c.duration=Lt(c.duration)),c.repeatDelay&&(c.repeatDelay=Lt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Mh(c),c.delay===0&&(d=!0)),(Vr.instantAnimations||Vr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(d=!0,Mh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const h=vu(c.keyframes,a);if(h!==void 0){ge.update(()=>{c.onUpdate(h),c.onComplete()});return}}return a.isSync?new Oc(c):new p3(c)},S3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function C3(e){const t=S3.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function p_(e,t,n=1){const[r,s]=C3(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Tk(o)?parseFloat(o):o}return jm(s)?p_(s,t,n+1):s}function o0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Dm(e,t,n,r){if(typeof t=="function"){const[s,i]=o0(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=o0(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function _s(e,t,n){const r=e.getProps();return Dm(r,t,n!==void 0?n:r.custom,e)}const m_=new Set(["width","height","top","left","right","bottom",...$i]),Lh=e=>Array.isArray(e);function P3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ri(n))}function j3(e){return Lh(e)?e[e.length-1]||0:e}function E3(e,t){const n=_s(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=j3(i[o]);P3(e,o,a)}}const Ye=e=>!!(e&&e.getVelocity);function T3(e){return!!(Ye(e)&&e.add)}function Dh(e,t){const n=e.getValue("willChange");if(T3(n))return n.add(t);if(!n&&Vr.WillChange){const r=new Vr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Fm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const R3="framerAppearId",g_="data-"+Fm(R3);function y_(e){return e.props[g_]}function N3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?h_(i,l):l;const u=i==null?void 0:i.reduceMotion,c=i==null?void 0:i.skipAnimations;r&&(i=r);const d=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,d);for(const m in a){const y=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||h&&N3(h,m))continue;const g={delay:n,...Mm(i||{},m)};c&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===x&&!g.velocity){ge.update(()=>y.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const b=y_(e);if(b){const j=window.MotionHandoffAnimation(b,m,ge);j!==null&&(g.startTime=j,v=!0)}}Dh(e,m);const k=u??e.shouldReduceMotion;y.start(Lm(m,y,w,k&&m_.has(m)?{type:!1}:g,e,v));const S=y.animation;S&&d.push(S)}if(o){const m=()=>ge.update(()=>{o&&E3(e,o)});d.length?Promise.all(d).then(m):m()}return d}function Fh(e,t,n={}){var l;const r=_s(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(x_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:h}=s;return I3(e,t,u,c,d,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[u,c]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function I3(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Fh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+f_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function A3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Fh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Fh(e,t,n);else{const s=typeof t=="function"?_s(e,t,n.custom):t;r=Promise.all(x_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const M3={test:e=>e==="auto",parse:e=>e},v_=e=>t=>t.test(e),w_=[Bi,K,An,Un,oD,iD,M3],a0=e=>w_.find(v_(e));function L3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nk(e):!0}const D3=new Set(["brightness","contrast","saturate","opacity"]);function F3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Em)||[];if(!r)return e;const s=n.replace(r,"");let i=D3.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const O3=/\b([a-z-]*)\(.*?\)/gu,Oh={...pn,getAnimatableNone:e=>{const t=e.match(O3);return t?t.map(F3).join(" "):e}},zh={...pn,getAnimatableNone:e=>{const t=pn.parse(e);return pn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},l0={...Bi,transform:Math.round},z3={rotate:Un,pathRotation:Un,rotateX:Un,rotateY:Un,rotateZ:Un,scale:ul,scaleX:ul,scaleY:ul,scaleZ:ul,skew:Un,skewX:Un,skewY:Un,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:ca,originX:qx,originY:qx,originZ:K},zc={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,...z3,zIndex:l0,fillOpacity:ca,strokeOpacity:ca,numOctaves:l0},B3={...zc,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:Oh,WebkitFilter:Oh,mask:zh,WebkitMask:zh},b_=e=>B3[e],$3=new Set([Oh,zh]);function k_(e,t){let n=b_(e);return $3.has(n)||(n=pn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const V3=new Set(["auto","none","0"]);function U3(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!V3.has(i)&&Ti(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=k_(n,s)}class W3 extends Am{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),jm(d))){const h=p_(d,n.current);h!==void 0&&(t[c]=h),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!m_.has(r)||t.length!==2)return;const[s,i]=t,o=a0(s),a=a0(i),l=Kx(s),u=Kx(i);if(l!==u&&Er[r]){this.needsMeasurement=!0;return}if(o!==a)if(n0(o)&&n0(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else Er[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||L3(t[s]))&&r.push(s);r.length&&U3(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Er[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Er[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function __(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Bh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Wl(e){return Rk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Om}=Wk(queueMicrotask,!1),ln={x:!1,y:!1};function S_(){return ln.x||ln.y}function H3(e){return e==="x"||e==="y"?ln[e]?null:(ln[e]=!0,()=>{ln[e]=!1}):ln.x||ln.y?null:(ln.x=ln.y=!0,()=>{ln.x=ln.y=!1})}function C_(e,t){const n=__(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function G3(e){return!(e.pointerType==="touch"||S_())}function K3(e,t,n={}){const[r,s,i]=C_(e,n);return r.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",m)},d=w=>{u&&(u(w),u=void 0),c()},h=w=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(w))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}d(w)}},y=w=>{if(!G3(w))return;l=!1;const g=t(o,w);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",p,s)}),i}const P_=(e,t)=>t?e===t?!0:P_(e,t.parentElement):!1,zm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,q3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Y3(e){return q3.has(e.tagName)||e.isContentEditable===!0}const Q3=new Set(["INPUT","SELECT","TEXTAREA"]);function X3(e){return Q3.has(e.tagName)||e.isContentEditable===!0}const Hl=new WeakSet;function c0(e){return t=>{t.key==="Enter"&&e(t)}}function Wd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const J3=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=c0(()=>{if(Hl.has(n))return;Wd(n,"down");const s=c0(()=>{Wd(n,"up")}),i=()=>Wd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function u0(e){return zm(e)&&!S_()}const d0=new WeakSet;function Z3(e,t,n={}){const[r,s,i]=C_(e,n),o=a=>{const l=a.currentTarget;if(!u0(a)||d0.has(a))return;Hl.add(l),n.stopPropagation&&d0.add(a);const u=t(l,a),c=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),Hl.has(l)&&Hl.delete(l),u0(p)&&typeof u=="function"&&u(p,{success:m})},d=p=>{c(p,l===window||l===document||n.useGlobalTarget||P_(l,p.target))},h=p=>{c(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Wl(a)&&(a.addEventListener("focus",u=>J3(u,s)),!Y3(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Bm(e){return Rk(e)&&"ownerSVGElement"in e}const Gl=new WeakMap;let mr;const j_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Bm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],eF=j_("inline","width","offsetWidth"),tF=j_("block","height","offsetHeight");function nF({target:e,borderBoxSize:t}){var n;(n=Gl.get(e))==null||n.forEach(r=>{r(e,{get width(){return eF(e,t)},get height(){return tF(e,t)}})})}function rF(e){e.forEach(nF)}function sF(){typeof ResizeObserver>"u"||(mr=new ResizeObserver(rF))}function iF(e,t){mr||sF();const n=__(e);return n.forEach(r=>{let s=Gl.get(r);s||(s=new Set,Gl.set(r,s)),s.add(t),mr==null||mr.observe(r)}),()=>{n.forEach(r=>{const s=Gl.get(r);s==null||s.delete(t),s!=null&&s.size||mr==null||mr.unobserve(r)})}}const Kl=new Set;let oi;function oF(){oi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Kl.forEach(t=>t(e))},window.addEventListener("resize",oi)}function aF(e){return Kl.add(e),oi||oF(),()=>{Kl.delete(e),!Kl.size&&typeof oi=="function"&&(window.removeEventListener("resize",oi),oi=void 0)}}function f0(e,t){return typeof e=="function"?aF(e):iF(e,t)}function lF(e){return Bm(e)&&e.tagName==="svg"}const cF=[...w_,Oe,pn],uF=e=>cF.find(v_(e)),h0=()=>({translate:0,scale:1,origin:0,originPoint:0}),ai=()=>({x:h0(),y:h0()}),p0=()=>({min:0,max:0}),Be=()=>({x:p0(),y:p0()}),dF=new WeakMap;function wu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ua(e){return typeof e=="string"||Array.isArray(e)}const $m=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vm=["initial",...$m];function bu(e){return wu(e.animate)||Vm.some(t=>ua(e[t]))}function E_(e){return!!(bu(e)||e.variants)}function fF(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Ye(s))e.addValue(r,s);else if(Ye(i))e.addValue(r,Ri(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Ri(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bc={current:null},Um={current:!1},hF=typeof window<"u";function T_(){if(Um.current=!0,!!hF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bc.current=e.matches;e.addEventListener("change",t),t()}else Bc.current=!1}const m0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $c={};function R_(e){$c=e}function pF(){return $c}class mF{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Am,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=at.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ge.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=bu(n),this.isVariantNode=E_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];u[p]!==void 0&&Ye(m)&&m.set(u[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,dF.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Um.current||T_(),this.shouldReduceMotion=Bc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ur(this.notifyUpdate),Ur(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&d_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,d=new c_({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:Lt(c)}),h=o(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const r=Vi.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $c){const n=$c[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Be()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<m0.length;r++){const s=m0[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=fF(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ri(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Tk(r)||Nk(r))?r=parseFloat(r):!uF(r)&&pn.test(n)&&(r=k_(t,n)),this.setBaseTarget(t,Ye(r)?r.get():r)),Ye(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Dm(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ye(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Sm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Om.render(this.render)}}class N_ extends mF{constructor(){super(...arguments),this.KeyframeResolver=W3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function I_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function gF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Hd(e){return e===void 0||e===1}function $h({scale:e,scaleX:t,scaleY:n}){return!Hd(e)||!Hd(t)||!Hd(n)}function ls(e){return $h(e)||A_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function A_(e){return g0(e.x)||g0(e.y)}function g0(e){return e&&e!=="0%"}function Vc(e,t,n){const r=e-n,s=t*r;return n+s}function y0(e,t,n,r,s){return s!==void 0&&(e=Vc(e,s,r)),Vc(e,n,r)+t}function Vh(e,t=0,n=1,r,s){e.min=y0(e.min,t,n,r,s),e.max=y0(e.max,t,n,r,s)}function M_(e,{x:t,y:n}){Vh(e.x,t.translate,t.scale,t.originPoint),Vh(e.y,n.translate,n.scale,n.originPoint)}const x0=.999999999999,v0=1.0000000000001;function xF(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(jn(e.x,-i.scroll.offset.x),jn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,M_(e,o)),r&&ls(i.latestValues)&&ql(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<v0&&t.x>x0&&(t.x=1),t.y<v0&&t.y>x0&&(t.y=1)}function jn(e,t){e.min+=t,e.max+=t}function w0(e,t,n,r,s=.5){const i=me(e.min,e.max,s);Vh(e,t,n,i,r)}function b0(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ql(e,t,n){const r=n??e;w0(e.x,b0(t.x,r.x),t.scaleX,t.scale,t.originX),w0(e.y,b0(t.y,r.y),t.scaleY,t.scale,t.originY)}function L_(e,t){return I_(yF(e.getBoundingClientRect(),t))}function vF(e,t,n){const r=L_(e,n),{scroll:s}=t;return s&&(jn(r.x,s.offset.x),jn(r.y,s.offset.y)),r}const wF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bF=$i.length;function kF(e,t,n){let r="",s=!0;for(let o=0;o<bF;o++){const a=$i[o],l=e[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||n){const c=Bh(l,zc[a]);if(!u){s=!1;const d=wF[a]||a;r+=`${d}(${c}) `}n&&(t[a]=c)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Bh(i,zc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Wm(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(Vi.has(l)){o=!0;continue}else if(Gk(l)){s[l]=u;continue}else{const c=Bh(u,zc[l]);l.startsWith("origin")?(a=!0,i[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=kF(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}function D_(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function k0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const po={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(K.test(e))e=parseFloat(e);else return e;const n=k0(e,t.target.x),r=k0(e,t.target.y);return`${n}% ${r}%`}},_F={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=pn.parse(e);if(s.length>5)return r;const i=pn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const u=me(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},Uh={borderRadius:{...po,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:po,borderTopRightRadius:po,borderBottomLeftRadius:po,borderBottomRightRadius:po,boxShadow:_F};function F_(e,{layout:t,layoutId:n}){return Vi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Uh[e]||e==="opacity")}function Hm(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(Ye(r[a])||s&&Ye(s[a])||F_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function SF(e){return window.getComputedStyle(e)}class CF extends N_{constructor(){super(...arguments),this.type="html",this.renderInstance=D_}readValueFromInstance(t,n){var r;if(Vi.has(n))return(r=this.projection)!=null&&r.isProjecting?Th(n):GD(t,n);{const s=SF(t),i=(Gk(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return L_(t,n)}build(t,n,r){Wm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Hm(t,n,r)}}const PF={offset:"stroke-dashoffset",array:"stroke-dasharray"},jF={offset:"strokeDashoffset",array:"strokeDasharray"};function EF(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?PF:jF;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const TF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function O_(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,u,c){if(Wm(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const p of TF)d[p]!==void 0&&(h[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),s!==void 0&&EF(d,s,i,o,!1)}const z_=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),B_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function RF(e,t,n,r){D_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(z_.has(s)?s:Fm(s),t.attrs[s])}function $_(e,t,n){const r=Hm(e,t,n);for(const s in e)if(Ye(e[s])||Ye(t[s])){const i=$i.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class NF extends N_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vi.has(n)){const r=b_(n);return r&&r.default||0}return n=z_.has(n)?n:Fm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return $_(t,n,r)}build(t,n,r){O_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){RF(t,n,r,s)}mount(t){this.isSVGTag=B_(t.tagName),super.mount(t)}}const IF=Vm.length;function V_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?V_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<IF;n++){const r=Vm[n],s=e.props[r];(ua(s)||s===!1)&&(t[r]=s)}return t}function U_(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const AF=[...$m].reverse(),MF=$m.length;function LF(e){return t=>Promise.all(t.map(({animation:n,options:r})=>A3(e,n,r)))}function DF(e){let t=LF(e),n=_0(),r=!0,s=!1;const i=u=>(c,d)=>{var p;const h=_s(e,d,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...w}=h;c={...c,...w,...y}}return c};function o(u){t=u(e)}function a(u){const{props:c}=e,d=V_(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let g=0;g<MF;g++){const x=AF[g],v=n[x],k=c[x]!==void 0?c[x]:d[x],S=ua(k),b=x===u?v.isActive:null;b===!1&&(y=g);let j=k===d[x]&&k!==c[x]&&S;if(j&&(r||s)&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...m},!v.isActive&&b===null||!k&&!v.prevProp||wu(k)||typeof k=="boolean")continue;if(x==="exit"&&v.isActive&&b!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const P=FF(v.prevProp,k);let T=P||x===u&&v.isActive&&!j&&S||g>y&&S,E=!1;const I=Array.isArray(k)?k:[k];let M=I.reduce(i(x),{});b===!1&&(M={});const{prevResolvedValues:O={}}=v,A={...O,...M},R=L=>{T=!0,p.has(L)&&(E=!0,p.delete(L)),v.needsAnimating[L]=!0;const $=e.getValue(L);$&&($.liveStyle=!1)};for(const L in A){const $=M[L],C=O[L];if(m.hasOwnProperty(L))continue;let V=!1;Lh($)&&Lh(C)?V=!U_($,C)||P:V=$!==C,V?$!=null?R(L):p.add(L):$!==void 0&&p.has(L)?R(L):v.protectedKeys[L]=!0}v.prevProp=k,v.prevResolvedValues=M,v.isActive&&(m={...m,...M}),(r||s)&&e.blockInitialAnimation&&(T=!1);const z=j&&P;T&&(!z||E)&&h.push(...I.map(L=>{const $={type:x};if(typeof L=="string"&&(r||s)&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,V=_s(C,L);if(C.enteringChildren&&V){const{delayChildren:q}=V.transition||{};$.delay=f_(C.enteringChildren,e,q)}}return{animation:L,options:$}}))}if(p.size){const g={};if(typeof c.initial!="boolean"){const x=_s(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(g.transition=x.transition)}p.forEach(x=>{const v=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),g[x]=v??null}),h.push({animation:g})}let w=!!h.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function l(u,c){var h;if(n[u].isActive===c)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,c)}),n[u].isActive=c;const d=a(u);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=_0(),s=!0}}}function FF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!U_(t,e):!1}function ts(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _0(){return{animate:ts(!0),whileInView:ts(),whileHover:ts(),whileTap:ts(),whileDrag:ts(),whileFocus:ts(),exit:ts()}}function Wh(e,t){e.min=t.min,e.max=t.max}function rn(e,t){Wh(e.x,t.x),Wh(e.y,t.y)}function S0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const W_=1e-4,OF=1-W_,zF=1+W_,H_=.01,BF=0-H_,$F=0+H_;function lt(e){return e.max-e.min}function VF(e,t,n){return Math.abs(e-t)<=n}function C0(e,t,n,r=.5){e.origin=r,e.originPoint=me(t.min,t.max,e.origin),e.scale=lt(n)/lt(t),e.translate=me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=OF&&e.scale<=zF||isNaN(e.scale))&&(e.scale=1),(e.translate>=BF&&e.translate<=$F||isNaN(e.translate))&&(e.translate=0)}function Oo(e,t,n,r){C0(e.x,t.x,n.x,r?r.originX:void 0),C0(e.y,t.y,n.y,r?r.originY:void 0)}function P0(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+lt(t)}function UF(e,t,n,r){P0(e.x,t.x,n.x,r==null?void 0:r.x),P0(e.y,t.y,n.y,r==null?void 0:r.y)}function j0(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+lt(t)}function Uc(e,t,n,r){j0(e.x,t.x,n.x,r==null?void 0:r.x),j0(e.y,t.y,n.y,r==null?void 0:r.y)}function E0(e,t,n,r,s){return e-=t,e=Vc(e,1/n,r),s!==void 0&&(e=Vc(e,1/s,r)),e}function WF(e,t=0,n=1,r=.5,s,i=e,o=e){if(An.test(t)&&(t=parseFloat(t),t=me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=me(i.min,i.max,r);e===i&&(a-=t),e.min=E0(e.min,t,n,a,s),e.max=E0(e.max,t,n,a,s)}function T0(e,t,[n,r,s],i,o){WF(e,t[n],t[r],t[s],t.scale,i,o)}const HF=["x","scaleX","originX"],GF=["y","scaleY","originY"];function R0(e,t,n,r){T0(e.x,t,HF,n?n.x:void 0,r?r.x:void 0),T0(e.y,t,GF,n?n.y:void 0,r?r.y:void 0)}function N0(e){return e.translate===0&&e.scale===1}function G_(e){return N0(e.x)&&N0(e.y)}function I0(e,t){return e.min===t.min&&e.max===t.max}function KF(e,t){return I0(e.x,t.x)&&I0(e.y,t.y)}function A0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function K_(e,t){return A0(e.x,t.x)&&A0(e.y,t.y)}function M0(e){return lt(e.x)/lt(e.y)}function L0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Cn(e){return[e("x"),e("y")]}function qF(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,pathRotation:d,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const q_=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],YF=q_.length,D0=e=>typeof e=="string"?parseFloat(e):e,F0=e=>typeof e=="number"||K.test(e);function QF(e,t,n,r,s,i){s?(e.opacity=me(0,n.opacity??1,XF(r)),e.opacityExit=me(t.opacity??1,0,JF(r))):i&&(e.opacity=me(t.opacity??1,n.opacity??1,r));for(let o=0;o<YF;o++){const a=q_[o];let l=O0(t,a),u=O0(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||F0(l)===F0(u)?(e[a]=Math.max(me(D0(l),D0(u),r),0),(An.test(u)||An.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=me(t.rotate||0,n.rotate||0,r))}function O0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const XF=Y_(0,.5,Bk),JF=Y_(.5,.95,Qt);function Y_(e,t,n){return r=>r<e?0:r>t?1:n(la(e,t,r))}function ZF(e,t,n){const r=Ye(e)?e:Ri(e);return r.start(Lm("",r,t,n)),r.animation}function da(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const eO=(e,t)=>e.depth-t.depth;class tO{constructor(){this.children=[],this.isDirty=!1}add(t){km(this.children,t),this.isDirty=!0}remove(t){Mc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(eO),this.isDirty=!1,this.children.forEach(t)}}function nO(e,t){const n=at.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ur(r),e(i-t))};return ge.setup(r,!0),()=>Ur(r)}function Yl(e){return Ye(e)?e.get():e}class rO{constructor(){this.members=[]}add(t){km(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Mc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Mc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Ql={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Gd=["","X","Y","Z"],sO=1e3;let iO=0;function Kd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Q_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=y_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Q_(r)}function X_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=iO++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(lO),this.nodes.forEach(pO),this.nodes.forEach(mO),this.nodes.forEach(cO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new tO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Sm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Bm(o)&&!lF(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let c,d=0;const h=()=>this.root.updateBlockedByResize=!1;ge.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,c&&c(),c=nO(h,250),Ql.hasAnimatedSinceResize&&(Ql.hasAnimatedSinceResize=!1,this.nodes.forEach($0)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||wO,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=u.getProps(),g=!this.targetLayout||!K_(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Mm(m,"layout"),onPlay:y,onComplete:w};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,x,v.path)}else d||$0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ur(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(gO),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Q_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(dO),this.nodes.forEach(z0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(B0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fO),this.nodes.forEach(hO),this.nodes.forEach(oO),this.nodes.forEach(aO)):this.nodes.forEach(B0),this.clearAllSnapshots();const a=at.now();qe.delta=Ln(0,1e3/60,a-qe.timestamp),qe.timestamp=a,qe.isProcessing=!0,Od.update.process(qe),Od.preRender.process(qe),Od.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Om.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uO),this.sharedNodes.forEach(yO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lt(this.snapshot.measuredBox.x)&&!lt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Be()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!G_(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||ls(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),bO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Be();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(kO))){const{scroll:c}=this.root;c&&(jn(a.x,c.offset.x),jn(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(rn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:h}=c;c!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&rn(a,o),jn(a.x,d.offset.x),jn(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l){var c,d;const u=l||Be();rn(u,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(jn(u.x,-p.scroll.offset.x),jn(u.y,-p.scroll.offset.y)),ls(p.latestValues)&&ql(u,p.latestValues,(c=p.layout)==null?void 0:c.layoutBox)}return ls(this.latestValues)&&ql(u,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),u}removeTransform(o){var l;const a=Be();rn(a,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!ls(c.latestValues))continue;let d;c.instance&&($h(c.latestValues)&&c.updateSnapshot(),d=Be(),rn(d,c.measurePageBox())),R0(a,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,d)}return ls(this.latestValues)&&R0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:d}=this.options;if(!this.layout||!(c||d))return;this.resolvedRelativeTargetAt=qe.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Be(),this.targetWithTransforms=Be()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),UF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):rn(this.target,this.layout.layoutBox),M_(this.target,this.targetDelta)):rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||$h(this.parent.latestValues)||A_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Be(),this.relativeTargetOrigin=Be(),Uc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),rn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;rn(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;xF(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Be());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(S0(this.prevProjectionDelta.x,this.projectionDelta.x),S0(this.prevProjectionDelta.y,this.projectionDelta.y)),Oo(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!L0(this.projectionDelta.x,this.prevProjectionDelta.x)||!L0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ai(),this.projectionDelta=ai(),this.projectionDeltaWithTransform=ai()}setAnimationOrigin(o,a=!1,l){const u=this.snapshot,c=u?u.latestValues:{},d={...this.latestValues},h=ai();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Be(),m=u?u.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,g=this.getStack(),x=!g||g.members.length<=1,v=!!(w&&!x&&this.options.crossfade===!0&&!this.path.some(vO));this.animationProgress=0;let k;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=b=>{const j=b/1e3,P=S==null?void 0:S(j);P?(h.x.translate=P.x,h.x.scale=me(o.x.scale,1,j),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=P.y,h.y.scale=me(o.y.scale,1,j),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(V0(h.x,o.x,j),V0(h.y,o.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Uc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),xO(this.relativeTarget,this.relativeTargetOrigin,p,j),k&&KF(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Be()),rn(k,this.relativeTarget)),w&&(this.animationValues=d,QF(d,c,this.latestValues,j,v,x)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Ur(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Ql.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ri(0)),this.motionValue.jump(0,!1),this.currentAnimation=ZF(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(sO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&J_(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Be();const d=lt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=lt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}rn(a,l),ql(a,c),Oo(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new rO),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Kd("z",o,u,this.animationValues);for(let c=0;c<Gd.length;c++)Kd(`rotate${Gd[c]}`,o,u,this.animationValues),Kd(`skew${Gd[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Yl(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Yl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ls(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=qF(this.projectionDeltaWithTransform,this.treeScale,c);l&&(d=l(c,d)),o.transform=d;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in Uh){if(c[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:g}=Uh[m],x=d==="none"?c[m]:y(c[m],u);if(w){const v=w.length;for(let k=0;k<v;k++)o[w[k]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=u===this?Yl(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(z0),this.root.sharedNodes.clear()}}}function oO(e){e.updateLayout()}function aO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")Cn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=lt(h);h.min=r[d].min,h.max=h.min+p});else if(i==="x"||i==="y"){const d=i==="x"?"y":"x";Wh(o?t.measuredBox[d]:t.layoutBox[d],r[d])}else J_(i,t.layoutBox,r)&&Cn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=lt(r[d]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=ai();Oo(a,r,t.layoutBox);const l=ai();o?Oo(l,e.applyTransform(s,!0),t.measuredBox):Oo(l,r,t.layoutBox);const u=!G_(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const m=e.options.layoutAnchor||void 0,y=Be();Uc(y,t.layoutBox,h.layoutBox,m);const w=Be();Uc(w,r,p.layoutBox,m),K_(y,w)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function lO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function cO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uO(e){e.clearSnapshot()}function z0(e){e.clearMeasurements()}function dO(e){e.isLayoutDirty=!0,e.updateLayout()}function B0(e){e.isLayoutDirty=!1}function fO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function hO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pO(e){e.resolveTargetDelta()}function mO(e){e.calcProjection()}function gO(e){e.resetSkewAndRotation()}function yO(e){e.removeLeadSnapshot()}function V0(e,t,n){e.translate=me(t.translate,0,n),e.scale=me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function U0(e,t,n,r){e.min=me(t.min,n.min,r),e.max=me(t.max,n.max,r)}function xO(e,t,n,r){U0(e.x,t.x,n.x,r),U0(e.y,t.y,n.y,r)}function vO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wO={duration:.45,ease:[.4,0,.1,1]},W0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),H0=W0("applewebkit/")&&!W0("chrome/")?Math.round:Qt;function G0(e){e.min=H0(e.min),e.max=H0(e.max)}function bO(e){G0(e.x),G0(e.y)}function J_(e,t,n){return e==="position"||e==="preserve-aspect"&&!VF(M0(t),M0(n),.2)}function kO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const _O=X_({attachResizeListener:(e,t)=>da(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),qd={current:void 0},Z_=X_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qd.current){const e=new _O({});e.mount(window),e.setOptions({layoutScroll:!0}),qd.current=e}return qd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Gm=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function K0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function SO(...e){return t=>{let n=!1;const r=e.map(s=>{const i=K0(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():K0(e[s],null)}}}}function CO(...e){return _.useCallback(SO(...e),e)}class PO extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Wl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Wl(r)&&r.offsetWidth||0,i=Wl(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function jO({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=_.useId(),a=_.useRef(null),l=_.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=_.useContext(Gm),c=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=CO(a,c);return _.useInsertionEffect(()=>{const{width:p,height:m,top:y,left:w,right:g,bottom:x,direction:v}=l.current;if(t||i===!1||!a.current||!p||!m)return;const k=v==="rtl",S=n==="left"?k?`right: ${g}`:`left: ${w}`:k?`left: ${w}`:`right: ${g}`,b=r==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const j=document.createElement("style");u&&(j.nonce=u);const P=s??document.head;return P.appendChild(j),j.sheet&&j.sheet.insertRule(`
71
- [data-motion-pop-id="${o}"] {
72
- position: absolute !important;
73
- width: ${p}px !important;
74
- height: ${m}px !important;
75
- ${S}px !important;
76
- ${b}px !important;
77
- }
78
- `),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),P.contains(j)&&P.removeChild(j)}},[t]),f.jsx(PO,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:_.cloneElement(e,{ref:d})})}const EO=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:u})=>{const c=bm(TO),d=_.useId();let h=!0,p=_.useMemo(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{c.set(m,!0);for(const y of c.values())if(!y)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return i&&h&&(p={...p}),_.useMemo(()=>{c.forEach((m,y)=>c.set(y,!1))},[n]),_.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=f.jsx(jO,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:e}),f.jsx(xu.Provider,{value:p,children:e})};function TO(){return new Map}function eS(e=!0){const t=_.useContext(xu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=_.useId();_.useEffect(()=>{if(e)return s(i)},[e]);const o=_.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const dl=e=>e.key||"";function q0(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const tS=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,d]=eS(o),h=_.useMemo(()=>q0(e),[e]),p=o&&!c?[]:h.map(dl),m=_.useRef(!0),y=_.useRef(h),w=bm(()=>new Map),g=_.useRef(new Set),[x,v]=_.useState(h),[k,S]=_.useState(h);Ek(()=>{m.current=!1,y.current=h;for(let P=0;P<k.length;P++){const T=dl(k[P]);p.includes(T)?(w.delete(T),g.current.delete(T)):w.get(T)!==!0&&w.set(T,!1)}},[k,p.length,p.join("-")]);const b=[];if(h!==x){let P=[...h];for(let T=0;T<k.length;T++){const E=k[T],I=dl(E);p.includes(I)||(P.splice(T,0,E),b.push(E))}return i==="wait"&&b.length&&(P=b),S(q0(P)),v(h),null}const{forceRender:j}=_.useContext(wm);return f.jsx(f.Fragment,{children:k.map(P=>{const T=dl(P),E=o&&!c?!1:h===k||p.includes(T),I=()=>{if(g.current.has(T))return;if(w.has(T))g.current.add(T),w.set(T,!0);else return;let M=!0;w.forEach(O=>{O||(M=!1)}),M&&(j==null||j(),S(y.current),o&&(d==null||d()),r&&r())};return f.jsx(EO,{isPresent:E,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:E?void 0:I,anchorX:a,anchorY:l,children:P},T)})})},nS=_.createContext({strict:!1}),Y0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Q0=!1;function RO(){if(Q0)return;const e={};for(const t in Y0)e[t]={isEnabled:n=>Y0[t].some(r=>!!n[r])};R_(e),Q0=!0}function rS(){return RO(),pF()}function NO(e){const t=rS();for(const n in e)t[n]={...t[n],...e[n]};R_(t)}const IO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Wc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||IO.has(e)}let sS=e=>!Wc(e);function AO(e){typeof e=="function"&&(sS=t=>t.startsWith("on")?!Wc(t):e(t))}try{AO(require("@emotion/is-prop-valid").default)}catch{}function MO(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ye(e[s])||(sS(s)||n===!0&&Wc(s)||!t&&!Wc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const ku=_.createContext({});function LO(e,t){if(bu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ua(n)?n:void 0,animate:ua(r)?r:void 0}}return e.inherit!==!1?t:{}}function DO(e){const{initial:t,animate:n}=LO(e,_.useContext(ku));return _.useMemo(()=>({initial:t,animate:n}),[X0(t),X0(n)])}function X0(e){return Array.isArray(e)?e.join(" "):e}const Km=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function iS(e,t,n){for(const r in t)!Ye(t[r])&&!F_(r,n)&&(e[r]=t[r])}function FO({transformTemplate:e},t){return _.useMemo(()=>{const n=Km();return Wm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function OO(e,t){const n=e.style||{},r={};return iS(r,n,e),Object.assign(r,FO(e,t)),r}function zO(e,t){const n={},r=OO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const oS=()=>({...Km(),attrs:{}});function BO(e,t,n,r){const s=_.useMemo(()=>{const i=oS();return O_(i,t,B_(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};iS(i,e.style,e),s.style={...i,...s.style}}return s}const $O=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qm(e){return typeof e!="string"||e.includes("-")?!1:!!($O.indexOf(e)>-1||/[A-Z]/u.test(e))}function VO(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??qm(e)?BO:zO)(t,r,s,e),u=MO(t,typeof e=="string",i),c=e!==_.Fragment?{...u,...l,ref:n}:{},{children:d}=t,h=_.useMemo(()=>Ye(d)?d.get():d,[d]);return _.createElement(e,{...c,children:h})}function UO({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:WO(n,r,s,e),renderState:t()}}function WO(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Yl(i[h]);let{initial:o,animate:a}=e;const l=bu(e),u=E_(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!wu(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const m=Dm(e,h[p]);if(m){const{transitionEnd:y,transition:w,...g}=m;for(const x in g){let v=g[x];if(Array.isArray(v)){const k=c?v.length-1:0;v=v[k]}v!==null&&(s[x]=v)}for(const x in y)s[x]=y[x]}}}return s}const aS=e=>(t,n)=>{const r=_.useContext(ku),s=_.useContext(xu),i=()=>UO(e,t,r,s);return n?i():bm(i)},HO=aS({scrapeMotionValuesFromProps:Hm,createRenderState:Km}),GO=aS({scrapeMotionValuesFromProps:$_,createRenderState:oS}),KO=Symbol.for("motionComponentSymbol");function qO(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const lS=_.createContext({});function Hs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function YO(e,t,n,r,s,i){var v,k;const{visualElement:o}=_.useContext(ku),a=_.useContext(nS),l=_.useContext(xu),u=_.useContext(Gm),c=u.reducedMotion,d=u.skipAnimations,h=_.useRef(null),p=_.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:d,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,y=_.useContext(lS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&QO(h.current,n,s,y);const w=_.useRef(!1);_.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const g=n[g_],x=_.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,g)));return Ek(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function QO(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:cS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Hs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function cS(e){if(e)return e.options.allowProjection!==!1?e.projection:cS(e.parent)}function Yd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&NO(r);const i=n?n==="svg":qm(e),o=i?GO:HO;function a(u,c){let d;const h={..._.useContext(Gm),...u,layoutId:XO(u)},{isStatic:p}=h,m=DO(u),y=o(u,p);if(!p&&typeof window<"u"){JO();const w=ZO(h);d=w.MeasureLayout,m.visualElement=YO(e,y,h,s,w.ProjectionNode,i)}return f.jsxs(ku.Provider,{value:m,children:[d&&m.visualElement?f.jsx(d,{visualElement:m.visualElement,...h}):null,VO(e,u,qO(y,m.visualElement,c),y,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=_.forwardRef(a);return l[KO]=e,l}function XO({layoutId:e}){const t=_.useContext(wm).id;return t&&e!==void 0?t+"-"+e:e}function JO(e,t){_.useContext(nS).strict}function ZO(e){const t=rS(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function ez(e,t){if(typeof Proxy>"u")return Yd;const n=new Map,r=(i,o)=>Yd(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Yd(o,void 0,e,t)),n.get(o))})}const tz=(e,t)=>t.isSVG??qm(e)?new NF(t):new CF(t,{allowProjection:e!==_.Fragment});class nz extends Xr{constructor(t){super(t),t.animationState||(t.animationState=DF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let rz=0;class sz extends Xr{constructor(){super(...arguments),this.id=rz++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=_s(this.node,o,a);if(l){const{transition:u,transitionEnd:c,...d}=l;for(const h in d)(i=this.node.getValue(h))==null||i.jump(d[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const iz={animation:{Feature:nz},exit:{Feature:sz}};function _a(e){return{point:{x:e.pageX,y:e.pageY}}}const oz=e=>t=>zm(t)&&e(t,_a(t));function zo(e,t,n,r){return da(e,t,oz(n),r)}const uS=({current:e})=>e?e.ownerDocument.defaultView:null,J0=(e,t)=>Math.abs(e-t);function az(e,t){const n=J0(e.x,t.x),r=J0(e.y,t.y);return Math.sqrt(n**2+r**2)}const Z0=new Set(["auto","scroll"]);class dS{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=fl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Qd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=az(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:w}=p,{timestamp:g}=qe;this.history.push({...w,timestamp:g});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=fl(m,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:w,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Qd(p.type==="pointercancel"?this.lastMoveEventInfo:fl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,x),w&&w(p,x)},!zm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=_a(t),u=fl(l,this.transformPagePoint),{point:c}=u,{timestamp:d}=qe;this.history=[{...c,timestamp:d}];const{onSessionStart:h}=n;h&&h(t,Qd(u,this.history)),this.removeListeners=wa(zo(this.contextWindow,"pointermove",this.handlePointerMove),zo(this.contextWindow,"pointerup",this.handlePointerUp),zo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Z0.has(r.overflowX)||Z0.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ge.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ur(this.updatePoint)}}function fl(e,t){return t?{point:t(e.point)}:e}function ev(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qd({point:e},t){return{point:e,delta:ev(e,fS(t)),offset:ev(e,lz(t)),velocity:cz(t,.1)}}function lz(e){return e[0]}function fS(e){return e[e.length-1]}function cz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=fS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Lt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Lt(t)*2&&(r=e[1]);const i=qt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function uz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?me(n,e,r.max):Math.min(e,n)),e}function tv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function dz(e,{top:t,left:n,bottom:r,right:s}){return{x:tv(e.x,n,s),y:tv(e.y,t,r)}}function nv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function fz(e,t){return{x:nv(e.x,t.x),y:nv(e.y,t.y)}}function hz(e,t){let n=.5;const r=lt(e),s=lt(t);return s>r?n=la(t.min,t.max-r,e.min):r>s&&(n=la(e.min,e.max-s,t.min)),Ln(0,1,n)}function pz(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Hh=.35;function mz(e=Hh){return e===!1?e=0:e===!0&&(e=Hh),{x:rv(e,"left","right"),y:rv(e,"top","bottom")}}function rv(e,t,n){return{min:sv(e,t),max:sv(e,n)}}function sv(e,t){return typeof e=="number"?e:e[t]||0}const gz=new WeakMap;class yz{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{n&&this.snapToCursor(_a(d).point),this.stopAnimation()},o=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=H3(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Cn(g=>{let x=this.getAxisMotionValue(g).get()||0;if(An.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const k=v.layout.layoutBox[g];k&&(x=lt(k)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&ge.update(()=>y(d,h),!1,!0),Dh(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:g}=h;if(m&&this.currentDirection===null){this.currentDirection=vz(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,g),this.updateAxis("y",h.point,g),this.visualElement.render(),w&&ge.update(()=>w(d,h),!1,!0)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new dS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:uS(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ge.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!hl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=uz(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Hs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=dz(r.layoutBox,t):this.constraints=!1,this.elastic=mz(n),s!==this.constraints&&!Hs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Cn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=pz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=vF(r,s.root,this.visualElement.getTransformPagePoint());let o=fz(s.layout.layoutBox,i);if(n){const a=n(gF(o));this.hasMutatedConstraints=!!a,a&&(o=I_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Cn(c=>{if(!hl(c,n,this.currentDirection))return;let d=l&&l[c]||{};(o===!0||o===c)&&(d={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Dh(this.visualElement,t),r.start(Lm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Cn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Cn(n=>{const{drag:r}=this.getProps();if(!hl(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-me(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Hs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Cn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=hz({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Cn(o=>{if(!hl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(me(l,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gz.set(this.visualElement,this);const t=this.visualElement.current,n=zo(t,"pointerdown",u=>{const{drag:c,dragListener:d=!0}=this.getProps(),h=u.target,p=h!==t&&X3(h);c&&d&&!p&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();Hs(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=xz(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ge.read(s);const a=da(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Cn(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=u[d].translate,h.set(h.get()+u[d].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Hh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function iv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function xz(e,t,n){const r=f0(e,iv(n)),s=f0(t,iv(n));return()=>{r(),s()}}function hl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function vz(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wz extends Xr{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new yz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xd=e=>(t,n)=>{e&&ge.update(()=>e(t,n),!1,!0)};class bz extends Xr{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new dS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Xd(t),onStart:Xd(n),onMove:Xd(r),onEnd:(i,o)=>{delete this.session,s&&ge.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=zo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Jd=!1;class kz extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Jd&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ql.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Jd=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ge.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Om.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Jd=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function hS(e){const[t,n]=eS(),r=_.useContext(wm);return f.jsx(kz,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(lS),isPresent:t,safeToRemove:n})}const _z={pan:{Feature:bz},drag:{Feature:wz,ProjectionNode:Z_,MeasureLayout:hS}};function ov(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ge.postRender(()=>i(t,_a(t)))}class Sz extends Xr{mount(){const{current:t}=this.node;t&&(this.unmount=K3(t,(n,r)=>(ov(this.node,r,"Start"),s=>ov(this.node,s,"End"))))}unmount(){}}class Cz extends Xr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wa(da(this.node.current,"focus",()=>this.onFocus()),da(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function av(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ge.postRender(()=>i(t,_a(t)))}class Pz extends Xr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Z3(t,(s,i)=>(av(this.node,i,"Start"),(o,{success:a})=>av(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Gh=new WeakMap,Zd=new WeakMap,jz=e=>{const t=Gh.get(e.target);t&&t(e)},Ez=e=>{e.forEach(jz)};function Tz({root:e,...t}){const n=e||document;Zd.has(n)||Zd.set(n,{});const r=Zd.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Ez,{root:e,...t})),r[s]}function Rz(e,t,n){const r=Tz(t);return Gh.set(e,n),r.observe(e),()=>{Gh.delete(e),r.unobserve(e)}}const Nz={some:0,all:1};class Iz extends Xr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Nz[s]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=c?d:h;p&&p(u)};this.stopObserver=Rz(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Az(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Az({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Mz={inView:{Feature:Iz},tap:{Feature:Pz},focus:{Feature:Cz},hover:{Feature:Sz}},Lz={layout:{ProjectionNode:Z_,MeasureLayout:hS}},Dz={...iz,...Mz,..._z,...Lz},Ni=ez(Dz,tz);function _u(){!Um.current&&T_();const[e]=_.useState(Bc.current);return e}function Su(e,t){const n=_.useRef(t);n.current=t,_.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const ef={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},X={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function tt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const Fz={4:"1rem"};function Y(...e){return _L(HM(e))}const Oz={height:32,lineHeight:"32px",padding:"0 16px"},zz={white:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.97 0 0 0 0 0.96 0 0 0 0 0.95 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='1'/%3E%3C/svg%3E")`,paper:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E")`,speckle:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='speckle'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23speckle)' opacity='0.14'/%3E%3C/svg%3E")`,parchment:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='par'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.35 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23par)' opacity='1'/%3E%3C/svg%3E")`,canvas:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cv'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.62 0 0 0 0 0.60 0 0 0 0 0.52 0 0 0 0.42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cv)' opacity='1'/%3E%3C/svg%3E")`,kraft:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.50 0 0 0 0 0.35 0 0 0 0 0.20 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)' opacity='1'/%3E%3C/svg%3E")`,chalkboard:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.28 0 0 0 0 0.20 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='1'/%3E%3C/svg%3E")`},Bz={white:X.bgBase,paper:X.bgSurface,speckle:X.bgSurface,parchment:X.bgElevated,canvas:X.canvasBase,kraft:X.canvas300,chalkboard:X.chalkboardBg},lv={white:X.bgElevated,paper:X.bgElevated,speckle:X.bgElevated,parchment:X.canvasBase,canvas:X.canvas300,kraft:X.canvasDark,chalkboard:X.chalkboardBg},$z={base:X.bgBase,surface:X.bgSurface,elevated:X.bgElevated,canvas:X.canvasBase,canvasDark:X.canvasDark,blue:X.washBlue,green:X.washGreen,amber:X.washAmber,rose:X.washRose,slate:X.washSlate},Vz={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function pS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=zz[n],o=t.fill?$z[t.fill]:t.shade?lv[n]:Bz[n],a=Vz[s],l={"--pui-texture-shade":lv[n],"--pui-texture-image":i};return r==="none"?{...l,backgroundColor:o,backgroundImage:i,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat, repeat",backgroundSize:"200px 200px, 100% 32px, 32px 32px"}}function Sa(e){return pS(e)}function Ui(e,t="paper"){if(e!==!1)return Sa(e===!0?t:e)}function Uz(e){const t=Pu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let u=0;u<r;u++){const c=u/r*Math.PI*2+(t()-.5)*.15*n,d=o+(t()-.5)*a*2;l.push({x:s+Math.cos(c)*d,y:i+Math.sin(c)*d})}return Cu(l)}function Wz(e,t){const n=Pu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,u=[];for(let c=0;c<s;c++){const d=c/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;u.push({x:i+Math.cos(d)*h,y:o+Math.sin(d)*h})}return Cu(u)}function Hz(e){const t=Pu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let u=0;u<r;u++){const c=(u+.5)/r,d=l.ax+(l.bx-l.ax)*c,h=l.ay+(l.by-l.ay)*c,p=l.bx-l.ax,m=l.by-l.ay,y=Math.sqrt(p*p+m*m)||1,w=-m/y,g=p/y,x=(t()-.5)*i*2;o.push({x:d+w*x,y:h+g*x})}return Cu(o)}function Gz(e,t){const n=Pu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const u of l)for(let c=0;c<s;c++){const d=(c+.5)/s,h=u.ax+(u.bx-u.ax)*d,p=u.ay+(u.by-u.ay)*d,m=u.bx-u.ax,y=u.by-u.ay,w=Math.sqrt(m*m+y*y)||1,g=-y/w,x=m/w,v=(n()-.5)*o*2;a.push({x:h+g*v,y:p+x*v})}return Cu(a)}function Cu(e){const t=e.length;if(t<3)return"";let n=`M ${ur(e[0].x)} ${ur(e[0].y)}`;for(let r=0;r<t;r++){const s=e[(r-1+t)%t],i=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=i.x+(o.x-s.x)/6,u=i.y+(o.y-s.y)/6,c=o.x-(a.x-i.x)/6,d=o.y-(a.y-i.y)/6;n+=` C ${ur(l)} ${ur(u)}, ${ur(c)} ${ur(d)}, ${ur(o.x)} ${ur(o.y)}`}return n+=" Z",n}function ur(e){return e.toFixed(2)}function Pu(e){let t=typeof e=="string"?Kz(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function Kz(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)||1}function ju(){const e=_.useId();return _.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function Wi(e){const t=ju();return _.useMemo(()=>({blob:Uz({seed:t,wobble:e}),ring:Wz(t,e)}),[t,e])}const qz="button-module__button___Z331g",Yz="button-module__blobBg___QQFzf",Qz="button-module__blobFill___XwLjV",Xz="button-module__blobRing___567UW",Jz="button-module__isActive___FXNSJ",Zz="button-module__primary___ppbyq",eB="button-module__secondary___esy5L",tB="button-module__ghost___NisA0",nB="button-module__danger___Wnvuq",rB="button-module__chalkboard___d3Nqb",sB="button-module__small___u7y8a",iB="button-module__medium___HBIAj",oB="button-module__large___RPzNy",aB="button-module__fullWidth___H0P0F",lB="button-module__iconLeft___s60SZ",cB="button-module__iconRight___75eFu",uB="button-module__label___pXAyM",$t={button:qz,blobBg:Yz,blobFill:Qz,blobRing:Xz,isActive:Jz,primary:Zz,secondary:eB,ghost:tB,danger:nB,chalkboard:rB,small:sB,medium:iB,large:oB,fullWidth:aB,iconLeft:lB,iconRight:cB,label:uB},ne=_.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:u,...c},d){const h=Wi(o);return f.jsxs("button",{ref:d,type:"button",className:Y($t.button,$t[e],$t[n],t==="chalkboard"&&$t.chalkboard,a&&$t.isActive,i&&$t.fullWidth,u),...c,children:[f.jsxs("svg",{className:$t.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:h.blob,className:$t.blobFill}),f.jsx("path",{d:h.ring,className:$t.blobRing})]}),r&&f.jsx("span",{className:$t.iconLeft,children:r}),f.jsx("span",{className:$t.label,children:l}),s&&f.jsx("span",{className:$t.iconRight,children:s})]})});function Ym(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Fe=BL.generator(),dB="sketch-border-module__svg___whV4x",fB="sketch-border-module__behind___lgdYV",hB="sketch-border-module__stroke___vAm-v",pB="sketch-border-module__fill___zlpd6",pl={svg:dB,behind:fB,stroke:hB,fill:pB},mB=1.2,gB=.7;function _t({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:u=!0,strokeInset:c=!0,className:d}){const[h]=_.useState(Math.random),p=_.useRef(null),[m,y]=_.useState(null);_.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(!v)return;const k=new ResizeObserver(()=>{const S=v.offsetWidth,b=v.offsetHeight;y(j=>j&&j.width===S&&j.height===b?j:{width:S,height:b})});return k.observe(v),()=>k.disconnect()},[]);const{parts:w,clipPath:g}=_.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),v=x,k=x*2654435761%2147483647,S=T=>Fe.toPaths(Fe.path(T,{seed:v,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(E=>!E.fill||E.fill==="none").map(E=>({d:E.d,filled:!1}));if(l){const T={seed:v,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},E=M=>Fe.toPaths(M).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const M=ml(e,m,i,t,ns(k),n*1.1),O=c?cv(s,n):0,A=O?ml(e,m,i+O,t,ns(k),n*1.1):M;return{parts:E(Fe.path(A,{...T,preserveVertices:!0})),clipPath:M}}const I=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):Fe.path(tf(m,i,t,ns(v)),{...T,preserveVertices:!0});return{parts:E(I),clipPath:null}}if(a){if(u){const M=tf(m,i,t,ns(k)),O=Fe.toPaths(Fe.path(M,{seed:v,roughness:mB,bowing:gB,preserveVertices:!0,strokeWidth:s})).filter(A=>!A.fill||A.fill==="none").map(A=>({d:A.d,filled:!1}));return{parts:O.length?O:[{d:M,filled:!1}],clipPath:M}}const T=ml(e,m,i,t,ns(k),n*1.1),E=c?cv(s,n):0,I=E?ml(e,m,i+E,t,ns(k),n*1.1):T;return{parts:S(I),clipPath:T}}const b=(T,E)=>{const I=E?{fill:"#000",fillStyle:"solid"}:{},M=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...I}):Fe.path(tf(m,i,t,ns(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...I});return Fe.toPaths(M)},j=o?b(k,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],P=b(v,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...j,...P],clipPath:null}},[m,h,a,l,u,e,t,n,r,s,i,o,c]);return _.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(v)return g?v.style.setProperty("--sketch-clip",`path("${g}")`):v.style.removeProperty("--sketch-clip"),()=>{v.style.removeProperty("--sketch-clip")}},[g]),f.jsx("svg",{ref:p,className:Y(pl.svg,o&&pl.behind,d),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:w==null?void 0:w.map((x,v)=>x.filled?f.jsx("path",{className:pl.fill,d:x.d},`f-${v}`):f.jsx("path",{className:pl.stroke,d:x.d,strokeWidth:s},`s-${v}`))})}function cv(e,t){return e/2+t*1.5}function ns(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function ml(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,u=t.height/2,c=()=>(s()-.5)*i*2,d=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;d.push({x:l+Math.cos(p)*o/2+c(),y:u+Math.sin(p)*a/2+c()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,y=(x,v,k)=>{for(const S of[0,45,90]){const b=(k+S)*Math.PI/180;d.push({x:x+Math.cos(b)*h+c(),y:v+Math.sin(b)*h+c()})}},w=(x,v,k,S)=>{const b=Math.hypot(k-x,S-v),j=Math.min(12,Math.max(1,Math.round(b/160)));for(let P=1;P<=j;P++){const T=P/(j+1);d.push({x:x+(k-x)*T+c(),y:v+(S-v)*T+c()})}};y(p+h,m+h,180),w(p+h,m,p+o-h,m),y(p+o-h,m+h,270),w(p+o,m+h,p+o,m+a-h),y(p+o-h,m+a-h,0),w(p+o-h,m+a,p+h,m+a),y(p+h,m+a-h,90),w(p,m+a-h,p,m+h);const g=3;return uv([...d.slice(g),...d.slice(0,g)])}return uv(d)}function uv(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],u=n(i,o),c=n(o,a),d=n(a,l),h=a.x-o.x+c*((o.x-i.x)/u-(a.x-i.x)/(u+c)),p=a.y-o.y+c*((o.y-i.y)/u-(a.y-i.y)/(u+c)),m=a.x-o.x+c*((l.x-a.x)/d-(l.x-o.x)/(c+d)),y=a.y-o.y+c*((l.y-a.y)/d-(l.y-o.y)/(c+d)),w=o.x+h/3,g=o.y+p/3,x=a.x-m/3,v=a.y-y/3;r+=` C ${w.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function tf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return yB(t,t,e.width-t*2,e.height-t*2,s)}function yB(e,t,n,r,s){const i=c=>Math.min(c,n/2,r/2),[o,a,l,u]=s.map(i);return[`M ${ye(e+o)} ${ye(t)}`,`L ${ye(e+n-a)} ${ye(t)}`,`Q ${ye(e+n)} ${ye(t)} ${ye(e+n)} ${ye(t+a)}`,`L ${ye(e+n)} ${ye(t+r-l)}`,`Q ${ye(e+n)} ${ye(t+r)} ${ye(e+n-l)} ${ye(t+r)}`,`L ${ye(e+u)} ${ye(t+r)}`,`Q ${ye(e)} ${ye(t+r)} ${ye(e)} ${ye(t+r-u)}`,`L ${ye(e)} ${ye(t+o)}`,`Q ${ye(e)} ${ye(t)} ${ye(e+o)} ${ye(t)}`,"Z"].join(" ")}function ye(e){return e.toFixed(2)}const St={surface:{radius:12,inset:2.5,roughness:.2,bowing:0,strokeWidth:1.3},field:{radius:8,inset:2,roughness:1.1,strokeWidth:1.3},control:{radius:6,inset:2,roughness:.5,bowing:.6,strokeWidth:1.4},pill:{radius:999,inset:2,roughness:.7,strokeWidth:1}},xB="page-module__page___-uHnG",vB="page-module__outlined___Wwtyg",wB="page-module__surface___sWfI6",bB="page-module__flat___HlOaY",kB="page-module__withAccent___lsv-m",_B="page-module__accentBlue___XxbMV",SB="page-module__accentGreen___Ne6Q8",CB="page-module__accentAmber___kLAwa",PB="page-module__accentRose___O9ZbZ",jB="page-module__accentSlate___xCB66",Gs={page:xB,outlined:vB,surface:wB,flat:bB,withAccent:kB,accentBlue:_B,accentGreen:SB,accentAmber:CB,accentRose:PB,accentSlate:jB},EB=Ym(Gs),TB={all:14,top:14,none:2};function mS({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const u=Ui(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return f.jsxs("div",{className:Y(Gs.page,a&&Gs.outlined,s&&Gs.withAccent,s&&EB[i],!l&&Gs.flat,t),style:n,children:[f.jsx(_t,{clip:!0,...St.surface,radius:TB[o],straight:!l}),f.jsx("div",{className:Gs.surface,style:u,children:e})]})}const RB="layout-module__layout___O1aWi",NB="layout-module__header___I-kxe",IB="layout-module__headerLeft___JChJQ",AB="layout-module__headerTitles___aqSUG",MB="layout-module__headerTitle___wvr39",LB="layout-module__headerSubtitle___6f5BD",DB="layout-module__headerActions___adC12",FB="layout-module__mobileToggle___4WpVG",OB="layout-module__body___tywNf",zB="layout-module__mobileOverlay___tzbBC",BB="layout-module__sidebar___8VKGq",$B="layout-module__sidebarOpen___47rtr",VB="layout-module__sidebarInner___tq2X6",UB="layout-module__logoArea___RLnC0",WB="layout-module__logoText___pAmfV",HB="layout-module__nav___FxcrZ",GB="layout-module__main___9z7bu",KB="layout-module__navIslandFixed___H4TwP",qB="layout-module__content___jL-VB",YB="layout-module__contentWithPage___vVdfN",QB="layout-module__footer___LyakU",XB="layout-module__footerText___8BYxc",Te={layout:RB,header:NB,headerLeft:IB,headerTitles:AB,headerTitle:MB,headerSubtitle:LB,headerActions:DB,mobileToggle:FB,body:OB,mobileOverlay:zB,sidebar:BB,sidebarOpen:$B,sidebarInner:VB,logoArea:UB,logoText:WB,nav:HB,main:GB,navIslandFixed:KB,content:qB,contentWithPage:YB,footer:QB,footerText:XB};function JB(e){return!e||e==="plain"?{backgroundColor:"var(--pui-bg-base)"}:typeof e=="object"&&"image"in e?{backgroundImage:`url(${e.image})`,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:Sa(e)}function ZB({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:u,headerTexture:c,navigationItems:d=[],activeItemId:h,onNavigate:p,logo:m,footerContent:y,navigationIsland:w,style:g,bleedBottom:x=!0,routeKey:v,stackOpen:k}){const[S,b]=_.useState(!1),j=_u();Su(S,()=>b(!1));const P=JB(i),T=r&&d.length>0,E=u!==void 0||c!==void 0?{...c!==void 0?Sa(c):{},...u!==void 0?{height:typeof u=="number"?`${u}px`:u}:{}}:void 0;return f.jsxs("div",{className:Te.layout,style:{...P,...g},children:[t&&f.jsxs("header",{className:Te.header,style:E,children:[f.jsxs("div",{className:Te.headerLeft,children:[T&&f.jsx("button",{type:"button",className:Te.mobileToggle,onClick:()=>b(!0),"aria-label":"Open navigation",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),f.jsxs("div",{className:Te.headerTitles,children:[o&&f.jsx("h1",{className:Te.headerTitle,children:o}),a&&f.jsx("span",{className:Te.headerSubtitle,children:a})]})]}),l&&f.jsx("div",{className:Te.headerActions,children:l})]}),f.jsxs("div",{className:Te.body,children:[S&&f.jsx("button",{type:"button",className:Te.mobileOverlay,onClick:()=>b(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&f.jsx("aside",{className:Y(Te.sidebar,S&&Te.sidebarOpen),children:f.jsxs("div",{className:Te.sidebarInner,children:[f.jsx("div",{className:Te.logoArea,children:m||f.jsx("span",{className:Te.logoText,children:"Paper UI"})}),f.jsx("nav",{className:Te.nav,"aria-label":"Main navigation",children:d.map(I=>{const M=I.id===h;return f.jsx(ne,{variant:"ghost",size:"small",isActive:M,onClick:()=>{p==null||p(I),b(!1)},"aria-current":M?"page":void 0,icon:I.icon,style:Oz,children:I.label},I.id)})})]})}),f.jsx("div",{className:Te.main,children:f.jsx("main",{className:s?Te.contentWithPage:Te.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const I=v!==void 0?f.jsx(tS,{mode:"wait",children:f.jsx(Ni.div,{initial:j?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:j?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},v)}):e;return s?f.jsx(mS,{rounded:x?"top":"all",style:x&&w?{paddingBottom:`calc(${ef.navIslandBottom} + ${ef.navIslandHeight} + ${Fz[4]})`}:void 0,children:I}):I})()})})]}),w&&f.jsx("div",{className:Te.navIslandFixed,children:k!==void 0?f.jsx(Ni.div,{animate:{x:k?`-${ef.stackPanelWidth/2}px`:0},transition:{duration:j?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&f.jsx("footer",{className:Te.footer,children:y||f.jsx("p",{className:Te.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const e4="checkbox-module__wrapper___uLYMI",t4="checkbox-module__blobFill___mPJSR",n4="checkbox-module__input___Ptgt7",r4="checkbox-module__blobBg___bw3sn",s4="checkbox-module__labelLeft___-vAmH",i4="checkbox-module__box___yAh-r",o4="checkbox-module__checkmark___tTyBz",a4="checkbox-module__indeterminateLine___IosI-",l4="checkbox-module__boxWrapper___byjoS",c4="checkbox-module__icon___RO-yn",u4="checkbox-module__labelText___bAnLr",d4="checkbox-module__chalkboard___sv6SL",Tt={wrapper:e4,blobFill:t4,input:n4,blobBg:r4,labelLeft:s4,box:i4,checkmark:o4,indeterminateLine:a4,boxWrapper:l4,icon:c4,labelText:u4,chalkboard:d4},f4=_.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...u},c){const d=_.useId(),h=l??d,p=Wi(r),m=_.useRef(null);return _.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),f.jsxs("label",{className:Y(Tt.wrapper,t==="left"&&Tt.labelLeft,s==="chalkboard"&&Tt.chalkboard,i),htmlFor:h,children:[f.jsxs("span",{className:Tt.boxWrapper,children:[f.jsx("input",{ref:y=>{m.current=y,typeof c=="function"?c(y):c&&(c.current=y)},id:h,type:"checkbox",className:Tt.input,checked:o,onChange:a,...u}),f.jsx("svg",{className:Tt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:p.blob,className:Tt.blobFill})}),f.jsxs("span",{className:Tt.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,...St.control}),n?f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Tt.icon,children:f.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Tt.indeterminateLine})}):f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Tt.icon,children:f.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Tt.checkmark})})]})]}),e&&f.jsx("span",{className:Tt.labelText,children:e})]})}),h4="icon-button-module__iconButton___avg6i",p4="icon-button-module__blobBg___466Vy",m4="icon-button-module__blobFill___FTN1g",g4="icon-button-module__blobRing___hRdQb",y4="icon-button-module__isActive___XlvtM",x4="icon-button-module__icon___h204x",v4="icon-button-module__ghost___Wbxog",w4="icon-button-module__danger___p0Xz5",b4="icon-button-module__small___bPnCU",k4="icon-button-module__medium___nOxPf",_4="icon-button-module__large___UBU5z",S4="icon-button-module__chalkboard___mi0sQ",$n={iconButton:h4,blobBg:p4,blobFill:m4,blobRing:g4,isActive:y4,icon:x4,default:"icon-button-module__default___9frNR",ghost:v4,danger:w4,small:b4,medium:k4,large:_4,chalkboard:S4},ut=_.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},u){const c=Wi(i);return f.jsxs("button",{ref:u,type:"button",className:Y($n.iconButton,$n[t],n==="chalkboard"&&$n.chalkboard,$n[r],o&&$n.isActive,a),"aria-label":s,title:s,...l,children:[f.jsxs("svg",{className:$n.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:$n.blobFill}),f.jsx("path",{d:c.ring,className:$n.blobRing})]}),f.jsx("span",{className:$n.icon,children:e})]})}),C4="stamp-module__stamp___5qaNY",P4="stamp-module__small___BBlBg",j4="stamp-module__medium___HG2YD",E4="stamp-module__large___aUT0I",T4="stamp-module__blobBg___Mdrdd",R4="stamp-module__blobFill___QyCeB",N4="stamp-module__blobRing___EUDx7",I4="stamp-module__dot___qZyCR",A4="stamp-module__label___T89iH",M4="stamp-module__chalkboard___syI4T",dr={stamp:C4,small:P4,medium:j4,large:E4,blobBg:T4,blobFill:R4,blobRing:N4,dot:I4,label:A4,chalkboard:M4},nf={neutral:{fill:tt(X.accentSlate,.14),text:X.accentSlateDark,ring:tt(X.accentSlateDark,.35)},info:{fill:tt(X.accentBlue,.14),text:X.accentBlueDark,ring:tt(X.accentBlueDark,.35)},success:{fill:tt(X.accentGreen,.16),text:X.accentGreenDark,ring:tt(X.accentGreenDark,.35)},warning:{fill:tt(X.accentAmber,.16),text:X.accentAmberDark,ring:tt(X.accentAmberDark,.4)},error:{fill:tt(X.accentRose,.16),text:X.accentRoseDark,ring:tt(X.accentRoseDark,.35)}},dv={fill:tt(X.chalkboardBorderBase,.1),ring:tt(X.chalkboardBorderBase,.35)};function Ae({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const u=Wi(o),c=a==="chalkboard",d=n?c?dv.ring:nf[n].ring:void 0,h=s??(n?c?dv.fill:nf[n].fill:"transparent"),p=i??(n&&!c?nf[n].text:void 0);return f.jsxs("span",{className:Y(dr.stamp,dr[t],c&&dr.chalkboard,l),style:p?{color:p}:void 0,children:[f.jsxs("svg",{className:dr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:dr.blobFill,style:{fill:h}}),d&&f.jsx("path",{d:u.ring,className:dr.blobRing,style:{stroke:d}})]}),r&&f.jsx("span",{className:dr.dot,"aria-hidden":"true"}),f.jsx("span",{className:dr.label,children:e})]})}const L4="copy-button-module__copyButton___-hTo4",D4="copy-button-module__dark___O45N-",F4="copy-button-module__chalkboard___hW4aw",O4="copy-button-module__copied___XlHFr",gl={copyButton:L4,dark:D4,chalkboard:F4,copied:O4};function Kh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=_.useState(!1),a=_.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return f.jsx("button",{type:"button",onClick:a,className:Y(gl.copyButton,t==="dark"&&gl.dark,n==="chalkboard"&&gl.chalkboard,i&&gl.copied,r),...s,children:i?"Copied!":"Copy"})}const z4="code-block-module__codeBlock___dq28o",B4="code-block-module__header___42Fek",$4="code-block-module__relative___oO-zy",V4="code-block-module__copyOverlay___PjAuq",U4="code-block-module__pre___zXzLZ",W4="code-block-module__chalkboard___bdo9J",H4="code-block-module__chalkboardHeader___3RiVd",G4="code-block-module__chalkboardPre___iRBFR",fr={codeBlock:z4,header:B4,relative:$4,copyOverlay:V4,pre:U4,chalkboard:W4,chalkboardHeader:H4,chalkboardPre:G4};function e9({code:e,filename:t,surface:n="paper"}){return f.jsxs("div",{className:Y(fr.codeBlock,n==="chalkboard"&&fr.chalkboard),children:[t&&f.jsxs("div",{className:Y(fr.header,n==="chalkboard"&&fr.chalkboardHeader),children:[f.jsx("span",{children:t}),f.jsx(Kh,{text:e,variant:"light",surface:n})]}),!t&&f.jsx("div",{className:fr.relative,children:f.jsx("div",{className:fr.copyOverlay,children:f.jsx(Kh,{text:e,variant:"dark",surface:n})})}),f.jsx("pre",{className:Y(fr.pre,n==="chalkboard"&&fr.chalkboardPre),children:f.jsx("code",{children:e})})]})}function Ca({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function K4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M9 18h6"}),f.jsx("path",{d:"M10 22h4"}),f.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"})]})}function gS({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"20 6 9 17 4 12"})})}function q4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Y4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function Q4({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function X4({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const J4="table-module__tableFrame___KP-90",Z4="table-module__tableWrapper___gc3Y3",e$="table-module__toolbar___zhCel",t$="table-module__search___zIBk2",n$="table-module__searchIcon___ayhK8",r$="table-module__searchInput___PqsEG",s$="table-module__toolbarActions___EX6qS",i$="table-module__tableScroll___1gvc4",o$="table-module__table___tdU5g",a$="table-module__th___GQbKk",l$="table-module__td___WktB5",c$="table-module__tr___xeZno",u$="table-module__expandTh___uxkR4",d$="table-module__expandTd___VoBRC",f$="table-module__expandIcon___8V45X",h$="table-module__expandable___R7o2l",p$="table-module__expandedRow___1TbTQ",m$="table-module__expandedCell___sKAaD",g$="table-module__boardScroll___Y1yqm",y$="table-module__board___kFAI-",x$="table-module__boardColumn___-W9bP",v$="table-module__boardColumnHeader___kY3Fj",w$="table-module__accentBlue___PEJ1V",b$="table-module__accentGreen___wJ53r",k$="table-module__accentAmber___Iezjv",_$="table-module__accentRose___W8zxc",S$="table-module__accentSlate___oUZCX",C$="table-module__boardColumnLabel___JBEed",P$="table-module__boardColumnCount___Pkpiq",j$="table-module__boardColumnBody___uAgRF",E$="table-module__boardRow___C1P60",T$="table-module__boardEmpty___IKv2W",R$="table-module__chalkboardFrame___xB3N5",N$="table-module__chalkboardWrapper___KjY5r",I$="table-module__chalkboard___v0m3A",ie={tableFrame:J4,tableWrapper:Z4,toolbar:e$,search:t$,searchIcon:n$,searchInput:r$,toolbarActions:s$,tableScroll:i$,table:o$,th:a$,td:l$,tr:c$,expandTh:u$,expandTd:d$,expandIcon:f$,expandable:h$,expandedRow:p$,expandedCell:m$,boardScroll:g$,board:y$,boardColumn:x$,boardColumnHeader:v$,accentBlue:w$,accentGreen:b$,accentAmber:k$,accentRose:_$,accentSlate:S$,boardColumnLabel:C$,boardColumnCount:P$,boardColumnBody:j$,boardRow:E$,boardEmpty:T$,chalkboardFrame:R$,chalkboardWrapper:N$,chalkboard:I$},A$=Ym(ie);function M$({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:u,rowTexture:c,className:d}){const h=Ui(s,r==="chalkboard"?"chalkboard":"paper"),p=!!i,[m,y]=_.useState(new Set),w=v=>{y(k=>{const S=new Set(k);return S.has(v)?S.delete(v):S.add(v),S})},g=!!(o&&a),x=g?t.length+1:t.length;return f.jsxs("div",{className:Y(ie.tableFrame,r==="chalkboard"&&ie.chalkboardFrame,d),children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsxs("div",{className:Y(ie.tableWrapper,r==="chalkboard"&&ie.chalkboardWrapper),style:h,children:[p&&f.jsxs("div",{className:ie.toolbar,children:[i.search&&f.jsxs("div",{className:ie.search,children:[f.jsx(L$,{className:ie.searchIcon}),f.jsx("input",{type:"text",className:ie.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:v=>{var k,S;return(S=(k=i.search)==null?void 0:k.onChange)==null?void 0:S.call(k,v.target.value)}}),f.jsx(_t,{fill:!0,...St.field})]}),i.actions&&f.jsx("div",{className:ie.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?f.jsx("div",{className:ie.boardScroll,children:f.jsx("div",{className:ie.board,children:n.map(v=>f.jsxs("div",{className:ie.boardColumn,children:[f.jsxs("div",{className:Y(ie.boardColumnHeader,r==="chalkboard"&&ie.chalkboard,v.accent&&A$[v.accent]),children:[f.jsx("span",{className:ie.boardColumnLabel,children:v.label}),f.jsx("span",{className:ie.boardColumnCount,children:v.items.length})]}),f.jsx("div",{className:ie.boardColumnBody,children:v.items.length===0?f.jsx("div",{className:ie.boardEmpty,children:v.emptyLabel??"empty"}):v.items.map((k,S)=>f.jsx("div",{className:Y(ie.boardRow,r==="chalkboard"&&ie.chalkboard),children:v.renderItem(k,S,r)},v.getKey?v.getKey(k,S):S))})]},v.key))})}):f.jsx("div",{className:ie.tableScroll,children:f.jsxs("table",{className:Y(ie.table,r==="chalkboard"&&ie.chalkboard),children:[f.jsxs("colgroup",{children:[g&&f.jsx("col",{style:{width:"48px"}}),t.map(v=>f.jsx("col",{style:v.width?{width:`${v.width*32}px`}:void 0},v.key))]}),f.jsx("thead",{children:f.jsxs("tr",{children:[g&&f.jsx("th",{className:Y(ie.th,ie.expandTh),"aria-label":"Expand"}),t.map(v=>f.jsx("th",{className:ie.th,style:v.align?{textAlign:v.align}:void 0,children:v.header},v.key))]})}),f.jsx("tbody",{children:e.map((v,k)=>{const S=l?l(v,k):k,b=o==null?void 0:o.render(v,k,r),j=!!b,P=j&&m.has(S),T=c==null?void 0:c(v,k);return f.jsxs(_.Fragment,{children:[f.jsxs("tr",{className:Y(ie.tr,j&&ie.expandable,u==null?void 0:u(v,k)),style:T?Sa(T):void 0,onClick:()=>j&&w(S),children:[g&&f.jsx("td",{className:Y(ie.td,ie.expandTd),children:j&&f.jsx("button",{type:"button",className:ie.expandIcon,"aria-expanded":P,"aria-label":P?"Collapse row":"Expand row",onClick:E=>{E.stopPropagation(),w(S)},children:f.jsx(X4,{size:14})})}),t.map(E=>f.jsx("td",{className:ie.td,style:E.align?{textAlign:E.align}:void 0,children:E.cell(v,k,r)},E.key))]}),P&&f.jsx("tr",{className:ie.expandedRow,children:f.jsx("td",{colSpan:x,className:ie.expandedCell,children:b})})]},S)})})]})})]})]})}function L$({className:e}){return f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[f.jsx("circle",{cx:"11",cy:"11",r:"8"}),f.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const D$="card-module__borderLayer___WSpJq",F$="card-module__elevated___uhWj9",O$="card-module__textureLayer___Kcofz",z$="card-module__flat___KnG5z",B$="card-module__small___HXUTr",$$="card-module__withAccent___2t7bV",V$="card-module__accentBlue___a1KIq",U$="card-module__accentGreen___RNWoA",W$="card-module__accentAmber___uMhom",H$="card-module__accentRose___VPI3t",G$="card-module__accentSlate___-l4jE",K$="card-module__chalkboard___bQ48O",gr={borderLayer:D$,default:"card-module__default___glPy-",elevated:F$,textureLayer:O$,flat:z$,small:B$,withAccent:$$,accentBlue:V$,accentGreen:U$,accentAmber:W$,accentRose:H$,accentSlate:G$,chalkboard:K$},q$=Ym(gr);function Ee({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:s="parchment",fill:i,shade:o=!1,accent:a=!1,accentColor:l="blue",sketch:u=!1,className:c}){const d=n==="chalkboard"||s===!1?void 0:pS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return f.jsxs("div",{className:Y(gr.borderLayer,gr[t],n==="chalkboard"&&gr.chalkboard,gr[r],a&&gr.withAccent,a&&q$[l],!u&&gr.flat,c),children:[f.jsx(_t,{clip:!0,...St.surface,straight:!u}),f.jsx("div",{className:gr.textureLayer,style:d,children:e})]})}const Y$="input-module__wrapper___xaEw6",Q$="input-module__label___lu7R1",X$="input-module__field___khFpX",J$="input-module__input___h7K-F",Z$="input-module__small___SkByh",e5="input-module__medium___0QPuV",t5="input-module__large___zGwRu",n5="input-module__error___QDqga",r5="input-module__disabled___K-5hi",s5="input-module__helperText___njeLH",i5="input-module__helperError___qDBpD",o5="input-module__chalkboard___Xh-5s",wn={wrapper:Y$,label:Q$,field:X$,input:J$,small:Z$,medium:e5,large:t5,error:n5,disabled:r5,helperText:s5,helperError:i5,chalkboard:o5},Pa=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const u=_.useId(),c=o??u;return f.jsxs("div",{className:Y(wn.wrapper,s==="chalkboard"&&wn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:c,className:wn.label,children:e}),f.jsxs("span",{className:Y(wn.field,wn[r],n&&wn.error,a.disabled&&wn.disabled),children:[f.jsx("input",{ref:l,id:c,className:wn.input,...a}),f.jsx(_t,{fill:!0,...St.field})]}),t&&f.jsx("span",{className:Y(wn.helperText,n&&wn.helperError),children:t})]})}),a5="select-module__wrapper___Hc5F3",l5="select-module__label___ay-3s",c5="select-module__nativeSelect___UA2d-",u5="select-module__trigger___xMYHi",d5="select-module__open___w3mbZ",f5="select-module__triggerLabel___ihpER",h5="select-module__placeholder___0VOFP",p5="select-module__small___iU9W9",m5="select-module__chevron___0dCTg",g5="select-module__medium___B-XBN",y5="select-module__large___iII2c",x5="select-module__chevronOpen___cFOYe",v5="select-module__error___P5RBk",w5="select-module__dropdown___Q-uK3",b5="select-module__slideDown___sT374",k5="select-module__options___HmrQ0",_5="select-module__option___vNnue",S5="select-module__optionDisabled___ex2zq",C5="select-module__optionSelected___tAFjn",P5="select-module__optionHighlighted___zYQLq",j5="select-module__helperText___r5gyn",E5="select-module__helperError___ydSPT",T5="select-module__chalkboard___sXBw8",Me={wrapper:a5,label:l5,nativeSelect:c5,trigger:u5,open:d5,triggerLabel:f5,placeholder:h5,small:p5,chevron:m5,medium:g5,large:y5,chevronOpen:x5,error:v5,dropdown:w5,slideDown:b5,options:k5,option:_5,optionDisabled:S5,optionSelected:C5,optionHighlighted:P5,helperText:j5,helperError:E5,chalkboard:T5};function qh({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:u,name:c,disabled:d=!1,width:h,texture:p=!1,className:m}){const y=_.useId(),[w,g]=_.useState(!1),[x,v]=_.useState(-1),[k,S]=_.useState(l??""),[b,j]=_.useState(null),P=_.useRef(null),T=_.useRef(null),E=a!==void 0,I=E?a:k,M=i.find(C=>C.value===I),O=(M==null?void 0:M.label)??o??"Select...",A=_.useCallback(()=>{if(d)return;g(!0);const C=i.findIndex(V=>V.value===I);v(C>=0?C:0)},[d,i,I]),R=_.useCallback(()=>{g(!1),v(-1)},[]),z=_.useCallback(C=>{var V;C.disabled||(E||S(C.value),u==null||u(C.value),R(),(V=P.current)==null||V.focus())},[E,u,R]),B=_.useCallback(C=>{if(!d)switch(C.key){case"Enter":case" ":C.preventDefault(),w&&x>=0?z(i[x]):A();break;case"Escape":C.preventDefault(),w&&R();break;case"ArrowDown":C.preventDefault(),w?v(V=>{let q=V+1;for(;q<i.length&&i[q].disabled;)q++;return q<i.length?q:V}):A();break;case"ArrowUp":C.preventDefault(),w?v(V=>{let q=V-1;for(;q>=0&&i[q].disabled;)q--;return q>=0?q:V}):A();break;case"Home":if(C.preventDefault(),w){let V=0;for(;V<i.length&&i[V].disabled;)V++;V<i.length&&v(V)}break;case"End":if(C.preventDefault(),w){let V=i.length-1;for(;V>=0&&i[V].disabled;)V--;V>=0&&v(V)}break;case"Tab":w&&R();break}},[d,w,x,i,A,R,z]);_.useEffect(()=>{if(!w)return;const C=V=>{var q,N;const le=V.target;(q=P.current)!=null&&q.contains(le)||(N=T.current)!=null&&N.contains(le)||R()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[w,R]),_.useEffect(()=>{if(!w||x<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[w,x]),_.useEffect(()=>{if(!w){j(null);return}const C=()=>{if(!P.current)return;const V=P.current.getBoundingClientRect();if(V.bottom<0||V.top>window.innerHeight){R();return}j(V)};return C(),document.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{document.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[w,R]);const L=Ui(p),$=L?{"--sketch-fill":L.backgroundColor}:void 0;return f.jsxs("div",{className:Y(Me.wrapper,s==="chalkboard"&&Me.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&f.jsx("label",{htmlFor:y,className:Me.label,children:e}),f.jsxs("select",{id:y,name:c,className:Me.nativeSelect,value:I,onChange:C=>u==null?void 0:u(C.target.value),disabled:d,"aria-hidden":"true",tabIndex:-1,children:[o&&f.jsx("option",{value:"",children:o}),i.map(C=>f.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),f.jsxs("button",{ref:P,type:"button",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?`${y}-listbox`:void 0,"aria-activedescendant":w&&x>=0?`${y}-option-${x}`:void 0,className:Y(Me.trigger,Me[r],n&&Me.error,w&&Me.open,d&&Me.disabled),onClick:()=>w?R():A(),onKeyDown:B,disabled:d,children:[f.jsx("span",{className:Y(Me.triggerLabel,!M&&Me.placeholder),children:O}),f.jsx(R5,{className:Y(Me.chevron,w&&Me.chevronOpen)}),f.jsx(_t,{fill:!0,...St.field})]}),w&&b&&Ns.createPortal(f.jsxs("div",{ref:T,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Me.dropdown,style:{...$,position:"fixed",top:b.bottom+6,left:b.left,width:b.width},onKeyDown:C=>{var V;C.key==="Escape"&&(C.preventDefault(),R(),(V=P.current)==null||V.focus())},children:[f.jsx(_t,{fill:!0,...St.surface}),f.jsx("div",{className:Me.options,children:i.map((C,V)=>f.jsx("div",{id:`${y}-option-${V}`,role:"option","aria-selected":C.value===I,tabIndex:-1,"data-option-index":V,className:Y(Me.option,C.value===I&&Me.optionSelected,V===x&&Me.optionHighlighted,C.disabled&&Me.optionDisabled),onClick:q=>{q.stopPropagation(),z(C)},onMouseEnter:()=>v(V),children:C.label},C.value))})]}),document.body),t&&f.jsx("span",{className:Y(Me.helperText,n&&Me.helperError),children:t})]})}function R5({className:e}){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"6 9 12 15 18 9"})})}function yS({variant:e}){switch(e){case"info":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),f.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),f.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),f.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),f.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),f.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const N5="alert-module__alert___j7ZRS",I5="alert-module__surface___IaVgU",A5="alert-module__iconWrapper___kLoxT",M5="alert-module__message___klR2U",L5="alert-module__dismiss___f2uoG",D5="alert-module__info___PBo1l",F5="alert-module__success___AVBKS",O5="alert-module__warning___zkMaJ",z5="alert-module__error___cxg96",B5="alert-module__chalkboard___7pgWk",rs={alert:N5,surface:I5,iconWrapper:A5,message:M5,dismiss:L5,info:D5,success:F5,warning:O5,error:z5,chalkboard:B5};function xS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return f.jsxs("div",{className:Y(rs.alert,rs[t],a&&rs.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:rs.surface,style:a?void 0:Ui(r)}),f.jsx("span",{className:rs.iconWrapper,children:f.jsx(yS,{variant:t})}),f.jsx("div",{className:rs.message,children:e}),s&&f.jsx("button",{type:"button",className:rs.dismiss,onClick:i,"aria-label":"Dismiss alert",children:f.jsx(Ca,{size:16})})]})}const $5="modal-module__overlay___a52Ni",V5="modal-module__fadeIn___5OWd5",U5="modal-module__backdrop___RS4yj",W5="modal-module__modal___ZioOV",H5="modal-module__slideUp___vfFrm",G5="modal-module__small___hcxwF",K5="modal-module__medium___mjbM5",q5="modal-module__large___1dzyf",Y5="modal-module__header___iP09B",Q5="modal-module__title___nj06m",X5="modal-module__close___gQou9",J5="modal-module__body___Y-EdA",Z5="modal-module__chalkboard___qY8qo",Vn={overlay:$5,fadeIn:V5,backdrop:U5,modal:W5,slideUp:H5,small:G5,medium:K5,large:q5,header:Y5,title:Q5,close:X5,body:J5,chalkboard:Z5},eV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function ja({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=_.useId(),u=_.useRef(null),c=_.useRef(null);if(Su(e,t),_.useEffect(()=>{var h;if(!e)return;c.current=document.activeElement,(h=u.current)==null||h.focus();const p=y=>{var w;if(y.key!=="Tab")return;const g=(w=u.current)==null?void 0:w.querySelectorAll(eV);if(!g||g.length===0){y.preventDefault();return}const x=g[0],v=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),v.focus()):!y.shiftKey&&document.activeElement===v&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(y=c.current)==null?void 0:y.focus)==null||w.call(y)}},[e]),!e||typeof document>"u")return null;const d=Ui(o);return Ns.createPortal(f.jsxs("div",{className:Vn.overlay,children:[f.jsx("button",{type:"button",className:Vn.backdrop,"aria-label":"Close modal",onClick:t}),f.jsxs("div",{ref:u,className:Y(Vn.modal,Vn[s],i==="chalkboard"&&Vn.chalkboard,a),style:d,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[f.jsxs("div",{className:Vn.header,children:[n&&f.jsx("h2",{id:l,className:Vn.title,children:n}),f.jsx("button",{type:"button",className:Vn.close,onClick:t,"aria-label":"Close modal",children:f.jsx(Ca,{size:18})})]}),f.jsx("div",{className:Vn.body,children:r})]})]}),document.body)}const tV="textarea-module__wrapper___NbiNO",nV="textarea-module__label___ejhyZ",rV="textarea-module__field___KluQf",sV="textarea-module__textarea___0y-7v",iV="textarea-module__resizeGrip___lONlE",oV="textarea-module__small___yPyr8",aV="textarea-module__medium___ezQxA",lV="textarea-module__large___xfeKi",cV="textarea-module__error___EkXKJ",uV="textarea-module__disabled___9CKbb",dV="textarea-module__helperText___l1sPh",fV="textarea-module__helperError___VfTLy",hV="textarea-module__chalkboard___zZ0X0",sn={wrapper:tV,label:nV,field:rV,textarea:sV,resizeGrip:iV,small:oV,medium:aV,large:lV,error:cV,disabled:uV,helperText:dV,helperError:fV,chalkboard:hV},pV=48,Eu=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const u=_.useId(),c=o??u,d=_.useRef(null),h=_.useCallback(m=>{d.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=_.useCallback(m=>{const y=d.current;if(!y)return;m.preventDefault();const w=m.clientY,g=y.offsetHeight,x=k=>{y.style.height=`${Math.max(pV,g+k.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",v)},[]);return f.jsxs("div",{className:Y(sn.wrapper,s==="chalkboard"&&sn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:c,className:sn.label,children:e}),f.jsxs("span",{className:Y(sn.field,sn[r],n&&sn.error,a.disabled&&sn.disabled),children:[f.jsx("textarea",{ref:h,id:c,className:sn.textarea,...a}),f.jsx(_t,{fill:!0,...St.field}),!a.disabled&&f.jsx("span",{className:sn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:f.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M11 4.5 L4.5 11"}),f.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&f.jsx("span",{className:Y(sn.helperText,n&&sn.helperError),children:t})]})}),mV="progress-module__track___a5BMO",gV="progress-module__svg___3U0-E",fv={track:mV,svg:gV},rf=300,hr=1;function yV({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(ju()*1e6)),u=a?tt(X.chalkboardBorderBase,.16):tt(X.textPrimary,.12),c=n??(a?X.chalkboardChalk:X.textSecondary),d=_.useMemo(()=>Fe.toPaths(Fe.rectangle(hr,hr,rf-hr*2,r-hr*2,{seed:l,roughness:2.2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1.5})),[l,u,r]),h=Math.max(o/100*(rf-hr*2),0),p=_.useMemo(()=>h>0?Fe.toPaths(Fe.rectangle(hr,hr,h,r-hr*2,{seed:l+1,roughness:2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1})):[],[l,c,h,r]);return f.jsx("div",{className:Y(fv.track,i),style:{height:r,borderRadius:r/2},children:f.jsxs("svg",{className:fv.svg,viewBox:`0 0 ${rf} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[d.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),p.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function xV(e){const t=ju();return _.useMemo(()=>({blob:Hz({seed:t,wobble:e}),ring:Gz(t,e)}),[t,e])}const vV="list-item-module__listItem___-tw9O",wV="list-item-module__clickable___GLJmd",bV="list-item-module__blobBg___O3Mzh",kV="list-item-module__blobFill___dXHk1",_V="list-item-module__blobRing___S9mas",SV="list-item-module__active___UsL8O",CV="list-item-module__small___9dphK",PV="list-item-module__medium___yGZCr",jV="list-item-module__icon___2b4wU",EV="list-item-module__label___SIzJ4",TV="list-item-module__action___qGh0-",RV="list-item-module__chalkboard___qpWuM",Vt={listItem:vV,static:"list-item-module__static___qtEX6",clickable:wV,blobBg:bV,blobFill:kV,blobRing:_V,active:SV,small:CV,medium:PV,icon:jV,label:EV,action:TV,chalkboard:RV};function li({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const u=xV(s),c=!!l.onClick;return f.jsxs("button",{type:"button",className:Y(Vt.listItem,Vt[r],c&&Vt.clickable,!c&&!e&&Vt.static,e&&Vt.active,i==="chalkboard"&&Vt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[f.jsxs("svg",{className:Vt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:Vt.blobFill}),f.jsx("path",{d:u.ring,className:Vt.blobRing})]}),t&&f.jsx("span",{className:Vt.icon,children:t}),f.jsx("span",{className:Vt.label,children:o}),n&&f.jsx("span",{className:Vt.action,children:n})]})}const NV="icon-module__icon___2vrJz",IV="icon-module__blobBg___ENPYJ",AV="icon-module__blobFill___IPbwQ",MV="icon-module__blobRing___1awqV",LV="icon-module__content___TaZR6",DV="icon-module__small___Xp--F",FV="icon-module__medium___tCjMB",OV="icon-module__large___vBtP7",$s={icon:NV,blobBg:IV,blobFill:AV,blobRing:MV,content:LV,small:DV,medium:FV,large:OV},zV={small:20,medium:24,large:28};function BV({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Wi(n),o=zV[t];return f.jsxs("span",{className:Y($s.icon,$s[t],s),children:[f.jsxs("svg",{className:$s.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:i.blob,className:$s.blobFill,style:r?{fill:r}:void 0}),f.jsx("path",{d:i.ring,className:$s.blobRing})]}),f.jsx("span",{className:$s.content,style:{width:o,height:o},children:e})]})}const $V="radio-module__wrapper___BB05E",VV="radio-module__blobFill___p5BX4",UV="radio-module__labelLeft___ijB93",WV="radio-module__input___M2nFJ",HV="radio-module__box___H7ofS",GV="radio-module__dot___jVJ-d",KV="radio-module__boxWrapper___Y3qis",qV="radio-module__blobBg___IR-M5",YV="radio-module__labelText___I-nu3",QV="radio-module__chalkboard___IIBqI",bn={wrapper:$V,blobFill:VV,labelLeft:UV,input:WV,box:HV,dot:GV,boxWrapper:KV,blobBg:qV,labelText:YV,chalkboard:QV};_.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},u){const c=_.useId(),d=a??c,h=Wi(n);return f.jsxs("label",{className:Y(bn.wrapper,t==="left"&&bn.labelLeft,r==="chalkboard"&&bn.chalkboard,s),htmlFor:d,children:[f.jsxs("span",{className:bn.boxWrapper,children:[f.jsx("input",{ref:u,id:d,type:"radio",className:bn.input,checked:i,onChange:o,...l}),f.jsx("svg",{className:bn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:h.blob,className:bn.blobFill})}),f.jsxs("span",{className:bn.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,shape:"circle",...St.control}),f.jsx("span",{className:bn.dot})]})]}),e&&f.jsx("span",{className:bn.labelText,children:e})]})});const XV="switch-module__wrapper___5-2P1",JV="switch-module__labelLeft___WlT-N",ZV="switch-module__input___YKZRj",e6="switch-module__track___QNvnO",t6="switch-module__thumb___cunvF",n6="switch-module__small___WPIxc",r6="switch-module__medium___yPulW",s6="switch-module__large___VlKV1",i6="switch-module__labelText___9Qg39",o6="switch-module__chalkboard___qKTMz",pr={wrapper:XV,labelLeft:JV,input:ZV,track:e6,thumb:t6,small:n6,medium:r6,large:s6,labelText:i6,chalkboard:o6},a6=_.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},u){const c=_.useId(),d=a??c;return f.jsxs("label",{className:Y(pr.wrapper,pr[n],t==="left"&&pr.labelLeft,r==="chalkboard"&&pr.chalkboard,s),htmlFor:d,children:[f.jsx("input",{ref:u,id:d,type:"checkbox",className:pr.input,checked:i,onChange:o,...l}),f.jsxs("span",{className:pr.track,"aria-hidden":"true",children:[f.jsx(_t,{...St.pill}),f.jsx("span",{className:pr.thumb})]}),e&&f.jsx("span",{className:pr.labelText,children:e})]})}),l6="spinner-module__spinner___FDTk2",c6="spinner-module__chalkboard___DLE1z",u6="spinner-module__svg___JnCWN",d6="spinner-module__track___xbnbo",f6="spinner-module__head___j5dWe",mo={spinner:l6,chalkboard:c6,svg:u6,track:d6,head:f6},h6={small:18,medium:28,large:40},hv=25,p6=18,pv=Fe.toPaths(Fe.circle(hv,hv,p6*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Ii({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=h6[e];return f.jsx("span",{className:Y(mo.spinner,r==="chalkboard"&&mo.chalkboard,s),role:"status","aria-label":n,children:f.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:mo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[f.jsx("path",{className:mo.track,d:pv,fill:"none",pathLength:100,strokeLinecap:"round"}),f.jsx("path",{className:mo.head,d:pv,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const m6="skeleton-module__skeleton___HCSvg",g6="skeleton-module__pulse___6eCq1",y6="skeleton-module__svg___OzxGp",x6="skeleton-module__text___v17Nv",v6="skeleton-module__rect___wqIJy",w6="skeleton-module__circle___RCmyR",sf={skeleton:m6,pulse:g6,svg:y6,text:x6,rect:v6,circle:w6},mv={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Vs=2;function on({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(ju()*1e6)),l=o?tt(X.chalkboardBorderBase,.16):tt(X.textPrimary,.09),u=_.useMemo(()=>{const[,,c,d]=mv[e],h=e==="circle"?Fe.ellipse(c/2,d/2,c-Vs*2,d-Vs*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Fe.rectangle(Vs,Vs,c-Vs*2,d-Vs*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Fe.toPaths(h)},[e,a,l]);return f.jsx("span",{className:Y(sf.skeleton,sf[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:f.jsx("svg",{className:sf.svg,viewBox:mv[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:u.map((c,d)=>f.jsx("path",{d:c.d,stroke:c.stroke,strokeWidth:c.strokeWidth,fill:c.fill},d))})})}const b6="divider-module__horizontal___tP3rG",k6="divider-module__line___KnBes",_6="divider-module__label___WiUwZ",S6="divider-module__vertical___wBSrT",C6="divider-module__chalkboard___gXTde",Us={horizontal:b6,line:k6,label:_6,vertical:S6,chalkboard:C6};function gv({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Us.chalkboard;return e==="vertical"?f.jsx("span",{className:Y(Us.vertical,s,r),role:"separator","aria-orientation":"vertical"}):f.jsxs("div",{className:Y(Us.horizontal,s,r),role:"separator",children:[f.jsx("span",{className:Us.line}),t!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:Us.label,children:t}),f.jsx("span",{className:Us.line})]})]})}const P6="tooltip-module__wrapper___XeVNe",j6="tooltip-module__tooltip___e-rkz",E6="tooltip-module__tooltipIn___CZbRw",T6="tooltip-module__top___78WWU",R6="tooltip-module__bottom___Irl3O",N6="tooltip-module__left___C1Ec4",I6="tooltip-module__right___oUA-Z",A6="tooltip-module__chalkboard___Um6dx",yl={wrapper:P6,tooltip:j6,tooltipIn:E6,top:T6,bottom:R6,left:N6,right:I6,chalkboard:A6},xl=8,vl=8,M6=typeof window>"u"?_.useEffect:_.useLayoutEffect;function L6(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+xl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-xl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+xl;break;default:r=e.top-xl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,vl),window.innerWidth-n.width-vl),r=Math.min(Math.max(r,vl),window.innerHeight-n.height-vl),{top:r,left:s}}function Ie({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=_.useId(),[a,l]=_.useState(!1),[u,c]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),[y,w]=_.useState(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(),k=!s&&!!e&&!d&&(a||u),S=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},b=()=>{clearTimeout(v.current),l(!1),h(!1)},j=()=>{h(!1),c(!0)},P=()=>{c(!1),h(!1)};Su(k,()=>h(!0)),_.useEffect(()=>{if(!k){m(null);return}const E=()=>{g.current&&m(g.current.getBoundingClientRect())};return E(),window.addEventListener("scroll",E,{capture:!0,passive:!0}),window.addEventListener("resize",E,{passive:!0}),()=>{window.removeEventListener("scroll",E,{capture:!0}),window.removeEventListener("resize",E)}},[k]),M6(()=>{if(!k){w(null);return}const E=x.current;E&&w({width:E.offsetWidth,height:E.offsetHeight})},[k,e,n]),_.useEffect(()=>()=>clearTimeout(v.current),[]);const T=t.props;return f.jsxs("span",{ref:g,className:yl.wrapper,onMouseEnter:S,onMouseLeave:b,onFocus:j,onBlur:P,children:[_.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&p&&typeof document<"u"&&Ns.createPortal(f.jsx("span",{ref:x,id:o,role:"tooltip",className:Y(yl.tooltip,yl[n],i==="chalkboard"&&yl.chalkboard),style:y?{position:"fixed",...L6(p,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const D6="toast-module__stack___hDi0s",F6="toast-module__topLeft___Luw-F",O6="toast-module__topCenter___N1DwF",z6="toast-module__topRight___Dtgau",B6="toast-module__bottomLeft___Eb2lo",$6="toast-module__bottomCenter___gs-Yb",V6="toast-module__bottomRight___-0e2j",U6="toast-module__item___RFjtm",W6="toast-module__toastIn___9m9iN",H6="toast-module__card___ZCvJS",G6="toast-module__surface___mfMl0",K6="toast-module__iconWrapper___lnjcC",q6="toast-module__content___AlliM",Y6="toast-module__title___1Oqh8",Q6="toast-module__description___eiUSB",X6="toast-module__dismiss___tUGx4",J6="toast-module__info___Nh8S9",Z6="toast-module__success___hlKLc",e8="toast-module__warning___XUMJt",t8="toast-module__error___pSFFC",n8="toast-module__chalkboard___c49gt",Ut={stack:D6,topLeft:F6,topCenter:O6,topRight:z6,bottomLeft:B6,bottomCenter:$6,bottomRight:V6,item:U6,toastIn:W6,card:H6,surface:G6,iconWrapper:K6,content:q6,title:Y6,description:Q6,dismiss:X6,info:J6,success:Z6,warning:e8,error:t8,chalkboard:n8};function r8({record:e,surface:t="paper",onDismiss:n}){const r=_.useRef(e.duration),s=_.useRef(0),i=_.useRef(),o=_.useCallback(d=>{clearTimeout(i.current),!(d<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),d))},[n,e.id]);_.useEffect(()=>(o(e.duration),()=>clearTimeout(i.current)),[o,e.duration]);const a=()=>{i.current&&(clearTimeout(i.current),r.current-=Date.now()-s.current)},l=()=>o(r.current),u=t==="chalkboard",c=e.variant==="warning"||e.variant==="error"?"alert":"status";return f.jsx("div",{className:Ut.item,onMouseEnter:a,onMouseLeave:l,children:f.jsxs("div",{className:Y(Ut.card,Ut[e.variant],u&&Ut.chalkboard),role:c,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:Ut.surface,style:u?void 0:Ui("kraft")}),f.jsx("span",{className:Ut.iconWrapper,children:f.jsx(yS,{variant:e.variant})}),f.jsxs("div",{className:Ut.content,children:[e.title&&f.jsx("div",{className:Ut.title,children:e.title}),f.jsx("div",{className:Ut.description,children:e.description})]}),f.jsx("button",{type:"button",className:Ut.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:f.jsx(Ca,{size:16})})]})})}const vS=_.createContext(null);function s8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function i8({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=_.useState([]),o=_.useRef(0),a=_.useCallback(c=>{i(d=>d.filter(h=>h.id!==c))},[]),l=_.useCallback(c=>{o.current+=1;const d=`toast-${o.current}`;return i(h=>[...h,{id:d,title:c.title,description:c.description,variant:c.variant??"info",duration:c.duration??r}]),d},[r]),u=t.startsWith("top")?[...s].reverse():s;return f.jsxs(vS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ns.createPortal(f.jsx("div",{className:Y(Ut.stack,Ut[s8(t)]),role:"region","aria-label":"Notifications",children:u.map(c=>f.jsx(r8,{record:c,surface:n,onDismiss:a},c.id))}),document.body)]})}function Ge(){const e=_.useContext(vS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const o8="breadcrumb-module__breadcrumb___r-ILp",a8="breadcrumb-module__list___V3YFy",l8="breadcrumb-module__item___dDwYf",c8="breadcrumb-module__link___CHC9k",u8="breadcrumb-module__linkButton___XoMW-",d8="breadcrumb-module__current___dprI9",f8="breadcrumb-module__separator___uLhtn",h8="breadcrumb-module__chalkboard___COJpw",kn={breadcrumb:o8,list:a8,item:l8,link:c8,linkButton:u8,current:d8,static:"breadcrumb-module__static___affaf",separator:f8,chalkboard:h8};function yv({items:e,surface:t="paper",className:n}){return f.jsx("nav",{"aria-label":"Breadcrumb",className:Y(kn.breadcrumb,t==="chalkboard"&&kn.chalkboard,n),children:f.jsx("ol",{className:kn.list,children:e.map((r,s)=>{const i=s===e.length-1;return f.jsxs("li",{className:kn.item,children:[i?f.jsx("span",{className:kn.current,"aria-current":"page",children:r.label}):r.href?f.jsx("a",{href:r.href,className:kn.link,onClick:r.onClick,children:r.label}):r.onClick?f.jsx("button",{type:"button",className:Y(kn.link,kn.linkButton),onClick:r.onClick,children:r.label}):f.jsx("span",{className:kn.static,children:r.label}),!i&&f.jsx(p8,{className:kn.separator})]},r.id)})})})}function p8({className:e}){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const m8="menu-module__wrapper___WCtoy",g8="menu-module__menu___i40Wj",y8="menu-module__surface___SJbaB",x8="menu-module__list___YjCfD",v8="menu-module__item___aqcgg",w8="menu-module__icon___1qUvA",b8="menu-module__label___MtQMh",k8="menu-module__danger___p9oZo",_8="menu-module__itemDisabled___HByLP",S8="menu-module__separator___g2uay",C8="menu-module__chalkboard___5jIwI",an={wrapper:m8,menu:g8,surface:y8,list:x8,item:v8,icon:w8,label:b8,danger:k8,itemDisabled:_8,separator:S8,chalkboard:C8},P8=6;function j8(e){return"type"in e&&e.type==="separator"}function E8({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=_.useId(),[o,a]=_.useState(!1),[l,u]=_.useState(null),c=_.useRef(null),d=_.useRef(null),h=_.useCallback(()=>{var g,x;(x=(g=c.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=_.useCallback(()=>a(!1),[]);Su(o,()=>{p(),h()}),_.useEffect(()=>{if(!o)return;const g=x=>{var v,k;const S=x.target;(v=c.current)!=null&&v.contains(S)||(k=d.current)!=null&&k.contains(S)||p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,p]),_.useEffect(()=>{if(!o){u(null);return}const g=()=>{c.current&&u(c.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),_.useEffect(()=>{var g,x;!o||!l||(x=(g=d.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,v,k,S,b;const j=Array.from(((x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(j.length===0)return;const P=j.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(v=j[(P+1)%j.length])==null||v.focus();break;case"ArrowUp":g.preventDefault(),(k=j[(P-1+j.length)%j.length])==null||k.focus();break;case"Home":g.preventDefault(),(S=j[0])==null||S.focus();break;case"End":g.preventDefault(),(b=j[j.length-1])==null||b.focus();break;case"Tab":p();break}},y=g=>{var x;g.disabled||(p(),h(),(x=g.onSelect)==null||x.call(g))},w=e.props;return f.jsxs("span",{ref:c,className:an.wrapper,children:[_.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=w.onClick)==null||x.call(w,g),a(v=>!v)}}),o&&l&&typeof document<"u"&&Ns.createPortal(f.jsxs("div",{ref:d,id:i,role:"menu",className:Y(an.menu,r==="chalkboard"&&an.chalkboard,s),style:{position:"fixed",top:l.bottom+P8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:an.surface}),f.jsx("div",{className:an.list,children:t.map(g=>j8(g)?f.jsx("div",{role:"separator",className:an.separator},g.id):f.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:Y(an.item,g.danger&&an.danger,g.disabled&&an.itemDisabled),onClick:()=>y(g),children:[g.icon&&f.jsx("span",{className:an.icon,children:g.icon}),f.jsx("span",{className:an.label,children:g.label})]},g.id))})]}),document.body)]})}function Qe(e){const t=e.split(`
79
- `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const wS="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",Gn={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},Kn={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},T8=Qe,R8=8,N8="basis-[25.5rem]",I8=e=>{switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?` — phase ${e.phaseIndex+1}`:"";case"audit":return" — audit";case"batch-reconcile":return" — batch reconcile";case"reconcile":return" — reconcile";case"fix-review":return" — fixing review comments";case"draft":return" — drafting";case"extend":return" — extending";case"commit-suggest":return" — suggesting commit message";case"overlap-check":return" — checking overlap";case"sync":return" — syncing to main";case"resolve-conflict":return" — resolving conflict";case"run-all":return" — run all phases";default:return""}},A8=({task:e,onStop:t})=>{const n=Zt(),{toast:r}=Ge(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(u){r({title:"Failed to stop agent",description:Qe(u.message),variant:"error"})}},o={starting:Gn.running,running:Gn.running,stopping:Gn.running,done:Gn.pass,error:Gn.fail,superseded:Gn.running},a={starting:Kn.running,running:Kn.running,stopping:Kn.running,done:Kn.pass,error:Kn.fail,superseded:Kn.running};return f.jsx(Ee,{surface:"chalkboard",size:"small",className:"stack-task-card",children:f.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[f.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,I8(e)," · ",ck[e.agentId]]}),f.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?f.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsx(Ae,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):f.jsx(Ae,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&f.jsx(ut,{icon:f.jsx(Ca,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},M8=()=>{const e=F(r=>r.agentStatus),t=F(r=>r.stopAgent),n=e.slice(0,R8);return f.jsxs("div",{className:"flex min-h-0 flex-auto flex-col p-6",children:[f.jsx("div",{className:wS,children:"Agent"}),f.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${N8} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>f.jsx(A8,{task:r,onStop:t},r.id)):f.jsx(Ee,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})};function wl(e,t){const{toast:n}=Ge(),r=F(o=>o.activeGitAction),s=F(o=>o.setActiveGitAction),i=_.useCallback(async o=>{if(!F.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Qe(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function Tu(){const e=F(k=>k.loadGitStatus),t=F(k=>k.loadPlans),n=F(k=>k.loadIdeas),r=F(k=>k.activeGitAction!==null),{toast:s,dismiss:i}=Ge(),o=()=>Promise.all([e(),t(),n()]),[a,l]=wl("push","Push failed"),[u,c]=wl("sync","Sync failed"),[d,h]=wl("pull","Pull failed"),[p,m]=wl("fix-divergence","Fix failed"),y=_.useCallback((k,S)=>{if(S.recovering)return s({title:`${k} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:b,message:j}=S,P=s({title:`${k} hit a conflict`,description:f.jsxs("div",{className:"flex flex-col items-start gap-2",children:[f.jsx("span",{children:Qe(j)}),f.jsx(ne,{size:"small",onClick:async()=>{const T=await IM(b).catch(E=>({ok:!1,error:Qe(E.message)}));T.ok&&i(P),s({title:T.ok?"Resolving conflict":"Could not start the agent",description:T.ok?"Handed off to the agent — see Stack for progress":T.error??"The agent did not start.",variant:T.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:u,pulling:d,fixingDivergence:p,gitActionBusy:r,handlePush:()=>l(async()=>{await EM(),await e()}),handleSync:()=>c(async()=>{const k=await TM();if(!k.ok){if(y("Sync",k)){await e();return}throw new Error(k.message)}await o()}),handlePull:()=>h(async()=>{await RM(),await o()}),handleFixDivergence:()=>m(async()=>{const k=await NM();if(!k.ok){if(y("Fix",k)){await e();return}throw new Error(k.message)}await o()})}}function xv(e){const t=e.match(/Found (\d+) errors?\./);return t?Number(t[1]):0}function L8(e,t){const n=xv(e)+xv(t);return n>0?`${n} lint/format issue${n===1?"":"s"} found.`:"Lint or format check failed."}function D8(e){const t=e.match(/Tests\s+(\d+) failed/);return t?`${t[1]} test${t[1]==="1"?"":"s"} failed.`:"Tests failed."}const bS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m12 3-1.6 4.85a2 2 0 0 1-1.27 1.27L4.27 10.7l4.86 1.6a2 2 0 0 1 1.27 1.27L12 18.4l1.6-4.86a2 2 0 0 1 1.27-1.27l4.86-1.6-4.86-1.6a2 2 0 0 1-1.27-1.27L12 3Z"}),f.jsx("path",{d:"M19 3v3"}),f.jsx("path",{d:"M20.5 4.5h-3"})]}),kS=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 19V5"}),f.jsx("path",{d:"m5 12 7-7 7 7"})]}),_S=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M12 5v14"}),f.jsx("path",{d:"m5 12 7 7 7-7"})]}),Ru=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"18",cy:"18",r:"3"}),f.jsx("circle",{cx:"6",cy:"6",r:"3"}),f.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),f.jsx("path",{d:"M12 17v2"})]}),F8=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),f.jsx("polyline",{points:"21 3 21 9 15 9"})]}),O8=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[f.jsx("circle",{cx:"5",cy:"12",r:"2"}),f.jsx("circle",{cx:"12",cy:"12",r:"2"}),f.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),z8=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"m18 4 3 3-3 3"}),f.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),f.jsx("path",{d:"m18 20 3-3-3-3"}),f.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),f.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),B8=({size:e=12})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"10",cy:"10",r:"3"}),f.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),$8=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})}),Qm=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Idea"}),f.jsx("path",{d:"M9 18h6M10 22h4M12 2a6 6 0 0 0-3.5 10.9c.53.4.9 1.03.9 1.72V15h5.2v-.38c0-.69.37-1.32.9-1.72A6 6 0 0 0 12 2Z"})]}),V8=({size:e=14})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[f.jsx("title",{children:"Note"}),f.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),f.jsx("path",{d:"M15 3v6h6"})]}),U8=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function W8(e){var s;if(!e||e.phases.length>0&&e.phases.every(i=>i.done))return{title:""};const t=((s=e.tags)==null?void 0:s.find(i=>U8.includes(i)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const H8=()=>{var M,O,A;const e=F(R=>R.status),t=F(R=>R.runCheck),n=F(R=>R.fixQuality),r=F(R=>R.consistency),s=F(R=>R.plans),i=F(R=>R.gitBranch),o=F(R=>R.gitAhead),a=F(R=>R.gitBehind),l=F(R=>R.gitDiverged),u=Zt(),[c,d]=_.useState(!1),{fixingDivergence:h,gitActionBusy:p,handleFixDivergence:m}=Tu(),{qualityStatus:y,testStatus:w,consistencyStatus:g}=_.useMemo(()=>mk(e),[e]),x=y==="running"||w==="running"||g==="running",v=r.length>0,k=_.useCallback(R=>R.kind==="orphan-subject"&&R.planId?s==null?void 0:s.entries.find(z=>z.id===R.planId):void 0,[s==null?void 0:s.entries]),S=_.useCallback(R=>{const z=k(R);z&&u({to:"/plans/$planId",params:{planId:encodeURIComponent(z.title)}})},[k,u]),b={...Gn,stale:"transparent"},j={...Kn,stale:void 0},P=x,T=v;`${((M=e==null?void 0:e.lint)==null?void 0:M.output)||"(none)"}${((O=e==null?void 0:e.format)==null?void 0:O.output)||"(none)"}`;const E=`Fix the failing tests in this repo. Output from the last test run:
80
-
81
- ${((A=e==null?void 0:e.test)==null?void 0:A.output)||"(no output captured)"}`,I=R=>f.jsx(Ie,{content:R.title,surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] ${P?"cursor-not-allowed":"cursor-pointer"} ${P&&R.status!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{P||R.onClick()},disabled:P,children:f.jsxs(Ae,{surface:"chalkboard",size:"small",fillColor:b[R.status],textColor:j[R.status],children:[R.label,f.jsx("span",{className:R.status==="running"?"visible":"invisible",children:"…"})]})})});return f.jsxs("div",{className:"flex-none flex flex-col gap-3",children:[f.jsxs("div",{className:"flex gap-2 flex-wrap justify-center",children:[I({label:"Quality",status:y,title:"Code style & formatting (Biome lint + format). Click to run.",onClick:()=>{t("lint"),t("format")}}),I({label:"Tests",status:w,title:"Unit tests (Vitest). Click to run.",onClick:()=>t("test")}),I({label:"Consistency",status:g,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",onClick:()=>t("consistency")}),f.jsxs("div",{children:[f.jsx(Ie,{content:T?"Plan/idea doc findings — orphan subjects & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, stale references).",surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${T?"enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] cursor-pointer":"cursor-default"}`,disabled:!T,"aria-expanded":T?c:void 0,"aria-controls":"stack-doc-findings",onClick:()=>{T&&d(R=>!R)},children:f.jsx(Ae,{surface:"chalkboard",size:"small",fillColor:T?Gn.fail:Gn.pass,textColor:T?Kn.fail:Kn.pass,children:"Docs"})})}),c&&T&&f.jsx("div",{id:"stack-doc-findings",className:"mt-2 flex flex-col gap-2",children:r.map((R,z)=>f.jsx("div",{className:"font-mono text-2xs text-desk-text-muted",children:k(R)?f.jsx("button",{type:"button",onClick:()=>S(R),className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit] text-left",children:R.message}):f.jsx("span",{className:"text-left",children:R.message})},`${R.kind}-${R.title}-${z}`))})]})]}),(()=>{var B,L,$;let R,z=null;return P?R=f.jsx("span",{className:"text-desk-text-muted",children:"Running checks…"}):l?(R=f.jsxs("span",{className:"text-desk-text-muted",children:[i," has diverged from origin (",o," local, ",a," remote)"]}),z=f.jsx("button",{type:"button",onClick:m,disabled:p,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 [font:inherit]",children:h?"Fixing…":"Suggested fix: Fix git issues"})):y==="fail"?(R=f.jsx("span",{className:"text-desk-text-muted",children:L8(((B=e==null?void 0:e.lint)==null?void 0:B.output)??"",((L=e==null?void 0:e.format)==null?void 0:L.output)??"")}),z=f.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit]",children:"Suggested fix: run biome --write"})):w==="fail"?(R=f.jsx("span",{className:"text-desk-text-muted",children:D8((($=e==null?void 0:e.test)==null?void 0:$.output)??"")}),z=f.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",f.jsx(Kh,{text:E,surface:"chalkboard"})]})):g==="fail"?(R=f.jsx("span",{className:"text-desk-text-muted",children:"Codebase consistency failed (knip / dependency-cruiser)."}),z=f.jsx("span",{className:"text-desk-text-muted opacity-80",children:"Run pnpm run consistency for details."})):v?R=f.jsx("span",{className:"text-desk-text-muted",children:"Plan doc issues — see the Docs stamp."}):y==="pass"&&w==="pass"&&g==="pass"?R=f.jsx("span",{className:"text-chalk-pass-text",children:"All checks passing."}):R=f.jsx("span",{className:"text-desk-text-muted opacity-60",children:"Checks haven't run yet."}),f.jsxs("div",{className:"text-center flex flex-col gap-1 font-handwritten text-sm",children:[R,f.jsx("span",{className:z?"visible":"invisible",children:z??" "})]})})()]})},G8=({count:e})=>{const t=Zt();return f.jsxs("button",{type:"button",onClick:()=>t({to:"/diff"}),className:"block mx-auto bg-none bg-transparent border-none p-0 text-center font-mono text-xs text-desk-text-muted underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},K8=({files:e})=>{const t=F(S=>S.plans),n=F(S=>S.agentStatus),r=F(S=>S.loadGitStatus),s=F(S=>S.commitInFlight),i=F(S=>S.setCommitInFlight),{toast:o}=Ge(),[a,l]=_.useState(""),[u,c]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),y=_.useMemo(()=>oM(t==null?void 0:t.entries),[t==null?void 0:t.entries]),{title:w}=_.useMemo(()=>W8(y),[y]);_.useEffect(()=>{w&&!a&&l(w)},[w,a]);const g=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{if(g.current===null){if(n.length===0)return;g.current=new Set(n.filter(b=>b.suggestedCommit).map(b=>b.id))}const S=n.find(b=>{var j;return b.suggestedCommit&&!((j=g.current)!=null&&j.has(b.id))});!(S!=null&&S.suggestedCommit)||x.current===S.id||(x.current=S.id,l(S.suggestedCommit.title))},[n]);const v=_.useCallback(async()=>{if(!(!a.trim()||s)){c(!0),i(!0);try{await hk(e,a.trim()),l(""),await r()}catch(S){o({title:"Commit failed",description:T8(S.message),variant:"error"}),await r()}finally{c(!1),i(!1)}}},[a,e,r,s,i,o]),k=_.useCallback(async()=>{if(e.length!==0){h(!0),m(null);try{const S=await pk(e);l(S.title)}catch(S){m(S.message)}finally{h(!1)}}},[e]);return f.jsxs(f.Fragment,{children:[p&&f.jsx(xS,{surface:"chalkboard",dismissible:!0,onDismiss:()=>m(null),children:p}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx("div",{className:"flex-1",children:f.jsx(Pa,{surface:"chalkboard",size:"small",placeholder:"Commit title",value:a,onChange:S=>l(S.currentTarget.value)})}),f.jsx(ut,{icon:f.jsx(bS,{size:16}),surface:"chalkboard",size:"small",label:"Suggest title and message from the diff",disabled:e.length===0||d,onClick:k,wobble:d?1:0})]}),f.jsx(ne,{surface:"chalkboard",size:"small",fullWidth:!0,disabled:e.length===0||!a.trim()||u||s,onClick:v,children:u||s?"Committing…":"Commit"})]})},q8=()=>{const{syncing:e,gitActionBusy:t,handleSync:n}=Tu();return f.jsx(ne,{surface:"chalkboard",size:"small",fullWidth:!0,icon:f.jsx(Ru,{size:14}),disabled:t,onClick:n,children:e?"Syncing…":"Branch merged — sync to main"})},Y8=({gitAhead:e,gitBranchHygiene:t})=>{const{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=Tu();return e>0?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"opacity-50 text-xs m-0",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(kS,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"opacity-50 text-xs m-0",children:"No changed files."}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(Ie,{content:t==="clean-on-main"?"Already on clean main":void 0,surface:"chalkboard",children:f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(Ru,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),f.jsx(ne,{surface:"chalkboard",size:"small",icon:f.jsx(_S,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},Q8=()=>{const e=F(i=>i.gitStatus),t=F(i=>i.gitBranch),n=F(i=>i.gitAhead),r=F(i=>i.gitBranchHygiene),s=_.useMemo(()=>(e==null?void 0:e.map(i=>i.path))??[],[e]);return f.jsxs("div",{className:"flex-none flex flex-col p-6",children:[f.jsxs("div",{className:`${wS} flex items-center gap-2`,children:["Deliver",t&&f.jsx(Ae,{surface:"chalkboard",size:"small",children:t})]}),f.jsxs(Ee,{surface:"chalkboard",size:"small",children:[f.jsx(H8,{}),e&&e.length>0?f.jsxs(f.Fragment,{children:[f.jsx(G8,{count:e.length}),f.jsx("div",{className:"flex-shrink-0 flex flex-col gap-3 mt-3",children:r==="stale-merged"?f.jsx(q8,{}):f.jsx(K8,{files:s})})]}):f.jsx("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-3",children:f.jsx(Y8,{gitAhead:n,gitBranchHygiene:r})})]})]})},X8=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=F(b=>b.loadPlans),i=F(b=>b.status),o=F(b=>b.loadStatus),a=F(b=>b.consistency),l=F(b=>b.loadConsistency),u=F(b=>b.loadGitStatus),c=F(b=>b.agentStatus),d=F(b=>b.loadAgentStatus),h=F(b=>b.loadSuggestions),p=F(b=>b.loadArchivableIdeas),m=_u(),y=_.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:u,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p});_.useEffect(()=>{y.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:u,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p}}),_.useEffect(()=>{y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},[]),_.useEffect(()=>{const b=new EventSource("/api/activity/stream"),j={},P=(T,E,I)=>{j[T]&&clearTimeout(j[T]),j[T]=setTimeout(E,I)};return b.onmessage=T=>{const E=JSON.parse(T.data);if(E.type==="status"){P("status",()=>y.current.loadStatus(),80);return}if(E.type==="agent"){P("agent",()=>y.current.loadAgentStatus(),120);return}E.message==="changed"&&P("activity",()=>{y.current.loadPlans(),y.current.loadSuggestions(),y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},250)},()=>{for(const T of Object.values(j))T&&clearTimeout(T);b.close()}},[]);const{qualityStatus:w,testStatus:g,consistencyStatus:x}=_.useMemo(()=>mk(i),[i]),v=a.length>0,k=w==="fail"||g==="fail"||x==="fail"||v,S=c.some(b=>b.status==="running"||b.status==="starting"||b.status==="stopping");return f.jsxs(f.Fragment,{children:[f.jsx(tS,{children:!r&&f.jsx(Ni.div,{initial:m?void 0:{opacity:0,x:20},animate:{opacity:1,x:0},exit:m?void 0:{opacity:0,x:20},transition:{duration:m?0:.2,ease:"easeOut"},className:"fixed right-0 top-[var(--pc-stack-toggle-top,50%)] z-[300] rounded-l-md shadow-[-2px_0_8px_rgba(0,0,0,0.15)] bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:"translateY(-50%)"},children:f.jsx(ut,{icon:S?f.jsx(Ii,{size:"small",surface:"chalkboard",label:"Agent running"}):k?f.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-chalk-fail-text shadow-[0_0_6px_rgba(214,160,160,0.9)]"}):f.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:S?"Open stack panel — agent running":k?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${S?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":k?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})})}),f.jsxs(Ni.div,{animate:{x:r?0:"100%"},transition:{duration:m?0:.3,ease:[.4,0,.2,1]},className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",children:[f.jsxs("div",{className:"flex h-20 shrink-0 items-center justify-between px-6",children:[f.jsx("span",{className:"font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&f.jsx(ut,{icon:f.jsx("span",{className:"text-sm leading-none",children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,className:"h-7 w-7 border border-desk-border"})]}),f.jsx(gv,{surface:"chalkboard"}),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(M8,{}),f.jsx(gv,{surface:"chalkboard"}),f.jsx(Q8,{})]})]})]})},J8=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),Z8=()=>{const[e,t]=_.useState(null),[n,r]=_.useState(null),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return i(!0),Promise.all([_A().then(a=>{!o&&a&&t(J8(a))}),kA().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},eU=["repo-docs"],tU=["subjects","setup","merge-policy"];function Xm(){const{planId:e}=Di({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function nU(){const{ideaId:e}=Di({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function rU(){const{section:e}=Di({strict:!1});return eU.includes(e)?e:null}function t9(){const{section:e}=Di({strict:!1});return tU.includes(e)?e:null}function n9(){const e=rU(),t=F(r=>r.activeDocTitle),n=F(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const sU=250;function SS(e,t,n={}){const{debounceMs:r=sU,...s}=n,[i,o]=_.useState(e);_.useEffect(()=>{const u=setTimeout(()=>o(e),r);return()=>clearTimeout(u)},[e,r]);const{threshold:a,limit:l}=s;return _.useMemo(()=>kM(i,t,{threshold:a,limit:l}),[i,t,a,l])}const CS=()=>{const[e,t]=_.useState([]),[n,r]=_.useState(!0),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return rk().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},iU=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=Z8();return f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?f.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):f.jsx(BV,{icon:f.jsx(Y4,{}),size:"small"}),f.jsx("span",{className:`font-display-luminari font-semibold whitespace-nowrap overflow-hidden text-ellipsis min-w-0 ${e==="sm"?"text-sm":"text-md"}`,children:r?"Loading…":t??"Paper Camp"})]})},oU=()=>{const[e,t]=_.useState(null);return _.useEffect(()=>{},[]),e?f.jsxs("div",{role:"alert",className:"bg-watercolor-rose-dark text-desk-text py-2 px-4 text-2xs font-mono shrink-0",children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null};function PS(e,t=0){return e?{duration:0,ease:"easeOut"}:{duration:.18,ease:"easeOut",delay:t}}function jS(e,t={y:8}){return{initial:e?void 0:{opacity:0,...t},animate:{opacity:1,x:0,y:0}}}const aU=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=_u(),i=_.useRef(null);return _.useEffect(()=>{if(!n)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,r]),_.useEffect(()=>{var a;if(!n)return;const o=document.activeElement;return(a=i.current)==null||a.focus(),()=>{var l;return(l=o==null?void 0:o.focus)==null?void 0:l.call(o)}},[n]),f.jsxs(f.Fragment,{children:[n&&f.jsx("button",{type:"button",className:"lg:hidden fixed inset-0 z-[290] cursor-default border-none p-0 bg-ink-900/[40%] backdrop-blur-sm",onClick:r,"aria-label":"Close sidebar",tabIndex:-1}),f.jsx("aside",{ref:i,role:n?"dialog":void 0,"aria-modal":n||void 0,"aria-label":"Sidebar navigation",tabIndex:-1,className:`fixed inset-y-0 left-0 z-[300] w-[224px] shrink-0 flex flex-col overflow-hidden transition-transform duration-300 ease-out lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 h-[var(--pc-sidebar-h,100%)] ${n?"translate-x-0":"-translate-x-full"} ${n?"bg-[var(--pui-bg-base)] shadow-[2px_0_12px_rgba(0,0,0,0.15)]":"bg-transparent"}`,children:f.jsx("div",{className:"flex-1 overflow-y-auto pt-5 relative",children:f.jsx(Ni.div,{...jS(s,{x:-8}),transition:PS(s,.08),children:t},e)})})]})},lU=()=>{const e=F(b=>b.agentStatus),t=F(b=>b.gitStatus),n=F(b=>b.gitBranch),r=F(b=>b.gitAhead),s=F(b=>b.gitBranchHygiene),i=F(b=>b.quickCommit),o=F(b=>b.commitInFlight),a=F(VM),l=F(UM),{pushing:u,syncing:c,pulling:d,gitActionBusy:h,handlePush:p,handleSync:m,handlePull:y}=Tu(),{toast:w}=Ge(),g=Zt(),x=e.find(b=>b.status==="running"||b.status==="starting"||b.status==="stopping"),v=x!==void 0,k=(t==null?void 0:t.length)??0,S=async()=>{if(o||k===0)return;const b=await i();b.ok?w({title:"Committed",description:b.warning??b.title,variant:b.warning?"warning":"success"}):w({title:"Commit failed",description:b.error,variant:"error"})};return f.jsxs("div",{style:Sa("kraft"),className:"flex items-center gap-3 h-8 px-4 border-b border-black/[8%] text-2xs flex-shrink-0 box-border overflow-x-auto overflow-y-hidden whitespace-nowrap",children:[f.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx("span",{className:"opacity-50",children:"⌥"}),f.jsx("code",{className:"text-ink-900",children:n??"no branch"})]}),r>0&&f.jsxs("span",{className:"opacity-60",children:["↑",r]}),f.jsx("span",{className:"opacity-60",children:k>0?`${k} changed`:"clean"}),v&&f.jsx(Ii,{size:"small",label:`Agent ${x==null?void 0:x.status}…`}),l&&f.jsx(Ie,{content:"Sign in from Settings → Connections so agent tasks can run",children:f.jsx("button",{type:"button",onClick:()=>g({to:"/settings/$section",params:{section:"setup"}}),className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsx(Ae,{size:"small",variant:"warning",children:"Agent not signed in"})})}),a>0&&f.jsx(Ie,{content:"Some features are disabled — open Setup to fix",children:f.jsx("button",{type:"button",onClick:()=>g({to:"/settings/$section",params:{section:"setup"}}),className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsxs(Ae,{size:"small",variant:"warning",children:["Setup (",a,")"]})})})]}),f.jsx("div",{className:"flex-1"}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(Ie,{content:s==="clean-on-main"?"Already on clean main":"Sync to main",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(Ru,{}),className:"text-2xs",disabled:h||s==="clean-on-main",onClick:m,children:c?"Syncing…":"Sync to main"})}),f.jsx(Ie,{content:"Push commits to origin",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(kS,{}),className:"text-2xs",disabled:h||r===0,onClick:p,children:u?"Pushing…":r>0?`Push (${r})`:"Push"})}),f.jsx(Ie,{content:"Fast-forward the current branch from origin",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(_S,{}),className:"text-2xs",disabled:h,onClick:y,children:d?"Pulling…":"Pull"})}),f.jsx(Ie,{content:"Commit all changes with an auto-suggested message",children:f.jsx(ne,{variant:"ghost",size:"small",icon:f.jsx(B8,{}),className:"text-2xs",disabled:o||k===0,onClick:S,children:o?"Committing…":k>0?`Commit (${k})`:"Commit"})})]})]})},cU=({children:e})=>f.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),Ea=()=>{const e=F(i=>i.loadPlans),{toast:t}=Ge(),[n,r]=_.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await nM(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},uU=e=>{const t=F(d=>d.loadPlans),{toast:n}=Ge(),[r,s]=_.useState(!1),[i,o]=_.useState(!1),[a,l]=_.useState(null);return _.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async d=>{if(!e.id)return!1;s(!0),l(null);try{const{error:h,undo:p}=await LA(e.id,d);return await t(),p&&l(p),h&&n({title:"Agent did not reply",description:Qe(h),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Qe(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:d}=await DA(e.id,a.commitSha);if(d){n({title:"Undo failed",description:Qe(d),variant:"error"});return}l(null),await t()}catch(d){n({title:"Undo failed",description:Qe(d.message),variant:"error"})}finally{o(!1)}}}}},dU=async e=>{const t=await fetch(`/api/trail?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},fU=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{if(n(null),!e)return;let r=!1;return dU(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function ES(){const[e,t]=_.useState("idle"),[n,r]=_.useState(null),s=_.useRef(null),i=_.useCallback(async a=>{s.current&&clearTimeout(s.current),t("loading"),r(null);try{await a(),t("success"),s.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),s.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=_.useCallback(()=>{s.current&&clearTimeout(s.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:i,reset:o,loading:e==="loading",success:e==="success"}}const Jm="Keep phases short: 3-7 phases, each a one-line imperative title. Add a description only when the phase isn't self-explanatory, and keep it to one sentence. Never restate the idea's body and never summarise the work you did.";function hU(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
82
- `),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
83
- `):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
84
- `):"(none)";return`You are auditing the plan "${e.title}" (${e.id??"no id"}) for missing phases. The plan is a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
85
-
86
- Plan body: ${e.body}
87
-
88
- Current phases:
89
- ${t}
90
-
91
- Log entries (issues, bugs, and review notes recorded so far):
92
- ${n}
93
-
94
- Clarifications (answered scope/design questions):
95
- ${r}
96
-
97
- ${Jm}
98
-
99
- Task:
100
- 1. Read the plan above, then inspect the relevant code in this repo.
101
- 2. Identify work that is clearly required to fulfil this plan but is covered by no existing phase. The Log entries are the best source — they often record bugs or gaps that were never turned into phases.
102
- 3. If you found missing work: append one \`- [ ] <short phase title>\` line per item at the end of the \`### Phases\` list. You may add detail below a checkbox line as continuation lines indented with 6 spaces. Then append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what was found and appended>\`, creating that section after the Phases list if it does not exist.
103
- 4. If nothing is missing: make no edits at all — no Log line, no empty heading, no "nothing found" note. This audit re-runs regularly and must leave no trace when there is nothing to add.
104
-
105
- Rules:
106
- - Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
107
- - Never touch the YAML frontmatter.
108
- - Append only: new unchecked phases at the end of the list, plus the single Log line.`}function pU(e){const t=e.phases.length>0,n=t?"plan":"idea",r=t?e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
109
- `):"(none — this is a backlog idea with no phases yet)";return`You are reconciling the ${n} "${e.title}" (${e.id??"no id"}), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
110
-
111
- ${t?"Plan":"Idea"} body: ${e.body}
112
-
113
- Current phases:
114
- ${r}
115
-
116
- Task: this ${n} has drifted from the codebase — some ${t?"phase descriptions and body prose":"body prose"} may reference file paths that moved, code symbols that were renamed or removed, or approaches that were superseded during implementation. Find and fix only that drift.
117
-
118
- 1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
119
- 2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
120
- 3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
121
-
122
- Hard guardrails, never violate these:
123
- - Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
124
- - Never un-check, check, delete, or reorder any phase line, checked or unchecked.
125
- - Never add or remove phases.
126
- - Never touch the Log or Clarifications sections.
127
- - If nothing is stale, make no edits at all.`}function Zm(e,t,n,r){return`You are ${t} the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. Edit only that file, and within it only the \`### Log\` section.
128
-
129
- ${n}
130
-
131
- ${Jm}
132
-
133
- Task:
134
- 1. Explore this codebase and find what is relevant to the idea: the files it would touch, existing helpers or patterns it should build on, and constraints visible in the code.
135
- 2. Write up what you found as a single dated entry — name specific files and symbols, describe a workable approach, and include the architectural context you found. Sharpen the idea's original intent, do not redirect it.
136
- 3. Append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what you found>\`, creating that section at the end of the file if it does not exist. Use today's date, and keep the entry to that single physical line (no literal line breaks).
137
-
138
- Keep unchanged:
139
- ${r}
140
-
141
- Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function mU(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
142
- `):"(none)",n=`Current idea body, in full (do not modify this):
143
- ${e.body}
144
-
145
- Prior Log entries:
146
- ${t}`,r=`- the YAML frontmatter (id, title)
147
- - the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return Zm(e,"expanding",n,r)}const TS=`- the YAML frontmatter (id, title, status)
148
- - the original body prose beneath the frontmatter`;function gU(e){const t=`This idea was just promoted from an AI-generated one-liner suggestion — its current body is only that one-liner, with no deeper context yet:
149
- ${e.body}`;return Zm(e,"fleshing out",t,TS)}function r9(e,t){const n=`This idea was just promoted from a roadmap item under "${t}" in ROADMAP.md — its current body is only that item's one-line description plus a provenance note, with no deeper context yet:
150
- ${e.body}`;return Zm(e,"fleshing out",n,TS)}function yU(e,t){const n=t.filter(s=>s.status!=="done"),r=n.length?n.map(s=>`${s.id??"no id"}: ${s.title} (${s.phases.length} phases)`).join(`
151
- `):"(no other open plans exist yet)";return`You are drafting a plan for the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. The idea and its plan are ONE file: you draft the plan by editing that existing file in place — never create a new file.
152
-
153
- Idea body, in full:
154
- ${e.body}
155
-
156
- ## What drafting adds to the file (see papercamp/about.md)
157
-
158
- The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
159
-
160
- 1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
161
- 2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
162
- 3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
163
-
164
- \`\`\`
165
- ### Phases
166
- - [ ] Short phase title
167
- Optional description of the phase, indented with 6 spaces.
168
- \`\`\`
169
-
170
- ${Jm}
171
-
172
- Hard rules:
173
- - Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft.
174
- - Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
175
- - Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
176
-
177
- ## Every other open (non-done) plan, for scope context
178
-
179
- ${r}
180
-
181
- Use the open entities above only to avoid duplicating in-flight scope and to match phase granularity. Edit only papercamp/ideas/${e.id??"<ID>"}.md — never create, edit, move, or rename any other file.`}function xU(e,t){const n=e.length?e.map(s=>`### ${s.id??"no id"}: ${s.title}
182
- ${s.body}`).join(`
183
-
184
- `):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
185
- `):"(none yet)";return`You are scanning this repository for ideas worth suggesting, to append to papercamp/suggestions.md — a lightweight holding pen. Edit only that one file.
186
-
187
- Existing ideas (do not repeat anything already covered here):
188
- ${n}
189
-
190
- Existing suggestions already in the holding pen (do not repeat these either):
191
- ${r}
192
-
193
- Task:
194
- 1. Explore this codebase for gaps, rough edges, or "you might want to do X" hunches that aren't already an idea or an existing suggestion above — things like missing error handling, an obvious follow-up to recent work, a TODO left in code, or a UX gap you notice while reading the app.
195
- 2. For each genuinely new one you find (0 to a handful — do not force a quota), append one line to papercamp/suggestions.md formatted exactly \`- YYYY-MM-DD: Title — one-line description\`, using today's date. Keep the title short (a few words, like an idea title) and the description to a single physical line (no literal line breaks).
196
- 3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
197
-
198
- Rules:
199
- - Append only — never modify, reorder, or delete any existing line in suggestions.md.
200
- - Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
201
- - Never touch any other file in the repo.`}const Nu=({idea:e,otherPlans:t})=>{const n=F(d=>d.launchPlanDraft),r=F(Qr),{state:s,errorMessage:i,run:o}=ES(),{toast:a}=Ge(),l=()=>{const d=e.id;d&&o(async()=>{try{await n(d,yU(e,t))}catch(h){throw a({title:"Draft failed",description:Qe(h.message),variant:"error"}),h}})},u=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",c=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Ie,{content:c,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:u})})},RS=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=_.useRef(null),[s,i]=_.useState(!1),[o,a]=_.useState(!1);return _.useLayoutEffect(()=>i(!1),[n]),_.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const u=()=>a(l.scrollHeight-l.clientHeight>1);u();const c=new ResizeObserver(u);return c.observe(l),()=>c.disconnect()},[s,n]),f.jsxs("div",{children:[f.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&f.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":s,className:"self-start bg-none bg-transparent border-none py-1 px-0 [font:inherit] text-xs opacity-60 cursor-pointer underline",children:s?"Show less":"Show more"})]})},Jr=({id:e})=>e?f.jsx(Ae,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,NS={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},eg={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},nr={idea:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},planned:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"in-progress":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"},review:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},IS={open:"Open",done:"Done",dropped:"Dropped"},Hc={open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},vU={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},vv={draft:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},closed:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},merged:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"}},wU={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},wv={approved:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"changes-requested":{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},"review-required":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"}},AS=({pr:e})=>f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:f.jsx(Ae,{size:"small",fillColor:vv[e.state].fill,textColor:vv[e.state].text,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx($8,{}),"#",e.number," ",vU[e.state]]})})}),MS=({pct:e,color:t,height:n=6})=>f.jsx(yV,{value:e,color:t,height:n}),bv={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},kv={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},bl=({reached:e,label:t,tooltip:n,href:r})=>{const s=f.jsx(Ae,{size:"small",fillColor:e?bv.fill:kv.fill,textColor:e?bv.text:kv.text,children:t}),i=r?f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?f.jsx(Ie,{content:n,children:i}):i},of=()=>f.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),_v=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function bU(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const kU=({trail:e})=>{var o,a;const{taskRuns:t,commits:n,pr:r,releaseLine:s}=e,i=s.data?bU(s.data):void 0;return f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(bl,{reached:t.reached,label:t.data?_v(t.data.length,"task run"):"Tasks",tooltip:(o=t.data)==null?void 0:o.map(l=>l.taskKind).join(", ")}),f.jsx(of,{}),f.jsx(bl,{reached:n.reached,label:n.data?_v(n.data.length,"commit"):"Commits",tooltip:(a=n.data)==null?void 0:a.join(`
202
- `)}),f.jsx(of,{}),r.data?f.jsx(AS,{pr:r.data}):f.jsx(bl,{reached:!1,label:"PR"}),f.jsx(of,{}),f.jsx(bl,{reached:s.reached,label:i?`Released ${i.hash}`:"Release",tooltip:s.data,href:i==null?void 0:i.url})]})},_U=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&f.jsx(Ae,{size:"small",fillColor:wv[t].fill,textColor:wv[t].text,children:wU[t]}),!!n&&f.jsxs(Ae,{size:"small",fillColor:nr["in-progress"].fill,textColor:nr["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},SU=({open:e,onClose:t,onAdd:n})=>{const[r,s]=_.useState(""),[i,o]=_.useState(""),[a,l]=_.useState(!1),[u,c]=_.useState(!1),[d,h]=_.useState(null),[p,m]=_.useState(null),[y,w]=_.useState(!1),[g,x]=_.useState(null),[v,k]=_.useState(null),S=F(A=>{var R;return((R=A.plans)==null?void 0:R.entries)??[]}),{patch:b}=Ea(),j=Zt(),P=SS(r,S.map(A=>({id:A.id,title:A.title,body:A.body,tags:A.tags,log:A.log})));_.useEffect(()=>{e&&(s(""),o(""),l(!1),c(!1),h(null),w(!1),x(null),k(null))},[e]);const T=A=>{t(),j({to:"/plans/$planId",params:{planId:encodeURIComponent(A)}})},E=async()=>{const A=`${r.trim()}${i.trim()?`
203
-
204
- ${i.trim()}`:""}`;if(A){w(!0),k(null),x(null);try{const R=S.map(z=>({id:z.id,title:z.title,body:z.body,tags:z.tags}));x(await ik(A,R))}catch(R){k(R.message)}finally{w(!1)}}},I=A=>{const R=S.find(z=>z.id===A);R&&T(R.title)},M=async(A,R,z)=>{m(A);const L={date:new Date().toISOString().slice(0,10),text:r.trim()},$=await b(R,{log:[...z??[],L]},{errorTitle:"Extend failed"});m(null),$&&t()},O=async A=>{if(A.preventDefault(),!(!r.trim()||u)){h(null),c(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a?"note":void 0}),t()}catch(R){h(R.message)}finally{c(!1)}}};return f.jsx(ja,{open:e,onClose:t,title:"New idea",size:"small",children:f.jsxs("form",{onSubmit:O,className:"flex flex-col gap-4",children:[f.jsx(Pa,{label:"Title",value:r,onChange:A=>s(A.target.value),placeholder:"Idea title…",disabled:u,autoFocus:!0,required:!0}),P.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),P.map(({candidate:A})=>{const R={id:A.id??null,title:A.title,body:A.body,log:A.log},z=S.filter(B=>B.id!==A.id);return f.jsx(Ee,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Jr,{id:A.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:A.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>T(A.title),children:"Open it"}),f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!A.id||!r.trim()||p!==null,onClick:()=>A.id&&M(A.id,A.title,A.log),children:p===A.id?"Extending…":"Extend it instead"}),f.jsx(Nu,{idea:R,otherPlans:z})]})]})},A.id??A.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:E,children:y?"Checking overlap…":"Check overlap"})}),v&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),g&&f.jsx(Ee,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>I(g.targetId),children:"Open it"})})]})})]}),f.jsx(Eu,{label:"Description",value:i,onChange:A=>o(A.target.value),placeholder:"Optional details…",disabled:u,rows:4}),f.jsx(a6,{label:"Just a note (no plan needed)",checked:a,onChange:A=>l(A.target.checked),disabled:u}),d&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),f.jsx(ne,{type:"submit",variant:"primary",disabled:!r.trim()||u,children:"Add"})]})]})})},CU=({suggestion:e,onClose:t})=>{const n=F(c=>c.promoteSuggestion),r=F(c=>c.launchIdeaExtend),[s,i]=_.useState(!1),[o,a]=_.useState(null),{toast:l}=Ge();_.useEffect(()=>{e&&(i(!1),a(null))},[e]);const u=async()=>{if(e){i(!0),a(null);try{const c=await n(e),d=F.getState().ideaEntries.find(h=>h.id===c);if(d)try{await r(c,gU(d))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Qe(h.message),variant:"error"})}t()}catch(c){a(c.message)}finally{i(!1)}}};return f.jsx(ja,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),f.jsx(ne,{type:"button",variant:"primary",onClick:u,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},af=({tokens:e})=>f.jsx(f.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return f.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return f.jsx("span",{className:r?"bg-watercolor-green/[30%] text-watercolor-green-dark no-underline":"bg-watercolor-rose/[30%] text-watercolor-rose-dark line-through",children:t.text},`${t.type}-${n}`)})}),Sv=e=>f.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),PU=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=_.useState(!1),[a,l]=_.useState(!1),u=e.body!==t.body,c=e.phases.map((m,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),d=i||a,h=async()=>{if(!d){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return f.jsx(ja,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:d?()=>{}:h,children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!u&&c.length===0&&f.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),u&&f.jsxs("div",{children:[Sv("Body"),f.jsx("p",{className:"text-base m-0 leading-normal",children:f.jsx(af,{tokens:Ed(t.body,e.body)})})]}),c.length>0&&f.jsxs("div",{children:[Sv("Phases"),f.jsx("div",{className:"flex flex-col gap-3",children:c.map(({phase:m,before:y,index:w})=>f.jsxs("div",{className:"text-sm leading-normal",children:[f.jsx(af,{tokens:Ed(y.text,m.text)}),(m.description||y.description)&&f.jsx("div",{className:"opacity-[0.85] mt-1",children:f.jsx(af,{tokens:Ed(y.description??"",m.description??"")})})]},w))})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{variant:"danger",size:"small",onClick:h,disabled:d,children:"Discard"}),f.jsx(ne,{variant:"primary",size:"small",onClick:p,disabled:d,children:"Approve"})]})]})})},jU=()=>{const e=F(c=>c.archivableIdeas),t=F(c=>c.archiveIdeas),[n,r]=_.useState(null),[s,i]=_.useState(!1),{toast:o}=Ge(),a=_.useCallback(async c=>{try{await t(c)}catch(d){o({title:"Archive failed",description:d.message,variant:"error"})}},[t,o]),l=_.useCallback(async c=>{r(c.id);try{await a([c.id])}finally{r(null)}},[a]),u=_.useCallback(async()=>{i(!0);try{await a(e.map(c=>c.id))}finally{i(!1)}},[a,e]);return e.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[f.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",e.length,")"]}),f.jsx(ne,{variant:"ghost",size:"small",disabled:s||n!==null,onClick:u,children:s?"Archiving…":"Archive all"})]}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(c=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Ee,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Jr,{id:c.id}),f.jsx("span",{className:"flex-1 min-w-0 font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:c.title}),f.jsx(ut,{icon:f.jsx("span",{children:"→"}),variant:"ghost",size:"small",label:`Archive ${c.title}`,disabled:n===c.id||s,onClick:()=>l(c),className:"w-[28px] h-[28px]"})]})})},c.id))})]})},EU="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]",TU=({onAdd:e,disabled:t})=>{const[n,r]=_.useState(!1),[s,i]=_.useState(""),[o,a]=_.useState(null),[l,u]=_.useState(!1),c=()=>{r(!1),i(""),a(null)},d=async()=>{let h;try{h=CM(s)}catch(p){a(p instanceof Error?p.message:"Could not parse findings");return}u(!0),a(null);try{await e(h),c()}finally{u(!1)}};return f.jsxs(f.Fragment,{children:[f.jsx(Ie,{content:"Add code-review findings as phases",children:f.jsx(ut,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:f.jsx(Q4,{size:16})})}),f.jsx(ja,{open:n,onClose:c,title:"Add code-review findings",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",f.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),f.jsx(Eu,{value:s,onChange:h=>i(h.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&f.jsxs(xS,{variant:"warning",children:["Could not add phases — ",o]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:c,disabled:l,children:"Cancel"}),f.jsx(ne,{type:"button",variant:"primary",onClick:d,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},RU=cM.map(e=>({value:e,label:e})),NU=({open:e,onClose:t,onAdd:n})=>{const[r,s]=_.useState(""),[i,o]=_.useState(""),[a,l]=_.useState("feat"),[u,c]=_.useState(!1),[d,h]=_.useState(null),[p,m]=_.useState(null),[y,w]=_.useState(!1),[g,x]=_.useState(null),[v,k]=_.useState(null),S=F(R=>{var z;return((z=R.plans)==null?void 0:z.entries)??[]}),{patch:b}=Ea(),j=Zt(),{toast:P}=Ge(),T=SS(r,S.map(R=>({id:R.id,title:R.title,body:R.body,tags:R.tags,log:R.log})));_.useEffect(()=>{e&&(s(""),o(""),l("feat"),c(!1),h(null),w(!1),x(null),k(null))},[e]),_.useEffect(()=>{x(null),k(null)},[r,i]);const E=R=>{t(),j({to:"/plans/$planId",params:{planId:encodeURIComponent(R)}})},I=async()=>{const R=`${r.trim()}${i.trim()?`
205
-
206
- ${i.trim()}`:""}`;if(R){w(!0),k(null),x(null);try{const z=S.map(B=>({id:B.id,title:B.title,body:B.body,tags:B.tags}));x(await ik(R,z))}catch(z){k(z.message)}finally{w(!1)}}},M=R=>{const z=S.find(B=>B.id===R);z?E(z.title):P({title:"Plan not found",description:`No plan with id ${R}`,variant:"error"})},O=async(R,z,B)=>{m(R);const $={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await b(z,{log:[...B??[],$]},{errorTitle:"Extend failed"});m(null),C&&t()},A=async R=>{if(R.preventDefault(),!(!r.trim()||u)){h(null),c(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(z){h(z.message)}finally{c(!1)}}};return f.jsx(ja,{open:e,onClose:t,title:"Quick plan",size:"small",children:f.jsxs("form",{onSubmit:A,className:"flex flex-col gap-4",children:[f.jsx(Pa,{label:"Title",value:r,onChange:R=>s(R.target.value),placeholder:"Backlog item title…",disabled:u,autoFocus:!0,required:!0}),T.length>0&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),T.map(({candidate:R})=>{const z={id:R.id??null,title:R.title,body:R.body,log:R.log},B=S.filter(L=>L.id!==R.id);return f.jsx(Ee,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Jr,{id:R.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:R.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>E(R.title),children:"Open it"}),f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!R.id||!r.trim()||p!==null,onClick:()=>R.id&&O(R.id,R.title,R.log),children:p===R.id?"Extending…":"Extend it instead"}),f.jsx(Nu,{idea:z,otherPlans:B})]})]})},R.id??R.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:I,children:y?"Checking overlap…":"Check overlap"})}),v&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),g&&f.jsx(Ee,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(ne,{type:"button",variant:"ghost",size:"small",onClick:()=>M(g.targetId),children:"Open it"})})]})})]}),f.jsx(qh,{label:"Kind",value:a,onChange:R=>l(R),options:RU,disabled:u}),f.jsx(Eu,{label:"Description",value:i,onChange:R=>o(R.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(ne,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),f.jsx(ne,{type:"submit",variant:"primary",disabled:!r.trim()||u,children:"Add"})]})]})})},IU=()=>f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10 6h10M10 12h10M10 18h10"}),f.jsx("path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"})]}),AU=()=>{const e=F(o=>o.loadPlans),t=F(o=>o.gitBranchHygiene),[n,r]=_.useState(!1),s=t==="stale-merged",i=async o=>{await tM(o),await e(),r(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(Ie,{content:s?"Switch to main first":void 0,children:f.jsx(ut,{icon:f.jsx(IU,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),f.jsx(NU,{open:n,onClose:()=>r(!1),onAdd:i})]})},MU=({planId:e,phaseIndex:t,disabled:n})=>{const r=F(c=>c.launchAgent),s=F(Qr),{toast:i}=Ge(),[o,a]=_.useState(!1),l=async c=>{if(c.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(d){i({title:"Failed to start agent",description:Qe(d.message),variant:"error"})}finally{a(!1)}}},u=e?s?"Start agent on this phase":"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(ut,{icon:f.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:u,onClick:l,disabled:n||o||!e||!s,className:"transition-opacity text-ink-500"})},LU=({plan:e,disabled:t})=>{const n=F(l=>l.launchPlanAudit),r=F(Qr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,hU(e))}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ie,{content:a,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},tg=({idea:e,compact:t})=>{const n=F(h=>h.launchIdeaExtend),r=F(Qr),{state:s,errorMessage:i,run:o}=ES(),{toast:a}=Ge(),l=e.id,u=()=>{l&&o(async()=>{const h=F.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,mU(h))}catch(p){throw a({title:"Extension failed",description:Qe(p.message),variant:"error"}),p}})},c=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",d=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Ie,{content:d,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:u,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:c})})},DU=({plan:e,disabled:t})=>{const n=F(c=>c.launchFixReview),r=F(Qr),s=F($M),[i,o]=_.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,u=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ie,{content:u,children:f.jsx(li,{size:"small",icon:f.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:l?"opacity-50":void 0,children:i?"Starting…":"Fix review comments"})})},FU=()=>{const e=F(s=>s.loadIdeas),[t,n]=_.useState(!1),r=async s=>{await ZA(s),await e(),n(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(ut,{icon:f.jsx(K4,{size:16}),variant:"ghost",size:"small",label:"New idea",onClick:()=>n(!0)}),f.jsx(SU,{open:t,onClose:()=>n(!1),onAdd:r})]})};async function OU(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const zU=({planTitle:e,planId:t,phaseIndex:n})=>{const[r,s]=_.useState("idle"),i=async o=>{o.stopPropagation();const a=`Start phase ${n+1} of plan "${e}" in papercamp/ideas/${t??"<ID>"}.md`,l=await OU(a);s(l?"copied":"failed"),setTimeout(()=>s("idle"),1500)};return f.jsx(ut,{icon:r==="copied"?f.jsx(gS,{size:16}):r==="failed"?f.jsx(Ca,{size:16}):f.jsx(q4,{size:16}),variant:"ghost",size:"small",label:r==="copied"?"Copied":r==="failed"?"Copy failed — select and copy manually":"Copy phase prompt",onClick:i,className:`transition-opacity ${r==="copied"?"text-state-success":r==="failed"?"text-state-danger":"text-ink-500"}`})},BU=({plan:e,disabled:t})=>{const n=F(l=>l.launchPlanReconcile),r=F(Qr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,pU(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ie,{content:a,children:f.jsx(ne,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},LS=()=>{const e=F(s=>s.refreshAll),t=F(s=>s.refreshing),{toast:n}=Ge(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return f.jsx(ut,{icon:f.jsx("span",{className:`inline-flex${t?" animate-pc-spin motion-reduce:animate-none":""}`,children:f.jsx(F8,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},$U=({plan:e,disabled:t})=>{const n=F(u=>u.launchRunAll),r=F(Qr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{i(!1)}}},a=t||s||!e.id||!r,l=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return f.jsx(Ie,{content:l,children:f.jsx(li,{size:"small",icon:f.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:a?"opacity-50":void 0,children:s?"Starting…":"Run all phases"})})},VU=()=>{const e=F(y=>y.launchSuggestIdeas),t=F(y=>y.launchBatchReconcile),n=F(y=>y.launchPrioritise),r=F(y=>y.ideaEntries),s=F(y=>y.suggestions),i=F(gm),o=F(Qr),{toast:a}=Ge(),[l,u]=_.useState(null),c=async()=>{u("suggest");try{await e(xU(r,s))}catch(y){a({title:"Failed to launch",description:Qe(y.message),variant:"error"})}finally{u(null)}},d=async()=>{u("actualise");try{await t()}catch(y){a({title:"Failed to launch",description:Qe(y.message),variant:"error"})}finally{u(null)}},h=async()=>{u("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:Qe(y.message),variant:"error"})}finally{u(null)}},p=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:f.jsx(bS,{size:16}),disabled:p||!o,onSelect:c},{id:"actualise-all",label:l==="actualise"?"Starting…":"Actualise all",icon:f.jsx(gS,{size:16}),disabled:p||!o,onSelect:d},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:f.jsx(z8,{size:16}),disabled:p||!o,onSelect:h}];return f.jsx(E8,{align:"end",trigger:f.jsx(ut,{icon:f.jsx(O8,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function UU(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Iu="font-display-luminari text-sm font-semibold opacity-[0.65]",WU=({plan:e,auditRunning:t,agentBusy:n,agentPhaseIndex:r,planTask:s,updating:i,onTogglePhase:o,onToggleFix:a,onAddReviewPhases:l})=>{const u=F(p=>p.launchRunAll),c=e.fixes??[],d=c.some(p=>!p.done),h=[...e.phases.map((p,m)=>({kind:"phase",item:p,index:m})),...c.map((p,m)=>({kind:"fix",item:p,index:m}))];return f.jsxs("div",{className:"mb-8",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[f.jsx("h3",{className:`${Iu} m-0`,children:"Phases"}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t&&f.jsx(Ii,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&f.jsx(LU,{plan:e}),e.status!=="done"&&f.jsx(BU,{plan:e}),f.jsx(TU,{onAdd:l,disabled:i}),e.id&&d&&f.jsx(Ie,{content:"Run the open fixes with an agent",children:f.jsx(ne,{size:"small",onClick:()=>e.id&&u(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})]}),f.jsx(M$,{data:h,columns:[{key:"checkbox",header:"Status",cell:p=>f.jsx(f4,{checked:p.item.done,onChange:()=>p.kind==="phase"?o(p.index):a(p.index),disabled:i}),width:2},{key:"title",header:"Title",cell:p=>f.jsxs("span",{className:`inline-flex items-center gap-2 ${p.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[p.item.text,p.kind==="phase"&&p.item.source==="review"&&f.jsx(Ae,{size:"small",fillColor:nr.review.fill,textColor:nr.review.text,children:"review"}),p.kind==="fix"&&f.jsx(Ae,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"Actions",align:"end",cell:p=>p.kind==="phase"?f.jsxs("div",{className:"inline-flex gap-2 items-center",children:[f.jsx(zU,{planTitle:e.title,planId:e.id,phaseIndex:p.index}),!p.item.done&&r===p.index?f.jsx(Ii,{size:"small",label:`Agent ${s==null?void 0:s.status}…`}):!p.item.done&&f.jsx(MU,{planId:e.id,phaseIndex:p.index,disabled:n})]}):null,width:7}],expandable:{render:p=>p.item.description||null},showExpandColumn:!1,rowTexture:p=>p.kind==="fix"?"kraft":void 0,rowClassName:p=>p.kind==="phase"&&p.item.source==="review"?"bg-[rgba(155,122,181,0.08)]":void 0,className:"phase-table-phone"})]})},HU=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-4",children:[i&&!n&&f.jsx(Ee,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("span",{className:"text-sm",children:["Working branch: ",f.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&f.jsx(Ie,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:f.jsx(ne,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&f.jsxs("span",{className:"text-sm opacity-[0.45]",children:["Working branch: ",f.jsx("code",{children:t})]}),e.pr&&f.jsx(AS,{pr:e.pr}),e.pr&&f.jsx(_U,{pr:e.pr})]})},GU=({progress:e,color:t})=>f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"flex-1",children:f.jsx(MS,{pct:e.pct,color:t})}),f.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[e.done,"/",e.total]})]}),KU=({plan:e})=>f.jsx("div",{className:"mb-4",children:f.jsx("div",{className:"opacity-[0.85]",children:e.body&&f.jsx(RS,{resetKey:e.id??e.title,children:f.jsx(ek,{children:e.body})})})}),qU=({clarifications:e})=>e.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${Iu} mb-3`,children:"Clarifications"}),f.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>f.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:f.jsxs("span",{children:[f.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),YU=({planId:e})=>{const t=fU(e);return t?f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Iu} mb-3`,children:"History"}),f.jsx(kU,{trail:t})]}):null},QU={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},XU=({messages:e,undo:t,undoing:n,onUndo:r})=>f.jsx(f.Fragment,{children:e.map((s,i)=>{const o=QU[s.kind],a=s.from==="agent",l=i===e.length-1;return f.jsxs("div",{className:`flex flex-col gap-1 ${a?"items-start":"items-end"}`,children:[f.jsx("div",{className:"max-w-[85%]",children:f.jsx(Ee,{size:"small",surface:"paper",texture:a?"kraft":o?"canvas":"parchment",shade:a,accent:!a,accentColor:o?"rose":"blue",children:f.jsx(RS,{collapsedLines:3,resetKey:`${s.kind}-${s.date??""}-${i}`,children:s.text})})}),f.jsxs("div",{className:"flex items-center gap-2",children:[a&&f.jsx(Ae,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),a&&l&&t&&f.jsx(Ie,{content:"Revert this run's plan edit",children:f.jsx(ne,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),s.date&&f.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:s.date}),o&&f.jsx(Ae,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:o})]})]},`${s.kind}-${s.date??""}-${i}`)})}),JU=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{const[o,a]=_.useState(""),l=e.thread??[],u=async()=>{o.trim()&&await n(o.trim())&&a("")};return f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Iu} mb-3`,children:"Feedback"}),f.jsxs(Ee,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[f.jsx("div",{className:"flex flex-col gap-3 mb-4",children:l.length>0?f.jsx(XU,{messages:l,undo:r,undoing:s,onUndo:i}):f.jsx("p",{className:"text-sm m-0 text-ink-500",children:"Jot a comment, ask a question, or say what's wrong with this plan."})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Eu,{value:o,onChange:c=>a(c.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3,disabled:t}),f.jsxs("div",{className:"flex justify-end items-center gap-3",children:[f.jsx("span",{className:t?"visible":"invisible",children:f.jsx(Ii,{size:"small",label:"Agent replying…"})}),f.jsx(ne,{size:"small",onClick:u,disabled:t||!o.trim(),children:"Send"})]})]})]})]})},ZU=({plan:e})=>{const t=F(A=>A.plans),n=F(A=>A.gitBranch),r=F(A=>A.loadGitStatus),{toast:s}=Ge(),{patch:i,updating:o}=Ea(),[a,l]=_.useState(!1),u=F(A=>A.agentStatus),c=F(gm),d=F(A=>A.detailView),h=fm(e.id,u),p=h?h.phaseIndex:null,m=(h==null?void 0:h.taskKind)==="audit",y=iM(e),w=e.phases.length>0,g=d==="feedback",x={id:e.id??null,title:e.title,body:e.body,log:e.log},v=((t==null?void 0:t.entries)??[]).filter(A=>A.id!==e.id),k=e.id!==void 0&&UU(n)===e.id,S=async()=>{if(e.id){l(!0);try{const A=await AM(e.id);s({title:"Branch ready",description:`Now on ${A}`,variant:"success"}),await r()}catch(A){s({title:"Branch failed",description:Qe(A.message),variant:"error"})}finally{l(!1)}}},b=async A=>{const R=e.phases.map((B,L)=>L===A?{...B,done:!B.done}:B);R.every(B=>B.done)&&e.status==="in-progress"?await i(e.title,{phases:R,status:"review"}):await i(e.title,{phases:R})},j=async A=>{await i(e.title,{phases:[...e.phases,...A]})},P=async A=>{const R=(e.fixes??[]).map((B,L)=>L===A?{...B,done:!B.done}:B);R.every(B=>B.done)&&e.status==="in-progress"?await i(e.title,{fixes:R,status:"review"}):await i(e.title,{fixes:R})},{sending:T,send:E,undo:I,undoing:M,undoEdit:O}=uU(e);return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-3 flex-wrap",children:[f.jsxs("h2",{className:`${EU} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[f.jsx(Jr,{id:e.id}),e.title]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${Tc(e.updated)}`:`created ${Tc(e.created)}`}),f.jsx(LS,{})]})]}),g?f.jsx(JU,{plan:e,updating:T,onSend:E,undo:I,undoing:M,onUndo:O}):f.jsxs(f.Fragment,{children:[f.jsx(HU,{plan:e,gitBranch:n,onOwnBranch:k,branching:a,onCreateBranch:S}),y!==null&&f.jsx(GU,{progress:y,color:NS[hm(e,u)]}),f.jsx(KU,{plan:e}),f.jsx(qU,{clarifications:e.clarifications??[]}),!w&&f.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[f.jsx(Nu,{idea:x,otherPlans:v}),f.jsx(tg,{idea:x})]}),w&&f.jsx(WU,{plan:e,auditRunning:m,agentBusy:c,agentPhaseIndex:p,planTask:h,updating:o,onTogglePhase:b,onToggleFix:P,onAddReviewPhases:j}),f.jsx(YU,{planId:e.id})]})]})},eW=()=>{const[e,t]=_.useState(new Set);return _.useEffect(()=>{let n=!1;return qA().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},go="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",ng=({order:e,done:t,running:n,status:r})=>f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?f.jsx(Ii,{size:"small",label:"Agent running"}):t?f.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?f.jsx(Ae,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:f.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?f.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:f.jsx(Qm,{size:14})}):null}),Yh="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",DS=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=Yh,i=F(o=>o.agentStatus);return f.jsxs("div",{className:"flex flex-col gap-1",children:[r&&f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Ee,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx("span",{className:go,children:"Id"}),f.jsx("span",{className:go,children:"Title"}),f.jsx("span",{className:`max-lg:hidden ${go}`,children:"Updated"}),f.jsx("span",{className:go,children:"Progress"}),f.jsx("span",{className:go,children:"Status"})]})})})]}),e.map(o=>{var u;const a=lk(o),l=hm(o,i);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(ng,{order:o.order,done:o.status==="done",status:o.status,running:!!fm(o.id,i)}),f.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:f.jsx(Ee,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx(Jr,{id:o.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?Tc(o.updated):Tc(o.created)}),a?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(MS,{pct:a.pct,color:NS[l]})}),f.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Ae,{size:"small",fillColor:nr[l].fill,textColor:nr[l].text,children:eg[l]}),((u=o.pr)==null?void 0:u.state)==="merged"&&f.jsx(Ie,{content:`Merged in #${o.pr.number}`,children:f.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:f.jsx(Ru,{size:14})})})]})]})})})]},o.title)})]})},tW=5,nW="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",FS="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",Cv="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",Pv=`${nW} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,rW=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],OS="flex items-center gap-2 min-w-0 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit font-semibold",zS="overflow-hidden text-ellipsis whitespace-nowrap",sW=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=_.useState(new Set),{subjects:a,loading:l,available:u}=CS(),c=eW(),d=Zt(),h=FS,p=F(b=>b.planFilters.sortKey),m=F(b=>b.planFilters.sortDirection),y=F(b=>b.setPlanSortKey),w=F(b=>b.togglePlanSortDirection),g=b=>{b===p?w():y(b)},x=b=>{o(j=>{const P=new Set(j);return P.has(b)?P.delete(b):P.add(b),P})},v=b=>b.type==="plan"?f.jsx(DS,{plans:[b.plan],activePlanTitle:n,onOpen:r,showHeader:!1},b.plan.title):b.type==="note"?f.jsx(iW,{row:b,onOpen:s},b.idea.title):f.jsx(oW,{row:b,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(b.idea.title),onToggleExpanded:()=>x(b.idea.title)},b.idea.title),k=gM(e,l||!u?void 0:a),S=k.length>1;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:Pv,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Ee,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsx("div",{className:h,children:rW.map(({key:b,label:j})=>{const P=b===p;return f.jsx("span",{role:"columnheader",className:b==="updated"?"max-lg:hidden":void 0,"aria-sort":P?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:Pv,onClick:()=>g(b),children:[j,P&&(m==="asc"?" ▲":" ▼")]})},b)})})})})]}),S?k.map(b=>{const j=b.subject;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx("div",{className:"flex items-baseline gap-2",children:j&&c.has(j)?f.jsx("button",{type:"button",className:`${Cv} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>d({to:"/roadmap",search:{item:j}}),children:j}):f.jsx("div",{className:Cv,children:j??"No subject"})}),b.rows.map(P=>v(P))]},j??"__no-subject__")}):e.map(b=>v(b))]})},iW=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return f.jsxs("div",{className:"flex items-center",children:[f.jsx(ng,{order:n.order,done:r==="done",status:r}),f.jsx("div",{role:t?"button":void 0,tabIndex:t?0:void 0,onClick:t?()=>t(n.title):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(n.title))}:void 0,className:`${t?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:f.jsx(Ee,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:FS,children:[n.id?f.jsx(Jr,{id:n.id}):f.jsx("span",{}),f.jsxs("span",{className:`${OS} [cursor:inherit]`,children:[f.jsx(V8,{}),f.jsx("span",{className:zS,children:n.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsx(Ae,{size:"small",fillColor:Hc[r].fill,textColor:Hc[r].text,children:IS[r]})]})})})]})},oW=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,u=l.filter(p=>p.status==="done"),c=l.filter(p=>p.status!=="done"),d=l.length>tW,h=d&&!i?c:l;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx(ng,{order:a.order,done:a.status==="done",status:a.status}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Ee,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?f.jsx(Jr,{id:a.id}):f.jsx("span",{}),f.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:OS,children:[f.jsx(Qm,{}),f.jsx("span",{className:zS,children:a.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${u.length}/${l.length} plans done`:"—"}),f.jsx(tg,{idea:a,compact:!0}),f.jsx(Nu,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&f.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[f.jsx(DS,{plans:h,activePlanTitle:n,onOpen:r,showHeader:!1}),d&&f.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${u.length} done`})]})]})},aW=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=_.useRef(null);return _.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),f.jsx("div",{ref:i,children:t.length>0?f.jsx(sW,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):f.jsx("p",{className:"opacity-50 py-6 px-0 text-center",children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},lW=({idea:e})=>f.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[f.jsxs("h2",{className:"font-display-luminari font-semibold text-[1.75rem] leading-tight mt-0 mr-0 mb-4 ml-0 flex items-center gap-3 flex-wrap",children:[f.jsx(Jr,{id:e.id??void 0}),e.title,e.status&&f.jsx(Ae,{size:"small",fillColor:Hc[e.status].fill,textColor:Hc[e.status].text,children:IS[e.status]})]}),f.jsx(ek,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),f.jsx("div",{className:"mt-6",children:f.jsx(tg,{idea:e})})]}),lf="__no-subject__",ss="font-handwritten text-xs font-semibold leading-none text-ink-300 mb-2",cW=()=>{const e=F(P=>P.plans),t=Xm(),n=F(gm),r=F(P=>P.agentStatus),{patch:s,updating:i}=Ea(),{subjects:o,available:a}=CS(),l=F(P=>P.detailView),u=F(P=>P.setDetailView),c=t?e==null?void 0:e.entries.find(P=>P.title===t):null,[d,h]=_.useState("");if(_.useEffect(()=>{h((c==null?void 0:c.order)!==void 0?String(c==null?void 0:c.order):"")},[c==null?void 0:c.order]),!c)return null;const p=hm(c,r),m=c.status==="in-progress",y=c.status==="review",w=c.status==="dropped",g=c.phases.some(P=>!P.done),x=(c.status==="planned"||m)&&g,v=!!(c.pr&&(c.pr.state==="open"||c.pr.state==="draft")&&c.pr.unresolvedThreadCount),k=a&&c.subject&&!o.includes(c.subject)?c.subject:void 0,S=P=>s(c.title,P),b=m||y||c.status==="planned",j=async()=>{const P=d.trim(),T=Number(P);if(P===""||!Number.isInteger(T)||T<1){h(c.order!==void 0?String(c.order):"");return}T!==c.order&&await S({order:T})};return f.jsx("div",{className:"-mt-5",children:f.jsx(Ee,{surface:"paper",texture:"speckle",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.jsx("h2",{className:"m-0 font-display-luminari text-base text-ink-900",children:"Plan"}),f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Show"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(li,{size:"small",active:l==="details",onClick:()=>u("details"),children:"Details"}),f.jsx(li,{size:"small",active:l==="feedback",onClick:()=>u("feedback"),children:"Feedback"})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Status"}),f.jsx(Ae,{size:"small",fillColor:nr[p].fill,textColor:nr[p].text,children:eg[p]})]}),f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Subject"}),f.jsx(qh,{size:"small",value:c.subject??lf,onChange:P=>S({subject:P===lf?null:P}),disabled:i||!a,options:[{value:lf,label:"No subject"},...k?[{value:k,label:`${k} (orphan)`}]:[],...!a&&c.subject&&!k?[{value:c.subject,label:c.subject}]:[],...o.map(P=>({value:P,label:P}))]})]}),b&&f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Order"}),f.jsx(Pa,{type:"number",size:"small","aria-label":"Run order",min:1,value:d,onChange:P=>h(P.target.value),onBlur:j,disabled:i})]}),f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Agent"}),f.jsx(qh,{size:"small",value:c.agent??"",onChange:P=>S({agent:P||null}),disabled:i,options:[{value:"",label:"Project default agent"},...uM.map(P=>({value:P,label:ck[P]}))]})]}),c.tags.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Tags"}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:c.tags.map(P=>f.jsx(Ae,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:P},P))})]}),f.jsxs("div",{children:[f.jsx("div",{className:ss,children:"Actions"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[x&&f.jsx($U,{plan:c,disabled:n||i}),v&&f.jsx(DU,{plan:c,disabled:n||i}),y&&f.jsx(li,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>S({status:"done"}),disabled:i,className:i?"opacity-50":void 0,children:"Approve & close"}),f.jsx(li,{size:"small",icon:f.jsx("span",{className:w?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:w?"↺":"⊘"}),onClick:()=>S({status:w?null:"dropped"}),disabled:i,className:i?"opacity-50":void 0,children:w?"Reopen plan":"Mark dropped"})]})]})]})})})},jv=8,uW=["in-progress","review","planned","idea","done","dropped"],dW={...eg,idea:"Backlog"},Ev="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",fW=()=>{const e=F(v=>v.plans),t=Xm(),n=F(v=>v.planFilters),r=F(v=>v.togglePlanStatus),s=F(v=>v.togglePlanTag),i=F(v=>v.setPlanSearch),o=F(v=>v.setSubjectFilter),a=Zt(),[l,u]=_.useState(!1);if(!e||t)return null;const{statusCounts:c,tagCounts:d}=Bl(e.entries,n),h=new Set(n.statuses),p=new Set(n.tags),y=[...new Set([...Object.keys(d),...n.tags])].sort((v,k)=>{const S=(d[k]??0)-(d[v]??0);return S!==0?S:v.localeCompare(k)}),w=l?y:y.slice(0,jv),g=y.length-w.length,x="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs";return f.jsx("div",{className:"-mt-5",children:f.jsx(Ee,{surface:"paper",texture:"speckle",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.jsx("h2",{className:"m-0 font-display-luminari text-base text-ink-900",children:"Filters"}),f.jsx(Pa,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:v=>i(v.target.value)}),n.subject!==null&&f.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[f.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),f.jsx("button",{type:"button",onClick:()=>{o(null),a({to:"/",search:{}})},className:x,children:"Clear"})]}),f.jsxs("div",{children:[f.jsx("div",{className:Ev,children:"Status"}),f.jsx("div",{className:"flex flex-col gap-1",children:uW.map(v=>{const k=h.has(v);return f.jsxs("button",{type:"button",onClick:()=>r(v),"aria-pressed":k,className:`flex items-center gap-2 w-full px-2 py-1 rounded-md border-none cursor-pointer text-left ${k?"bg-black/[5%] opacity-100":"bg-transparent opacity-50"}`,children:[f.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:nr[v].text}}),f.jsx("span",{className:"flex-1 text-xs text-ink-900",children:dW[v]}),f.jsx("span",{className:"text-2xs text-ink-500",children:c[v]})]},v)})})]}),f.jsxs("div",{children:[f.jsx("div",{className:Ev,children:"Tags"}),f.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[y.length===0&&f.jsx("span",{className:"opacity-50 text-2xs",children:"No tags"}),w.map(v=>{const k=p.has(v);return f.jsxs("button",{type:"button",onClick:()=>s(v),"aria-pressed":k,className:`text-2xs px-2 py-[2px] rounded-md border-[0.5px] border-black/[12%] cursor-pointer ${k?"bg-black/[8%] opacity-100":"bg-transparent opacity-55"}`,children:[v," ",d[v]??0]},v)}),g>0&&f.jsxs("button",{type:"button",onClick:()=>u(!0),className:x,children:["+",g," more"]}),l&&y.length>jv&&f.jsx("button",{type:"button",onClick:()=>u(!1),className:x,children:"Show less"})]})]})]})})})},Tv=()=>f.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[f.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),f.jsx(LS,{}),f.jsx(FU,{}),f.jsx(AU,{}),f.jsx(VU,{})]}),hW=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],pW=()=>f.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Ee,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:Yh,children:[f.jsx(on,{variant:"text",width:28}),f.jsx(on,{variant:"text",width:44}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(on,{variant:"text",width:56})}),f.jsx(on,{variant:"text",width:64}),f.jsx(on,{variant:"text",width:48})]})})})]}),hW.map(e=>f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:f.jsx(on,{variant:"text",width:16})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Ee,{size:"small",className:"plan-row-card",children:f.jsxs("div",{className:Yh,children:[f.jsx(on,{variant:"rect",width:44,height:18}),f.jsx(on,{variant:"text",width:e.title}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(on,{variant:"text",width:52})}),f.jsx(on,{variant:"rect",width:80,height:8}),f.jsx(on,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),mW=()=>{const e=F(c=>c.reconcileQueue),t=F(c=>c.removeFromReconcileQueue),n=F(c=>c.plans),{patch:r}=Ea(),{toast:s}=Ge(),i=_.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(c=>c.id===o.planId))??null:null;if(_.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),_.useEffect(()=>{e.length===0&&(i.current=0)},[e.length]),!o||!a)return null;const l=async()=>{t(o.previewId),i.current+=1,s({title:"Kept the merged version",description:`"${a.title}" keeps the agent's rewrite.`})},u=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return f.jsx(PU,{plan:a,before:o.before,onApprove:l,onDiscard:u,queuePosition:{index:i.current+1,total:i.current+e.length}})},gW=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Ee,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex-1 min-w-0 flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit",children:[f.jsx(Qm,{}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),f.jsx(ut,{icon:f.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),rg=()=>{const e=F(b=>b.plans),t=F(b=>b.plansError),n=F(b=>b.ideaEntries),r=F(b=>b.suggestions);F(b=>b.loadPlans);const s=F(b=>b.setDetailView),i=F(b=>b.planFilters),o=F(b=>b.setSubjectFilter),a=Xm(),l=nU(),u=F(b=>b.dismissSuggestion),c=Zt(),{toast:d}=Ge(),{subject:h}=Qp({strict:!1});_.useEffect(()=>{o(h??null)},[h,o]),_.useEffect(()=>{s("details")},[a,l,s]);const p=()=>{c({to:"/"})},m=b=>{c({to:"/plans/$planId",params:{planId:encodeURIComponent(b)}})},y=b=>{c({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(b)}})},[w,g]=_.useState(null),x=async b=>{try{await u(b)}catch(j){d({title:"Failed to dismiss suggestion",description:j.message,variant:"error"})}},v=a?e==null?void 0:e.entries.find(b=>b.title===a):null,k=l?n.find(b=>b.title===l):null;if(t)return f.jsxs("div",{children:[f.jsx(cU,{children:"Plans"}),f.jsxs(Ee,{size:"small",accent:!0,accentColor:"rose",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),f.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return f.jsxs("div",{children:[f.jsx(Tv,{}),f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),f.jsx(pW,{})]});const{rows:S}=yM(e.entries,n,i);return f.jsxs(f.Fragment,{children:[f.jsx(mW,{}),v?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(yv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"plan",label:v.title}]})}),f.jsx(ZU,{plan:v})]}):k?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(yv,{items:[{id:"plans",label:"Plans",onClick:p},{id:"idea",label:k.title}]})}),f.jsx(lW,{idea:k})]}):f.jsxs("div",{children:[f.jsx(Tv,{}),e.warnings.length>0&&f.jsxs(Ee,{size:"small",accent:!0,accentColor:"amber",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),f.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(b=>f.jsxs("li",{children:[b.title,": ",b.message]},b.title))})]}),e.entries.length===0?f.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",f.jsx("strong",{children:"New idea"})," above, or click"," ",f.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):f.jsx(aW,{plans:e.entries,rows:S,activePlanTitle:a,onOpenPlan:m,onOpenIdea:y}),f.jsx(jU,{}),f.jsx(gW,{suggestions:r,onOpen:g,onDismiss:x}),f.jsx(CU,{suggestion:w,onClose:()=>g(null)})]})]})},BS=_.lazy(()=>Kr(()=>import("./index-D7DjxVq7.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsPage}))),yW=_.lazy(()=>Kr(()=>import("./index-D7DjxVq7.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsSidebar}))),$S=_.lazy(()=>Kr(()=>import("./index-CSirjtoU.js"),__vite__mapDeps([2,3,1])).then(e=>({default:e.SettingsPage}))),xW=_.lazy(()=>Kr(()=>import("./index-CSirjtoU.js"),__vite__mapDeps([2,3,1])).then(e=>({default:e.SettingsSidebar}))),vW=_.lazy(()=>Kr(()=>import("./index-ChVvOU5G.js"),__vite__mapDeps([4,3])).then(e=>({default:e.TasksPage}))),wW=_.lazy(()=>Kr(()=>import("./index-CvQKE4RC.js"),[]).then(e=>({default:e.RoadmapPage}))),bW=_.lazy(()=>Kr(()=>import("./index-CPoqe3xq.js"),[]).then(e=>({default:e.DiffPage}))),kW=_.lazy(()=>Kr(()=>import("./index-jTvzs7JN.js"),__vite__mapDeps([5,3])).then(e=>({default:e.StatsPage}))),cf=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],Rv=()=>f.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),VS="stack-open";function _W(){try{return localStorage.getItem(VS)==="true"}catch{return!1}}function SW(e){try{localStorage.setItem(VS,String(e))}catch{}}const CW="(min-width: 1440px)";function PW(e){const[t,n]=_.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return _.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const jW=()=>{var S;const e=Zt(),t=bT({select:b=>b.location.pathname}),n=F(b=>b.loadPlans),r=F(b=>b.loadIdeas),s=F(b=>b.loadSuggestions),i=F(b=>b.loadCapabilities),o=F(b=>b.loadAgentAuthStatus),a=F(b=>b.setActiveDocTitle),l=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),u=t==="/docs"||t.startsWith("/docs/"),c=t==="/settings"||t.startsWith("/settings/"),d=l?"plans":u?"docs":c?"settings":(S=cf.find(b=>b.path===t))==null?void 0:S.id,h=l||u||c,p=l?"plans":u?"docs":"settings",[m,y]=_.useState(_W),[w,g]=_.useState(!1),x=_u(),v=PW(CW),k=_.useRef(!1);return _.useEffect(()=>{n(),r(),s(),i(),o()},[n,r,s,i,o]),_.useEffect(()=>{k.current||t!=="/"||(k.current=!0,Promise.all([rk(),nk()]).then(([b,j])=>{if(!(b!=null&&b.setupDismissed)&&j!==null&&!j.every(P=>P.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([sk(),ok()]).then(([P,T])=>{P.entries.length>1||T.entries.length>0||(a("USAGE.md"),e({to:"/docs"}))})}))},[t,e,a]),_.useEffect(()=>{g(!1)},[t]),f.jsxs(i8,{position:"bottom-left",children:[f.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[f.jsx(oU,{}),f.jsx(lU,{}),f.jsx(ZB,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:f.jsxs(f.Fragment,{children:[h&&f.jsx(ut,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>g(!0),icon:f.jsx(Rv,{})}),f.jsx(iU,{size:"sm"}),f.jsx("div",{className:"flex-1"}),f.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 max-[480px]:hidden",children:cf.map(b=>f.jsx(ne,{variant:"ghost",size:"small",isActive:b.id===d,onClick:()=>e({to:b.path}),"aria-current":b.id===d?"page":void 0,children:b.label},b.id))})]}),children:f.jsx("div",{className:"flex flex-col h-full min-h-0",children:f.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:f.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[h&&f.jsxs(aU,{routeKey:p,mobileOpen:w,onMobileClose:()=>g(!1),children:[l&&f.jsxs(f.Fragment,{children:[f.jsx(fW,{}),f.jsx(cW,{})]}),u&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(yW,{})}),c&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(xW,{})})]}),f.jsx("div",{className:`flex flex-col min-w-0 ${v?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:f.jsx(Ni.div,{...jS(x),transition:PS(x),className:"flex flex-col flex-1 min-w-0",children:f.jsx(mS,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${v?"max-w-none":""}`,children:f.jsx(_.Suspense,{fallback:null,children:f.jsx(yb,{})})})},t)})]})})})})]}),f.jsx(X8,{open:m,pinned:v,onToggle:()=>{const b=!m;SW(b),y(b)}}),f.jsxs("nav",{"aria-label":"Main navigation",className:"hidden max-[480px]:flex max-[480px]:fixed max-[480px]:left-0 max-[480px]:right-0 max-[480px]:bottom-0 max-[480px]:z-[250] max-[480px]:items-stretch max-[480px]:justify-around max-[480px]:gap-1 max-[480px]:py-2 max-[480px]:px-2 max-[480px]:[padding-bottom:calc(0.5rem+env(safe-area-inset-bottom))] max-[480px]:bg-[var(--pui-bg-base,#fff)] max-[480px]:border-t max-[480px]:border-black/10 max-[480px]:shadow-[0_-2px_8px_rgba(0,0,0,0.08)]",children:[h&&f.jsx(ut,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>g(!0),icon:f.jsx(Rv,{}),className:"min-h-11"}),cf.map(b=>f.jsx(ne,{variant:"ghost",size:"small",isActive:b.id===d,onClick:()=>e({to:b.path}),"aria-current":b.id===d?"page":void 0,className:"min-h-11",children:b.label},b.id))]})]})},en=oT({component:jW}),EW=gn({getParentRoute:()=>en,path:"/",component:rg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),TW=gn({getParentRoute:()=>en,path:"/plans/$planId",component:rg}),RW=gn({getParentRoute:()=>en,path:"/ideas/$ideaId",component:rg}),NW=gn({getParentRoute:()=>en,path:"/docs",component:BS}),IW=gn({getParentRoute:()=>en,path:"/docs/$section",component:BS}),AW=gn({getParentRoute:()=>en,path:"/settings",component:$S}),MW=gn({getParentRoute:()=>en,path:"/settings/$section",component:$S}),LW=gn({getParentRoute:()=>en,path:"/roadmap",component:wW,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),DW=gn({getParentRoute:()=>en,path:"/diff",component:bW}),FW=gn({getParentRoute:()=>en,path:"/stats",component:kW}),OW=gn({getParentRoute:()=>en,path:"/tasks",component:vW,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),zW=en.addChildren([EW,TW,RW,NW,IW,AW,MW,OW,LW,DW,FW]),BW=yT({routeTree:zW}),US=document.getElementById("root");if(!US)throw new Error("#root element not found");Uw(US).render(f.jsx(_.StrictMode,{children:f.jsx(wT,{router:BW})}));export{qW as A,HW as B,ja as C,YW as D,r9 as E,Qe as F,qA as G,KW as H,GW as I,ne as J,AS as K,eg as L,ek as M,eW as N,QW as O,cU as P,yV as Q,lM as R,nr as S,Ae as U,e9 as V,Zt as a,n9 as b,rk as c,EU as d,VW as e,$W as f,Ie as g,CS as h,li as i,f as j,Ge as k,xS as l,t9 as m,Z8 as n,Pa as o,gv as p,WW as q,_ as r,UW as s,qh as t,F as u,uM as v,Ee as w,ck as x,yv as y,Qp as z};
207
- //# sourceMappingURL=main-CezpONOg.js.map