@dendelion/paper-camp 0.19.0 → 0.20.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.
- package/dist/app/assets/index-3pzg7Iyw.js +2 -0
- package/dist/app/assets/index-3pzg7Iyw.js.map +1 -0
- package/dist/app/assets/{index-B6251tL6.js → index-BHmWkgBW.js} +2 -2
- package/dist/app/assets/{index-B6251tL6.js.map → index-BHmWkgBW.js.map} +1 -1
- package/dist/app/assets/{index-DLkUANCR.js → index-BuzzfADD.js} +2 -2
- package/dist/app/assets/{index-DLkUANCR.js.map → index-BuzzfADD.js.map} +1 -1
- package/dist/app/assets/{index-D5j1njQR.js → index-CkLeljbk.js} +2 -2
- package/dist/app/assets/{index-D5j1njQR.js.map → index-CkLeljbk.js.map} +1 -1
- package/dist/app/assets/{index-nuVVSVma.js → index-DMDqfoCe.js} +2 -2
- package/dist/app/assets/index-DMDqfoCe.js.map +1 -0
- package/dist/app/assets/index-D_Lo8ptS.js +6 -0
- package/dist/app/assets/index-D_Lo8ptS.js.map +1 -0
- package/dist/app/assets/{index-BNoowtMI.js → index-DfekHwwU.js} +3 -3
- package/dist/app/assets/{index-BNoowtMI.js.map → index-DfekHwwU.js.map} +1 -1
- package/dist/app/assets/{index-D2iIIpI1.js → index-Gi97Lmex.js} +3 -3
- package/dist/app/assets/{index-D2iIIpI1.js.map → index-Gi97Lmex.js.map} +1 -1
- package/dist/app/assets/main-Bm0W4ucz.css +1 -0
- package/dist/app/assets/main-DP_okYxh.js +215 -0
- package/dist/app/assets/main-DP_okYxh.js.map +1 -0
- package/dist/app/assets/sidebar-section-B-A20bg9.js +2 -0
- package/dist/app/assets/sidebar-section-B-A20bg9.js.map +1 -0
- package/dist/app/index.html +2 -2
- package/dist/app/toolbar.js +1071 -1049
- package/dist/app/toolbar.js.map +1 -1
- package/dist/chunks/{phase-progress.CwSKAAZ-.js → phase-progress.DPAZ01Gg.js} +1720 -1594
- package/dist/chunks/phase-progress.DPAZ01Gg.js.map +1 -0
- package/dist/cli/index.js +6633 -6345
- package/dist/cli/index.js.map +1 -1
- package/dist/core/corpus-format.d.ts +11 -0
- package/dist/core/corpus-format.d.ts.map +1 -0
- package/dist/core/corpus-format.test.d.ts +2 -0
- package/dist/core/corpus-format.test.d.ts.map +1 -0
- package/dist/core/doctor/checks/metadata.d.ts.map +1 -1
- package/dist/core/doctor/rules.d.ts +6 -1
- package/dist/core/doctor/rules.d.ts.map +1 -1
- package/dist/core/git-pr/pr-lookup.d.ts +6 -1
- package/dist/core/git-pr/pr-lookup.d.ts.map +1 -1
- package/dist/core/git-pr/pr.d.ts +10 -0
- package/dist/core/git-pr/pr.d.ts.map +1 -1
- package/dist/core/index.js +54 -53
- package/dist/core/issues.d.ts +51 -0
- package/dist/core/issues.d.ts.map +1 -0
- package/dist/core/issues.test.d.ts +2 -0
- package/dist/core/issues.test.d.ts.map +1 -0
- package/dist/core/parse/parser.d.ts.map +1 -1
- package/dist/core/parse/schemas.d.ts +8 -4
- package/dist/core/parse/schemas.d.ts.map +1 -1
- package/dist/core/readers.d.ts +7 -2
- package/dist/core/readers.d.ts.map +1 -1
- package/dist/core/run-order.d.ts +1 -1
- package/dist/core/run-order.d.ts.map +1 -1
- package/dist/core/scaffold/scaffold.d.ts +0 -1
- package/dist/core/scaffold/scaffold.d.ts.map +1 -1
- package/dist/core/scaffold/templates.d.ts +1 -1
- package/dist/core/scaffold/templates.d.ts.map +1 -1
- package/dist/core/sections.d.ts.map +1 -1
- package/dist/core/serialize/serializer.d.ts +4 -2
- package/dist/core/serialize/serializer.d.ts.map +1 -1
- package/dist/core/status/status.d.ts +8 -4
- package/dist/core/status/status.d.ts.map +1 -1
- package/dist/types/index.d.ts +65 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/app/assets/index-nuVVSVma.js.map +0 -1
- package/dist/app/assets/index-s6CVH54G.js +0 -6
- package/dist/app/assets/index-s6CVH54G.js.map +0 -1
- package/dist/app/assets/main--EStESJz.js +0 -217
- package/dist/app/assets/main--EStESJz.js.map +0 -1
- package/dist/app/assets/main-CAJuC1Pz.css +0 -1
- package/dist/app/assets/sidebar-section-DTU8Naqm.js +0 -2
- package/dist/app/assets/sidebar-section-DTU8Naqm.js.map +0 -1
- package/dist/chunks/phase-progress.CwSKAAZ-.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DfekHwwU.js","./sidebar-section-B-A20bg9.js","./index-CkLeljbk.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 uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function su(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dw={exports:{}},iu={},fw={exports:{}},se={};/**
|
|
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 ka=Symbol.for("react.element"),HC=Symbol.for("react.portal"),GC=Symbol.for("react.fragment"),KC=Symbol.for("react.strict_mode"),YC=Symbol.for("react.profiler"),qC=Symbol.for("react.provider"),QC=Symbol.for("react.context"),XC=Symbol.for("react.forward_ref"),JC=Symbol.for("react.suspense"),ZC=Symbol.for("react.memo"),ej=Symbol.for("react.lazy"),kg=Symbol.iterator;function tj(e){return e===null||typeof e!="object"?null:(e=kg&&e[kg]||e["@@iterator"],typeof e=="function"?e:null)}var hw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pw=Object.assign,mw={};function Ui(e,t,n){this.props=e,this.context=t,this.refs=mw,this.updater=n||hw}Ui.prototype.isReactComponent={};Ui.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")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gw(){}gw.prototype=Ui.prototype;function mp(e,t,n){this.props=e,this.context=t,this.refs=mw,this.updater=n||hw}var gp=mp.prototype=new gw;gp.constructor=mp;pw(gp,Ui.prototype);gp.isPureReactComponent=!0;var _g=Array.isArray,yw=Object.prototype.hasOwnProperty,yp={current:null},xw={key:!0,ref:!0,__self:!0,__source:!0};function vw(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)yw.call(t,r)&&!xw.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),c=0;c<a;c++)l[c]=arguments[c+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:ka,type:e,key:i,ref:o,props:s,_owner:yp.current}}function nj(e,t){return{$$typeof:ka,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xp(e){return typeof e=="object"&&e!==null&&e.$$typeof===ka}function rj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Sg=/\/+/g;function Yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?rj(""+e.key):t.toString(36)}function Ll(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 ka:case HC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Yu(o,0):r,_g(s)?(n="",e!=null&&(n=e.replace(Sg,"$&/")+"/"),Ll(s,t,n,"",function(c){return c})):s!=null&&(xp(s)&&(s=nj(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Sg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",_g(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Yu(i,a);o+=Ll(i,t,n,l,s)}else if(l=tj(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Yu(i,a++),o+=Ll(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 Ka(e,t,n){if(e==null)return e;var r=[],s=0;return Ll(e,r,"","",function(i){return t.call(n,i,s++)}),r}function sj(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 ht={current:null},Dl={transition:null},ij={ReactCurrentDispatcher:ht,ReactCurrentBatchConfig:Dl,ReactCurrentOwner:yp};function ww(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:Ka,forEach:function(e,t,n){Ka(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ka(e,function(){t++}),t},toArray:function(e){return Ka(e,function(t){return t})||[]},only:function(e){if(!xp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=Ui;se.Fragment=GC;se.Profiler=YC;se.PureComponent=mp;se.StrictMode=KC;se.Suspense=JC;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ij;se.act=ww;se.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=pw({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=yp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)yw.call(t,l)&&!xw.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 c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ka,type:e.type,key:s,ref:i,props:r,_owner:o}};se.createContext=function(e){return e={$$typeof:QC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qC,_context:e},e.Consumer=e};se.createElement=vw;se.createFactory=function(e){var t=vw.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:XC,render:e}};se.isValidElement=xp;se.lazy=function(e){return{$$typeof:ej,_payload:{_status:-1,_result:e},_init:sj}};se.memo=function(e,t){return{$$typeof:ZC,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Dl.transition;Dl.transition={};try{e()}finally{Dl.transition=t}};se.unstable_act=ww;se.useCallback=function(e,t){return ht.current.useCallback(e,t)};se.useContext=function(e){return ht.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return ht.current.useDeferredValue(e)};se.useEffect=function(e,t){return ht.current.useEffect(e,t)};se.useId=function(){return ht.current.useId()};se.useImperativeHandle=function(e,t,n){return ht.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return ht.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return ht.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return ht.current.useMemo(e,t)};se.useReducer=function(e,t,n){return ht.current.useReducer(e,t,n)};se.useRef=function(e){return ht.current.useRef(e)};se.useState=function(e){return ht.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return ht.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return ht.current.useTransition()};se.version="18.3.1";fw.exports=se;var b=fw.exports;const Ei=su(b);/**
|
|
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 oj=b,aj=Symbol.for("react.element"),lj=Symbol.for("react.fragment"),cj=Object.prototype.hasOwnProperty,uj=oj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dj={key:!0,ref:!0,__self:!0,__source:!0};function bw(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)cj.call(t,r)&&!dj.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:aj,type:e,key:i,ref:o,props:s,_owner:uj.current}}iu.Fragment=lj;iu.jsx=bw;iu.jsxs=bw;dw.exports=iu;var d=dw.exports,kw={exports:{}},Ut={},_w={exports:{}},Sw={};/**
|
|
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(F,z){var _=F.length;F.push(z);e:for(;0<_;){var B=_-1>>>1,q=F[B];if(0<s(q,z))F[B]=z,F[_]=q,_=B;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var z=F[0],_=F.pop();if(_!==z){F[0]=_;e:for(var B=0,q=F.length,R=q>>>1;B<R;){var ue=2*(B+1)-1,pe=F[ue],fe=ue+1,Nt=F[fe];if(0>s(pe,_))fe<q&&0>s(Nt,pe)?(F[B]=Nt,F[fe]=_,B=fe):(F[B]=pe,F[ue]=_,B=ue);else if(fe<q&&0>s(Nt,_))F[B]=Nt,F[fe]=_,B=fe;else break e}}return z}function s(F,z){var _=F.sortIndex-z.sortIndex;return _!==0?_:F.id-z.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=[],c=[],u=1,f=null,h=3,p=!1,m=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(F){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=F)r(c),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(c)}}function k(F){if(g=!1,w(F),!m)if(n(l)!==null)m=!0,$(S);else{var z=n(c);z!==null&&U(k,z.startTime-F)}}function S(F,z){m=!1,g&&(g=!1,y(E),E=-1),p=!0;var _=h;try{for(w(z),f=n(l);f!==null&&(!(f.expirationTime>z)||F&&!N());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var q=B(f.expirationTime<=z);z=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(l)&&r(l),w(z)}else r(l);f=n(l)}if(f!==null)var R=!0;else{var ue=n(c);ue!==null&&U(k,ue.startTime-z),R=!1}return R}finally{f=null,h=_,p=!1}}var C=!1,P=null,E=-1,T=5,j=-1;function N(){return!(e.unstable_now()-j<T)}function I(){if(P!==null){var F=e.unstable_now();j=F;var z=!0;try{z=P(!0,F)}finally{z?L():(C=!1,P=null)}}else C=!1}var L;if(typeof x=="function")L=function(){x(I)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,A=O.port2;O.port1.onmessage=I,L=function(){A.postMessage(null)}}else L=function(){v(I,0)};function $(F){P=F,C||(C=!0,L())}function U(F,z){E=v(function(){F(e.unstable_now())},z)}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(F){F.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,$(S))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(F){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var _=h;h=z;try{return F()}finally{h=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,z){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var _=h;h=F;try{return z()}finally{h=_}},e.unstable_scheduleCallback=function(F,z,_){var B=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?B+_:B):_=B,F){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=_+q,F={id:u++,callback:z,priorityLevel:F,startTime:_,expirationTime:q,sortIndex:-1},_>B?(F.sortIndex=_,t(c,F),n(l)===null&&F===n(c)&&(g?(y(E),E=-1):g=!0,U(k,_-B))):(F.sortIndex=q,t(l,F),m||p||(m=!0,$(S))),F},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(F){var z=h;return function(){var _=h;h=z;try{return F.apply(this,arguments)}finally{h=_}}}})(Sw);_w.exports=Sw;var fj=_w.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 hj=b,Bt=fj;function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Cw=new Set,Qo={};function Fs(e,t){Ti(e,t),Ti(e+"Capture",t)}function Ti(e,t){for(Qo[e]=t,e=0;e<t.length;e++)Cw.add(t[e])}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jf=Object.prototype.hasOwnProperty,pj=/^[: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]*$/,Cg={},jg={};function mj(e){return jf.call(jg,e)?!0:jf.call(Cg,e)?!1:pj.test(e)?jg[e]=!0:(Cg[e]=!0,!1)}function gj(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 yj(e,t,n,r){if(t===null||typeof t>"u"||gj(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 pt(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 Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ze[t]=new pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new pt(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){Ze[e]=new pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var vp=/[\-:]([a-z])/g;function wp(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(vp,wp);Ze[t]=new pt(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(vp,wp);Ze[t]=new pt(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(vp,wp);Ze[t]=new pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bp(e,t,n,r){var s=Ze.hasOwnProperty(t)?Ze[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(yj(t,n,s,r)&&(n=null),r||s===null?mj(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 dr=hj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ya=Symbol.for("react.element"),ni=Symbol.for("react.portal"),ri=Symbol.for("react.fragment"),kp=Symbol.for("react.strict_mode"),Pf=Symbol.for("react.profiler"),jw=Symbol.for("react.provider"),Pw=Symbol.for("react.context"),_p=Symbol.for("react.forward_ref"),Ef=Symbol.for("react.suspense"),Tf=Symbol.for("react.suspense_list"),Sp=Symbol.for("react.memo"),jr=Symbol.for("react.lazy"),Ew=Symbol.for("react.offscreen"),Pg=Symbol.iterator;function so(e){return e===null||typeof e!="object"?null:(e=Pg&&e[Pg]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Object.assign,qu;function Co(e){if(qu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qu=t&&t[1]||""}return`
|
|
35
|
+
`+qu+e}var Qu=!1;function Xu(e,t){if(!e||Qu)return"";Qu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.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{Qu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Co(e):""}function xj(e){switch(e.tag){case 5:return Co(e.type);case 16:return Co("Lazy");case 13:return Co("Suspense");case 19:return Co("SuspenseList");case 0:case 2:case 15:return e=Xu(e.type,!1),e;case 11:return e=Xu(e.type.render,!1),e;case 1:return e=Xu(e.type,!0),e;default:return""}}function Nf(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 ri:return"Fragment";case ni:return"Portal";case Pf:return"Profiler";case kp:return"StrictMode";case Ef:return"Suspense";case Tf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pw:return(e.displayName||"Context")+".Consumer";case jw:return(e._context.displayName||"Context")+".Provider";case _p:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sp:return t=e.displayName||null,t!==null?t:Nf(e.type)||"Memo";case jr:t=e._payload,e=e._init;try{return Nf(e(t))}catch{}}return null}function vj(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 Nf(t);case 8:return t===kp?"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 qr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wj(e){var t=Tw(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 qa(e){e._valueTracker||(e._valueTracker=wj(e))}function Nw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Tw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function dc(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 Rf(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Eg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qr(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 Rw(e,t){t=t.checked,t!=null&&bp(e,"checked",t,!1)}function If(e,t){Rw(e,t);var n=qr(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")?Af(e,t.type,n):t.hasOwnProperty("defaultValue")&&Af(e,t.type,qr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tg(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 Af(e,t,n){(t!=="number"||dc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jo=Array.isArray;function xi(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=""+qr(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 Mf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return Re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ng(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(jo(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qr(n)}}function Iw(e,t){var n=qr(t.value),r=qr(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 Rg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Aw(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 Lf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Aw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qa,Mw=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(Qa=Qa||document.createElement("div"),Qa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ro={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},bj=["Webkit","ms","Moz","O"];Object.keys(Ro).forEach(function(e){bj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ro[t]=Ro[e]})});function Lw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ro.hasOwnProperty(e)&&Ro[e]?(""+t).trim():t+"px"}function Dw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Lw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var kj=Re({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 Df(e,t){if(t){if(kj[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Ff(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 Of=null;function Cp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $f=null,vi=null,wi=null;function Ig(e){if(e=Ca(e)){if(typeof $f!="function")throw Error(V(280));var t=e.stateNode;t&&(t=uu(t),$f(e.stateNode,e.type,t))}}function Fw(e){vi?wi?wi.push(e):wi=[e]:vi=e}function Ow(){if(vi){var e=vi,t=wi;if(wi=vi=null,Ig(e),t)for(e=0;e<t.length;e++)Ig(t[e])}}function $w(e,t){return e(t)}function zw(){}var Ju=!1;function Bw(e,t,n){if(Ju)return e(t,n);Ju=!0;try{return $w(e,t,n)}finally{Ju=!1,(vi!==null||wi!==null)&&(zw(),Ow())}}function Jo(e,t){var n=e.stateNode;if(n===null)return null;var r=uu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(V(231,t,typeof n));return n}var zf=!1;if(or)try{var io={};Object.defineProperty(io,"passive",{get:function(){zf=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{zf=!1}function _j(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Io=!1,fc=null,hc=!1,Bf=null,Sj={onError:function(e){Io=!0,fc=e}};function Cj(e,t,n,r,s,i,o,a,l){Io=!1,fc=null,_j.apply(Sj,arguments)}function jj(e,t,n,r,s,i,o,a,l){if(Cj.apply(this,arguments),Io){if(Io){var c=fc;Io=!1,fc=null}else throw Error(V(198));hc||(hc=!0,Bf=c)}}function Os(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 Vw(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 Ag(e){if(Os(e)!==e)throw Error(V(188))}function Pj(e){var t=e.alternate;if(!t){if(t=Os(e),t===null)throw Error(V(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 Ag(s),e;if(i===r)return Ag(s),t;i=i.sibling}throw Error(V(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(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function Uw(e){return e=Pj(e),e!==null?Ww(e):null}function Ww(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ww(e);if(t!==null)return t;e=e.sibling}return null}var Hw=Bt.unstable_scheduleCallback,Mg=Bt.unstable_cancelCallback,Ej=Bt.unstable_shouldYield,Tj=Bt.unstable_requestPaint,De=Bt.unstable_now,Nj=Bt.unstable_getCurrentPriorityLevel,jp=Bt.unstable_ImmediatePriority,Gw=Bt.unstable_UserBlockingPriority,pc=Bt.unstable_NormalPriority,Rj=Bt.unstable_LowPriority,Kw=Bt.unstable_IdlePriority,ou=null,zn=null;function Ij(e){if(zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(ou,e,void 0,(e.current.flags&128)===128)}catch{}}var bn=Math.clz32?Math.clz32:Lj,Aj=Math.log,Mj=Math.LN2;function Lj(e){return e>>>=0,e===0?32:31-(Aj(e)/Mj|0)|0}var Xa=64,Ja=4194304;function Po(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 mc(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=Po(a):(i&=o,i!==0&&(r=Po(i)))}else o=n&~s,o!==0?r=Po(o):i!==0&&(r=Po(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-bn(t),s=1<<n,r|=e[n],t&=~s;return r}function Dj(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 Fj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-bn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=Dj(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Vf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Yw(){var e=Xa;return Xa<<=1,!(Xa&4194240)&&(Xa=64),e}function Zu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _a(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bn(t),e[t]=n}function Oj(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-bn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Pp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var de=0;function qw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qw,Ep,Xw,Jw,Zw,Uf=!1,Za=[],Or=null,$r=null,zr=null,Zo=new Map,ea=new Map,Tr=[],$j="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 Lg(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":Zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(t.pointerId)}}function oo(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=Ca(t),t!==null&&Ep(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function zj(e,t,n,r,s){switch(t){case"focusin":return Or=oo(Or,e,t,n,r,s),!0;case"dragenter":return $r=oo($r,e,t,n,r,s),!0;case"mouseover":return zr=oo(zr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Zo.set(i,oo(Zo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,ea.set(i,oo(ea.get(i)||null,e,t,n,r,s)),!0}return!1}function eb(e){var t=xs(e.target);if(t!==null){var n=Os(t);if(n!==null){if(t=n.tag,t===13){if(t=Vw(n),t!==null){e.blockedOn=t,Zw(e.priority,function(){Xw(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 Fl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Of=r,n.target.dispatchEvent(r),Of=null}else return t=Ca(n),t!==null&&Ep(t),e.blockedOn=n,!1;t.shift()}return!0}function Dg(e,t,n){Fl(e)&&n.delete(t)}function Bj(){Uf=!1,Or!==null&&Fl(Or)&&(Or=null),$r!==null&&Fl($r)&&($r=null),zr!==null&&Fl(zr)&&(zr=null),Zo.forEach(Dg),ea.forEach(Dg)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Uf||(Uf=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,Bj)))}function ta(e){function t(s){return ao(s,e)}if(0<Za.length){ao(Za[0],e);for(var n=1;n<Za.length;n++){var r=Za[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Or!==null&&ao(Or,e),$r!==null&&ao($r,e),zr!==null&&ao(zr,e),Zo.forEach(t),ea.forEach(t),n=0;n<Tr.length;n++)r=Tr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Tr.length&&(n=Tr[0],n.blockedOn===null);)eb(n),n.blockedOn===null&&Tr.shift()}var bi=dr.ReactCurrentBatchConfig,gc=!0;function Vj(e,t,n,r){var s=de,i=bi.transition;bi.transition=null;try{de=1,Tp(e,t,n,r)}finally{de=s,bi.transition=i}}function Uj(e,t,n,r){var s=de,i=bi.transition;bi.transition=null;try{de=4,Tp(e,t,n,r)}finally{de=s,bi.transition=i}}function Tp(e,t,n,r){if(gc){var s=Wf(e,t,n,r);if(s===null)cd(e,t,r,yc,n),Lg(e,r);else if(zj(s,e,t,n,r))r.stopPropagation();else if(Lg(e,r),t&4&&-1<$j.indexOf(e)){for(;s!==null;){var i=Ca(s);if(i!==null&&Qw(i),i=Wf(e,t,n,r),i===null&&cd(e,t,r,yc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else cd(e,t,r,null,n)}}var yc=null;function Wf(e,t,n,r){if(yc=null,e=Cp(r),e=xs(e),e!==null)if(t=Os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vw(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 yc=e,null}function tb(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(Nj()){case jp:return 1;case Gw:return 4;case pc:case Rj:return 16;case Kw:return 536870912;default:return 16}default:return 16}}var Rr=null,Np=null,Ol=null;function nb(){if(Ol)return Ol;var e,t=Np,n=t.length,r,s="value"in Rr?Rr.value:Rr.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 Ol=s.slice(e,1<r?1-r:void 0)}function $l(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 el(){return!0}function Fg(){return!1}function Wt(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)?el:Fg,this.isPropagationStopped=Fg,this}return Re(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=el)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=el)},persist:function(){},isPersistent:el}),t}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rp=Wt(Wi),Sa=Re({},Wi,{view:0,detail:0}),Wj=Wt(Sa),ed,td,lo,au=Re({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ip,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!==lo&&(lo&&e.type==="mousemove"?(ed=e.screenX-lo.screenX,td=e.screenY-lo.screenY):td=ed=0,lo=e),ed)},movementY:function(e){return"movementY"in e?e.movementY:td}}),Og=Wt(au),Hj=Re({},au,{dataTransfer:0}),Gj=Wt(Hj),Kj=Re({},Sa,{relatedTarget:0}),nd=Wt(Kj),Yj=Re({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),qj=Wt(Yj),Qj=Re({},Wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xj=Wt(Qj),Jj=Re({},Wi,{data:0}),$g=Wt(Jj),Zj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eP={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"},tP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tP[e])?!!t[e]:!1}function Ip(){return nP}var rP=Re({},Sa,{key:function(e){if(e.key){var t=Zj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?eP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ip,charCode:function(e){return e.type==="keypress"?$l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sP=Wt(rP),iP=Re({},au,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zg=Wt(iP),oP=Re({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ip}),aP=Wt(oP),lP=Re({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),cP=Wt(lP),uP=Re({},au,{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}),dP=Wt(uP),fP=[9,13,27,32],Ap=or&&"CompositionEvent"in window,Ao=null;or&&"documentMode"in document&&(Ao=document.documentMode);var hP=or&&"TextEvent"in window&&!Ao,rb=or&&(!Ap||Ao&&8<Ao&&11>=Ao),Bg=" ",Vg=!1;function sb(e,t){switch(e){case"keyup":return fP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ib(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function pP(e,t){switch(e){case"compositionend":return ib(t);case"keypress":return t.which!==32?null:(Vg=!0,Bg);case"textInput":return e=t.data,e===Bg&&Vg?null:e;default:return null}}function mP(e,t){if(si)return e==="compositionend"||!Ap&&sb(e,t)?(e=nb(),Ol=Np=Rr=null,si=!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 rb&&t.locale!=="ko"?null:t.data;default:return null}}var gP={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 Ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gP[e.type]:t==="textarea"}function ob(e,t,n,r){Fw(r),t=xc(t,"onChange"),0<t.length&&(n=new Rp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mo=null,na=null;function yP(e){yb(e,0)}function lu(e){var t=ai(e);if(Nw(t))return e}function xP(e,t){if(e==="change")return t}var ab=!1;if(or){var rd;if(or){var sd="oninput"in document;if(!sd){var Wg=document.createElement("div");Wg.setAttribute("oninput","return;"),sd=typeof Wg.oninput=="function"}rd=sd}else rd=!1;ab=rd&&(!document.documentMode||9<document.documentMode)}function Hg(){Mo&&(Mo.detachEvent("onpropertychange",lb),na=Mo=null)}function lb(e){if(e.propertyName==="value"&&lu(na)){var t=[];ob(t,na,e,Cp(e)),Bw(yP,t)}}function vP(e,t,n){e==="focusin"?(Hg(),Mo=t,na=n,Mo.attachEvent("onpropertychange",lb)):e==="focusout"&&Hg()}function wP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lu(na)}function bP(e,t){if(e==="click")return lu(t)}function kP(e,t){if(e==="input"||e==="change")return lu(t)}function _P(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sn=typeof Object.is=="function"?Object.is:_P;function ra(e,t){if(Sn(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(!jf.call(t,s)||!Sn(e[s],t[s]))return!1}return!0}function Gg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kg(e,t){var n=Gg(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=Gg(n)}}function cb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ub(){for(var e=window,t=dc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=dc(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 SP(e){var t=ub(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cb(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=Kg(n,i);var o=Kg(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 CP=or&&"documentMode"in document&&11>=document.documentMode,ii=null,Hf=null,Lo=null,Gf=!1;function Yg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gf||ii==null||ii!==dc(r)||(r=ii,"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}),Lo&&ra(Lo,r)||(Lo=r,r=xc(Hf,"onSelect"),0<r.length&&(t=new Rp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ii)))}function tl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var oi={animationend:tl("Animation","AnimationEnd"),animationiteration:tl("Animation","AnimationIteration"),animationstart:tl("Animation","AnimationStart"),transitionend:tl("Transition","TransitionEnd")},id={},db={};or&&(db=document.createElement("div").style,"AnimationEvent"in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),"TransitionEvent"in window||delete oi.transitionend.transition);function cu(e){if(id[e])return id[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in db)return id[e]=t[n];return e}var fb=cu("animationend"),hb=cu("animationiteration"),pb=cu("animationstart"),mb=cu("transitionend"),gb=new Map,qg="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 es(e,t){gb.set(e,t),Fs(t,[e])}for(var od=0;od<qg.length;od++){var ad=qg[od],jP=ad.toLowerCase(),PP=ad[0].toUpperCase()+ad.slice(1);es(jP,"on"+PP)}es(fb,"onAnimationEnd");es(hb,"onAnimationIteration");es(pb,"onAnimationStart");es("dblclick","onDoubleClick");es("focusin","onFocus");es("focusout","onBlur");es(mb,"onTransitionEnd");Ti("onMouseEnter",["mouseout","mouseover"]);Ti("onMouseLeave",["mouseout","mouseover"]);Ti("onPointerEnter",["pointerout","pointerover"]);Ti("onPointerLeave",["pointerout","pointerover"]);Fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="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(" "),EP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eo));function Qg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jj(r,t,void 0,e),e.currentTarget=null}function yb(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,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Qg(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Qg(s,a,c),i=l}}}if(hc)throw e=Bf,hc=!1,Bf=null,e}function Ce(e,t){var n=t[Xf];n===void 0&&(n=t[Xf]=new Set);var r=e+"__bubble";n.has(r)||(xb(t,e,2,!1),n.add(r))}function ld(e,t,n){var r=0;t&&(r|=4),xb(n,e,r,t)}var nl="_reactListening"+Math.random().toString(36).slice(2);function sa(e){if(!e[nl]){e[nl]=!0,Cw.forEach(function(n){n!=="selectionchange"&&(EP.has(n)||ld(n,!1,e),ld(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nl]||(t[nl]=!0,ld("selectionchange",!1,t))}}function xb(e,t,n,r){switch(tb(t)){case 1:var s=Vj;break;case 4:s=Uj;break;default:s=Tp}n=s.bind(null,t,n,e),s=void 0,!zf||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 cd(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=xs(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}Bw(function(){var c=i,u=Cp(n),f=[];e:{var h=gb.get(e);if(h!==void 0){var p=Rp,m=e;switch(e){case"keypress":if($l(n)===0)break e;case"keydown":case"keyup":p=sP;break;case"focusin":m="focus",p=nd;break;case"focusout":m="blur",p=nd;break;case"beforeblur":case"afterblur":p=nd;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=Og;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Gj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=aP;break;case fb:case hb:case pb:p=qj;break;case mb:p=cP;break;case"scroll":p=Wj;break;case"wheel":p=dP;break;case"copy":case"cut":case"paste":p=Xj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=zg}var g=(t&4)!==0,v=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=c,w;x!==null;){w=x;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,y!==null&&(k=Jo(x,y),k!=null&&g.push(ia(x,k,w)))),v)break;x=x.return}0<g.length&&(h=new p(h,m,null,n,u),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Of&&(m=n.relatedTarget||n.fromElement)&&(xs(m)||m[ar]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?xs(m):null,m!==null&&(v=Os(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=Og,k="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=zg,k="onPointerLeave",y="onPointerEnter",x="pointer"),v=p==null?h:ai(p),w=m==null?h:ai(m),h=new g(k,x+"leave",p,n,u),h.target=v,h.relatedTarget=w,k=null,xs(u)===c&&(g=new g(y,x+"enter",m,n,u),g.target=w,g.relatedTarget=v,k=g),v=k,p&&m)t:{for(g=p,y=m,x=0,w=g;w;w=Gs(w))x++;for(w=0,k=y;k;k=Gs(k))w++;for(;0<x-w;)g=Gs(g),x--;for(;0<w-x;)y=Gs(y),w--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=Gs(g),y=Gs(y)}g=null}else g=null;p!==null&&Xg(f,h,p,g,!1),m!==null&&v!==null&&Xg(f,v,m,g,!0)}}e:{if(h=c?ai(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=xP;else if(Ug(h))if(ab)S=kP;else{S=wP;var C=vP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=bP);if(S&&(S=S(e,c))){ob(f,S,n,u);break e}C&&C(e,h,c),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&Af(h,"number",h.value)}switch(C=c?ai(c):window,e){case"focusin":(Ug(C)||C.contentEditable==="true")&&(ii=C,Hf=c,Lo=null);break;case"focusout":Lo=Hf=ii=null;break;case"mousedown":Gf=!0;break;case"contextmenu":case"mouseup":case"dragend":Gf=!1,Yg(f,n,u);break;case"selectionchange":if(CP)break;case"keydown":case"keyup":Yg(f,n,u)}var P;if(Ap)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else si?sb(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(rb&&n.locale!=="ko"&&(si||E!=="onCompositionStart"?E==="onCompositionEnd"&&si&&(P=nb()):(Rr=u,Np="value"in Rr?Rr.value:Rr.textContent,si=!0)),C=xc(c,E),0<C.length&&(E=new $g(E,e,null,n,u),f.push({event:E,listeners:C}),P?E.data=P:(P=ib(n),P!==null&&(E.data=P)))),(P=hP?pP(e,n):mP(e,n))&&(c=xc(c,"onBeforeInput"),0<c.length&&(u=new $g("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=P))}yb(f,t)})}function ia(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Jo(e,n),i!=null&&r.unshift(ia(e,i,s)),i=Jo(e,t),i!=null&&r.push(ia(e,i,s))),e=e.return}return r}function Gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xg(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Jo(n,i),l!=null&&o.unshift(ia(n,l,a))):s||(l=Jo(n,i),l!=null&&o.push(ia(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var TP=/\r\n?/g,NP=/\u0000|\uFFFD/g;function Jg(e){return(typeof e=="string"?e:""+e).replace(TP,`
|
|
39
|
+
`).replace(NP,"")}function rl(e,t,n){if(t=Jg(t),Jg(e)!==t&&n)throw Error(V(425))}function vc(){}var Kf=null,Yf=null;function qf(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 Qf=typeof setTimeout=="function"?setTimeout:void 0,RP=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,IP=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(e){return Zg.resolve(null).then(e).catch(AP)}:Qf;function AP(e){setTimeout(function(){throw e})}function ud(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),ta(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ta(t)}function Br(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 ey(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 Hi=Math.random().toString(36).slice(2),Fn="__reactFiber$"+Hi,oa="__reactProps$"+Hi,ar="__reactContainer$"+Hi,Xf="__reactEvents$"+Hi,MP="__reactListeners$"+Hi,LP="__reactHandles$"+Hi;function xs(e){var t=e[Fn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ar]||n[Fn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ey(e);e!==null;){if(n=e[Fn])return n;e=ey(e)}return t}e=n,n=e.parentNode}return null}function Ca(e){return e=e[Fn]||e[ar],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ai(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function uu(e){return e[oa]||null}var Jf=[],li=-1;function ts(e){return{current:e}}function je(e){0>li||(e.current=Jf[li],Jf[li]=null,li--)}function be(e,t){li++,Jf[li]=e.current,e.current=t}var Qr={},ot=ts(Qr),bt=ts(!1),Is=Qr;function Ni(e,t){var n=e.type.contextTypes;if(!n)return Qr;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 kt(e){return e=e.childContextTypes,e!=null}function wc(){je(bt),je(ot)}function ty(e,t,n){if(ot.current!==Qr)throw Error(V(168));be(ot,t),be(bt,n)}function vb(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(V(108,vj(e)||"Unknown",s));return Re({},n,r)}function bc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qr,Is=ot.current,be(ot,e),be(bt,bt.current),!0}function ny(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=vb(e,t,Is),r.__reactInternalMemoizedMergedChildContext=e,je(bt),je(ot),be(ot,e)):je(bt),be(bt,n)}var Zn=null,du=!1,dd=!1;function wb(e){Zn===null?Zn=[e]:Zn.push(e)}function DP(e){du=!0,wb(e)}function ns(){if(!dd&&Zn!==null){dd=!0;var e=0,t=de;try{var n=Zn;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Zn=null,du=!1}catch(s){throw Zn!==null&&(Zn=Zn.slice(e+1)),Hw(jp,ns),s}finally{de=t,dd=!1}}return null}var ci=[],ui=0,kc=null,_c=0,Jt=[],Zt=0,As=null,nr=1,rr="";function fs(e,t){ci[ui++]=_c,ci[ui++]=kc,kc=e,_c=t}function bb(e,t,n){Jt[Zt++]=nr,Jt[Zt++]=rr,Jt[Zt++]=As,As=e;var r=nr;e=rr;var s=32-bn(r)-1;r&=~(1<<s),n+=1;var i=32-bn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,nr=1<<32-bn(t)+s|n<<s|r,rr=i+e}else nr=1<<i|n<<s|r,rr=e}function Lp(e){e.return!==null&&(fs(e,1),bb(e,1,0))}function Dp(e){for(;e===kc;)kc=ci[--ui],ci[ui]=null,_c=ci[--ui],ci[ui]=null;for(;e===As;)As=Jt[--Zt],Jt[Zt]=null,rr=Jt[--Zt],Jt[Zt]=null,nr=Jt[--Zt],Jt[Zt]=null}var $t=null,Ft=null,Ee=!1,wn=null;function kb(e,t){var n=tn(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 ry(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,$t=e,Ft=Br(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$t=e,Ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=As!==null?{id:nr,overflow:rr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=tn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,$t=e,Ft=null,!0):!1;default:return!1}}function Zf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function eh(e){if(Ee){var t=Ft;if(t){var n=t;if(!ry(e,t)){if(Zf(e))throw Error(V(418));t=Br(n.nextSibling);var r=$t;t&&ry(e,t)?kb(r,n):(e.flags=e.flags&-4097|2,Ee=!1,$t=e)}}else{if(Zf(e))throw Error(V(418));e.flags=e.flags&-4097|2,Ee=!1,$t=e}}}function sy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$t=e}function sl(e){if(e!==$t)return!1;if(!Ee)return sy(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qf(e.type,e.memoizedProps)),t&&(t=Ft)){if(Zf(e))throw _b(),Error(V(418));for(;t;)kb(e,t),t=Br(t.nextSibling)}if(sy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ft=Br(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ft=null}}else Ft=$t?Br(e.stateNode.nextSibling):null;return!0}function _b(){for(var e=Ft;e;)e=Br(e.nextSibling)}function Ri(){Ft=$t=null,Ee=!1}function Fp(e){wn===null?wn=[e]:wn.push(e)}var FP=dr.ReactCurrentBatchConfig;function co(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var 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(V(284));if(!n._owner)throw Error(V(290,e))}return e}function il(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function iy(e){var t=e._init;return t(e._payload)}function Sb(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function s(y,x){return y=Hr(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,x,w,k){return x===null||x.tag!==6?(x=xd(w,y.mode,k),x.return=y,x):(x=s(x,w),x.return=y,x)}function l(y,x,w,k){var S=w.type;return S===ri?u(y,x,w.props.children,k,w.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===jr&&iy(S)===x.type)?(k=s(x,w.props),k.ref=co(y,x,w),k.return=y,k):(k=Gl(w.type,w.key,w.props,null,y.mode,k),k.ref=co(y,x,w),k.return=y,k)}function c(y,x,w,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=vd(w,y.mode,k),x.return=y,x):(x=s(x,w.children||[]),x.return=y,x)}function u(y,x,w,k,S){return x===null||x.tag!==7?(x=Cs(w,y.mode,k,S),x.return=y,x):(x=s(x,w),x.return=y,x)}function f(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=xd(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ya:return w=Gl(x.type,x.key,x.props,null,y.mode,w),w.ref=co(y,null,x),w.return=y,w;case ni:return x=vd(x,y.mode,w),x.return=y,x;case jr:var k=x._init;return f(y,k(x._payload),w)}if(jo(x)||so(x))return x=Cs(x,y.mode,w,null),x.return=y,x;il(y,x)}return null}function h(y,x,w,k){var S=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:a(y,x,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ya:return w.key===S?l(y,x,w,k):null;case ni:return w.key===S?c(y,x,w,k):null;case jr:return S=w._init,h(y,x,S(w._payload),k)}if(jo(w)||so(w))return S!==null?null:u(y,x,w,k,null);il(y,w)}return null}function p(y,x,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(w)||null,a(x,y,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ya:return y=y.get(k.key===null?w:k.key)||null,l(x,y,k,S);case ni:return y=y.get(k.key===null?w:k.key)||null,c(x,y,k,S);case jr:var C=k._init;return p(y,x,w,C(k._payload),S)}if(jo(k)||so(k))return y=y.get(w)||null,u(x,y,k,S,null);il(x,k)}return null}function m(y,x,w,k){for(var S=null,C=null,P=x,E=x=0,T=null;P!==null&&E<w.length;E++){P.index>E?(T=P,P=null):T=P.sibling;var j=h(y,P,w[E],k);if(j===null){P===null&&(P=T);break}e&&P&&j.alternate===null&&t(y,P),x=i(j,x,E),C===null?S=j:C.sibling=j,C=j,P=T}if(E===w.length)return n(y,P),Ee&&fs(y,E),S;if(P===null){for(;E<w.length;E++)P=f(y,w[E],k),P!==null&&(x=i(P,x,E),C===null?S=P:C.sibling=P,C=P);return Ee&&fs(y,E),S}for(P=r(y,P);E<w.length;E++)T=p(P,y,E,w[E],k),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?E:T.key),x=i(T,x,E),C===null?S=T:C.sibling=T,C=T);return e&&P.forEach(function(N){return t(y,N)}),Ee&&fs(y,E),S}function g(y,x,w,k){var S=so(w);if(typeof S!="function")throw Error(V(150));if(w=S.call(w),w==null)throw Error(V(151));for(var C=S=null,P=x,E=x=0,T=null,j=w.next();P!==null&&!j.done;E++,j=w.next()){P.index>E?(T=P,P=null):T=P.sibling;var N=h(y,P,j.value,k);if(N===null){P===null&&(P=T);break}e&&P&&N.alternate===null&&t(y,P),x=i(N,x,E),C===null?S=N:C.sibling=N,C=N,P=T}if(j.done)return n(y,P),Ee&&fs(y,E),S;if(P===null){for(;!j.done;E++,j=w.next())j=f(y,j.value,k),j!==null&&(x=i(j,x,E),C===null?S=j:C.sibling=j,C=j);return Ee&&fs(y,E),S}for(P=r(y,P);!j.done;E++,j=w.next())j=p(P,y,E,j.value,k),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?E:j.key),x=i(j,x,E),C===null?S=j:C.sibling=j,C=j);return e&&P.forEach(function(I){return t(y,I)}),Ee&&fs(y,E),S}function v(y,x,w,k){if(typeof w=="object"&&w!==null&&w.type===ri&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ya:e:{for(var S=w.key,C=x;C!==null;){if(C.key===S){if(S=w.type,S===ri){if(C.tag===7){n(y,C.sibling),x=s(C,w.props.children),x.return=y,y=x;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===jr&&iy(S)===C.type){n(y,C.sibling),x=s(C,w.props),x.ref=co(y,C,w),x.return=y,y=x;break e}n(y,C);break}else t(y,C);C=C.sibling}w.type===ri?(x=Cs(w.props.children,y.mode,k,w.key),x.return=y,y=x):(k=Gl(w.type,w.key,w.props,null,y.mode,k),k.ref=co(y,x,w),k.return=y,y=k)}return o(y);case ni:e:{for(C=w.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(y,x.sibling),x=s(x,w.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=vd(w,y.mode,k),x.return=y,y=x}return o(y);case jr:return C=w._init,v(y,x,C(w._payload),k)}if(jo(w))return m(y,x,w,k);if(so(w))return g(y,x,w,k);il(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(y,x.sibling),x=s(x,w),x.return=y,y=x):(n(y,x),x=xd(w,y.mode,k),x.return=y,y=x),o(y)):n(y,x)}return v}var Ii=Sb(!0),Cb=Sb(!1),Sc=ts(null),Cc=null,di=null,Op=null;function $p(){Op=di=Cc=null}function zp(e){var t=Sc.current;je(Sc),e._currentValue=t}function th(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 ki(e,t){Cc=e,Op=di=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(vt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(Op!==e)if(e={context:e,memoizedValue:t,next:null},di===null){if(Cc===null)throw Error(V(308));di=e,Cc.dependencies={lanes:0,firstContext:e}}else di=di.next=e;return t}var vs=null;function Bp(e){vs===null?vs=[e]:vs.push(e)}function jb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Bp(t)):(n.next=s.next,s.next=n),t.interleaved=n,lr(e,r)}function lr(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 Pr=!1;function Vp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pb(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 sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,lr(e,n)}return s=r.interleaved,s===null?(t.next=t,Bp(r)):(t.next=s.next,s.next=t),r.interleaved=t,lr(e,n)}function zl(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,Pp(e,n)}}function oy(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 jc(e,t,n,r){var s=e.updateQueue;Pr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,u=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Re({},f,h);break e;case 2:Pr=!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},u===null?(c=u=p,l=f):u=u.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(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,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);Ls|=o,e.lanes=o,e.memoizedState=f}}function ay(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(V(191,s));s.call(r)}}}var ja={},Bn=ts(ja),aa=ts(ja),la=ts(ja);function ws(e){if(e===ja)throw Error(V(174));return e}function Up(e,t){switch(be(la,t),be(aa,e),be(Bn,ja),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lf(t,e)}je(Bn),be(Bn,t)}function Ai(){je(Bn),je(aa),je(la)}function Eb(e){ws(la.current);var t=ws(Bn.current),n=Lf(t,e.type);t!==n&&(be(aa,e),be(Bn,n))}function Wp(e){aa.current===e&&(je(Bn),je(aa))}var Te=ts(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 fd=[];function Hp(){for(var e=0;e<fd.length;e++)fd[e]._workInProgressVersionPrimary=null;fd.length=0}var Bl=dr.ReactCurrentDispatcher,hd=dr.ReactCurrentBatchConfig,Ms=0,Ne=null,Ue=null,Ke=null,Ec=!1,Do=!1,ca=0,OP=0;function tt(){throw Error(V(321))}function Gp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sn(e[n],t[n]))return!1;return!0}function Kp(e,t,n,r,s,i){if(Ms=i,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bl.current=e===null||e.memoizedState===null?VP:UP,e=n(r,s),Do){i=0;do{if(Do=!1,ca=0,25<=i)throw Error(V(301));i+=1,Ke=Ue=null,t.updateQueue=null,Bl.current=WP,e=n(r,s)}while(Do)}if(Bl.current=Tc,t=Ue!==null&&Ue.next!==null,Ms=0,Ke=Ue=Ne=null,Ec=!1,t)throw Error(V(300));return e}function Yp(){var e=ca!==0;return ca=0,e}function In(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function ln(){if(Ue===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=Ke===null?Ne.memoizedState:Ke.next;if(t!==null)Ke=t,Ue=e;else{if(e===null)throw Error(V(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function ua(e,t){return typeof t=="function"?t(e):t}function pd(e){var t=ln(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=Ue,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,c=i;do{var u=c.lane;if((Ms&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Ne.lanes|=u,Ls|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Sn(r,t.memoizedState)||(vt=!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,Ne.lanes|=i,Ls|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function md(e){var t=ln(),n=t.queue;if(n===null)throw Error(V(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);Sn(i,t.memoizedState)||(vt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Tb(){}function Nb(e,t){var n=Ne,r=ln(),s=t(),i=!Sn(r.memoizedState,s);if(i&&(r.memoizedState=s,vt=!0),r=r.queue,qp(Ab.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,da(9,Ib.bind(null,n,r,s,t),void 0,null),Ye===null)throw Error(V(349));Ms&30||Rb(n,t,s)}return s}function Rb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ib(e,t,n,r){t.value=n,t.getSnapshot=r,Mb(t)&&Lb(e)}function Ab(e,t,n){return n(function(){Mb(t)&&Lb(e)})}function Mb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sn(e,n)}catch{return!0}}function Lb(e){var t=lr(e,1);t!==null&&kn(t,e,1,-1)}function ly(e){var t=In();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},t.queue=e,e=e.dispatch=BP.bind(null,Ne,e),[t.memoizedState,e]}function da(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.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 Db(){return ln().memoizedState}function Vl(e,t,n,r){var s=In();Ne.flags|=e,s.memoizedState=da(1|t,n,void 0,r===void 0?null:r)}function fu(e,t,n,r){var s=ln();r=r===void 0?null:r;var i=void 0;if(Ue!==null){var o=Ue.memoizedState;if(i=o.destroy,r!==null&&Gp(r,o.deps)){s.memoizedState=da(t,n,i,r);return}}Ne.flags|=e,s.memoizedState=da(1|t,n,i,r)}function cy(e,t){return Vl(8390656,8,e,t)}function qp(e,t){return fu(2048,8,e,t)}function Fb(e,t){return fu(4,2,e,t)}function Ob(e,t){return fu(4,4,e,t)}function $b(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 zb(e,t,n){return n=n!=null?n.concat([e]):null,fu(4,4,$b.bind(null,t,e),n)}function Qp(){}function Bb(e,t){var n=ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vb(e,t){var n=ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ub(e,t,n){return Ms&21?(Sn(n,t)||(n=Yw(),Ne.lanes|=n,Ls|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,vt=!0),e.memoizedState=n)}function $P(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=hd.transition;hd.transition={};try{e(!1),t()}finally{de=n,hd.transition=r}}function Wb(){return ln().memoizedState}function zP(e,t,n){var r=Wr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hb(e))Gb(t,n);else if(n=jb(e,t,n,r),n!==null){var s=ft();kn(n,e,r,s),Kb(n,t,r)}}function BP(e,t,n){var r=Wr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hb(e))Gb(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,Sn(a,o)){var l=t.interleaved;l===null?(s.next=s,Bp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=jb(e,t,s,r),n!==null&&(s=ft(),kn(n,e,r,s),Kb(n,t,r))}}function Hb(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Gb(e,t){Do=Ec=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kb(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pp(e,n)}}var Tc={readContext:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useInsertionEffect:tt,useLayoutEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useMutableSource:tt,useSyncExternalStore:tt,useId:tt,unstable_isNewReconciler:!1},VP={readContext:an,useCallback:function(e,t){return In().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:cy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vl(4194308,4,$b.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vl(4,2,e,t)},useMemo:function(e,t){var n=In();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=In();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,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=In();return e={current:e},t.memoizedState=e},useState:ly,useDebugValue:Qp,useDeferredValue:function(e){return In().memoizedState=e},useTransition:function(){var e=ly(!1),t=e[0];return e=$P.bind(null,e[1]),In().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,s=In();if(Ee){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),Ye===null)throw Error(V(349));Ms&30||Rb(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,cy(Ab.bind(null,r,i,e),[e]),r.flags|=2048,da(9,Ib.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=In(),t=Ye.identifierPrefix;if(Ee){var n=rr,r=nr;n=(r&~(1<<32-bn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ca++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=OP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},UP={readContext:an,useCallback:Bb,useContext:an,useEffect:qp,useImperativeHandle:zb,useInsertionEffect:Fb,useLayoutEffect:Ob,useMemo:Vb,useReducer:pd,useRef:Db,useState:function(){return pd(ua)},useDebugValue:Qp,useDeferredValue:function(e){var t=ln();return Ub(t,Ue.memoizedState,e)},useTransition:function(){var e=pd(ua)[0],t=ln().memoizedState;return[e,t]},useMutableSource:Tb,useSyncExternalStore:Nb,useId:Wb,unstable_isNewReconciler:!1},WP={readContext:an,useCallback:Bb,useContext:an,useEffect:qp,useImperativeHandle:zb,useInsertionEffect:Fb,useLayoutEffect:Ob,useMemo:Vb,useReducer:md,useRef:Db,useState:function(){return md(ua)},useDebugValue:Qp,useDeferredValue:function(e){var t=ln();return Ue===null?t.memoizedState=e:Ub(t,Ue.memoizedState,e)},useTransition:function(){var e=md(ua)[0],t=ln().memoizedState;return[e,t]},useMutableSource:Tb,useSyncExternalStore:Nb,useId:Wb,unstable_isNewReconciler:!1};function xn(e,t){if(e&&e.defaultProps){t=Re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hu={isMounted:function(e){return(e=e._reactInternals)?Os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Wr(e),i=sr(r,s);i.payload=t,n!=null&&(i.callback=n),t=Vr(e,i,s),t!==null&&(kn(t,e,s,r),zl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Wr(e),i=sr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Vr(e,i,s),t!==null&&(kn(t,e,s,r),zl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ft(),r=Wr(e),s=sr(n,r);s.tag=2,t!=null&&(s.callback=t),t=Vr(e,s,r),t!==null&&(kn(t,e,r,n),zl(t,e,r))}};function uy(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?!ra(n,r)||!ra(s,i):!0}function Yb(e,t,n){var r=!1,s=Qr,i=t.contextType;return typeof i=="object"&&i!==null?i=an(i):(s=kt(t)?Is:ot.current,r=t.contextTypes,i=(r=r!=null)?Ni(e,s):Qr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=hu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function dy(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&&hu.enqueueReplaceState(t,t.state,null)}function rh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Vp(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=an(i):(i=kt(t)?Is:ot.current,s.context=Ni(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(nh(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&&hu.enqueueReplaceState(s,s.state,null),jc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Mi(e,t){try{var n="",r=t;do n+=xj(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 gd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var HP=typeof WeakMap=="function"?WeakMap:Map;function qb(e,t,n){n=sr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Rc||(Rc=!0,ph=r),sh(e,t)},n}function Qb(e,t,n){n=sr(-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(){sh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){sh(e,t),typeof r!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function fy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new HP;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=iE.bind(null,e,t,n),t.then(e,e))}function hy(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 py(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=sr(-1,1),t.tag=2,Vr(n,t,1))),n.lanes|=1),e)}var GP=dr.ReactCurrentOwner,vt=!1;function lt(e,t,n,r){t.child=e===null?Cb(t,null,n,r):Ii(t,e.child,n,r)}function my(e,t,n,r,s){n=n.render;var i=t.ref;return ki(t,s),r=Kp(e,t,n,r,i,s),n=Yp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,cr(e,t,s)):(Ee&&n&&Lp(t),t.flags|=1,lt(e,t,r,s),t.child)}function gy(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!sm(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Xb(e,t,i,r,s)):(e=Gl(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:ra,n(o,r)&&e.ref===t.ref)return cr(e,t,s)}return t.flags|=1,e=Hr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Xb(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(ra(i,r)&&e.ref===t.ref)if(vt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(vt=!0);else return t.lanes=e.lanes,cr(e,t,s)}return ih(e,t,n,r,s)}function Jb(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},be(hi,Dt),Dt|=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,be(hi,Dt),Dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,be(hi,Dt),Dt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,be(hi,Dt),Dt|=r;return lt(e,t,s,n),t.child}function Zb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ih(e,t,n,r,s){var i=kt(n)?Is:ot.current;return i=Ni(t,i),ki(t,s),n=Kp(e,t,n,r,i,s),r=Yp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,cr(e,t,s)):(Ee&&r&&Lp(t),t.flags|=1,lt(e,t,n,s),t.child)}function yy(e,t,n,r,s){if(kt(n)){var i=!0;bc(t)}else i=!1;if(ki(t,s),t.stateNode===null)Ul(e,t),Yb(t,n,r),rh(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=an(c):(c=kt(n)?Is:ot.current,c=Ni(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&dy(t,o,r,c),Pr=!1;var h=t.memoizedState;o.state=h,jc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||bt.current||Pr?(typeof u=="function"&&(nh(t,n,u,r),l=t.memoizedState),(a=Pr||uy(t,n,a,r,h,l,c))?(f||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=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Pb(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:xn(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=an(l):(l=kt(n)?Is:ot.current,l=Ni(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&dy(t,o,r,l),Pr=!1,h=t.memoizedState,o.state=h,jc(t,r,o,s);var m=t.memoizedState;a!==f||h!==m||bt.current||Pr?(typeof p=="function"&&(nh(t,n,p,r),m=t.memoizedState),(c=Pr||uy(t,n,c,r,h,m,l)||!1)?(u||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=c):(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 oh(e,t,n,r,i,s)}function oh(e,t,n,r,s,i){Zb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&ny(t,n,!1),cr(e,t,i);r=t.stateNode,GP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ii(t,e.child,null,i),t.child=Ii(t,null,a,i)):lt(e,t,a,i),t.memoizedState=r.state,s&&ny(t,n,!0),t.child}function e1(e){var t=e.stateNode;t.pendingContext?ty(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ty(e,t.context,!1),Up(e,t.containerInfo)}function xy(e,t,n,r,s){return Ri(),Fp(s),t.flags|=256,lt(e,t,n,r),t.child}var ah={dehydrated:null,treeContext:null,retryLane:0};function lh(e){return{baseLanes:e,cachePool:null,transitions:null}}function t1(e,t,n){var r=t.pendingProps,s=Te.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),be(Te,s&1),e===null)return eh(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=gu(o,r,0,null),e=Cs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=lh(n),t.memoizedState=ah,e):Xp(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return KP(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=Hr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Hr(a,i):(i=Cs(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?lh(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=ah,r}return i=e.child,e=i.sibling,r=Hr(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 Xp(e,t){return t=gu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ol(e,t,n,r){return r!==null&&Fp(r),Ii(t,e.child,null,n),e=Xp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function KP(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=gd(Error(V(422))),ol(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=gu({mode:"visible",children:r.children},s,0,null),i=Cs(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ii(t,e.child,null,o),t.child.memoizedState=lh(o),t.memoizedState=ah,i);if(!(t.mode&1))return ol(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(V(419)),r=gd(i,r,void 0),ol(e,t,o,r)}if(a=(o&e.childLanes)!==0,vt||a){if(r=Ye,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,lr(e,s),kn(r,e,s,-1))}return rm(),r=gd(Error(V(421))),ol(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=oE.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Ft=Br(s.nextSibling),$t=t,Ee=!0,wn=null,e!==null&&(Jt[Zt++]=nr,Jt[Zt++]=rr,Jt[Zt++]=As,nr=e.id,rr=e.overflow,As=t),t=Xp(t,r.children),t.flags|=4096,t)}function vy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),th(e.return,t,n)}function yd(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 n1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(lt(e,t,r.children,n),r=Te.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&&vy(e,n,t);else if(e.tag===19)vy(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(be(Te,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),yd(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}yd(t,!0,n,null,i);break;case"together":yd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ul(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ls|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=Hr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function YP(e,t,n){switch(t.tag){case 3:e1(t),Ri();break;case 5:Eb(t);break;case 1:kt(t.type)&&bc(t);break;case 4:Up(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;be(Sc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(be(Te,Te.current&1),t.flags|=128,null):n&t.child.childLanes?t1(e,t,n):(be(Te,Te.current&1),e=cr(e,t,n),e!==null?e.sibling:null);be(Te,Te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return n1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),be(Te,Te.current),r)break;return null;case 22:case 23:return t.lanes=0,Jb(e,t,n)}return cr(e,t,n)}var r1,ch,s1,i1;r1=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}};ch=function(){};s1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ws(Bn.current);var i=null;switch(n){case"input":s=Rf(e,s),r=Rf(e,r),i=[];break;case"select":s=Re({},s,{value:void 0}),r=Re({},r,{value:void 0}),i=[];break;case"textarea":s=Mf(e,s),r=Mf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vc)}Df(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Qo.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="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(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Qo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ce("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};i1=function(e,t,n,r){n!==r&&(t.flags|=4)};function uo(e,t){if(!Ee)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 nt(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(Dp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return kt(t.type)&&wc(),nt(t),null;case 3:return r=t.stateNode,Ai(),je(bt),je(ot),Hp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wn!==null&&(yh(wn),wn=null))),ch(e,t),nt(t),null;case 5:Wp(t);var s=ws(la.current);if(n=t.type,e!==null&&t.stateNode!=null)s1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return nt(t),null}if(e=ws(Bn.current),sl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Fn]=t,r[oa]=i,e=(t.mode&1)!==0,n){case"dialog":Ce("cancel",r),Ce("close",r);break;case"iframe":case"object":case"embed":Ce("load",r);break;case"video":case"audio":for(s=0;s<Eo.length;s++)Ce(Eo[s],r);break;case"source":Ce("error",r);break;case"img":case"image":case"link":Ce("error",r),Ce("load",r);break;case"details":Ce("toggle",r);break;case"input":Eg(r,i),Ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ce("invalid",r);break;case"textarea":Ng(r,i),Ce("invalid",r)}Df(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&&rl(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&rl(r.textContent,a,e),s=["children",""+a]):Qo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ce("scroll",r)}switch(n){case"input":qa(r),Tg(r,i,!0);break;case"textarea":qa(r),Rg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=vc)}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=Aw(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[Fn]=t,e[oa]=r,r1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ff(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),s=r;break;case"iframe":case"object":case"embed":Ce("load",e),s=r;break;case"video":case"audio":for(s=0;s<Eo.length;s++)Ce(Eo[s],e);s=r;break;case"source":Ce("error",e),s=r;break;case"img":case"image":case"link":Ce("error",e),Ce("load",e),s=r;break;case"details":Ce("toggle",e),s=r;break;case"input":Eg(e,r),s=Rf(e,r),Ce("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Re({},r,{value:void 0}),Ce("invalid",e);break;case"textarea":Ng(e,r),s=Mf(e,r),Ce("invalid",e);break;default:s=r}Df(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Dw(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Mw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Xo(e,l):typeof l=="number"&&Xo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Qo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ce("scroll",e):l!=null&&bp(e,i,l,o))}switch(n){case"input":qa(e),Tg(e,r,!1);break;case"textarea":qa(e),Rg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?xi(e,!!r.multiple,i,!1):r.defaultValue!=null&&xi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=vc)}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 nt(t),null;case 6:if(e&&t.stateNode!=null)i1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=ws(la.current),ws(Bn.current),sl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fn]=t,(i=r.nodeValue!==n)&&(e=$t,e!==null))switch(e.tag){case 3:rl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fn]=t,t.stateNode=r}return nt(t),null;case 13:if(je(Te),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Ft!==null&&t.mode&1&&!(t.flags&128))_b(),Ri(),t.flags|=98560,i=!1;else if(i=sl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[Fn]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;nt(t),i=!1}else wn!==null&&(yh(wn),wn=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||Te.current&1?We===0&&(We=3):rm())),t.updateQueue!==null&&(t.flags|=4),nt(t),null);case 4:return Ai(),ch(e,t),e===null&&sa(t.stateNode.containerInfo),nt(t),null;case 10:return zp(t.type._context),nt(t),null;case 17:return kt(t.type)&&wc(),nt(t),null;case 19:if(je(Te),i=t.memoizedState,i===null)return nt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)uo(i,!1);else{if(We!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Pc(e),o!==null){for(t.flags|=128,uo(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 be(Te,Te.current&1|2),t.child}e=e.sibling}i.tail!==null&&De()>Li&&(t.flags|=128,r=!0,uo(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),uo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ee)return nt(t),null}else 2*De()-i.renderingStartTime>Li&&n!==1073741824&&(t.flags|=128,r=!0,uo(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=De(),t.sibling=null,n=Te.current,be(Te,r?n&1|2:n&1),t):(nt(t),null);case 22:case 23:return nm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Dt&1073741824&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function QP(e,t){switch(Dp(t),t.tag){case 1:return kt(t.type)&&wc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ai(),je(bt),je(ot),Hp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wp(t),null;case 13:if(je(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Te),null;case 4:return Ai(),null;case 10:return zp(t.type._context),null;case 22:case 23:return nm(),null;case 24:return null;default:return null}}var al=!1,st=!1,XP=typeof WeakSet=="function"?WeakSet:Set,K=null;function fi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function uh(e,t,n){try{n()}catch(r){Me(e,t,r)}}var wy=!1;function JP(e,t){if(Kf=gc,e=ub(),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,c=0,u=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yf={focusedElem:e,selectionRange:n},gc=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:xn(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(k){Me(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return m=wy,wy=!1,m}function Fo(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&&uh(t,n,i)}s=s.next}while(s!==r)}}function pu(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 dh(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 o1(e){var t=e.alternate;t!==null&&(e.alternate=null,o1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fn],delete t[oa],delete t[Xf],delete t[MP],delete t[LP])),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 a1(e){return e.tag===5||e.tag===3||e.tag===4}function by(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a1(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 fh(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=vc));else if(r!==4&&(e=e.child,e!==null))for(fh(e,t,n),e=e.sibling;e!==null;)fh(e,t,n),e=e.sibling}function hh(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(hh(e,t,n),e=e.sibling;e!==null;)hh(e,t,n),e=e.sibling}var qe=null,vn=!1;function pr(e,t,n){for(n=n.child;n!==null;)l1(e,t,n),n=n.sibling}function l1(e,t,n){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(ou,n)}catch{}switch(n.tag){case 5:st||fi(n,t);case 6:var r=qe,s=vn;qe=null,pr(e,t,n),qe=r,vn=s,qe!==null&&(vn?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(vn?(e=qe,n=n.stateNode,e.nodeType===8?ud(e.parentNode,n):e.nodeType===1&&ud(e,n),ta(e)):ud(qe,n.stateNode));break;case 4:r=qe,s=vn,qe=n.stateNode.containerInfo,vn=!0,pr(e,t,n),qe=r,vn=s;break;case 0:case 11:case 14:case 15:if(!st&&(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)&&uh(n,t,o),s=s.next}while(s!==r)}pr(e,t,n);break;case 1:if(!st&&(fi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}pr(e,t,n);break;case 21:pr(e,t,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,pr(e,t,n),st=r):pr(e,t,n);break;default:pr(e,t,n)}}function ky(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new XP),t.forEach(function(r){var s=aE.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function fn(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:qe=a.stateNode,vn=!1;break e;case 3:qe=a.stateNode.containerInfo,vn=!0;break e;case 4:qe=a.stateNode.containerInfo,vn=!0;break e}a=a.return}if(qe===null)throw Error(V(160));l1(i,o,s),qe=null,vn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Me(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)c1(t,e),t=t.sibling}function c1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fn(t,e),En(e),r&4){try{Fo(3,e,e.return),pu(3,e)}catch(g){Me(e,e.return,g)}try{Fo(5,e,e.return)}catch(g){Me(e,e.return,g)}}break;case 1:fn(t,e),En(e),r&512&&n!==null&&fi(n,n.return);break;case 5:if(fn(t,e),En(e),r&512&&n!==null&&fi(n,n.return),e.flags&32){var s=e.stateNode;try{Xo(s,"")}catch(g){Me(e,e.return,g)}}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&&Rw(s,i),Ff(a,o);var c=Ff(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?Dw(s,f):u==="dangerouslySetInnerHTML"?Mw(s,f):u==="children"?Xo(s,f):bp(s,u,f,c)}switch(a){case"input":If(s,i);break;case"textarea":Iw(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?xi(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?xi(s,!!i.multiple,i.defaultValue,!0):xi(s,!!i.multiple,i.multiple?[]:"",!1))}s[oa]=i}catch(g){Me(e,e.return,g)}}break;case 6:if(fn(t,e),En(e),r&4){if(e.stateNode===null)throw Error(V(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Me(e,e.return,g)}}break;case 3:if(fn(t,e),En(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ta(t.containerInfo)}catch(g){Me(e,e.return,g)}break;case 4:fn(t,e),En(e);break;case 13:fn(t,e),En(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(em=De())),r&4&&ky(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(st=(c=st)||u,fn(t,e),st=c):fn(t,e),En(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(f=K=u;K!==null;){switch(h=K,p=h.child,h.tag){case 0:case 11:case 14:case 15:Fo(4,h,h.return);break;case 1:fi(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(g){Me(r,n,g)}}break;case 5:fi(h,h.return);break;case 22:if(h.memoizedState!==null){Sy(f);continue}}p!==null?(p.return=h,K=p):Sy(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Lw("display",o))}catch(g){Me(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Me(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:fn(t,e),En(e),r&4&&ky(e);break;case 21:break;default:fn(t,e),En(e)}}function En(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(a1(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Xo(s,""),r.flags&=-33);var i=by(e);hh(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=by(e);fh(e,a,o);break;default:throw Error(V(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZP(e,t,n){K=e,u1(e)}function u1(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var s=K,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||al;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||st;a=al;var c=st;if(al=o,(st=l)&&!c)for(K=s;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?Cy(s):l!==null?(l.return=o,K=l):Cy(s);for(;i!==null;)K=i,u1(i),i=i.sibling;K=s,al=a,st=c}_y(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,K=i):_y(e)}}function _y(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:st||pu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!st)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:xn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ay(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}ay(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 c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&ta(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}st||t.flags&512&&dh(t)}catch(h){Me(t,t.return,h)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Sy(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Cy(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pu(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Me(t,s,l)}}var i=t.return;try{dh(t)}catch(l){Me(t,i,l)}break;case 5:var o=t.return;try{dh(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){K=null;break}var a=t.sibling;if(a!==null){a.return=t.return,K=a;break}K=t.return}}var eE=Math.ceil,Nc=dr.ReactCurrentDispatcher,Jp=dr.ReactCurrentOwner,sn=dr.ReactCurrentBatchConfig,ae=0,Ye=null,Be=null,Je=0,Dt=0,hi=ts(0),We=0,fa=null,Ls=0,mu=0,Zp=0,Oo=null,xt=null,em=0,Li=1/0,Jn=null,Rc=!1,ph=null,Ur=null,ll=!1,Ir=null,Ic=0,$o=0,mh=null,Wl=-1,Hl=0;function ft(){return ae&6?De():Wl!==-1?Wl:Wl=De()}function Wr(e){return e.mode&1?ae&2&&Je!==0?Je&-Je:FP.transition!==null?(Hl===0&&(Hl=Yw()),Hl):(e=de,e!==0||(e=window.event,e=e===void 0?16:tb(e.type)),e):1}function kn(e,t,n,r){if(50<$o)throw $o=0,mh=null,Error(V(185));_a(e,n,r),(!(ae&2)||e!==Ye)&&(e===Ye&&(!(ae&2)&&(mu|=n),We===4&&Nr(e,Je)),_t(e,r),n===1&&ae===0&&!(t.mode&1)&&(Li=De()+500,du&&ns()))}function _t(e,t){var n=e.callbackNode;Fj(e,t);var r=mc(e,e===Ye?Je:0);if(r===0)n!==null&&Mg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mg(n),t===1)e.tag===0?DP(jy.bind(null,e)):wb(jy.bind(null,e)),IP(function(){!(ae&6)&&ns()}),n=null;else{switch(qw(r)){case 1:n=jp;break;case 4:n=Gw;break;case 16:n=pc;break;case 536870912:n=Kw;break;default:n=pc}n=x1(n,d1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function d1(e,t){if(Wl=-1,Hl=0,ae&6)throw Error(V(327));var n=e.callbackNode;if(_i()&&e.callbackNode!==n)return null;var r=mc(e,e===Ye?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ac(e,r);else{t=r;var s=ae;ae|=2;var i=h1();(Ye!==e||Je!==t)&&(Jn=null,Li=De()+500,Ss(e,t));do try{rE();break}catch(a){f1(e,a)}while(!0);$p(),Nc.current=i,ae=s,Be!==null?t=0:(Ye=null,Je=0,t=We)}if(t!==0){if(t===2&&(s=Vf(e),s!==0&&(r=s,t=gh(e,s))),t===1)throw n=fa,Ss(e,0),Nr(e,r),_t(e,De()),n;if(t===6)Nr(e,r);else{if(s=e.current.alternate,!(r&30)&&!tE(s)&&(t=Ac(e,r),t===2&&(i=Vf(e),i!==0&&(r=i,t=gh(e,i))),t===1))throw n=fa,Ss(e,0),Nr(e,r),_t(e,De()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:hs(e,xt,Jn);break;case 3:if(Nr(e,r),(r&130023424)===r&&(t=em+500-De(),10<t)){if(mc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Qf(hs.bind(null,e,xt,Jn),t);break}hs(e,xt,Jn);break;case 4:if(Nr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-bn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*eE(r/1960))-r,10<r){e.timeoutHandle=Qf(hs.bind(null,e,xt,Jn),r);break}hs(e,xt,Jn);break;case 5:hs(e,xt,Jn);break;default:throw Error(V(329))}}}return _t(e,De()),e.callbackNode===n?d1.bind(null,e):null}function gh(e,t){var n=Oo;return e.current.memoizedState.isDehydrated&&(Ss(e,t).flags|=256),e=Ac(e,t),e!==2&&(t=xt,xt=n,t!==null&&yh(t)),e}function yh(e){xt===null?xt=e:xt.push.apply(xt,e)}function tE(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(!Sn(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 Nr(e,t){for(t&=~Zp,t&=~mu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-bn(t),r=1<<n;e[n]=-1,t&=~r}}function jy(e){if(ae&6)throw Error(V(327));_i();var t=mc(e,0);if(!(t&1))return _t(e,De()),null;var n=Ac(e,t);if(e.tag!==0&&n===2){var r=Vf(e);r!==0&&(t=r,n=gh(e,r))}if(n===1)throw n=fa,Ss(e,0),Nr(e,t),_t(e,De()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hs(e,xt,Jn),_t(e,De()),null}function tm(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Li=De()+500,du&&ns())}}function Ds(e){Ir!==null&&Ir.tag===0&&!(ae&6)&&_i();var t=ae;ae|=1;var n=sn.transition,r=de;try{if(sn.transition=null,de=1,e)return e()}finally{de=r,sn.transition=n,ae=t,!(ae&6)&&ns()}}function nm(){Dt=hi.current,je(hi)}function Ss(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,RP(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(Dp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wc();break;case 3:Ai(),je(bt),je(ot),Hp();break;case 5:Wp(r);break;case 4:Ai();break;case 13:je(Te);break;case 19:je(Te);break;case 10:zp(r.type._context);break;case 22:case 23:nm()}n=n.return}if(Ye=e,Be=e=Hr(e.current,null),Je=Dt=t,We=0,fa=null,Zp=mu=Ls=0,xt=Oo=null,vs!==null){for(t=0;t<vs.length;t++)if(n=vs[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}vs=null}return e}function f1(e,t){do{var n=Be;try{if($p(),Bl.current=Tc,Ec){for(var r=Ne.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ec=!1}if(Ms=0,Ke=Ue=Ne=null,Do=!1,ca=0,Jp.current=null,n===null||n.return===null){We=1,fa=t,Be=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=hy(o);if(p!==null){p.flags&=-257,py(p,o,a,i,t),p.mode&1&&fy(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){fy(i,c,t),rm();break e}l=Error(V(426))}}else if(Ee&&a.mode&1){var v=hy(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),py(v,o,a,i,t),Fp(Mi(l,a));break e}}i=l=Mi(l,a),We!==4&&(We=2),Oo===null?Oo=[i]:Oo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=qb(i,l,t);oy(i,y);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ur===null||!Ur.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=Qb(i,a,t);oy(i,k);break e}}i=i.return}while(i!==null)}m1(n)}catch(S){t=S,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function h1(){var e=Nc.current;return Nc.current=Tc,e===null?Tc:e}function rm(){(We===0||We===3||We===2)&&(We=4),Ye===null||!(Ls&268435455)&&!(mu&268435455)||Nr(Ye,Je)}function Ac(e,t){var n=ae;ae|=2;var r=h1();(Ye!==e||Je!==t)&&(Jn=null,Ss(e,t));do try{nE();break}catch(s){f1(e,s)}while(!0);if($p(),ae=n,Nc.current=r,Be!==null)throw Error(V(261));return Ye=null,Je=0,We}function nE(){for(;Be!==null;)p1(Be)}function rE(){for(;Be!==null&&!Ej();)p1(Be)}function p1(e){var t=y1(e.alternate,e,Dt);e.memoizedProps=e.pendingProps,t===null?m1(e):Be=t,Jp.current=null}function m1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=QP(n,t),n!==null){n.flags&=32767,Be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Be=null;return}}else if(n=qP(n,t,Dt),n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);We===0&&(We=5)}function hs(e,t,n){var r=de,s=sn.transition;try{sn.transition=null,de=1,sE(e,t,n,r)}finally{sn.transition=s,de=r}return null}function sE(e,t,n,r){do _i();while(Ir!==null);if(ae&6)throw Error(V(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(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Oj(e,i),e===Ye&&(Be=Ye=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,x1(pc,function(){return _i(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=sn.transition,sn.transition=null;var o=de;de=1;var a=ae;ae|=4,Jp.current=null,JP(e,n),c1(n,e),SP(Yf),gc=!!Kf,Yf=Kf=null,e.current=n,ZP(n),Tj(),ae=a,de=o,sn.transition=i}else e.current=n;if(ll&&(ll=!1,Ir=e,Ic=s),i=e.pendingLanes,i===0&&(Ur=null),Ij(n.stateNode),_t(e,De()),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(Rc)throw Rc=!1,e=ph,ph=null,e;return Ic&1&&e.tag!==0&&_i(),i=e.pendingLanes,i&1?e===mh?$o++:($o=0,mh=e):$o=0,ns(),null}function _i(){if(Ir!==null){var e=qw(Ic),t=sn.transition,n=de;try{if(sn.transition=null,de=16>e?16:e,Ir===null)var r=!1;else{if(e=Ir,Ir=null,Ic=0,ae&6)throw Error(V(331));var s=ae;for(ae|=4,K=e.current;K!==null;){var i=K,o=i.child;if(K.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(K=c;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:Fo(8,u,i)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var h=u.sibling,p=u.return;if(o1(u),u===c){K=null;break}if(h!==null){h.return=p,K=h;break}K=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}K=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,K=o;else e:for(;K!==null;){if(i=K,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Fo(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,K=y;break e}K=i.return}}var x=e.current;for(K=x;K!==null;){o=K;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,K=w;else e:for(o=x;K!==null;){if(a=K,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:pu(9,a)}}catch(S){Me(a,a.return,S)}if(a===o){K=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,K=k;break e}K=a.return}}if(ae=s,ns(),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(ou,e)}catch{}r=!0}return r}finally{de=n,sn.transition=t}}return!1}function Py(e,t,n){t=Mi(n,t),t=qb(e,t,1),e=Vr(e,t,1),t=ft(),e!==null&&(_a(e,1,t),_t(e,t))}function Me(e,t,n){if(e.tag===3)Py(e,e,n);else for(;t!==null;){if(t.tag===3){Py(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){e=Mi(n,e),e=Qb(t,e,1),t=Vr(t,e,1),e=ft(),t!==null&&(_a(t,1,e),_t(t,e));break}}t=t.return}}function iE(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ft(),e.pingedLanes|=e.suspendedLanes&n,Ye===e&&(Je&n)===n&&(We===4||We===3&&(Je&130023424)===Je&&500>De()-em?Ss(e,0):Zp|=n),_t(e,t)}function g1(e,t){t===0&&(e.mode&1?(t=Ja,Ja<<=1,!(Ja&130023424)&&(Ja=4194304)):t=1);var n=ft();e=lr(e,t),e!==null&&(_a(e,t,n),_t(e,n))}function oE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g1(e,n)}function aE(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(V(314))}r!==null&&r.delete(t),g1(e,n)}var y1;y1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||bt.current)vt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return vt=!1,YP(e,t,n);vt=!!(e.flags&131072)}else vt=!1,Ee&&t.flags&1048576&&bb(t,_c,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ul(e,t),e=t.pendingProps;var s=Ni(t,ot.current);ki(t,n),s=Kp(null,t,r,e,s,n);var i=Yp();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,kt(r)?(i=!0,bc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vp(t),s.updater=hu,t.stateNode=s,s._reactInternals=t,rh(t,r,e,n),t=oh(null,t,r,!0,i,n)):(t.tag=0,Ee&&i&&Lp(t),lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ul(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=cE(r),e=xn(r,e),s){case 0:t=ih(null,t,r,e,n);break e;case 1:t=yy(null,t,r,e,n);break e;case 11:t=my(null,t,r,e,n);break e;case 14:t=gy(null,t,r,xn(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),ih(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),yy(e,t,r,s,n);case 3:e:{if(e1(t),e===null)throw Error(V(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Pb(e,t),jc(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=Mi(Error(V(423)),t),t=xy(e,t,r,n,s);break e}else if(r!==s){s=Mi(Error(V(424)),t),t=xy(e,t,r,n,s);break e}else for(Ft=Br(t.stateNode.containerInfo.firstChild),$t=t,Ee=!0,wn=null,n=Cb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ri(),r===s){t=cr(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return Eb(t),e===null&&eh(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,qf(r,s)?o=null:i!==null&&qf(r,i)&&(t.flags|=32),Zb(e,t),lt(e,t,o,n),t.child;case 6:return e===null&&eh(t),null;case 13:return t1(e,t,n);case 4:return Up(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ii(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),my(e,t,r,s,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(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,be(Sc,r._currentValue),r._currentValue=o,i!==null)if(Sn(i.value,o)){if(i.children===s.children&&!bt.current){t=cr(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=sr(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),th(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(V(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),th(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}lt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ki(t,n),s=an(s),r=r(s),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,s=xn(r,t.pendingProps),s=xn(r.type,s),gy(e,t,r,s,n);case 15:return Xb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),Ul(e,t),t.tag=1,kt(r)?(e=!0,bc(t)):e=!1,ki(t,n),Yb(t,r,s),rh(t,r,s,n),oh(null,t,r,!0,e,n);case 19:return n1(e,t,n);case 22:return Jb(e,t,n)}throw Error(V(156,t.tag))};function x1(e,t){return Hw(e,t)}function lE(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 tn(e,t,n,r){return new lE(e,t,n,r)}function sm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cE(e){if(typeof e=="function")return sm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_p)return 11;if(e===Sp)return 14}return 2}function Hr(e,t){var n=e.alternate;return n===null?(n=tn(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 Gl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")sm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ri:return Cs(n.children,s,i,t);case kp:o=8,s|=8;break;case Pf:return e=tn(12,n,t,s|2),e.elementType=Pf,e.lanes=i,e;case Ef:return e=tn(13,n,t,s),e.elementType=Ef,e.lanes=i,e;case Tf:return e=tn(19,n,t,s),e.elementType=Tf,e.lanes=i,e;case Ew:return gu(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jw:o=10;break e;case Pw:o=9;break e;case _p:o=11;break e;case Sp:o=14;break e;case jr:o=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=tn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Cs(e,t,n,r){return e=tn(7,e,r,t),e.lanes=n,e}function gu(e,t,n,r){return e=tn(22,e,r,t),e.elementType=Ew,e.lanes=n,e.stateNode={isHidden:!1},e}function xd(e,t,n){return e=tn(6,e,null,t),e.lanes=n,e}function vd(e,t,n){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uE(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=Zu(0),this.expirationTimes=Zu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function im(e,t,n,r,s,i,o,a,l){return e=new uE(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=tn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vp(i),e}function dE(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ni,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function v1(e){if(!e)return Qr;e=e._reactInternals;e:{if(Os(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(kt(n))return vb(e,n,t)}return t}function w1(e,t,n,r,s,i,o,a,l){return e=im(n,r,!0,e,s,i,o,a,l),e.context=v1(null),n=e.current,r=ft(),s=Wr(n),i=sr(r,s),i.callback=t??null,Vr(n,i,s),e.current.lanes=s,_a(e,s,r),_t(e,r),e}function yu(e,t,n,r){var s=t.current,i=ft(),o=Wr(s);return n=v1(n),t.context===null?t.context=n:t.pendingContext=n,t=sr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vr(s,t,o),e!==null&&(kn(e,s,o,i),zl(e,s,o)),o}function Mc(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 Ey(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function om(e,t){Ey(e,t),(e=e.alternate)&&Ey(e,t)}function fE(){return null}var b1=typeof reportError=="function"?reportError:function(e){console.error(e)};function am(e){this._internalRoot=e}xu.prototype.render=am.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));yu(e,t,null,null)};xu.prototype.unmount=am.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ds(function(){yu(null,e,null,null)}),t[ar]=null}};function xu(e){this._internalRoot=e}xu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tr.length&&t!==0&&t<Tr[n].priority;n++);Tr.splice(n,0,e),n===0&&eb(e)}};function lm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ty(){}function hE(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Mc(o);i.call(c)}}var o=w1(t,r,e,0,null,!1,!1,"",Ty);return e._reactRootContainer=o,e[ar]=o.current,sa(e.nodeType===8?e.parentNode:e),Ds(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Mc(l);a.call(c)}}var l=im(e,0,!1,null,null,!1,!1,"",Ty);return e._reactRootContainer=l,e[ar]=l.current,sa(e.nodeType===8?e.parentNode:e),Ds(function(){yu(t,l,n,r)}),l}function wu(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=Mc(o);a.call(l)}}yu(t,o,e,s)}else o=hE(n,t,e,s,r);return Mc(o)}Qw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Po(t.pendingLanes);n!==0&&(Pp(t,n|1),_t(t,De()),!(ae&6)&&(Li=De()+500,ns()))}break;case 13:Ds(function(){var r=lr(e,1);if(r!==null){var s=ft();kn(r,e,1,s)}}),om(e,1)}};Ep=function(e){if(e.tag===13){var t=lr(e,134217728);if(t!==null){var n=ft();kn(t,e,134217728,n)}om(e,134217728)}};Xw=function(e){if(e.tag===13){var t=Wr(e),n=lr(e,t);if(n!==null){var r=ft();kn(n,e,t,r)}om(e,t)}};Jw=function(){return de};Zw=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};$f=function(e,t,n){switch(t){case"input":if(If(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=uu(r);if(!s)throw Error(V(90));Nw(r),If(r,s)}}}break;case"textarea":Iw(e,n);break;case"select":t=n.value,t!=null&&xi(e,!!n.multiple,t,!1)}};$w=tm;zw=Ds;var pE={usingClientEntryPoint:!1,Events:[Ca,ai,uu,Fw,Ow,tm]},fo={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mE={bundleType:fo.bundleType,version:fo.version,rendererPackageName:fo.rendererPackageName,rendererConfig:fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Uw(e),e===null?null:e.stateNode},findFiberByHostInstance:fo.findFiberByHostInstance||fE,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 cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cl.isDisabled&&cl.supportsFiber)try{ou=cl.inject(mE),zn=cl}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pE;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lm(t))throw Error(V(200));return dE(e,t,null,n)};Ut.createRoot=function(e,t){if(!lm(e))throw Error(V(299));var n=!1,r="",s=b1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=im(e,1,!1,null,null,n,!1,r,s),e[ar]=t.current,sa(e.nodeType===8?e.parentNode:e),new am(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Uw(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return Ds(e)};Ut.hydrate=function(e,t,n){if(!vu(t))throw Error(V(200));return wu(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!lm(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=b1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=w1(t,null,e,1,n??null,s,!1,i,o),e[ar]=t.current,sa(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 xu(t)};Ut.render=function(e,t,n){if(!vu(t))throw Error(V(200));return wu(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!vu(e))throw Error(V(40));return e._reactRootContainer?(Ds(function(){wu(null,null,e,!1,function(){e._reactRootContainer=null,e[ar]=null})}),!0):!1};Ut.unstable_batchedUpdates=tm;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vu(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return wu(e,t,n,!1,r)};Ut.version="18.3.1-next-f1338f8080-20240426";function k1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k1)}catch(e){console.error(e)}}k1(),kw.exports=Ut;var $s=kw.exports,_1,Ny=$s;_1=Ny.createRoot,Ny.hydrateRoot;var To=typeof window<"u"?b.useLayoutEffect:b.useEffect;function wd(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function gE(e,t,n={},r={}){b.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 yE(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}const S1=!1;function ha(e){return e[e.length-1]}function xE(e){return typeof e=="function"}function Ar(e,t){return xE(e)?e(t):e}const vE=Object.prototype.hasOwnProperty,Ry=Object.prototype.propertyIsEnumerable,wE=()=>Object.create(null),as=(e,t)=>Mr(e,t,wE);function Mr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=My(e)&&My(s);if(!i&&!(Di(e)&&Di(s)))return s;const o=i?e:Iy(e);if(!o)return s;const a=i?s:Iy(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],g=s[p];if(m===g){u[p]=m,(i?h<l:vE.call(e,p))&&f++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[p]=g;continue}const v=Mr(m,g,n,r+1);u[p]=v,v===m&&f++}return l===c&&f===l?e:u}function Iy(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Ry.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(!Ry.call(e,s))return!1;r.push(s)}return r}function Di(e){if(!Ay(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Ay(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ay(e){return Object.prototype.toString.call(e)==="[object Object]"}function My(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function js(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(!js(e[r],t[r],n))return!1;return!0}if(Di(e)&&Di(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)&&!js(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||!js(e[o],t[o],n)))return!1;return s===i}return!1}function Fi(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 pa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function bE(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Ly(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 bE(t)}const kE=["http:","https:","mailto:","tel:"];function Lc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ho(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+=Ly(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+Ly(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function _E(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function SE(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 ir(){throw new Error("Invariant failed")}function ma(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 Lr=4,C1=5;function CE(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 cm(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=CE(i);if(o){const[a,l]=o,c=i.charCodeAt(a+1);if(c===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const u=a+3,f=l;if(u<f)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,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 bu(e,t,n,r,s,i,o){var l,c,u,f,h,p,m,g,v,y,x,w,k;o==null||o(n);let a=r;{const S=n.fullPath??n.from,C=S.length,P=((l=n.options)==null?void 0:l.caseSensitive)??e,E=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&h.params));for(;a<C;){const j=cm(S,a,t);let N;const I=a,L=j[5];switch(a=L+1,i++,j[0]){case 0:{const O=S.substring(j[2],j[3]);if(P){const A=(p=s.static)==null?void 0:p.get(O);if(A)N=A;else{s.static??(s.static=new Map);const $=bs(n.fullPath??n.from);$.parent=s,$.depth=i,N=$,s.static.set(O,$)}}else{const A=O.toLowerCase(),$=(m=s.staticInsensitive)==null?void 0:m.get(A);if($)N=$;else{s.staticInsensitive??(s.staticInsensitive=new Map);const U=bs(n.fullPath??n.from);U.parent=s,U.depth=i,N=U,s.staticInsensitive.set(A,U)}}break}case 1:{const O=S.substring(I,j[1]),A=S.substring(j[4],L),$=P&&!!(O||A),U=O?$?O:O.toLowerCase():void 0,F=A?$?A:A.toLowerCase():void 0,z=!E&&((g=s.dynamic)==null?void 0:g.find(_=>!_.skipOnParamError&&_.caseSensitive===$&&_.prefix===U&&_.suffix===F));if(z)N=z;else{const _=kd(1,n.fullPath??n.from,$,U,F);N=_,_.depth=i,_.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(_)}break}case 3:{const O=S.substring(I,j[1]),A=S.substring(j[4],L),$=P&&!!(O||A),U=O?$?O:O.toLowerCase():void 0,F=A?$?A:A.toLowerCase():void 0,z=!E&&((v=s.optional)==null?void 0:v.find(_=>!_.skipOnParamError&&_.caseSensitive===$&&_.prefix===U&&_.suffix===F));if(z)N=z;else{const _=kd(3,n.fullPath??n.from,$,U,F);N=_,_.parent=s,_.depth=i,s.optional??(s.optional=[]),s.optional.push(_)}break}case 2:{const O=S.substring(I,j[1]),A=S.substring(j[4],L),$=P&&!!(O||A),U=O?$?O:O.toLowerCase():void 0,F=A?$?A:A.toLowerCase():void 0,z=kd(2,n.fullPath??n.from,$,U,F);N=z,z.parent=s,z.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(z)}}s=N}if(E&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const j=bs(n.fullPath??n.from);j.kind=C1,j.parent=s,i++,j.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(j),s=j}const T=(n.path||!n.children)&&!n.isRoot;if(T&&S.endsWith("/")){const j=bs(n.fullPath??n.from);j.kind=Lr,j.parent=s,i++,j.depth=i,s.index=j,s=j}s.parse=((x=(y=n.options)==null?void 0:y.params)==null?void 0:x.parse)??null,s.skipOnParamError=E,s.parsingPriority=((k=(w=n.options)==null?void 0:w.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)bu(e,t,S,a,s,i,o)}function bd(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 Er(e){var t,n,r;if(e.pathless)for(const s of e.pathless)Er(s);if(e.static)for(const s of e.static.values())Er(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Er(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(bd);for(const s of e.dynamic)Er(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(bd);for(const s of e.optional)Er(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(bd);for(const s of e.wildcard)Er(s)}}function bs(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 kd(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 jE(e,t){const n=bs("/"),r=new Uint16Array(6);for(const s of e)bu(!1,r,s,1,n,0);Er(n),t.masksTree=n,t.flatCache=ma(1e3)}function PE(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=um(e,t.masksTree);return t.flatCache.set(e,r),r}function EE(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=bs("/"),bu(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),um(r,o,n)}function TE(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=um(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=IE(i.route)),t.matchCache.set(r,i),i}function NE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function RE(e,t=!1,n){const r=bs(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return bu(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&ir(),i[l.id]=l,a!==0&&l.path){const c=NE(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),Er(r),{processedTree:{segmentTree:r,singleCache:ma(1e3),matchCache:ma(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function um(e,t,n=!1){const r=e.split("/"),s=ME(e,r,t,n);if(!s)return null;const[i]=j1(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function j1(e,t,n){var u,f,h,p,m,g,v,y,x,w;const r=AE(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((f=n.extract)==null?void 0:f.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,c=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,c++){const k=r[a];if(k.kind===Lr)break;if(k.kind===C1){c--,o--,l--;continue}const S=t[o],C=l;if(S&&(l+=S.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const P=s[c],E=((m=k.prefix)==null?void 0:m.length)??0;if(P.charCodeAt(E)===123){const T=((g=k.suffix)==null?void 0:g.length)??0,j=P.substring(E+2,P.length-T-1),N=S.substring(E,S.length-T);i[j]=decodeURIComponent(N)}else{const T=P.substring(1);i[T]=decodeURIComponent(S)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=C-1;continue}s??(s=n.node.fullPath.split("/"));const P=s[c],E=((v=k.prefix)==null?void 0:v.length)??0,T=((y=k.suffix)==null?void 0:y.length)??0,j=P.substring(E+3,P.length-T-1),N=k.suffix||k.prefix?S.substring(E,S.length-T):S;N&&(i[j]=decodeURIComponent(N))}else if(k.kind===2){const P=k,E=e.substring(C+(((x=P.prefix)==null?void 0:x.length)??0),e.length-(((w=P.suffix)==null?void 0:w.length)??0)),T=decodeURIComponent(E);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function IE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function AE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ME(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ha(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,c=null;for(;a.length;){const u=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:g,dynamics:v,optionals:y}=u;let{extract:x,rawParams:w,parsedParams:k}=u;if(f.kind===2&&f.route&&!dl(c,u))continue;if(f.skipOnParamError){if(!Dy(e,t,u))continue;w=u.rawParams,x=u.extract,k=u.parsedParams}r&&f.route&&f.kind!==Lr&&dl(l,u)&&(l=u);const S=h===o;if(S&&(f.route&&(!i||f.kind===Lr||f.kind===2)&&dl(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const C=S?void 0:t[h];let P;if(S&&f.index){const E={node:f.index,index:h,skipped:p,depth:m+1,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k};let T=!0;if(f.index.skipOnParamError&&(Dy(e,t,E)||(T=!1)),T){if(!v&&!y&&!p&&LE(g,o))return E;dl(c,E)&&(c=E)}}if(f.wildcard)for(let E=f.wildcard.length-1;E>=0;E--){const T=f.wildcard[E],{prefix:j,suffix:N}=T;if(!(j&&(S||!(T.caseSensitive?C:P??(P=C.toLowerCase())).startsWith(j)))){if(N){if(S)continue;const I=t.slice(h).join("/").slice(-N.length);if((T.caseSensitive?I:I.toLowerCase())!==N)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k})}}if(f.optional){const E=p|1<<m,T=m+1;for(let j=f.optional.length-1;j>=0;j--){const N=f.optional[j];a.push({node:N,index:h,skipped:E,depth:T,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k})}if(!S)for(let j=f.optional.length-1;j>=0;j--){const N=f.optional[j],{prefix:I,suffix:L}=N;if(I||L){const O=N.caseSensitive?C:P??(P=C.toLowerCase());if(I&&!O.startsWith(I)||L&&!O.endsWith(L))continue}a.push({node:N,index:h+1,skipped:p,depth:T,statics:g,dynamics:v,optionals:y+ul(o,h),extract:x,rawParams:w,parsedParams:k})}}if(!S&&f.dynamic&&C)for(let E=f.dynamic.length-1;E>=0;E--){const T=f.dynamic[E],{prefix:j,suffix:N}=T;if(j||N){const I=T.caseSensitive?C:P??(P=C.toLowerCase());if(j&&!I.startsWith(j)||N&&!I.endsWith(N))continue}a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g,dynamics:v+ul(o,h),optionals:y,extract:x,rawParams:w,parsedParams:k})}if(!S&&f.staticInsensitive){const E=f.staticInsensitive.get(P??(P=C.toLowerCase()));E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+ul(o,h),dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k})}if(!S&&f.static){const E=f.static.get(C);E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+ul(o,h),dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k})}if(f.pathless){const E=m+1;for(let T=f.pathless.length-1;T>=0;T--){const j=f.pathless[T];a.push({node:j,index:h,skipped:p,depth:E,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:k})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(f),l}return null}function ul(e,t){return 2**(e-t-1)}function LE(e,t){return e===2**(t-1)-1}function Dy(e,t,n){try{const[r,s]=j1(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 dl(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===Lr)>(e.node.kind===Lr)||t.node.kind===Lr==(e.node.kind===Lr)&&t.depth>e.depth))):!0}function Kl(e){return dm(e.filter(t=>t!==void 0).join("/"))}function dm(e){return e.replace(/\/{2,}/g,"/")}function P1(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Gr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function E1(e){return Gr(P1(e))}function Dc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function DE(e,t,n){return Dc(e,n)===Dc(t,n)}function FE({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 f=r.get(o);if(f)return f}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&ha(a)==="";)a.pop();const f=t.split("/");for(let h=0,p=f.length;h<p;h++){const m=f[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ha(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const h=a[f];if(!h)continue;l=cm(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),v=h.substring(l[4],m),y=h.substring(l[2],l[3]);p===1?c+=g||v?`${g}{$${y}}${v}`:`$${y}`:p===2?c+=g||v?`${g}{$}${v}`:"$":c+=`${g}{-$${y}}${v}`}c=dm(c);const u=c||"/";return o&&r&&r.set(o,u),u}function OE(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 _d(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=>Oy(s,n)).join("/"):Oy(r,n)}function Fy({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,c="";for(;a<o;){const u=a;l=cm(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,f);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),g=e.substring(l[4],f);if(!p){s=!0,(m||g)&&(c+="/"+m+g);continue}const v=_d("_splat",t,n);c+="/"+m+v+g;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(u,l[1]),g=e.substring(l[4],f),v=_d(p,t,n)??"undefined";c+="/"+m+v+g;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const g=e.substring(u,l[1]),v=e.substring(l[4],f),y=_d(p,t,n)??"";c+="/"+g+y+v;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Oy(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function it(e){return(e==null?void 0:e.isNotFound)===!0}function $E(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const zE="tsr-scroll-restoration-v1_3";function BE(){const e=$E();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Di(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=Ar(r,t)||t},persist:()=>{try{e.setItem(zE,JSON.stringify(t))}catch{}}}}const $y=BE(),VE=e=>e.state.__TSR_key||e.href;function UE(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 fl=!1;const po="window",zy="data-scroll-restoration-id";function WE(e,t){if(!$y)return;const n=$y;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,fl=!1;const r=e.options.getScrollRestorationKey||VE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(fl||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(po,{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 c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,f]of s){let h;if(u===po)h=po;else if(u.isConnected){const p=u.getAttribute(zy);h=p?`[${zy}="${p}"]`:UE(u)}h&&(l[h]=f)}};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 f;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){fl=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const g=h[m];if(!Di(g))continue;const{scrollX:v,scrollY:y}=g;if(!(!Number.isFinite(v)||!Number.isFinite(y))){if(m===po)window.scrollTo({top:y,left:v,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=v,x.scrollTop=y,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const g=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(g){const v=document.getElementById(m);v&&v.scrollIntoView(g)}}else{const g={top:0,left:0,behavior:c};if(window.scrollTo(g),u)for(const v of u){if(v===po)continue;const y=typeof v=="function"?v():document.querySelector(v);y&&y.scrollTo(g)}}}}finally{fl=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function HE(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 Sd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function GE(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]=Sd(s):Array.isArray(i)?i.push(Sd(s)):n[r]=[i,Sd(s)]}return n}const KE=qE(JSON.parse),YE=QE(JSON.stringify,JSON.parse);function qE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=GE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function QE(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=HE(s,r);return i?`?${i}`:""}}const Ps="__root__";function XE(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 wt(e){return e instanceof Response&&!!e.options}function JE(e){return{input:({url:t})=>{for(const n of e)t=xh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=T1(e[n],t);return t}}}function ZE(e){const t=E1(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=Kl(["/",t,o.pathname]),o)}}function xh(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 T1(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 eT(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),f=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),g=n(e.statusCode),v=n(e.redirect),y=n([]),x=n([]),w=n([]),k=r(()=>Cd(o,y.get())),S=r(()=>Cd(a,x.get())),C=r(()=>Cd(l,w.get())),P=r(()=>y.get()[0]),E=r(()=>y.get().some(U=>{var F;return((F=o.get(U))==null?void 0:F.get().status)==="pending"})),T=r(()=>{var U;return{locationHref:p.get().href,resolvedLocationHref:(U=m.get())==null?void 0:U.href,status:c.get()}}),j=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:h.get(),matches:k.get(),location:p.get(),resolvedLocation:m.get(),statusCode:g.get(),redirect:v.get()})),N=ma(64);function I(U){let F=N.get(U);return F||(F=r(()=>{const z=y.get();for(const _ of z){const B=o.get(_);if(B&&B.routeId===U)return B.get()}}),N.set(U,F)),F}const L={status:c,loadedAt:u,isLoading:f,isTransitioning:h,location:p,resolvedLocation:m,statusCode:g,redirect:v,matchesId:y,pendingIds:x,cachedIds:w,matches:k,pendingMatches:S,cachedMatches:C,firstId:P,hasPending:E,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:j,getRouteMatchStore:I,setMatches:O,setPending:A,setCached:$};O(e.matches),i==null||i(L);function O(U){jd(U,o,y,n,s)}function A(U){jd(U,a,x,n,s)}function $(U){jd(U,l,w,n,s)}return L}function Cd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function jd(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 c=r(a);c.routeId=a.routeId,t.set(a.id,c);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}SE(n.get(),i)||n.set(i)})}const vh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},tT=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),ku=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Es=(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},By=(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},Dr=(e,t,n)=>{var r,s,i;if(!(!wt(n)&&!it(n)))throw wt(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:wt(n)?"redirected":it(n)?"notFound":o.status==="pending"?"success":o.status,context:Es(e,t.index),isFetching:!1,error:n})),it(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),wt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},N1=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Vy=(e,t,n)=>{const r=Es(e,n);e.updateMatch(t,s=>({...s,context:r}))},mo=(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),Dr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Dr(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,f;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!wt(n)&&!it(n)&&(e.serialError??(e.serialError=n))},R1=(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&&!ku(e,t)&&(n.options.loader||n.options.beforeLoad||A1(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{vh(e)},s);r._nonReactive.pendingTimeout=o}},nT=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;R1(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Dr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},rT=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Fi(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&mo(e,n,o,"PARSE_PARAMS"),a&&mo(e,n,a,"VALIDATE_SEARCH"),R1(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{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(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Fi();const h={...Es(e,n,!1),...s.__routeContext},{search:p,params:m,cause:g}=s,v=ku(e,t),y={search:p,abortController:l,params:m,preload:v,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=k=>{if(k===void 0){e.router.batch(()=>{u(),f()});return}(wt(k)||it(k))&&(u(),mo(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:k})),f()})};let w;try{if(w=r.options.beforeLoad(y),pa(w))return u(),w.catch(k=>{mo(e,n,k,"BEFORE_LOAD")}).then(x)}catch(k){u(),mo(e,n,k,"BEFORE_LOAD")}x(w)},sT=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>rT(e,n,t,s),a=()=>{if(N1(e,n))return;const l=nT(e,n,s);return pa(l)?l.then(o):o()};return i()},iT=(e,t,n)=>{var i,o,a,l,c,u;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),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([f,h,p])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:p,scripts:h,styles:f==null?void 0:f.styles}))},I1=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=Es(e,r),f=ku(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},Uy=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(S1??e.router.isServer)||u.ssr===!0)&&ga(s);const f=s.options.loader,h=typeof f=="function"?f:f==null?void 0:f.handler,p=h==null?void 0:h(I1(e,t,n,r,s)),m=!!h&&pa(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,v=>({...v,isFetching:"loader"})),h){const v=m?await p:p;Dr(e,e.router.getMatch(n),v),v!==void 0&&e.updateMatch(n,y=>({...y,loaderData:v}))}s._lazyPromise&&await s._lazyPromise;const g=u._nonReactive.minPendingPromise;g&&await g,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,v=>({...v,error:void 0,context:Es(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let h=f;if((h==null?void 0:h.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:Es(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,it(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Dr(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){h=m,Dr(e,e.router.getMatch(n),m)}!wt(h)&&!it(h)&&await ga(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:Es(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),Dr(e,f,u)}},oT=async(e,t,n)=>{var p,m,g,v;async function r(y,x,w,k,S){const C=Date.now()-x.updatedAt,P=y?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,E=S.options.shouldReload,T=typeof E=="function"?E(I1(e,t,s,n,S)):E,{status:j,invalid:N}=k,I=C>=P&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);o=j==="success"&&(N||(T??I)),y&&S.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var L,O;try{await Uy(e,t,s,n,S);const A=e.router.getMatch(s);(L=A._nonReactive.loaderPromise)==null||L.resolve(),(O=A._nonReactive.loadPromise)==null||O.resolve(),A._nonReactive.loaderPromise=void 0,A._nonReactive.loadPromise=void 0}catch(A){wt(A)&&await e.router.navigate(A.options)}})()):j!=="success"||o?await Uy(e,t,s,n,S):Vy(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],c=l.options.loader,u=((typeof c=="function"||c==null?void 0:c.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(N1(e,s)){if(!e.router.getMatch(s))return e.matches[n];Vy(e,s,n)}else{const y=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],w=((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=ku(e,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&u)return y;await y._nonReactive.loaderPromise;const S=e.router.getMatch(s),C=S._nonReactive.error||S.error;C&&Dr(e,S,C),S.status==="pending"&&await r(k,y,w,S,l)}else{const S=k&&!e.router.stores.matchStores.has(s),C=e.router.getMatch(s);C._nonReactive.loaderPromise=Fi(),S!==C.preload&&e.updateMatch(s,P=>({...P,preload:S})),await r(k,y,w,C,l)}}const f=e.router.getMatch(s);a||((g=f._nonReactive.loaderPromise)==null||g.resolve(),(v=f._nonReactive.loadPromise)==null||v.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,y=>({...y,isFetching:h,invalid:!1})),e.router.getMatch(s)):f};async function Wy(e){var h,p;const t=e,n=[];tT(t.router)&&vh(t);let r;for(let m=0;m<t.matches.length;m++){try{const g=sT(t,m);pa(g)&&await g}catch(g){if(wt(g))throw g;if(it(g))r=g;else if(!t.preload)throw g;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?By(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(oT(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const g of m){if(g.status!=="rejected")continue;const v=g.reason;if(wt(v))throw v;it(v)?a??(a=v):l??(l=v)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=By(t,c);m===void 0&&ir();const g=t.matches[m],v=t.router.looseRoutesById[g.routeId],y=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!v.options.notFoundComponent&&y&&(v.options.notFoundComponent=y),c.routeId=g.routeId;const x=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,w=>({...w,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await ga(v,["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,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await ga(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:g,routeId:v}=t.matches[m],y=t.router.looseRoutesById[v];try{const x=iT(t,g,y);if(x){const w=await x;t.updateMatch(g,k=>({...k,...w}))}}catch(x){console.error(`Error executing head for route ${v}:`,x)}}const f=vh(t);if(pa(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Hy(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 ga(e,t=Yl){!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===Yl?(()=>{if(e._componentsPromise===void 0){const r=Hy(e,Yl);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Hy(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function A1(e){var t;for(const n of Yl)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Yl=["component","errorComponent","pendingComponent","notFoundComponent"];var Kr="__TSR_index",Gy="popstate",Ky="beforeunload";function aT(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 f,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((f=e.getBlockers)==null?void 0:f.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=Fc(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 c=t.state[Kr];a=Yy(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[Kr];a=Yy(c,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[Kr]!==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 u,f;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.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 Yy(e,t){t||(t={});const n=fm();return{...t,key:n,__TSR_key:n,[Kr]:e}}function lT(e){var E,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=j=>s=j,a=j=>j,l=()=>Fc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((E=t.history.state)!=null&&E.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const j=fm();t.history.replaceState({[Kr]:0,key:j,__TSR_key:j},"")}let c=l(),u,f=!1,h=!1,p=!1,m=!1;const g=()=>c;let v,y;const x=()=>{v&&(P._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),P._ignoreSubscribers=!1,v=void 0,y=void 0,u=void 0)},w=(j,N,I)=>{const L=a(N);y||(u=c),c=Fc(N,I),v={href:L,state:I,isPush:(v==null?void 0:v.isPush)||j==="push"},y||(y=Promise.resolve().then(()=>x()))},k=j=>{c=l(),P.notify({type:j})},S=async()=>{if(h){h=!1;return}const j=l(),N=j.state[Kr]-c.state[Kr],I=N===1,L=N===-1,O=!I&&!L||f;f=!1;const A=O?"GO":L?"BACK":"FORWARD",$=O?{type:"GO",index:N}:{type:L?"BACK":"FORWARD"};if(p)p=!1;else{const U=i();if(typeof document<"u"&&U.length){for(const F of U)if(await F.blockerFn({currentLocation:c,nextLocation:j,action:A})){h=!0,t.history.go(1),P.notify($);return}}}c=l(),P.notify($)},C=j=>{if(m){m=!1;return}let N=!1;const I=i();if(typeof document<"u"&&I.length)for(const L of I){const O=L.enableBeforeUnload??!0;if(O===!0){N=!0;break}if(typeof O=="function"&&O()===!0){N=!0;break}}if(N)return j.preventDefault(),j.returnValue=""},P=aT({getLocation:g,getLength:()=>t.history.length,pushState:(j,N)=>w("push",j,N),replaceState:(j,N)=>w("replace",j,N),back:j=>(j&&(p=!0),m=!0,t.history.back()),forward:j=>{j&&(p=!0),m=!0,t.history.forward()},go:j=>{f=!0,t.history.go(j)},createHref:j=>a(j),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ky,C,{capture:!0}),t.removeEventListener(Gy,S)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ky,C,{capture:!0}),t.addEventListener(Gy,S),t.history.pushState=function(...j){const N=n.apply(t.history,j);return P._ignoreSubscribers||k("PUSH"),N},t.history.replaceState=function(...j){const N=r.apply(t.history,j);return P._ignoreSubscribers||k("REPLACE"),N},P}function cT(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Fc(e,t){const n=cT(e),r=n.indexOf("#"),s=n.indexOf("?"),i=fm();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||{[Kr]:0,key:i,__TSR_key:i}}}function fm(){return(Math.random()+1).toString(36).substring(7)}function Si(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 uT=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 u;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=OE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lT()),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 f;this.resolvePathCache=ma(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=eT(fT(this.latestLocation),f),WE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],h=E1(l);h&&h!=="/"&&f.push(ZE({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:JE(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((u=window.CSS)==null?void 0:u.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=RE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&jE(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:c,hash:u,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const y=this.options.parseSearch(c),x=this.options.stringifySearch(y);return{href:l+x+u,publicHref:l+x+u,pathname:ho(l).path,external:!1,searchStr:x,search:as(r==null?void 0:r.search,y),hash:ho(u.slice(1)).path,state:Mr(r==null?void 0:r.state,h)}}const p=new URL(f,this.origin),m=xh(this.rewrite,p),g=this.options.parseSearch(m.search),v=this.options.stringifySearch(g);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:f,pathname:ho(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:as(r==null?void 0:r.search,g),hash:ho(m.hash.slice(1)).path,state:Mr(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)=>FE({base:n,to:dm(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=>hT({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 j,N;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,c=this.resolvePathWithBase(l,"."),u=a.search,f=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?f:Object.assign(f,Ar(i.params,f)),m=this.getMatchedRoutes(h);let g=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(p).length>0)for(const I of g){const L=((j=I.options.params)==null?void 0:j.stringify)??I.options.stringifyParams;if(L)try{Object.assign(p,L(p))}catch{}}const v=n.leaveParams?h:ho(Fy({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=u;if(n._includeValidateSearch&&((N=this.options.search)!=null&&N.strict)){const I={};g.forEach(L=>{if(L.options.validateSearch)try{Object.assign(I,ql(L.options.validateSearch,{...I,...y}))}catch{}}),y=I}y=pT({search:y,dest:i,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),y=as(u,y);const x=this.options.stringifySearch(y),w=i.hash===!0?o.hash:i.hash?Ar(i.hash,o.hash):void 0,k=w?`#${w}`:"";let S=i.state===!0?o.state:i.state?Ar(i.state,o.state):{};S=Mr(o.state,S);const C=`${v}${x}${k}`;let P,E,T=!1;if(this.rewrite){const I=new URL(C,this.origin),L=T1(this.rewrite,I);P=I.href.replace(I.origin,""),L.origin!==this.origin?(E=L.href,T=!0):E=L.pathname+L.search+L.hash}else P=_E(C),E=P;return{publicHref:E,href:P,pathname:v,search:y,searchStr:x,state:S,hash:w??"",external:T,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=PE(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,Ar(h,c));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(u=>{s.state[u]=this.latestLocation.state[u]});const c=js(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=Gr(this.latestLocation.href)===Gr(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Fi(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.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 f=this.history.location.state.__TSR_index,h=Fc(a,{__TSR_index:n?f:f+1}),p=new URL(h.pathname,this.origin);l.to=xh(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...o});s=s??f.publicHref,i=i??f.publicHref}const u=!a&&i?i:s;if(Lc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of f)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(u):window.location.href=u,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 c;try{this.beforeLoad();const u=this.latestLocation,f=Si(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await Wy({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var v,y;let h=null,p=null,m=null,g=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),w=x.length,k=this.stores.matches.get();h=w?k.filter(P=>!this.stores.pendingMatchStores.has(P.id)):null;const S=new Set;for(const P of this.stores.pendingMatchStores.values())P.routeId&&S.add(P.routeId);const C=new Set;for(const P of this.stores.matchStores.values())P.routeId&&C.add(P.routeId);p=w?k.filter(P=>!S.has(P.routeId)):null,m=w?x.filter(P=>!C.has(P.routeId)):null,g=w?x.filter(P=>C.has(P.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(P=>P.status!=="error"&&P.status!=="notFound"&&P.status!=="redirected")]),this.clearExpiredCache())});for(const[x,w]of[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(x)for(const k of x)(y=(v=this.looseRoutesById[k.routeId].options)[w])==null||y.call(v,k)})})}})}catch(u){wt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):it(u)&&(s=u);const f=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.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(Si(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(c=>c!==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&&Lc(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=ga,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 Wy({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(wt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});it(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=EE(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!js(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?js(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??YE,parseSearch:e.parseSearch??KE,protocolAllowlist:e.protocolAllowlist??kE}),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 f,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:Gr(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?gT(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const p of this.stores.matchStores.values())p.routeId&&u.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],g=c[p-1];let v,y,x;{const A=(g==null?void 0:g.search)??e.search,$=(g==null?void 0:g._strictSearch)??void 0;try{const U=ql(m.options.validateSearch,{...A})??void 0;v={...A,...U},y={...$,...U},x=void 0}catch(U){let F=U;if(U instanceof Oc||(F=new Oc(U.message,{cause:U})),t!=null&&t.throwOnError)throw F;v=A,y={},x=F}}const w=((h=(f=m.options).loaderDeps)==null?void 0:h.call(f,{search:v}))??"",k=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:C}=Fy({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),P=m.id+S+k,E=this.getMatch(P),T=u.get(m.id),j=(E==null?void 0:E._strictParams)??C;let N;if(!E)try{qy(m,C,i,j)}catch(A){if(it(A)||wt(A)?N=A:N=new dT(A.message,{cause:A}),t!=null&&t.throwOnError)throw N}Object.assign(s,j);const I=T?"stay":"enter";let L;if(E)L={...E,cause:I,params:(T==null?void 0:T.params)??s,_strictParams:j,search:as(T?T.search:E.search,v),_strictSearch:y};else{const A=m.options.loader||m.options.beforeLoad||m.lazyFn||A1(m)?"pending":"success";L={id:P,ssr:m.options.ssr,index:p,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:j,pathname:S,updatedAt:Date.now(),search:T?as(T.search,v):v,_strictSearch:y,searchError:void 0,status:A,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Fi()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:I,loaderDeps:T?Mr(T.loaderDeps,w):w,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||(L.globalNotFound=l===m.id),L.searchError=x;const O=this.getParentContext(g);L.context={...O,...L.__routeContext,...L.__beforeLoadContext},c[p]=L}for(let p=0;p<c.length;p++){const m=c[p],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),y=u.get(m.routeId);if(m.params=y?as(y.params,s):s,!v){const x=c[p-1],w=this.getParentContext(x);if(g.options.context){const k={deps:m.loaderDeps,params:m.params,context:w??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:g.id};m.__routeContext=g.options.context(k)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=ha(t),i={...e.search};for(const f of t)try{Object.assign(i,ql(f.options.validateSearch,i))}catch{}const o=ha(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const f=Object.assign(Object.create(null),n);for(const h of t)try{qy(h,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Oc=class extends Error{},dT=class extends Error{};function fT(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function ql(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Oc("Async validation not supported");if(n.issues)throw new Oc(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 hT({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Gr(e);let i,o;const a=TE(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 pT({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return mT(n)(e,t,r??!1)}function mT(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 c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((f,h)=>h(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,h)=>h(f),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...ql(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:Ar(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:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function gT(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 Ps}function qy(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 yT="Error preloading route! ☝️";var M1=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,c;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(c=(l=this.options).getParentRoute)==null?void 0:c.call(l),r?this._path=Ps:this.parentRoute||ir();let s=r?Ps:n==null?void 0:n.path;s&&s!=="/"&&(s=P1(s));const i=(n==null?void 0:n.id)||s;let o=r?Ps:Kl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Kl(["/",o]));const a=o==="__root__"?"/":Kl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=Gr(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=>XE({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.")}},xT=class extends M1{constructor(e){super(e)}};function vT(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 hm(e){const t=e.errorComponent??pm;return d.jsx(wT,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var wT=class extends b.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 pm({error:e}){const[t,n]=b.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.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"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function bT({children:e,fallback:t=null}){return L1()?d.jsx(Ei.Fragment,{children:e}):d.jsx(Ei.Fragment,{children:t})}function L1(){return Ei.useSyncExternalStore(kT,()=>!0,()=>!1)}function kT(){return()=>{}}var D1=b.createContext(null);function Ht(e){return b.useContext(D1)}var _u=b.createContext(void 0),_T=b.createContext(void 0),Pe=(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))(Pe||{});function ST({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const p=h!==void 0?h.nextDep:u.deps;if(p!==void 0&&p.dep===c){p.version=f,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=g),h!==void 0?h.nextDep=g:u.deps=g,m!==void 0?m.nextSub=g:c.subs=g}function s(c,u=c.sub){const f=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,g=c.prevSub;return p!==void 0?p.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=p:u.deps=p,m!==void 0?m.prevSub=g:f.subsTail=g,g!==void 0?g.nextSub=m:(f.subs=m)===void 0&&n(f),p}function i(c){let u=c.nextSub,f;e:do{const h=c.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(c,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 g=(c=m).nextSub;g!==void 0&&(f={value:u,prev:f},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let f,h=0,p=!1;e:do{const m=c.dep,g=m.flags;if(u.flags&16)p=!0;else if((g&17)===17){if(e(m)){const v=m.subs;v.nextSub!==void 0&&a(v),p=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++h;continue}if(!p){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;h--;){const v=u.subs,y=v.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=v,p){if(e(u)){y&&a(v),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function CT(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 wh=[];let Ql=0;const{link:Qy,unlink:jT,propagate:PT,checkDirty:F1,shallowPropagate:Xy}=ST({update(e){return e._update()},notify(e){wh[bh++]=e,e.flags&=~Pe.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Pe.Mutable|Pe.Dirty,$c(e))}});let hl=0,bh=0,Ln,kh=0;function O1(e){try{++kh,e()}finally{--kh||$1()}}function $c(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=jT(n,e)}function $1(){if(!(kh>0)){for(;hl<bh;){const e=wh[hl];wh[hl++]=void 0,e.notify()}hl=0,bh=0}}function Jy(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?Pe.None:Pe.Mutable,get(){return Ln!==void 0&&Qy(s,Ln,Ql),s._snapshot},subscribe(i){const o=CT(i),a={current:!1},l=ET(()=>{var c;s.get(),a.current?(c=o.next)==null||c.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=Ln,a=(t==null?void 0:t.compare)??Object.is;if(n)Ln=s,++Ql,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Pe.Mutable|Pe.RecursedCheck);try{const l=s._snapshot,c=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,c)?(s._snapshot=c,!0):!1}finally{Ln=o,n&&(s.flags&=~Pe.RecursedCheck),$c(s)}}};return n?(s.flags=Pe.Mutable|Pe.Dirty,s.get=function(){const i=s.flags;if(i&Pe.Dirty||i&Pe.Pending&&F1(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&Xy(o)}}else i&Pe.Pending&&(s.flags=i&~Pe.Pending);return Ln!==void 0&&Qy(s,Ln,Ql),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(PT(o),Xy(o),$1())}},s}function ET(e){const t=()=>{const r=Ln;Ln=n,++Ql,n.depsTail=void 0,n.flags=Pe.Watching|Pe.RecursedCheck;try{return e()}finally{Ln=r,n.flags&=~Pe.RecursedCheck,$c(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Pe.Watching|Pe.RecursedCheck,notify(){const r=this.flags;r&Pe.Dirty||r&Pe.Pending&&F1(this.deps,this)?t():this.flags=Pe.Watching},stop(){this.flags=Pe.None,this.depsTail=void 0,$c(this)}};return t(),n}var z1={exports:{}},B1={},V1={exports:{}},U1={};/**
|
|
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 Oi=b;function TT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var NT=typeof Object.is=="function"?Object.is:TT,RT=Oi.useState,IT=Oi.useEffect,AT=Oi.useLayoutEffect,MT=Oi.useDebugValue;function LT(e,t){var n=t(),r=RT({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return AT(function(){s.value=n,s.getSnapshot=t,Pd(s)&&i({inst:s})},[e,n,t]),IT(function(){return Pd(s)&&i({inst:s}),e(function(){Pd(s)&&i({inst:s})})},[e]),MT(n),n}function Pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!NT(e,n)}catch{return!0}}function DT(e,t){return t()}var FT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?DT:LT;U1.useSyncExternalStore=Oi.useSyncExternalStore!==void 0?Oi.useSyncExternalStore:FT;V1.exports=U1;var OT=V1.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 Su=b,$T=OT;function zT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BT=typeof Object.is=="function"?Object.is:zT,VT=$T.useSyncExternalStore,UT=Su.useRef,WT=Su.useEffect,HT=Su.useMemo,GT=Su.useDebugValue;B1.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=UT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=HT(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,BT(u,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(u=p,m):(u=p,f=g)}var c=!1,u,f,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=VT(e,i[0],i[1]);return WT(function(){o.hasValue=!0,o.value=a},[a]),GT(a),a};z1.exports=B1;var W1=z1.exports;const KT=su(W1);function YT(e,t){return e===t}function Ct(e,t,n=YT){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=b.useCallback(()=>e==null?void 0:e.get(),[e]);return W1.useSyncExternalStoreWithSelector(r,s,s,t,n)}var qT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function zs(e){const t=Ht(),n=b.useContext(e.from?_T:_u),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=b.useRef(void 0);return Ct(s??qT,o=>{if((e.shouldThrow??!0)&&!o&&ir(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Mr(i.current,a);return i.current=l,l}return a})}function H1(e){return zs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function G1(e){const{select:t,...n}=e;return zs({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Bs(e){return zs({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 mm(e){return zs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){const t=Ht();return b.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function K1(e){return zs({...e,select:t=>e.select?e.select(t.context):t.context})}function QT(e,t){const n=Ht(),r=yE(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:h,startTransition:p,resetScroll:m,viewTransition:g,children:v,target:y,disabled:x,style:w,className:k,onClick:S,onBlur:C,onFocus:P,onMouseEnter:E,onMouseLeave:T,onTouchStart:j,ignoreBlocker:N,params:I,search:L,hash:O,state:A,mask:$,reloadDocument:U,unsafeRelative:F,from:z,_fromLocation:_,...B}=e,q=L1(),R=b.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=Ct(n.stores.location,he=>he,(he,D)=>he.href===D.href),pe=b.useMemo(()=>{const he={_fromLocation:ue,...R};return n.buildLocation(he)},[n,ue,R]),fe=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,Nt=pe.maskedLocation?pe.maskedLocation.external:pe.external,Ge=b.useMemo(()=>n2(fe,Nt,n.history,x),[x,Nt,fe,n.history]),Yt=b.useMemo(()=>{if(Ge!=null&&Ge.external)return Lc(Ge.href,n.protocolAllowlist)?void 0:Ge.href;if(!r2(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Lc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ge,n.protocolAllowlist]),jn=b.useMemo(()=>{if(Yt)return!1;if(o!=null&&o.exact){if(!DE(ue.pathname,pe.pathname,n.basepath))return!1}else{const he=Dc(ue.pathname,n.basepath),D=Dc(pe.pathname,n.basepath);if(!(he.startsWith(D)&&(he.length===D.length||he[D.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!js(ue.search,pe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?q&&ue.hash===pe.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,ue,Yt,q,pe.hash,pe.pathname,pe.search,n.basepath]),Hn=jn?Ar(s,{})??XT:Ed,Us=jn?Ed:Ar(i,{})??Ed,Va=[k,Hn.className,Us.className].filter(Boolean).join(" "),Ua=(w||Hn.style||Us.style)&&{...w,...Hn.style,...Us.style},[Wa,eo]=b.useState(!1),to=b.useRef(!1),hr=e.reloadDocument||Yt?!1:l??n.options.defaultPreload,Ws=c??n.options.defaultPreloadDelay??0,Pn=b.useCallback(()=>{n.preloadRoute({...R,_builtLocation:pe}).catch(he=>{console.warn(he),console.warn(yT)})},[n,R,pe]);gE(r,b.useCallback(he=>{he!=null&&he.isIntersecting&&Pn()},[Pn]),t2,{disabled:!!x||hr!=="viewport"}),b.useEffect(()=>{to.current||!x&&hr==="render"&&(Pn(),to.current=!0)},[x,Pn,hr]);const Gu=he=>{const D=he.currentTarget.getAttribute("target"),H=y!==void 0?y:D;if(!x&&!s2(he)&&!he.defaultPrevented&&(!H||H==="_self")&&he.button===0){he.preventDefault(),$s.flushSync(()=>{eo(!0)});const ee=n.subscribe("onResolved",()=>{ee(),eo(!1)});n.navigate({...R,replace:h,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:g,ignoreBlocker:N})}};if(Yt)return{...B,ref:r,href:Yt,...v&&{children:v},...y&&{target:y},...x&&{disabled:x},...w&&{style:w},...k&&{className:k},...S&&{onClick:S},...C&&{onBlur:C},...P&&{onFocus:P},...E&&{onMouseEnter:E},...T&&{onMouseLeave:T},...j&&{onTouchStart:j}};const Ha=he=>{if(x||hr!=="intent")return;if(!Ws){Pn();return}const D=he.currentTarget;if(go.has(D))return;const H=setTimeout(()=>{go.delete(D),Pn()},Ws);go.set(D,H)},Ku=he=>{x||hr!=="intent"||Pn()},Ga=he=>{if(x||!hr||!Ws)return;const D=he.currentTarget,H=go.get(D);H&&(clearTimeout(H),go.delete(D))};return{...B,...Hn,...Us,href:Ge==null?void 0:Ge.href,ref:r,onClick:Ks([S,Gu]),onBlur:Ks([C,Ga]),onFocus:Ks([P,Ha]),onMouseEnter:Ks([E,Ha]),onMouseLeave:Ks([T,Ga]),onTouchStart:Ks([j,Ku]),disabled:!!x,target:y,...Ua&&{style:Ua},...Va&&{className:Va},...x&&JT,...jn&&ZT,...q&&Wa&&e2}}var Ed={},XT={className:"active"},JT={role:"link","aria-disabled":!0},ZT={"data-status":"active","aria-current":"page"},e2={"data-transitioning":"transitioning"},go=new WeakMap,t2={rootMargin:"100px"},Ks=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function n2(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function r2(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Y1=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=QT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return b.createElement("a",l,o)}return b.createElement(n,i,o)});function s2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var i2=class extends M1{constructor(e){super(e),this.useMatch=t=>zs({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>K1({...t,from:this.id}),this.useSearch=t=>mm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Bs({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>G1({...t,from:this.id}),this.useLoaderData=t=>H1({...t,from:this.id}),this.useNavigate=()=>mt({from:this.fullPath}),this.Link=Ei.forwardRef((t,n)=>d.jsx(Y1,{ref:n,from:this.fullPath,...t}))}};function Gt(e){return new i2(e)}var o2=class extends xT{constructor(e){super(e),this.useMatch=t=>zs({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>K1({...t,from:this.id}),this.useSearch=t=>mm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Bs({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>G1({...t,from:this.id}),this.useLoaderData=t=>H1({...t,from:this.id}),this.useNavigate=()=>mt({from:this.fullPath}),this.Link=Ei.forwardRef((t,n)=>d.jsx(Y1,{ref:n,from:this.fullPath,...t}))}};function a2(e){return new o2(e)}function l2(e){const t=Ht(),n=`not-found-${Ct(t.stores.location,r=>r.pathname)}-${Ct(t.stores.status,r=>r)}`;return d.jsx(hm,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(it(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(it(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function c2(){return d.jsx("p",{children:"Not Found"})}function Zs(e){return d.jsx(d.Fragment,{children:e.children})}function q1(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(c2,{})}function u2(e){return null}function d2(){return u2(Ht()),null}var Q1=b.memo(function({matchId:t}){const n=Ht(),r=n.stores.matchStores.get(t);r||ir();const s=Ct(n.stores.loadedAt,o=>o),i=Ct(r,o=>o);return d.jsx(f2,{router:n,matchId:t,resetKey:s,matchState:b.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 f2({router:e,matchId:t,resetKey:n,matchState:r}){var m,g;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?d.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((g=s.options.errorComponent)==null?void 0:g.preload)||u))?b.Suspense:Zs,h=a?hm:Zs,p=c?l2:Zs;return d.jsxs(s.isRoot?s.options.shellComponent??Zs:Zs,{children:[d.jsx(_u.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(h,{getResetKey:()=>n,errorComponent:a||pm,onCatch:(v,y)=>{if(it(v))throw v.routeId??(v.routeId=r.routeId),v;l==null||l(v,y)},children:d.jsx(p,{fallback:v=>{if(v.routeId??(v.routeId=r.routeId),!c||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return b.createElement(c,v)},children:u||r._displayPending?d.jsx(bT,{fallback:o,children:d.jsx(Zy,{matchId:t})}):d.jsx(Zy,{matchId:t})})})})}),r.parentRouteId===Ps?d.jsxs(d.Fragment,{children:[d.jsx(h2,{resetKey:n}),e.options.scrollRestoration&&S1?d.jsx(d2,{}):null]}):null]})}function h2({resetKey:e}){const t=Ht(),n=b.useRef(void 0);return To(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...Si(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Zy=b.memo(function({matchId:t}){const n=Ht(),r=(u,f)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||ir();const i=Ct(s,u=>u),o=i.routeId,a=n.routesById[o],l=b.useMemo(()=>{var f;const u=(f=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:f({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return u?JSON.stringify(u):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),c=b.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?d.jsx(u,{},l):d.jsx(X1,{})},[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 u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const f=n.getMatch(i.id);if(f&&!f._nonReactive.minPendingPromise){const h=Fi();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return it(i.error)||ir(),q1(n,a,i.error);if(i.status==="redirected")throw wt(i.error)||ir(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),X1=b.memo(function(){const t=Ht(),n=b.useContext(_u);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=Ct(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=Ct(t.stores.matchesId,u=>u[u.findIndex(f=>f===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||ir(),q1(t,o,void 0);if(!i)return null;const l=d.jsx(Q1,{matchId:i});return r===Ps?d.jsx(b.Suspense,{fallback:a,children:l}):l});function p2(){const e=Ht(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),s=Ct(e.stores.isLoading,f=>f),i=Ct(e.stores.hasPending,f=>f),o=wd(s),a=s||n||i,l=wd(a),c=s||i,u=wd(c);return e.startTransition=f=>{r(!0),b.startTransition(()=>{f(),r(!1)})},b.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Gr(e.latestLocation.publicHref)!==Gr(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),To(()=>{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]),To(()=>{o&&!s&&e.emit({type:"onLoad",...Si(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),To(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...Si(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),To(()=>{if(l&&!a){const f=Si(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),O1(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&vT(e)}},[a,l,e]),null}function m2(){const e=Ht(),t=e.routesById[Ps].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?Zs:b.Suspense,{fallback:n,children:[d.jsx(p2,{}),d.jsx(g2,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function g2(){const e=Ht(),t=Ct(e.stores.firstId,s=>s),n=Ct(e.stores.loadedAt,s=>s),r=t?d.jsx(Q1,{matchId:t}):null;return d.jsx(_u.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(hm,{getResetKey:()=>n,errorComponent:pm,onCatch:void 0,children:r})})}var y2=e=>({createMutableStore:Jy,createReadonlyStore:Jy,batch:O1}),x2=e=>new v2(e),v2=class extends uT{constructor(e){super(e,y2)}};function w2({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=d.jsx(D1.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function b2({router:e,...t}){return d.jsx(w2,{router:e,...t,children:d.jsx(m2,{})})}function k2(e){const t=Ht({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=b.useRef(void 0);return Ct(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Mr(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const _2="modulepreload",S2=function(e,t){return new URL(e,t).href},ex={},cn=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=S2(c,r),c in ex)return;ex[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const g=o[m];if(g.href===c&&(!u||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":_2,u||(p.as="script"),p.crossOrigin="",p.href=c,l&&p.setAttribute("nonce",l),document.head.appendChild(p),u)return new Promise((m,g)=>{p.addEventListener("load",m),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}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 J1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=J1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function C2(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=J1(e))&&(r&&(r+=" "),r+=t);return r}const gm="-",j2=e=>{const t=E2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(gm);return a[0]===""&&a.length!==1&&a.shift(),Z1(a,t)||P2(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Z1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Z1(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(gm);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},tx=/^\[(.+)\]$/,P2=e=>{if(tx.test(e)){const t=tx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},E2=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return N2(Object.entries(e.classGroups),n).forEach(([i,o])=>{_h(o,r,i,t)}),r},_h=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:nx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(T2(s)){_h(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{_h(o,nx(t,i),n,r)})})},nx=(e,t)=>{let n=e;return t.split(gm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},T2=e=>e.isThemeGetter,N2=(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,R2=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)}}},ek="!",I2=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let v=0;v<a.length;v++){let y=a[v];if(c===0){if(y===s&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(y==="/"){f=v;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(ek),m=p?h.substring(1):h,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},A2=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},M2=e=>({cache:R2(e.cacheSize),parseClassName:I2(e),...j2(e)}),L2=/\s+/,D2=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(L2);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=A2(u).join(":"),y=f?v+ek:v,x=y+g;if(i.includes(x))continue;i.push(x);const w=s(g,m);for(let k=0;k<w.length;++k){const S=w[k];i.push(y+S)}a=c+(a.length>0?" "+a:a)}return a};function F2(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=tk(t))&&(r&&(r+=" "),r+=n);return r}const tk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=tk(e[r]))&&(n&&(n+=" "),n+=t);return n};function O2(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=M2(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=D2(l,n);return s(l,u),u}return function(){return i(F2.apply(null,arguments))}}const Se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nk=/^\[(?:([a-z-]+):)?(.+)\]$/i,$2=/^\d+\/\d+$/,z2=new Set(["px","full","screen"]),B2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V2=/\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$/,U2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,W2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yn=e=>Ci(e)||z2.has(e)||$2.test(e),mr=e=>Gi(e,"length",Z2),Ci=e=>!!e&&!Number.isNaN(Number(e)),Td=e=>Gi(e,"number",Ci),yo=e=>!!e&&Number.isInteger(Number(e)),G2=e=>e.endsWith("%")&&Ci(e.slice(0,-1)),ne=e=>nk.test(e),gr=e=>B2.test(e),K2=new Set(["length","size","percentage"]),Y2=e=>Gi(e,K2,rk),q2=e=>Gi(e,"position",rk),Q2=new Set(["image","url"]),X2=e=>Gi(e,Q2,tN),J2=e=>Gi(e,"",eN),xo=()=>!0,Gi=(e,t,n)=>{const r=nk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Z2=e=>V2.test(e)&&!U2.test(e),rk=()=>!1,eN=e=>W2.test(e),tN=e=>H2.test(e),nN=()=>{const e=Se("colors"),t=Se("spacing"),n=Se("blur"),r=Se("brightness"),s=Se("borderColor"),i=Se("borderRadius"),o=Se("borderSpacing"),a=Se("borderWidth"),l=Se("contrast"),c=Se("grayscale"),u=Se("hueRotate"),f=Se("invert"),h=Se("gap"),p=Se("gradientColorStops"),m=Se("gradientColorStopPositions"),g=Se("inset"),v=Se("margin"),y=Se("opacity"),x=Se("padding"),w=Se("saturate"),k=Se("scale"),S=Se("sepia"),C=Se("skew"),P=Se("space"),E=Se("translate"),T=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ne,t],I=()=>[ne,t],L=()=>["",Yn,mr],O=()=>["auto",Ci,ne],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",ne],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ci,ne];return{cacheSize:500,separator:":",theme:{colors:[xo],spacing:[Yn,mr],blur:["none","",gr,ne],brightness:B(),borderColor:[e],borderRadius:["none","","full",gr,ne],borderSpacing:I(),borderWidth:L(),contrast:B(),grayscale:z(),hueRotate:B(),invert:z(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[G2,mr],inset:N(),margin:N(),opacity:B(),padding:I(),saturate:B(),scale:B(),sepia:z(),skew:B(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[gr]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...A(),ne]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yo,ne]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",yo,ne]}],"grid-cols":[{"grid-cols":[xo]}],"col-start-end":[{col:["auto",{span:["full",yo,ne]},ne]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[xo]}],"row-start-end":[{row:["auto",{span:[yo,ne]},ne]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"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:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[gr]},gr]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gr,mr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Td]}],"font-family":[{font:[xo]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",Ci,Td]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yn,mr]}],"underline-offset":[{"underline-offset":["auto",Yn,ne]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],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",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),q2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Y2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},X2]}],"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":[y]}],"border-style":[{border:[...$(),"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":[y]}],"divide-style":[{divide:$()}],"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:["",...$()]}],"outline-offset":[{"outline-offset":[Yn,ne]}],"outline-w":[{outline:[Yn,mr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Yn,mr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gr,J2]}],"shadow-color":[{shadow:[xo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",gr,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],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":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"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",ne]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[yo,ne]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],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",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yn,mr,Td]}],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"]}}},rN=O2(nN);function Nd(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[c,u]=l;l[0]=(c-r)*o-(u-s)*a+r,l[1]=(c-r)*a+(u-s)*o+s}}}function sN(e,t){return e[0]===t[0]&&e[1]===t[1]}function iN(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 c of o)Nd(c,a,s);const l=function(c,u,f){const h=[];for(const x of c){const w=[...x];sN(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&h.push(w)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let w=0;w<x.length-1;w++){const k=x[w],S=x[w+1];if(k[1]!==S[1]){const C=Math.min(k[1],S[1]);m.push({ymin:C,ymax:Math.max(k[1],S[1]),x:C===k[1]?k[0]:S[0],islope:(S[0]-k[0])/(S[1]-k[1])})}}if(m.sort((x,w)=>x.ymin<w.ymin?-1:x.ymin>w.ymin?1:x.x<w.x?-1:x.x>w.x?1:x.ymax===w.ymax?0:(x.ymax-w.ymax)/Math.abs(x.ymax-w.ymax)),!m.length)return p;let g=[],v=m[0].ymin,y=0;for(;g.length||m.length;){if(m.length){let x=-1;for(let w=0;w<m.length&&!(m[w].ymin>v);w++)x=w;m.splice(0,x+1).forEach(w=>{g.push({s:v,edge:w})})}if(g=g.filter(x=>!(x.edge.ymax<=v)),g.sort((x,w)=>x.edge.x===w.edge.x?0:(x.edge.x-w.edge.x)/Math.abs(x.edge.x-w.edge.x)),(f!==1||y%u==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const w=x+1;if(w>=g.length)break;const k=g[x].edge,S=g[w].edge;p.push([[Math.round(k.x),v],[Math.round(S.x),v]])}v+=f,g.forEach(x=>{x.edge.x=x.edge.x+f*x.edge.islope}),y++}return p}(o,i,r);if(s){for(const c of o)Nd(c,a,-s);(function(c,u,f){const h=[];c.forEach(p=>h.push(...p)),Nd(h,u,f)})(l,a,-s)}return l}function Pa(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),iN(e,s,r,i||1)}class ym{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=Pa(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 Cu(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 oN extends ym{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=Pa(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[c,u]of s)Cu([c,u])&&o.push([[c[0]-a,c[1]+l],[...u]],[[c[0]+a,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class aN extends ym{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 lN{constructor(t){this.helper=t}fillPolygons(t,n){const r=Pa(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=Cu(a),c=l/s,u=Math.ceil(c)-1,f=l-u*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<u;m++){const g=p+f+m*s,v=h-o+2*Math.random()*o,y=g-o+2*Math.random()*o,x=this.helper.ellipse(v,y,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class cN{constructor(t){this.helper=t}fillPolygons(t,n){const r=Pa(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=Cu(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],f=o[1];u[0]>f[0]&&(u=o[1],f=o[0]);const h=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),g=m+r,v=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],y=[u[0]+g*Math.cos(h)+c*Math.cos(h),u[1]+g*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(v[0],v[1],y[0],y[1],n))}}),i}}class uN{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=Pa(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=Cu(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let f=0;f<a;f++){const h=2*f*n,p=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],v=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],y=[g[0]+m*Math.cos(u+Math.PI/4),g[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],r),...this.helper.doubleLineOps(y[0],y[1],v[0],v[1],r))}}),s}}const gt={};class dN{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const fN=0,Rd=1,rx=2,pl={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 Id(e,t){return e.type===t}function xm(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:fN,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:Rd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:rx,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Id(i,rx);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return xm("M0,0"+e);s++,o=pl[i.text],r=i.text}else Id(i,Rd)?o=pl[r]:(s++,o=pl[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 c=n[l];if(!Id(c,Rd))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof pl[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 sk(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((c,u)=>u%2?c+n:c+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((c,u)=>u%2?c+n:c+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((c,u)=>u%2?c+n:c+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 ik(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let f=0,h=0;n==="C"||n==="S"?(f=r+(r-a),h=s+(s-l)):(f=r,h=s),t.push({key:"C",data:[f,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const g=r+2*(p-r)/3,v=s+2*(m-s)/3,y=f+2*(p-f)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[g,v,y,x,f,h]}),a=p,l=m,r=f,s=h;break}case"Q":{const[f,h,p,m]=u,g=r+2*(f-r)/3,v=s+2*(h-s)/3,y=p+2*(f-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[g,v,y,x,p,m]}),a=f,l=h,r=p,s=m;break}case"A":{const f=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],g=u[4],v=u[5],y=u[6];f===0||h===0?(t.push({key:"C",data:[r,s,v,y,v,y]}),r=v,s=y):(r!==v||s!==y)&&(ok(r,s,v,y,f,h,p,m,g).forEach(function(x){t.push({key:"C",data:x})}),r=v,s=y);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function vo(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ok(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let h=[],p=0,m=0,g=0,v=0;if(c)[p,m,g,v]=c;else{[e,t]=vo(e,t,-u),[n,r]=vo(n,r,-u);const L=(e-n)/2,O=(t-r)/2;let A=L*L/(s*s)+O*O/(i*i);A>1&&(A=Math.sqrt(A),s*=A,i*=A);const $=s*s,U=i*i,F=$*U-$*O*O-U*L*L,z=$*O*O+U*L*L,_=(a===l?-1:1)*Math.sqrt(Math.abs(F/z));g=_*s*O/i+(e+n)/2,v=_*-i*L/s+(t+r)/2,p=Math.asin(parseFloat(((t-v)/i).toFixed(9))),m=Math.asin(parseFloat(((r-v)/i).toFixed(9))),e<g&&(p=Math.PI-p),n<g&&(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 y=m-p;if(Math.abs(y)>120*Math.PI/180){const L=m,O=n,A=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=ok(n=g+s*Math.cos(m),r=v+i*Math.sin(m),O,A,s,i,o,0,l,[m,L,g,v])}y=m-p;const x=Math.cos(p),w=Math.sin(p),k=Math.cos(m),S=Math.sin(m),C=Math.tan(y/4),P=4/3*s*C,E=4/3*i*C,T=[e,t],j=[e+P*w,t-E*x],N=[n+P*S,r-E*k],I=[n,r];if(j[0]=2*T[0]-j[0],j[1]=2*T[1]-j[1],c)return[j,N,I].concat(h);{h=[j,N,I].concat(h);const L=[];for(let O=0;O<h.length;O+=3){const A=vo(h[O][0],h[O][1],u),$=vo(h[O+1][0],h[O+1][1],u),U=vo(h[O+2][0],h[O+2][1],u);L.push([A[0],A[1],$[0],$[1],U[0],U[1]])}return L}}const hN={randOffset:function(e,t){return X(e,t)},randOffsetWithRange:function(e,t,n){return zc(e,t,n)},ellipse:function(e,t,n,r,s){const i=lk(n,r,s);return Sh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Xr(e,t,n,r,s,!0)}};function ak(e,t,n,r,s){return{type:"path",ops:Xr(e,t,n,r,s)}}function Xl(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Xr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Xr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?ak(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function pN(e,t,n,r,s){return function(i,o){return Xl(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function sx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=ml(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:ml(n[0],1.5*(1+.22*t.roughness),ax(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=ml(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ml(o,1.5*(1+.22*t.roughness),ax(t));for(const c of a)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function lk(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+=X(o*l,n),a+=X(a*l,n),{increment:i,rx:o,ry:a}}function Sh(e,t,n,r){const[s,i]=lx(r.increment,e,t,r.rx,r.ry,1,r.increment*zc(.1,zc(.4,1,n),n),n);let o=Bc(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=lx(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Bc(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function ix(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),h=Math.abs(r/2);f+=X(.01*f,l),h+=X(.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 g=2*Math.PI/l.curveStepCount,v=Math.min(g/2,(m-p)/2),y=cx(v,c,u,f,h,p,m,1,l);if(!l.disableMultiStroke){const x=cx(v,c,u,f,h,p,m,1.5,l);y.push(...x)}return o&&(a?y.push(...Xr(c,u,c+f*Math.cos(p),u+h*Math.sin(p),l),...Xr(c,u,c+f*Math.cos(m),u+h*Math.sin(m),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:y}}function ox(e,t){const n=ik(sk(xm(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(...Xr(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,h,p]=a;r.push(...mN(l,c,u,f,h,p,i,t)),i=[h,p];break}case"Z":r.push(...Xr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Ad(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]+X(s,t),r[0][1]+X(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+X(s,t),r[o][1]+X(s,t)]})}}return{type:"fillPath",ops:n}}function Ys(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!gt[s])switch(s){case"zigzag":gt[s]||(gt[s]=new oN(r));break;case"cross-hatch":gt[s]||(gt[s]=new aN(r));break;case"dots":gt[s]||(gt[s]=new lN(r));break;case"dashed":gt[s]||(gt[s]=new cN(r));break;case"zigzag-line":gt[s]||(gt[s]=new uN(r));break;default:s="hachure",gt[s]||(gt[s]=new ym(r))}return gt[s]}(t,hN).fillPolygons(e,t)}function ax(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function ck(e){return e.randomizer||(e.randomizer=new dN(e.seed||0)),e.randomizer.next()}function zc(e,t,n,r=1){return n.roughness*r*(ck(n)*(t-e)+e)}function X(e,t,n=1){return zc(-e,e,t,n)}function Xr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Ch(e,t,n,r,s,!0,!1);if(o)return a;const l=Ch(e,t,n,r,s,!0,!0);return a.concat(l)}function Ch(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const f=u/2,h=.2+.2*ck(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=X(p,s,c),m=X(m,s,c);const g=[],v=()=>X(f,s,c),y=()=>X(u,s,c),x=s.preserveVertices;return o?g.push({op:"move",data:[e+(x?0:v()),t+(x?0:v())]}):g.push({op:"move",data:[e+(x?0:X(u,s,c)),t+(x?0:X(u,s,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*h+v(),m+t+(r-t)*h+v(),p+e+2*(n-e)*h+v(),m+t+2*(r-t)*h+v(),n+(x?0:v()),r+(x?0:v())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*h+y(),m+t+(r-t)*h+y(),p+e+2*(n-e)*h+y(),m+t+2*(r-t)*h+y(),n+(x?0:y()),r+(x?0:y())]}),g}function ml(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]),r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]),s===e.length-1&&r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]);return Bc(r,null,n)}function Bc(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(...Ch(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function lx(e,t,n,r,s,i,o,a){const l=[],c=[];if(a.roughness===0){e/=4,c.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const f=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(f),c.push(f)}c.push([t+r*Math.cos(0),n+s*Math.sin(0)]),c.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const u=X(.5,a)-Math.PI/2;c.push([X(i,a)+t+.9*r*Math.cos(u-e),X(i,a)+n+.9*s*Math.sin(u-e)]);const f=2*Math.PI+u-.01;for(let h=u;h<f;h+=e){const p=[X(i,a)+t+r*Math.cos(h),X(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([X(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),X(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([X(i,a)+t+.98*r*Math.cos(u+o),X(i,a)+n+.98*s*Math.sin(u+o)]),c.push([X(i,a)+t+.9*r*Math.cos(u+.5*o),X(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function cx(e,t,n,r,s,i,o,a,l){const c=i+X(.1,l),u=[];u.push([X(a,l)+t+.9*r*Math.cos(c-e),X(a,l)+n+.9*s*Math.sin(c-e)]);for(let f=c;f<=o;f+=e)u.push([X(a,l)+t+r*Math.cos(f),X(a,l)+n+s*Math.sin(f)]);return u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Bc(u,null,l)}function mN(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const f=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<f;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:X(c[0],a)),o[1]+(h?0:X(c[0],a))]}),u=h?[s,i]:[s+X(c[p],a),i+X(c[p],a)],l.push({op:"bcurveTo",data:[e+X(c[p],a),t+X(c[p],a),n+X(c[p],a),r+X(c[p],a),u[0],u[1]]});return l}function wo(e){return[...e]}function ux(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(wo(e[0]),wo(e[1]),wo(e[2]),wo(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(wo(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 Jl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function gN(e,t,n){const r=Jl(t,n);if(r===0)return Jl(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)),Jl(e,ps(t,n,s))}function ps(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function jh(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=a[l+2],h=a[l+3];let p=3*u[0]-2*c[0]-h[0];p*=p;let m=3*u[1]-2*c[1]-h[1];m*=m;let g=3*f[0]-2*h[0]-c[0];g*=g;let v=3*f[1]-2*h[1]-c[1];return v*=v,p<g&&(p=g),m<v&&(m=v),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Jl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],f=e[t+3],h=ps(l,c,.5),p=ps(c,u,.5),m=ps(u,f,.5),g=ps(h,p,.5),v=ps(p,m,.5),y=ps(g,v,.5);jh([l,h,g,y],0,n,s),jh([y,v,m,f],0,n,s)}var i,o;return s}function yN(e,t){return Vc(e,0,e.length,t)}function Vc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const f=gN(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?(Vc(e,t,c+1,r,i),Vc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function Md(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)jh(e,3*i,t,r);return n&&n>0?Vc(r,0,r.length,n):r}const It="none";let Uc=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",[ak(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=pN(t,n,r,s,o);if(o.fill){const c=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(Ad([c],o)):a.push(Ys([c],o))}return o.stroke!==It&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=lk(r,s,o),c=Sh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=Sh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Ys([c.estimatedPoints],o));return o.stroke!==It&&a.push(c.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",[Xl(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=ix(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const h=Object.assign({},c);h.disableMultiStroke=!0;const p=ix(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,g,v,y,x){const w=h,k=p;let S=Math.abs(m/2),C=Math.abs(g/2);S+=X(.01*S,x),C+=X(.01*C,x);let P=v,E=y;for(;P<0;)P+=2*Math.PI,E+=2*Math.PI;E-P>2*Math.PI&&(P=0,E=2*Math.PI);const T=(E-P)/x.curveStepCount,j=[];for(let N=P;N<=E;N+=T)j.push([w+S*Math.cos(N),k+C*Math.sin(N)]);return j.push([w+S*Math.cos(E),k+C*Math.sin(E)]),j.push([w,k]),Ys([j],x)}(t,n,r,s,i,o,c));return c.stroke!==It&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=sx(t,r);if(r.fill&&r.fill!==It)if(r.fillStyle==="solid"){const o=sx(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 c of l)c.length<3?o.push(...c):c.length===3?o.push(...Md(ux([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...Md(ux(c),10,(1+r.roughness)/2))}o.length&&s.push(Ys([o],r))}return r.stroke!==It&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Xl(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Ad([t],r)):s.push(Ys([t],r))),r.stroke!==It&&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!==It,o=r.stroke!==It,a=!!(r.simplification&&r.simplification<1),l=function(u,f,h){const p=ik(sk(xm(u))),m=[];let g=[],v=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...Md(y,f)),y=[]},w=()=>{x(),g.length&&(m.push(g),g=[])};for(const{key:S,data:C}of p)switch(S){case"M":w(),v=[C[0],C[1]],g.push(v);break;case"L":x(),g.push([C[0],C[1]]);break;case"C":if(!y.length){const P=g.length?g[g.length-1]:v;y.push([P[0],P[1]])}y.push([C[0],C[1]]),y.push([C[2],C[3]]),y.push([C[4],C[5]]);break;case"Z":x(),g.push([v[0],v[1]])}if(w(),!h)return m;const k=[];for(const S of m){const C=yN(S,h);C.length&&k.push(C)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=ox(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=ox(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else s.push(Ad(l,r));else s.push(Ys(l,r));return o&&(a?l.forEach(u=>{s.push(Xl(u,!1,r))}):s.push(c)),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:It};break;case"fillPath":o={d:this.opsToPath(i),stroke:It,strokeWidth:0,fill:r.fill||It};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||It,strokeWidth:r,fill:It}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},xN=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Uc(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 c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}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 gl="http://www.w3.org/2000/svg";class vN{constructor(t,n){this.svg=t,this.gen=new Uc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(gl,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(gl,"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(gl,"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(gl,"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 c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}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 wN={canvas:(e,t)=>new xN(e,t),svg:(e,t)=>new vN(e,t),generator:e=>new Uc(e),newSeed:()=>Uc.newSeed()};const vm=b.createContext({});function wm(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const bN=typeof window<"u",uk=bN?b.useLayoutEffect:b.useEffect,ju=b.createContext(null);function bm(e,t){e.indexOf(t)===-1&&e.push(t)}function Wc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Un=(e,t,n)=>n>t?t:n<e?e:n;let km=()=>{};const Jr={},dk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),fk=e=>typeof e=="object"&&e!==null,hk=e=>/^0[^.\s]+$/u.test(e);function pk(e){let t;return()=>(t===void 0&&(t=e()),t)}const on=e=>e,Ea=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ya=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class _m{constructor(){this.subscriptions=[]}add(t){return bm(this.subscriptions,t),()=>Wc(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 zt=e=>e*1e3,nn=e=>e/1e3,mk=(e,t)=>t?e*(1e3/t):0,gk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kN=1e-7,_N=12;function SN(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=gk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>kN&&++a<_N);return o}function Ta(e,t,n,r){if(e===t&&n===r)return on;const s=i=>SN(i,0,1,e,n);return i=>i===0||i===1?i:gk(s(i),t,r)}const yk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xk=e=>t=>1-e(1-t),vk=Ta(.33,1.53,.69,.99),Sm=xk(vk),wk=yk(Sm),bk=e=>e>=1?1:(e*=2)<1?.5*Sm(e):.5*(2-Math.pow(2,-10*(e-1))),Cm=e=>1-Math.sin(Math.acos(e)),kk=xk(Cm),_k=yk(Cm),CN=Ta(.42,0,1,1),jN=Ta(0,0,.58,1),Sk=Ta(.42,0,.58,1),PN=e=>Array.isArray(e)&&typeof e[0]!="number",Ck=e=>Array.isArray(e)&&typeof e[0]=="number",EN={linear:on,easeIn:CN,easeInOut:Sk,easeOut:jN,circIn:Cm,circInOut:_k,circOut:kk,backIn:Sm,backInOut:wk,backOut:vk,anticipate:bk},TN=e=>typeof e=="string",dx=e=>{if(Ck(e)){km(e.length===4);const[t,n,r,s]=e;return Ta(t,n,r,s)}else if(TN(e))return EN[e];return e},yl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function NN(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(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,h=!1)=>{const m=h&&s?n:r;return f&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const RN=40;function jk(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=yl.reduce((w,k)=>(w[k]=NN(i),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:h,render:p,postRender:m}=o,g=()=>{const w=Jr.useManualTiming,k=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,RN),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:yl.reduce((w,k)=>{const S=o[k];return w[k]=(C,P=!1,E=!1)=>(n||v(),S.schedule(C,P,E)),w},{}),cancel:w=>{for(let k=0;k<yl.length;k++)o[yl[k]].cancel(w)},state:s,steps:o}}const{schedule:ve,cancel:Zr,state:Qe,steps:Ld}=jk(typeof requestAnimationFrame<"u"?requestAnimationFrame:on,!0);let Zl;function IN(){Zl=void 0}const ct={now:()=>(Zl===void 0&&ct.set(Qe.isProcessing||Jr.useManualTiming?Qe.timestamp:performance.now()),Zl),set:e=>{Zl=e,queueMicrotask(IN)}},Pk=e=>t=>typeof t=="string"&&t.startsWith(e),Ek=Pk("--"),AN=Pk("var(--"),jm=e=>AN(e)?MN.test(e.split("/*")[0].trim()):!1,MN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function fx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ki={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},xa={...Ki,transform:e=>Un(0,1,e)},xl={...Ki,default:1},zo=e=>Math.round(e*1e5)/1e5,Pm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function LN(e){return e==null}const DN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Em=(e,t)=>n=>!!(typeof n=="string"&&DN.test(n)&&n.startsWith(e)||t&&!LN(n)&&Object.prototype.hasOwnProperty.call(n,t)),Tk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Pm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},FN=e=>Un(0,255,e),Dd={...Ki,transform:e=>Math.round(FN(e))},ks={test:Em("rgb","red"),parse:Tk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dd.transform(e)+", "+Dd.transform(t)+", "+Dd.transform(n)+", "+zo(xa.transform(r))+")"};function ON(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 Ph={test:Em("#"),parse:ON,transform:ks.transform},Na=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xn=Na("deg"),Vn=Na("%"),Y=Na("px"),$N=Na("vh"),zN=Na("vw"),hx={...Vn,parse:e=>Vn.parse(e)/100,transform:e=>Vn.transform(e*100)},pi={test:Em("hsl","hue"),parse:Tk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Vn.transform(zo(t))+", "+Vn.transform(zo(n))+", "+zo(xa.transform(r))+")"},ze={test:e=>ks.test(e)||Ph.test(e)||pi.test(e),parse:e=>ks.test(e)?ks.parse(e):pi.test(e)?pi.parse(e):Ph.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ks.transform(e):pi.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},BN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VN(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Pm))==null?void 0:t.length)||0)+(((n=e.match(BN))==null?void 0:n.length)||0)>0}const Nk="number",Rk="color",UN="var",WN="var(",px="${}",HN=/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 $i(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(HN,l=>(ze.test(l)?(r.color.push(i),s.push(Rk),n.push(ze.parse(l))):l.startsWith(WN)?(r.var.push(i),s.push(UN),n.push(l)):(r.number.push(i),s.push(Nk),n.push(parseFloat(l))),++i,px)).split(px);return{values:n,split:a,indexes:r,types:s}}function GN(e){return $i(e).values}function Ik({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===Nk?s+=zo(r[i]):o===Rk?s+=ze.transform(r[i]):s+=r[i]}return s}}function KN(e){return Ik($i(e))}const YN=e=>typeof e=="number"?0:ze.test(e)?ze.getAnimatableNone(e):e,qN=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:YN(e);function QN(e){const t=$i(e);return Ik(t)(t.values.map((r,s)=>qN(r,t.split[s])))}const _n={test:VN,parse:GN,createTransformer:KN,getAnimatableNone:QN};function Fd(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 XN({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=Fd(l,a,e+1/3),i=Fd(l,a,e),o=Fd(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Hc(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,Od=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},JN=[Ph,ks,pi],ZN=e=>JN.find(t=>t.test(e));function mx(e){const t=ZN(e);if(!t)return!1;let n=t.parse(e);return t===pi&&(n=XN(n)),n}const gx=(e,t)=>{const n=mx(e),r=mx(t);if(!n||!r)return Hc(e,t);const s={...n};return i=>(s.red=Od(n.red,r.red,i),s.green=Od(n.green,r.green,i),s.blue=Od(n.blue,r.blue,i),s.alpha=ye(n.alpha,r.alpha,i),ks.transform(s))},Eh=new Set(["none","hidden"]);function eR(e,t){return Eh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tR(e,t){return n=>ye(e,t,n)}function Tm(e){return typeof e=="number"?tR:typeof e=="string"?jm(e)?Hc:ze.test(e)?gx:sR:Array.isArray(e)?Ak:typeof e=="object"?ze.test(e)?gx:nR:Hc}function Ak(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Tm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function nR(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Tm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function rR(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 sR=(e,t)=>{const n=_n.createTransformer(t),r=$i(e),s=$i(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?Eh.has(e)&&!s.values.length||Eh.has(t)&&!r.values.length?eR(e,t):Ea(Ak(rR(r,s),s.values),n):Hc(e,t)};function Mk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):Tm(e)(e,t)}const iR=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ve.update(t,n),stop:()=>Zr(t),now:()=>Qe.isProcessing?Qe.timestamp:ct.now()}},Lk=(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)})`},Gc=2e4;function Nm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Gc;)t+=n,r=e.next(t);return t>=Gc?1/0:t}function oR(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Nm(r),Gc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:nn(s)}}const Ae={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 Th(e,t){return e*Math.sqrt(1-t*t)}const aR=12;function lR(e,t,n){let r=n;for(let s=1;s<aR;s++)r=r-e(r)/t(r);return r}const $d=.001;function cR({duration:e=Ae.duration,bounce:t=Ae.bounce,velocity:n=Ae.velocity,mass:r=Ae.mass}){let s,i,o=1-t;o=Un(Ae.minDamping,Ae.maxDamping,o),e=Un(Ae.minDuration,Ae.maxDuration,nn(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,p=Th(c,o),m=Math.exp(-f);return $d-h/p*m},i=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),g=Th(Math.pow(c,2),o);return(-s(c)+$d>0?-1:1)*((h-p)*m)/g}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-$d+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=lR(s,i,a);if(e=zt(e),isNaN(l))return{stiffness:Ae.stiffness,damping:Ae.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const uR=["duration","bounce"],dR=["stiffness","damping","mass"];function yx(e,t){return t.some(n=>e[n]!==void 0)}function fR(e){let t={velocity:Ae.velocity,stiffness:Ae.stiffness,damping:Ae.damping,mass:Ae.mass,isResolvedFromDuration:!1,...e};if(!yx(e,dR)&&yx(e,uR))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Un(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ae.mass,stiffness:s,damping:i}}else{const n=cR({...e,velocity:0});t={...t,...n,mass:Ae.mass},t.isResolvedFromDuration=!0}return t}function Kc(e=Ae.visualDuration,t=Ae.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:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=fR({...n,velocity:-nn(n.velocity||0)}),m=h||0,g=c/(2*Math.sqrt(l*u)),v=o-i,y=nn(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?Ae.restSpeed.granular:Ae.restSpeed.default),s||(s=x?Ae.restDelta.granular:Ae.restDelta.default);let w,k,S,C,P,E;if(g<1)S=Th(y,g),C=(m+g*y*v)/S,w=j=>{const N=Math.exp(-g*y*j);return o-N*(C*Math.sin(S*j)+v*Math.cos(S*j))},P=g*y*C+v*S,E=g*y*v-C*S,k=j=>Math.exp(-g*y*j)*(P*Math.sin(S*j)+E*Math.cos(S*j));else if(g===1){w=N=>o-Math.exp(-y*N)*(v+(m+y*v)*N);const j=m+y*v;k=N=>Math.exp(-y*N)*(y*j*N-m)}else{const j=y*Math.sqrt(g*g-1);w=O=>{const A=Math.exp(-g*y*O),$=Math.min(j*O,300);return o-A*((m+g*y*v)*Math.sinh($)+j*v*Math.cosh($))/j};const N=(m+g*y*v)/j,I=g*y*N-v*j,L=g*y*v-N*j;k=O=>{const A=Math.exp(-g*y*O),$=Math.min(j*O,300);return A*(I*Math.sinh($)+L*Math.cosh($))}}const T={calculatedDuration:p&&f||null,velocity:j=>zt(k(j)),next:j=>{if(!p&&g<1){const I=Math.exp(-g*y*j),L=Math.sin(S*j),O=Math.cos(S*j),A=o-I*(C*L+v*O),$=zt(I*(P*L+E*O));return a.done=Math.abs($)<=r&&Math.abs(o-A)<=s,a.value=a.done?o:A,a}const N=w(j);if(p)a.done=j>=f;else{const I=zt(k(j));a.done=Math.abs(I)<=r&&Math.abs(o-N)<=s}return a.value=a.done?o:N,a},toString:()=>{const j=Math.min(Nm(T),Gc),N=Lk(I=>T.next(j*I).value,j,30);return j+"ms "+N},toTransition:()=>{}};return T}Kc.applyToOptions=e=>{const t=oR(e,100,Kc);return e.ease=t.ease,e.duration=zt(t.duration),e.type="keyframes",e};const hR=5;function Dk(e,t,n){const r=Math.max(t-hR,0);return mk(n-e(r),t-r)}function Nh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=E=>a!==void 0&&E<a||l!==void 0&&E>l,m=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let g=n*t;const v=f+g,y=o===void 0?v:o(v);y!==v&&(g=y-f);const x=E=>-g*Math.exp(-E/r),w=E=>y+x(E),k=E=>{const T=x(E),j=w(E);h.done=Math.abs(T)<=c,h.value=h.done?y:j};let S,C;const P=E=>{p(h.value)&&(S=E,C=Kc({keyframes:[h.value,m(h.value)],velocity:Dk(w,E,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:E=>{let T=!1;return!C&&S===void 0&&(T=!0,k(E),P(E)),S!==void 0&&E>=S?C.next(E-S):(!T&&k(E),h)}}}function pR(e,t,n){const r=[],s=n||Jr.mix||Mk,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]||on:t;a=Ea(l,a)}r.push(a)}return r}function mR(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(km(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=pR(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=ya(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Un(e[0],e[i-1],u)):c}function gR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ya(0,t,r);e.push(ye(n,1,s))}}function yR(e){const t=[0];return gR(t,e.length-1),t}function xR(e,t){return e.map(n=>n*t)}function vR(e,t){return e.map(()=>t||Sk).splice(0,e.length-1)}function Bo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=PN(r)?r.map(dx):dx(r),i={done:!1,value:t[0]},o=xR(n&&n.length===t.length?n:yR(t),e),a=mR(o,t,{ease:Array.isArray(s)?s:vR(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const wR=e=>e!==null;function Pu(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(wR),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const bR={decay:Nh,inertia:Nh,tween:Bo,keyframes:Bo,spring:Kc};function Fk(e){typeof e.type=="string"&&(e.type=bR[e.type])}class Rm{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 kR=e=>e/100;class Yc extends Rm{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!==ct.now()&&this.tick(ct.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;Fk(t);const{type:n=Bo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Bo;l!==Bo&&typeof a[0]!="number"&&(this.mixKeyframes=Ea(kR,Mk(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Nm(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}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:c=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:v}=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 y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,k=r;if(f){const E=Math.min(this.currentTime,s)/a;let T=Math.floor(E),j=E%1;!j&&E>=1&&(j=1),j===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(j=1-j,p&&(j-=p/a)):h==="mirror"&&(k=o)),w=Un(0,1,j)*a}let S;x?(this.delayState.value=u[0],S=this.delayState):S=k.next(w),i&&!x&&(S.value=i(S.value));let{done:C}=S;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return P&&m!==Nh&&(S.value=Pu(u,this.options,v,this.speed)),g&&g(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return nn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nn(t)}get time(){return nn(this.currentTime)}set time(t){t=zt(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 Dk(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(ct.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=nn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=iR,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(ct.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 _R(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const _s=e=>e*180/Math.PI,Rh=e=>{const t=_s(Math.atan2(e[1],e[0]));return Ih(t)},SR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rh,rotateZ:Rh,skewX:e=>_s(Math.atan(e[1])),skewY:e=>_s(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),xx=Rh,vx=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),wx=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),CR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vx,scaleY:wx,scale:e=>(vx(e)+wx(e))/2,rotateX:e=>Ih(_s(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(_s(Math.atan2(-e[2],e[0]))),rotateZ:xx,rotate:xx,skewX:e=>_s(Math.atan(e[4])),skewY:e=>_s(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ah(e){return e.includes("scale")?1:0}function Mh(e,t){if(!e||e==="none")return Ah(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=CR,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=SR,s=a}if(!s)return Ah(t);const i=r[t],o=s[1].split(",").map(PR);return typeof i=="function"?i(o):o[i]}const jR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mh(n,t)};function PR(e){return parseFloat(e.trim())}const Yi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qi=new Set([...Yi,"pathRotation"]),bx=e=>e===Ki||e===Y,ER=new Set(["x","y","z"]),TR=Yi.filter(e=>!ER.has(e));function NR(e){const t=[];return TR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Fr={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})=>Mh(t,"x"),y:(e,{transform:t})=>Mh(t,"y")};Fr.translateX=Fr.x;Fr.translateY=Fr.y;const Ts=new Set;let Lh=!1,Dh=!1,Fh=!1;function Ok(){if(Dh){const e=Array.from(Ts).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=NR(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)})}Dh=!1,Lh=!1,Ts.forEach(e=>e.complete(Fh)),Ts.clear()}function $k(){Ts.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dh=!0)})}function RR(){Fh=!0,$k(),Ok(),Fh=!1}class Im{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?(Ts.add(this),Lh||(Lh=!0,ve.read($k),ve.resolveKeyframes(Ok))):(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])}_R(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ts.delete(this)}cancel(){this.state==="scheduled"&&(Ts.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const IR=e=>e.startsWith("--");function zk(e,t,n){IR(t)?e.style.setProperty(t,n):e.style[t]=n}const AR={};function Bk(e,t){const n=pk(e);return()=>AR[t]??n()}const MR=Bk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Vk=Bk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),No=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,kx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:No([0,.65,.55,1]),circOut:No([.55,0,1,.45]),backIn:No([.31,.01,.66,-.59]),backOut:No([.33,1.53,.69,.99])};function Uk(e,t){if(e)return typeof e=="function"?Vk()?Lk(e,t):"ease-out":Ck(e)?No(e):Array.isArray(e)?e.map(n=>Uk(n,t)||kx.easeOut):kx[e]}function LR(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Uk(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function Wk(e){return typeof e=="function"&&"applyToOptions"in e}function DR({type:e,...t}){return Wk(e)&&Vk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Hk extends Rm{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,km(typeof t.type!="string");const c=DR(t);this.animation=LR(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Pu(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),zk(n,r,u),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 nn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nn(t)}get time(){return nn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zt(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&&MR()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),on):s(this)}}const Gk={anticipate:bk,backInOut:wk,circInOut:_k};function FR(e){return e in Gk}function OR(e){typeof e.ease=="string"&&FR(e.ease)&&(e.ease=Gk[e.ease])}const zd=10;class $R extends Hk{constructor(t){OR(t),Fk(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 Yc({...o,autoplay:!1}),l=Math.max(zd,ct.now()-this.startTime),c=Un(0,zd,l-zd),u=a.sample(l).value,{name:f}=this.options;i&&f&&zk(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const _x=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(_n.test(e)||e==="0")&&!e.startsWith("url("));function zR(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 BR(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=_x(s,t),a=_x(i,t);return!o||!a?!1:zR(e)||(n==="spring"||Wk(n))&&r}function Oh(e){e.duration=0,e.type="keyframes"}const Kk=new Set(["opacity","clipPath","filter","transform"]),VR=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function UR(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&VR.test(e[t]))return!0;return!1}const WR=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),HR=pk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function GR(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return HR()&&n&&(Kk.has(n)||WR.has(n)&&UR(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const KR=40;class YR extends Rm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){var m;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ct.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},p=(u==null?void 0:u.KeyframeResolver)||Im;this.keyframeResolver=new p(a,(g,v,y)=>this.onKeyframesResolved(g,v,h,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ct.now();let f=!0;BR(t,i,o,a)||(f=!1,(Jr.instantAnimations||!l)&&(u==null||u(Pu(t,r,n))),t[0]=t[t.length-1],Oh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>KR?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&GR(p),g=(x=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:x.current;let v;if(m)try{v=new $R({...p,element:g})}catch{v=new Yc(p)}else v=new Yc(p);v.finished.then(()=>{this.notifyFinished()}).catch(on),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}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(),RR()),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 Yk(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const Sx=30,qR=e=>!isNaN(parseFloat(e));class QR{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ct.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=ct.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=qR(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 _m);const r=this.events[t].add(n);return t==="change"?()=>{r(),ve.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=ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sx);return mk(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 zi(e,t){return new QR(e,t)}function qk(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Am(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?qk(n,e):n}const XR={type:"spring",stiffness:500,damping:25,restSpeed:10},JR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ZR={type:"keyframes",duration:.8},eI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tI=(e,{keyframes:t})=>t.length>2?ZR:qi.has(e)?e.startsWith("scale")?JR(t[1]):XR:eI,nI=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function rI(e){for(const t in e)if(!nI.has(t))return!0;return!1}const Mm=(e,t,n,r={},s,i)=>o=>{const a=Am(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-zt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,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};rI(a)||Object.assign(u,tI(e,u)),u.duration&&(u.duration=zt(u.duration)),u.repeatDelay&&(u.repeatDelay=zt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(f=!0)),(Jr.instantAnimations||Jr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,Oh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const h=Pu(u.keyframes,a);if(h!==void 0){ve.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Yc(u):new YR(u)},sI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function iI(e){const t=sI.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Qk(e,t,n=1){const[r,s]=iI(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return dk(o)?parseFloat(o):o}return jm(s)?Qk(s,t,n+1):s}function Cx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Lm(e,t,n,r){if(typeof t=="function"){const[s,i]=Cx(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]=Cx(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Ns(e,t,n){const r=e.getProps();return Lm(r,t,n!==void 0?n:r.custom,e)}const Xk=new Set(["width","height","top","left","right","bottom",...Yi]),$h=e=>Array.isArray(e);function oI(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zi(n))}function aI(e){return $h(e)?e[e.length-1]||0:e}function lI(e,t){const n=Ns(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=aI(i[o]);oI(e,o,a)}}const Xe=e=>!!(e&&e.getVelocity);function cI(e){return!!(Xe(e)&&e.add)}function zh(e,t){const n=e.getValue("willChange");if(cI(n))return n.add(t);if(!n&&Jr.WillChange){const r=new Jr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Dm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const uI="framerAppearId",Jk="data-"+Dm(uI);function Zk(e){return e.props[Jk]}function dI({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function e_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?qk(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,f);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||h&&dI(h,m))continue;const y={delay:n,...Am(i||{},m)};u&&(y.skipAnimations=!0);const x=g.get();if(x!==void 0&&!g.isAnimating()&&!Array.isArray(v)&&v===x&&!y.velocity){ve.update(()=>g.set(v));continue}let w=!1;if(window.MotionHandoffAnimation){const C=Zk(e);if(C){const P=window.MotionHandoffAnimation(C,m,ve);P!==null&&(y.startTime=P,w=!0)}}zh(e,m);const k=c??e.shouldReduceMotion;g.start(Mm(m,g,v,k&&Xk.has(m)?{type:!1}:y,e,w));const S=g.animation;S&&f.push(S)}if(o){const m=()=>ve.update(()=>{o&&lI(e,o)});f.length?Promise.all(f).then(m):m()}return f}function Bh(e,t,n={}){var l;const r=Ns(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(e_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return fI(e,t,c,u,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function fI(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(Bh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+Yk(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function hI(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Bh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Bh(e,t,n);else{const s=typeof t=="function"?Ns(e,t,n.custom):t;r=Promise.all(e_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const pI={test:e=>e==="auto",parse:e=>e},t_=e=>t=>t.test(e),n_=[Ki,Y,Vn,Xn,zN,$N,pI],jx=e=>n_.find(t_(e));function mI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||hk(e):!0}const gI=new Set(["brightness","contrast","saturate","opacity"]);function yI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Pm)||[];if(!r)return e;const s=n.replace(r,"");let i=gI.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const xI=/\b([a-z-]*)\(.*?\)/gu,Vh={..._n,getAnimatableNone:e=>{const t=e.match(xI);return t?t.map(yI).join(" "):e}},Uh={..._n,getAnimatableNone:e=>{const t=_n.parse(e);return _n.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Px={...Ki,transform:Math.round},vI={rotate:Xn,pathRotation:Xn,rotateX:Xn,rotateY:Xn,rotateZ:Xn,scale:xl,scaleX:xl,scaleY:xl,scaleZ:xl,skew:Xn,skewX:Xn,skewY:Xn,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:xa,originX:hx,originY:hx,originZ:Y},qc={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...vI,zIndex:Px,fillOpacity:xa,strokeOpacity:xa,numOctaves:Px},wI={...qc,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Vh,WebkitFilter:Vh,mask:Uh,WebkitMask:Uh},r_=e=>wI[e],bI=new Set([Vh,Uh]);function s_(e,t){let n=r_(e);return bI.has(n)||(n=_n),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kI=new Set(["auto","none","0"]);function _I(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!kI.has(i)&&$i(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=s_(n,s)}class SI extends Im{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 u=0;u<t.length;u++){let f=t[u];if(typeof f=="string"&&(f=f.trim(),jm(f))){const h=Qk(f,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Xk.has(r)||t.length!==2)return;const[s,i]=t,o=jx(s),a=jx(i),l=fx(s),c=fx(i);if(l!==c&&Fr[r]){this.needsMeasurement=!0;return}if(o!==a)if(bx(o)&&bx(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else Fr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||mI(t[s]))&&r.push(s);r.length&&_I(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=Fr[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]=Fr[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,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function i_(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 Wh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ec(e){return fk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Fm}=jk(queueMicrotask,!1),yn={x:!1,y:!1};function o_(){return yn.x||yn.y}function CI(e){return e==="x"||e==="y"?yn[e]?null:(yn[e]=!0,()=>{yn[e]=!1}):yn.x||yn.y?null:(yn.x=yn.y=!0,()=>{yn.x=yn.y=!1})}function a_(e,t){const n=i_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function jI(e){return!(e.pointerType==="touch"||o_())}function PI(e,t,n={}){const[r,s,i]=a_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=v=>{c&&(c(v),c=void 0),u()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(v))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=v=>{if(v.pointerType!=="touch"){if(a){l=!0;return}f(v)}},g=v=>{if(!jI(v))return;l=!1;const y=t(o,v);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const l_=(e,t)=>t?e===t?!0:l_(e,t.parentElement):!1,Om=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,EI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function TI(e){return EI.has(e.tagName)||e.isContentEditable===!0}const NI=new Set(["INPUT","SELECT","TEXTAREA"]);function RI(e){return NI.has(e.tagName)||e.isContentEditable===!0}const tc=new WeakSet;function Ex(e){return t=>{t.key==="Enter"&&e(t)}}function Bd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const II=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ex(()=>{if(tc.has(n))return;Bd(n,"down");const s=Ex(()=>{Bd(n,"up")}),i=()=>Bd(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 Tx(e){return Om(e)&&!o_()}const Nx=new WeakSet;function AI(e,t,n={}){const[r,s,i]=a_(e,n),o=a=>{const l=a.currentTarget;if(!Tx(a)||Nx.has(a))return;tc.add(l),n.stopPropagation&&Nx.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),tc.has(l)&&tc.delete(l),Tx(p)&&typeof c=="function"&&c(p,{success:m})},f=p=>{u(p,l===window||l===document||n.useGlobalTarget||l_(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),ec(a)&&(a.addEventListener("focus",c=>II(c,s)),!TI(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function $m(e){return fk(e)&&"ownerSVGElement"in e}const nc=new WeakMap;let Sr;const c_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:$m(r)&&"getBBox"in r?r.getBBox()[t]:r[n],MI=c_("inline","width","offsetWidth"),LI=c_("block","height","offsetHeight");function DI({target:e,borderBoxSize:t}){var n;(n=nc.get(e))==null||n.forEach(r=>{r(e,{get width(){return MI(e,t)},get height(){return LI(e,t)}})})}function FI(e){e.forEach(DI)}function OI(){typeof ResizeObserver>"u"||(Sr=new ResizeObserver(FI))}function $I(e,t){Sr||OI();const n=i_(e);return n.forEach(r=>{let s=nc.get(r);s||(s=new Set,nc.set(r,s)),s.add(t),Sr==null||Sr.observe(r)}),()=>{n.forEach(r=>{const s=nc.get(r);s==null||s.delete(t),s!=null&&s.size||Sr==null||Sr.unobserve(r)})}}const rc=new Set;let mi;function zI(){mi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};rc.forEach(t=>t(e))},window.addEventListener("resize",mi)}function BI(e){return rc.add(e),mi||zI(),()=>{rc.delete(e),!rc.size&&typeof mi=="function"&&(window.removeEventListener("resize",mi),mi=void 0)}}function Rx(e,t){return typeof e=="function"?BI(e):$I(e,t)}function VI(e){return $m(e)&&e.tagName==="svg"}const UI=[...n_,ze,_n],WI=e=>UI.find(t_(e)),Ix=()=>({translate:0,scale:1,origin:0,originPoint:0}),gi=()=>({x:Ix(),y:Ix()}),Ax=()=>({min:0,max:0}),Ve=()=>({x:Ax(),y:Ax()}),HI=new WeakMap;function Eu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function va(e){return typeof e=="string"||Array.isArray(e)}const zm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bm=["initial",...zm];function Tu(e){return Eu(e.animate)||Bm.some(t=>va(e[t]))}function u_(e){return!!(Tu(e)||e.variants)}function GI(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Xe(s))e.addValue(r,s);else if(Xe(i))e.addValue(r,zi(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,zi(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Qc={current:null},Vm={current:!1},KI=typeof window<"u";function d_(){if(Vm.current=!0,!!KI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qc.current=e.matches;e.addEventListener("change",t),t()}else Qc.current=!1}const Mx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xc={};function f_(e){Xc=e}function YI(){return Xc}class qI{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=Im,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=ct.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,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=Tu(n),this.isVariantNode=u_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&Xe(m)&&m.set(c[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,HI.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:(Vm.current||d_(),this.shouldReduceMotion=Qc.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(),Zr(this.notifyUpdate),Zr(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&&Kk.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new Hk({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:zt(u)}),h=o(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=qi.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ve.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 Xc){const n=Xc[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):Ve()}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<Mx.length;r++){const s=Mx[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=GI(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=zi(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"&&(dk(r)||hk(r))?r=parseFloat(r):!WI(r)&&_n.test(n)&&(r=s_(t,n)),this.setBaseTarget(t,Xe(r)?r.get():r)),Xe(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=Lm(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&&!Xe(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 _m),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Fm.render(this.render)}}class h_ extends qI{constructor(){super(...arguments),this.KeyframeResolver=SI}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;Xe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class rs{constructor(t){this.isMounted=!1,this.node=t}update(){}}function p_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function QI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function XI(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 Vd(e){return e===void 0||e===1}function Hh({scale:e,scaleX:t,scaleY:n}){return!Vd(e)||!Vd(t)||!Vd(n)}function ms(e){return Hh(e)||m_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m_(e){return Lx(e.x)||Lx(e.y)}function Lx(e){return e&&e!=="0%"}function Jc(e,t,n){const r=e-n,s=t*r;return n+s}function Dx(e,t,n,r,s){return s!==void 0&&(e=Jc(e,s,r)),Jc(e,n,r)+t}function Gh(e,t=0,n=1,r,s){e.min=Dx(e.min,t,n,r,s),e.max=Dx(e.max,t,n,r,s)}function g_(e,{x:t,y:n}){Gh(e.x,t.translate,t.scale,t.originPoint),Gh(e.y,n.translate,n.scale,n.originPoint)}const Fx=.999999999999,Ox=1.0000000000001;function JI(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:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Dn(e.x,-i.scroll.offset.x),Dn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,g_(e,o)),r&&ms(i.latestValues)&&sc(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<Ox&&t.x>Fx&&(t.x=1),t.y<Ox&&t.y>Fx&&(t.y=1)}function Dn(e,t){e.min+=t,e.max+=t}function $x(e,t,n,r,s=.5){const i=ye(e.min,e.max,s);Gh(e,t,n,i,r)}function zx(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function sc(e,t,n){const r=n??e;$x(e.x,zx(t.x,r.x),t.scaleX,t.scale,t.originX),$x(e.y,zx(t.y,r.y),t.scaleY,t.scale,t.originY)}function y_(e,t){return p_(XI(e.getBoundingClientRect(),t))}function ZI(e,t,n){const r=y_(e,n),{scroll:s}=t;return s&&(Dn(r.x,s.offset.x),Dn(r.y,s.offset.y)),r}const eA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tA=Yi.length;function nA(e,t,n){let r="",s=!0;for(let o=0;o<tA;o++){const a=Yi[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Wh(l,qc[a]);if(!c){s=!1;const f=eA[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Wh(i,qc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Um(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(qi.has(l)){o=!0;continue}else if(Ek(l)){s[l]=c;continue}else{const u=Wh(c,qc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=nA(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}function x_(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 Bx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Y.test(e))e=parseFloat(e);else return e;const n=Bx(e,t.target.x),r=Bx(e,t.target.y);return`${n}% ${r}%`}},rA={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=_n.parse(e);if(s.length>5)return r;const i=_n.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 c=ye(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Kh={borderRadius:{...bo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bo,borderTopRightRadius:bo,borderBottomLeftRadius:bo,borderBottomRightRadius:bo,boxShadow:rA};function v_(e,{layout:t,layoutId:n}){return qi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kh[e]||e==="opacity")}function Wm(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)(Xe(r[a])||s&&Xe(s[a])||v_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function sA(e){return window.getComputedStyle(e)}class iA extends h_{constructor(){super(...arguments),this.type="html",this.renderInstance=x_}readValueFromInstance(t,n){var r;if(qi.has(n))return(r=this.projection)!=null&&r.isProjecting?Ah(n):jR(t,n);{const s=sA(t),i=(Ek(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return y_(t,n)}build(t,n,r){Um(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Wm(t,n,r)}}const oA={offset:"stroke-dashoffset",array:"stroke-dasharray"},aA={offset:"strokeDashoffset",array:"strokeDasharray"};function lA(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?oA:aA;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const cA=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function w_(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Um(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const p of cA)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&lA(f,s,i,o,!1)}const b_=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"]),k_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function uA(e,t,n,r){x_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(b_.has(s)?s:Dm(s),t.attrs[s])}function __(e,t,n){const r=Wm(e,t,n);for(const s in e)if(Xe(e[s])||Xe(t[s])){const i=Yi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class dA extends h_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ve}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(qi.has(n)){const r=r_(n);return r&&r.default||0}return n=b_.has(n)?n:Dm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return __(t,n,r)}build(t,n,r){w_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){uA(t,n,r,s)}mount(t){this.isSVGTag=k_(t.tagName),super.mount(t)}}const fA=Bm.length;function S_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?S_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<fA;n++){const r=Bm[n],s=e.props[r];(va(s)||s===!1)&&(t[r]=s)}return t}function C_(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 hA=[...zm].reverse(),pA=zm.length;function mA(e){return t=>Promise.all(t.map(({animation:n,options:r})=>hI(e,n,r)))}function gA(e){let t=mA(e),n=Vx(),r=!0,s=!1;const i=c=>(u,f)=>{var p;const h=Ns(e,f,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...v}=h;u={...u,...v,...g}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=S_(e.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let y=0;y<pA;y++){const x=hA[y],w=n[x],k=u[x]!==void 0?u[x]:f[x],S=va(k),C=x===c?w.isActive:null;C===!1&&(g=y);let P=k===f[x]&&k!==u[x]&&S;if(P&&(r||s)&&e.manuallyAnimateOnMount&&(P=!1),w.protectedKeys={...m},!w.isActive&&C===null||!k&&!w.prevProp||Eu(k)||typeof k=="boolean")continue;if(x==="exit"&&w.isActive&&C!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const E=yA(w.prevProp,k);let T=E||x===c&&w.isActive&&!P&&S||y>g&&S,j=!1;const N=Array.isArray(k)?k:[k];let I=N.reduce(i(x),{});C===!1&&(I={});const{prevResolvedValues:L={}}=w,O={...L,...I},A=F=>{T=!0,p.has(F)&&(j=!0,p.delete(F)),w.needsAnimating[F]=!0;const z=e.getValue(F);z&&(z.liveStyle=!1)};for(const F in O){const z=I[F],_=L[F];if(m.hasOwnProperty(F))continue;let B=!1;$h(z)&&$h(_)?B=!C_(z,_)||E:B=z!==_,B?z!=null?A(F):p.add(F):z!==void 0&&p.has(F)?A(F):w.protectedKeys[F]=!0}w.prevProp=k,w.prevResolvedValues=I,w.isActive&&(m={...m,...I}),(r||s)&&e.blockInitialAnimation&&(T=!1);const $=P&&E;T&&(!$||j)&&h.push(...N.map(F=>{const z={type:x};if(typeof F=="string"&&(r||s)&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:_}=e,B=Ns(_,F);if(_.enteringChildren&&B){const{delayChildren:q}=B.transition||{};z.delay=Yk(_.enteringChildren,e,q)}}return{animation:F,options:z}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const x=Ns(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(y.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),y[x]=w??null}),h.push({animation:y})}let v=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(h):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Vx(),s=!0}}}function yA(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!C_(t,e):!1}function ls(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vx(){return{animate:ls(!0),whileInView:ls(),whileHover:ls(),whileTap:ls(),whileDrag:ls(),whileFocus:ls(),exit:ls()}}function Yh(e,t){e.min=t.min,e.max=t.max}function hn(e,t){Yh(e.x,t.x),Yh(e.y,t.y)}function Ux(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const j_=1e-4,xA=1-j_,vA=1+j_,P_=.01,wA=0-P_,bA=0+P_;function ut(e){return e.max-e.min}function kA(e,t,n){return Math.abs(e-t)<=n}function Wx(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=ut(n)/ut(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xA&&e.scale<=vA||isNaN(e.scale))&&(e.scale=1),(e.translate>=wA&&e.translate<=bA||isNaN(e.translate))&&(e.translate=0)}function Vo(e,t,n,r){Wx(e.x,t.x,n.x,r?r.originX:void 0),Wx(e.y,t.y,n.y,r?r.originY:void 0)}function Hx(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ut(t)}function _A(e,t,n,r){Hx(e.x,t.x,n.x,r==null?void 0:r.x),Hx(e.y,t.y,n.y,r==null?void 0:r.y)}function Gx(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ut(t)}function Zc(e,t,n,r){Gx(e.x,t.x,n.x,r==null?void 0:r.x),Gx(e.y,t.y,n.y,r==null?void 0:r.y)}function Kx(e,t,n,r,s){return e-=t,e=Jc(e,1/n,r),s!==void 0&&(e=Jc(e,1/s,r)),e}function SA(e,t=0,n=1,r=.5,s,i=e,o=e){if(Vn.test(t)&&(t=parseFloat(t),t=ye(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ye(i.min,i.max,r);e===i&&(a-=t),e.min=Kx(e.min,t,n,a,s),e.max=Kx(e.max,t,n,a,s)}function Yx(e,t,[n,r,s],i,o){SA(e,t[n],t[r],t[s],t.scale,i,o)}const CA=["x","scaleX","originX"],jA=["y","scaleY","originY"];function qx(e,t,n,r){Yx(e.x,t,CA,n?n.x:void 0,r?r.x:void 0),Yx(e.y,t,jA,n?n.y:void 0,r?r.y:void 0)}function Qx(e){return e.translate===0&&e.scale===1}function E_(e){return Qx(e.x)&&Qx(e.y)}function Xx(e,t){return e.min===t.min&&e.max===t.max}function PA(e,t){return Xx(e.x,t.x)&&Xx(e.y,t.y)}function Jx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function T_(e,t){return Jx(e.x,t.x)&&Jx(e.y,t.y)}function Zx(e){return ut(e.x)/ut(e.y)}function ev(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function An(e){return[e("x"),e("y")]}function EA(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:c,rotate:u,pathRotation:f,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}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 N_=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],TA=N_.length,tv=e=>typeof e=="string"?parseFloat(e):e,nv=e=>typeof e=="number"||Y.test(e);function NA(e,t,n,r,s,i){s?(e.opacity=ye(0,n.opacity??1,RA(r)),e.opacityExit=ye(t.opacity??1,0,IA(r))):i&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let o=0;o<TA;o++){const a=N_[o];let l=rv(t,a),c=rv(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||nv(l)===nv(c)?(e[a]=Math.max(ye(tv(l),tv(c),r),0),(Vn.test(c)||Vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function rv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const RA=R_(0,.5,kk),IA=R_(.5,.95,on);function R_(e,t,n){return r=>r<e?0:r>t?1:n(ya(e,t,r))}function AA(e,t,n){const r=Xe(e)?e:zi(e);return r.start(Mm("",r,t,n)),r.animation}function wa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const MA=(e,t)=>e.depth-t.depth;class LA{constructor(){this.children=[],this.isDirty=!1}add(t){bm(this.children,t),this.isDirty=!0}remove(t){Wc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(MA),this.isDirty=!1,this.children.forEach(t)}}function DA(e,t){const n=ct.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Zr(r),e(i-t))};return ve.setup(r,!0),()=>Zr(r)}function ic(e){return Xe(e)?e.get():e}class FA{constructor(){this.members=[]}add(t){bm(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&&(Wc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Wc(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 oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ud=["","X","Y","Z"],OA=1e3;let $A=0;function Wd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function I_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Zk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&I_(r)}function A_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=$A++,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(VA),this.nodes.forEach(YA),this.nodes.forEach(qA),this.nodes.forEach(UA)},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 LA)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new _m),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=$m(o)&&!VI(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;ve.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=DA(h,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(ov)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||eM,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!T_(this.targetLayout,p),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Am(m,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,x,w.path)}else f||ov(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(),Zr(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(QA),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&&I_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(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(HA),this.nodes.forEach(sv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(iv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(GA),this.nodes.forEach(KA),this.nodes.forEach(zA),this.nodes.forEach(BA)):this.nodes.forEach(iv),this.clearAllSnapshots();const a=ct.now();Qe.delta=Un(0,1e3/60,a-Qe.timestamp),Qe.timestamp=a,Qe.isProcessing=!0,Ld.update.process(Qe),Ld.preRender.process(Qe),Ld.render.process(Qe),Qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(WA),this.sharedNodes.forEach(XA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ut(this.snapshot.measuredBox.x)&&!ut(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=Ve()),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&&!E_(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ms(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),tM(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Ve();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(nM))){const{scroll:u}=this.root;u&&(Dn(a.x,u.offset.x),Dn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Ve();if(hn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&hn(a,o),Dn(a.x,f.offset.x),Dn(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||Ve();hn(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Dn(c.x,-p.scroll.offset.x),Dn(c.y,-p.scroll.offset.y)),ms(p.latestValues)&&sc(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return ms(this.latestValues)&&sc(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=Ve();hn(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ms(u.latestValues))continue;let f;u.instance&&(Hh(u.latestValues)&&u.updateSnapshot(),f=Ve(),hn(f,u.measurePageBox())),qx(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return ms(this.latestValues)&&qx(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:u,layoutId:f}=this.options;if(!this.layout||!(u||f))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=Ve(),this.targetWithTransforms=Ve()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_A(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):hn(this.target,this.layout.layoutBox),g_(this.target,this.targetDelta)):hn(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||Hh(this.parent.latestValues)||m_(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=Ve(),this.relativeTargetOrigin=Ve(),Zc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),hn(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:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;hn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;JI(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=Ve());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ux(this.prevProjectionDelta.x,this.projectionDelta.x),Ux(this.prevProjectionDelta.y,this.projectionDelta.y)),Vo(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!ev(this.projectionDelta.x,this.prevProjectionDelta.x)||!ev(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=gi(),this.projectionDelta=gi(),this.projectionDeltaWithTransform=gi()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},h=gi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Ve(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,v=m!==g,y=this.getStack(),x=!y||y.members.length<=1,w=!!(v&&!x&&this.options.crossfade===!0&&!this.path.some(ZA));this.animationProgress=0;let k;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=C=>{const P=C/1e3,E=S==null?void 0:S(P);E?(h.x.translate=E.x,h.x.scale=ye(o.x.scale,1,P),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=E.y,h.y.scale=ye(o.y.scale,1,P),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(av(h.x,o.x,P),av(h.y,o.y,P)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),JA(this.relativeTarget,this.relativeTargetOrigin,p,P),k&&PA(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Ve()),hn(k,this.relativeTarget)),v&&(this.animationValues=f,NA(f,u,this.latestValues,P,w,x)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Zr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{oc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zi(0)),this.motionValue.jump(0,!1),this.currentAnimation=AA(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},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(OA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&M_(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ve();const f=ut(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=ut(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}hn(a,l),sc(a,u),Vo(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new FA),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.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 c=this.getStack();c&&c.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 c={};l.z&&Wd("z",o,c,this.animationValues);for(let u=0;u<Ud.length;u++)Wd(`rotate${Ud[u]}`,o,c,this.animationValues),Wd(`skew${Ud[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);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=ic(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=ic(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ms(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=EA(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Kh){if(u[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=Kh[m],x=f==="none"?u[m]:g(u[m],c);if(v){const w=v.length;for(let k=0;k<w;k++)o[v[k]]=x}else y?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?ic(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(sv),this.root.sharedNodes.clear()}}}function zA(e){e.updateLayout()}function BA(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")An(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=ut(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";Yh(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else M_(i,t.layoutBox,r)&&An(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=ut(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=gi();Vo(a,r,t.layoutBox);const l=gi();o?Vo(l,e.applyTransform(s,!0),t.measuredBox):Vo(l,r,t.layoutBox);const c=!E_(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=e.options.layoutAnchor||void 0,g=Ve();Zc(g,t.layoutBox,h.layoutBox,m);const v=Ve();Zc(v,r,p.layoutBox,m),T_(g,v)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function VA(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 UA(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WA(e){e.clearSnapshot()}function sv(e){e.clearMeasurements()}function HA(e){e.isLayoutDirty=!0,e.updateLayout()}function iv(e){e.isLayoutDirty=!1}function GA(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function KA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ov(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YA(e){e.resolveTargetDelta()}function qA(e){e.calcProjection()}function QA(e){e.resetSkewAndRotation()}function XA(e){e.removeLeadSnapshot()}function av(e,t,n){e.translate=ye(t.translate,0,n),e.scale=ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lv(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function JA(e,t,n,r){lv(e.x,t.x,n.x,r),lv(e.y,t.y,n.y,r)}function ZA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eM={duration:.45,ease:[.4,0,.1,1]},cv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),uv=cv("applewebkit/")&&!cv("chrome/")?Math.round:on;function dv(e){e.min=uv(e.min),e.max=uv(e.max)}function tM(e){dv(e.x),dv(e.y)}function M_(e,t,n){return e==="position"||e==="preserve-aspect"&&!kA(Zx(t),Zx(n),.2)}function nM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const rM=A_({attachResizeListener:(e,t)=>wa(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}),Hd={current:void 0},L_=A_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hd.current){const e=new rM({});e.mount(window),e.setOptions({layoutScroll:!0}),Hd.current=e}return Hd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Hm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function fv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sM(...e){return t=>{let n=!1;const r=e.map(s=>{const i=fv(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():fv(e[s],null)}}}}function iM(...e){return b.useCallback(sM(...e),e)}class oM extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(ec(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=ec(r)&&r.offsetWidth||0,i=ec(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 aM({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=b.useId(),a=b.useRef(null),l=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=b.useContext(Hm),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=iM(a,u);return b.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:v,right:y,bottom:x,direction:w}=l.current;if(t||i===!1||!a.current||!p||!m)return;const k=w==="rtl",S=n==="left"?k?`right: ${y}`:`left: ${v}`:k?`left: ${v}`:`right: ${y}`,C=r==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");c&&(P.nonce=c);const E=s??document.head;return E.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
58
|
+
[data-motion-pop-id="${o}"] {
|
|
59
|
+
position: absolute !important;
|
|
60
|
+
width: ${p}px !important;
|
|
61
|
+
height: ${m}px !important;
|
|
62
|
+
${S}px !important;
|
|
63
|
+
${C}px !important;
|
|
64
|
+
}
|
|
65
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),E.contains(P)&&E.removeChild(P)}},[t]),d.jsx(oM,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:b.cloneElement(e,{ref:f})})}const lM=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=wm(cM),f=b.useId();let h=!0,p=b.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),b.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(aM,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx(ju.Provider,{value:p,children:e})};function cM(){return new Map}function D_(e=!0){const t=b.useContext(ju);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=b.useId();b.useEffect(()=>{if(e)return s(i)},[e]);const o=b.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const vl=e=>e.key||"";function hv(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const uM=({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:c})=>{const[u,f]=D_(o),h=b.useMemo(()=>hv(e),[e]),p=o&&!u?[]:h.map(vl),m=b.useRef(!0),g=b.useRef(h),v=wm(()=>new Map),y=b.useRef(new Set),[x,w]=b.useState(h),[k,S]=b.useState(h);uk(()=>{m.current=!1,g.current=h;for(let E=0;E<k.length;E++){const T=vl(k[E]);p.includes(T)?(v.delete(T),y.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[k,p.length,p.join("-")]);const C=[];if(h!==x){let E=[...h];for(let T=0;T<k.length;T++){const j=k[T],N=vl(j);p.includes(N)||(E.splice(T,0,j),C.push(j))}return i==="wait"&&C.length&&(E=C),S(hv(E)),w(h),null}const{forceRender:P}=b.useContext(vm);return d.jsx(d.Fragment,{children:k.map(E=>{const T=vl(E),j=o&&!u?!1:h===k||p.includes(T),N=()=>{if(y.current.has(T))return;if(v.has(T))y.current.add(T),v.set(T,!0);else return;let I=!0;v.forEach(L=>{L||(I=!1)}),I&&(P==null||P(),S(g.current),o&&(f==null||f()),r&&r())};return d.jsx(lM,{isPresent:j,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:j?void 0:N,anchorX:a,anchorY:l,children:E},T)})})},F_=b.createContext({strict:!1}),pv={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 mv=!1;function dM(){if(mv)return;const e={};for(const t in pv)e[t]={isEnabled:n=>pv[t].some(r=>!!n[r])};f_(e),mv=!0}function O_(){return dM(),YI()}function fM(e){const t=O_();for(const n in e)t[n]={...t[n],...e[n]};f_(t)}const hM=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 eu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hM.has(e)}let $_=e=>!eu(e);function pM(e){typeof e=="function"&&($_=t=>t.startsWith("on")?!eu(t):e(t))}try{pM(require("@emotion/is-prop-valid").default)}catch{}function mM(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Xe(e[s])||($_(s)||n===!0&&eu(s)||!t&&!eu(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Nu=b.createContext({});function gM(e,t){if(Tu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||va(n)?n:void 0,animate:va(r)?r:void 0}}return e.inherit!==!1?t:{}}function yM(e){const{initial:t,animate:n}=gM(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[gv(t),gv(n)])}function gv(e){return Array.isArray(e)?e.join(" "):e}const Gm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function z_(e,t,n){for(const r in t)!Xe(t[r])&&!v_(r,n)&&(e[r]=t[r])}function xM({transformTemplate:e},t){return b.useMemo(()=>{const n=Gm();return Um(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vM(e,t){const n=e.style||{},r={};return z_(r,n,e),Object.assign(r,xM(e,t)),r}function wM(e,t){const n={},r=vM(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 B_=()=>({...Gm(),attrs:{}});function bM(e,t,n,r){const s=b.useMemo(()=>{const i=B_();return w_(i,t,k_(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};z_(i,e.style,e),s.style={...i,...s.style}}return s}const kM=["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 Km(e){return typeof e!="string"||e.includes("-")?!1:!!(kM.indexOf(e)>-1||/[A-Z]/u.test(e))}function _M(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Km(e)?bM:wM)(t,r,s,e),c=mM(t,typeof e=="string",i),u=e!==b.Fragment?{...c,...l,ref:n}:{},{children:f}=t,h=b.useMemo(()=>Xe(f)?f.get():f,[f]);return b.createElement(e,{...u,children:h})}function SM({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:CM(n,r,s,e),renderState:t()}}function CM(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=ic(i[h]);let{initial:o,animate:a}=e;const l=Tu(e),c=u_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Eu(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=Lm(e,h[p]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const x in y){let w=y[x];if(Array.isArray(w)){const k=u?w.length-1:0;w=w[k]}w!==null&&(s[x]=w)}for(const x in g)s[x]=g[x]}}}return s}const V_=e=>(t,n)=>{const r=b.useContext(Nu),s=b.useContext(ju),i=()=>SM(e,t,r,s);return n?i():wm(i)},jM=V_({scrapeMotionValuesFromProps:Wm,createRenderState:Gm}),PM=V_({scrapeMotionValuesFromProps:__,createRenderState:B_}),EM=Symbol.for("motionComponentSymbol");function TM(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const s=b.useRef(null);return b.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 U_=b.createContext({});function ei(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function NM(e,t,n,r,s,i){var w,k;const{visualElement:o}=b.useContext(Nu),a=b.useContext(F_),l=b.useContext(ju),c=b.useContext(Hm),u=c.reducedMotion,f=c.skipAnimations,h=b.useRef(null),p=b.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:u,skipAnimations:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=b.useContext(U_);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&RM(h.current,n,s,g);const v=b.useRef(!1);b.useInsertionEffect(()=>{m&&v.current&&m.update(n,l)});const y=n[Jk],x=b.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,y)));return uk(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),b.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,y)}),x.current=!1),m.enteringChildren=void 0)}),m}function RM(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:W_(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&ei(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function W_(e){if(e)return e.options.allowProjection!==!1?e.projection:W_(e.parent)}function Gd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&fM(r);const i=n?n==="svg":Km(e),o=i?PM:jM;function a(c,u){let f;const h={...b.useContext(Hm),...c,layoutId:IM(c)},{isStatic:p}=h,m=yM(c),g=o(c,p);if(!p&&typeof window<"u"){AM();const v=MM(h);f=v.MeasureLayout,m.visualElement=NM(e,g,h,s,v.ProjectionNode,i)}return d.jsxs(Nu.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...h}):null,_M(e,c,TM(g,m.visualElement,u),g,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=b.forwardRef(a);return l[EM]=e,l}function IM({layoutId:e}){const t=b.useContext(vm).id;return t&&e!==void 0?t+"-"+e:e}function AM(e,t){b.useContext(F_).strict}function MM(e){const t=O_(),{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 LM(e,t){if(typeof Proxy>"u")return Gd;const n=new Map,r=(i,o)=>Gd(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,Gd(o,void 0,e,t)),n.get(o))})}const DM=(e,t)=>t.isSVG??Km(e)?new dA(t):new iA(t,{allowProjection:e!==b.Fragment});class FM extends rs{constructor(t){super(t),t.animationState||(t.animationState=gA(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Eu(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 OM=0;class $M extends rs{constructor(){super(...arguments),this.id=OM++,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=Ns(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[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 zM={animation:{Feature:FM},exit:{Feature:$M}};function Ra(e){return{point:{x:e.pageX,y:e.pageY}}}const BM=e=>t=>Om(t)&&e(t,Ra(t));function Uo(e,t,n,r){return wa(e,t,BM(n),r)}const H_=({current:e})=>e?e.ownerDocument.defaultView:null,yv=(e,t)=>Math.abs(e-t);function VM(e,t){const n=yv(e.x,t.x),r=yv(e.y,t.y);return Math.sqrt(n**2+r**2)}const xv=new Set(["auto","scroll"]);class G_{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=wl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Kd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=VM(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:v}=p,{timestamp:y}=Qe;this.history.push({...v,timestamp:y});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=wl(m,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Kd(p.type==="pointercancel"?this.lastMoveEventInfo:wl(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,x),v&&v(p,x)},!Om(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ra(t),c=wl(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=Qe;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Kd(c,this.history)),this.removeListeners=Ea(Uo(this.contextWindow,"pointermove",this.handlePointerMove),Uo(this.contextWindow,"pointerup",this.handlePointerUp),Uo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(xv.has(r.overflowX)||xv.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),ve.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Zr(this.updatePoint)}}function wl(e,t){return t?{point:t(e.point)}:e}function vv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Kd({point:e},t){return{point:e,delta:vv(e,K_(t)),offset:vv(e,UM(t)),velocity:WM(t,.1)}}function UM(e){return e[0]}function K_(e){return e[e.length-1]}function WM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=K_(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>zt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>zt(t)*2&&(r=e[1]);const i=nn(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 HM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ye(n,e,r.max):Math.min(e,n)),e}function wv(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 GM(e,{top:t,left:n,bottom:r,right:s}){return{x:wv(e.x,n,s),y:wv(e.y,t,r)}}function bv(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 KM(e,t){return{x:bv(e.x,t.x),y:bv(e.y,t.y)}}function YM(e,t){let n=.5;const r=ut(e),s=ut(t);return s>r?n=ya(t.min,t.max-r,e.min):r>s&&(n=ya(e.min,e.max-s,t.min)),Un(0,1,n)}function qM(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 qh=.35;function QM(e=qh){return e===!1?e=0:e===!0&&(e=qh),{x:kv(e,"left","right"),y:kv(e,"top","bottom")}}function kv(e,t,n){return{min:_v(e,t),max:_v(e,n)}}function _v(e,t){return typeof e=="number"?e:e[t]||0}const XM=new WeakMap;class JM{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=Ve(),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=f=>{n&&this.snapToCursor(Ra(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=CI(p),!this.openDragLock))return;this.latestPointerEvent=f,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),An(y=>{let x=this.getAxisMotionValue(y).get()||0;if(Vn.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const k=w.layout.layoutBox[y];k&&(x=ut(k)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&ve.update(()=>g(f,h),!1,!0),zh(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=eL(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),v&&ve.update(()=>v(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new G_(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:H_(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&&ve.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||!bl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=HM(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&&ei(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=GM(r.layoutBox,t):this.constraints=!1,this.elastic=QM(n),s!==this.constraints&&!ei(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=qM(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ei(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=ZI(r,s.root,this.visualElement.getTransformPagePoint());let o=KM(s.layout.layoutBox,i);if(n){const a=n(QI(o));this.hasMutatedConstraints=!!a,a&&(o=p_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!bl(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zh(this.visualElement,t),r.start(Mm(t,r,0,n,this.visualElement,!1))}stopAnimation(){An(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){An(n=>{const{drag:r}=this.getProps();if(!bl(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]-ye(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ei(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=YM({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(),An(o=>{if(!bl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ye(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;XM.set(this.visualElement,this);const t=this.visualElement.current,n=Uo(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&RI(h);u&&f&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();ei(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=ZM(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ve.read(s);const a=wa(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(An(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].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=qh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Sv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ZM(e,t,n){const r=Rx(e,Sv(n)),s=Rx(t,Sv(n));return()=>{r(),s()}}function bl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eL(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tL extends rs{constructor(t){super(t),this.removeGroupControls=on,this.removeListeners=on,this.controls=new JM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||on}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 Yd=e=>(t,n)=>{e&&ve.update(()=>e(t,n),!1,!0)};class nL extends rs{constructor(){super(...arguments),this.removePointerDownListener=on}onPointerDown(t){this.session=new G_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:H_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yd(t),onStart:Yd(n),onMove:Yd(r),onEnd:(i,o)=>{delete this.session,s&&ve.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Uo(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 qd=!1;class rL extends b.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),qd&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),oc.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}),qd=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ve.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(),Fm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;qd=!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 Y_(e){const[t,n]=D_(),r=b.useContext(vm);return d.jsx(rL,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(U_),isPresent:t,safeToRemove:n})}const sL={pan:{Feature:nL},drag:{Feature:tL,ProjectionNode:L_,MeasureLayout:Y_}};function Cv(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&&ve.postRender(()=>i(t,Ra(t)))}class iL extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=PI(t,(n,r)=>(Cv(this.node,r,"Start"),s=>Cv(this.node,s,"End"))))}unmount(){}}class oL extends rs{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=Ea(wa(this.node.current,"focus",()=>this.onFocus()),wa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function jv(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&&ve.postRender(()=>i(t,Ra(t)))}class aL extends rs{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=AI(t,(s,i)=>(jv(this.node,i,"Start"),(o,{success:a})=>jv(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Qh=new WeakMap,Qd=new WeakMap,lL=e=>{const t=Qh.get(e.target);t&&t(e)},cL=e=>{e.forEach(lL)};function uL({root:e,...t}){const n=e||document;Qd.has(n)||Qd.set(n,{});const r=Qd.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(cL,{root:e,...t})),r[s]}function dL(e,t,n){const r=uL(t);return Qh.set(e,n),r.observe(e),()=>{Qh.delete(e),r.unobserve(e)}}const fL={some:0,all:1};class hL extends rs{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:fL[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};this.stopObserver=dL(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(pL(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function pL({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const mL={inView:{Feature:hL},tap:{Feature:aL},focus:{Feature:oL},hover:{Feature:iL}},gL={layout:{ProjectionNode:L_,MeasureLayout:Y_}},yL={...zM,...mL,...sL,...gL},Pv=LM(yL,DM);function xL(){!Vm.current&&d_();const[e]=b.useState(Qc.current);return e}function Ru(e,t){const n=b.useRef(t);n.current=t,b.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const Xd={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},J={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 rt(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 vL={4:"1rem"};function Q(...e){return rN(C2(e))}const wL={height:32,lineHeight:"32px",padding:"0 16px"},bL={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")`},kL={white:J.bgBase,paper:J.bgSurface,speckle:J.bgSurface,parchment:J.bgElevated,canvas:J.canvasBase,kraft:J.canvas300,chalkboard:J.chalkboardBg},Ev={white:J.bgElevated,paper:J.bgElevated,speckle:J.bgElevated,parchment:J.canvasBase,canvas:J.canvas300,kraft:J.canvasDark,chalkboard:J.chalkboardBg},_L={base:J.bgBase,surface:J.bgSurface,elevated:J.bgElevated,canvas:J.canvasBase,canvasDark:J.canvasDark,blue:J.washBlue,green:J.washGreen,amber:J.washAmber,rose:J.washRose,slate:J.washSlate},SL={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function Ym(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=bL[n],o=t.fill?_L[t.fill]:t.shade?Ev[n]:kL[n],a=SL[s],l={"--pui-texture-shade":Ev[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 Bi(e){return Ym(e)}function Qi(e,t="paper"){if(e!==!1)return Bi(e===!0?t:e)}function CL(e){const t=Au((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 c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,f=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*f,y:i+Math.sin(u)*f})}return Iu(l)}function jL(e,t){const n=Au(`${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,c=[];for(let u=0;u<s;u++){const f=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*h,y:o+Math.sin(f)*h})}return Iu(c)}function PL(e){const t=Au((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 c=0;c<r;c++){const u=(c+.5)/r,f=l.ax+(l.bx-l.ax)*u,h=l.ay+(l.by-l.ay)*u,p=l.bx-l.ax,m=l.by-l.ay,g=Math.sqrt(p*p+m*m)||1,v=-m/g,y=p/g,x=(t()-.5)*i*2;o.push({x:f+v*x,y:h+y*x})}return Iu(o)}function EL(e,t){const n=Au(`${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 c of l)for(let u=0;u<s;u++){const f=(u+.5)/s,h=c.ax+(c.bx-c.ax)*f,p=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,g=c.by-c.ay,v=Math.sqrt(m*m+g*g)||1,y=-g/v,x=m/v,w=(n()-.5)*o*2;a.push({x:h+y*w,y:p+x*w})}return Iu(a)}function Iu(e){const t=e.length;if(t<3)return"";let n=`M ${yr(e[0].x)} ${yr(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,c=i.y+(o.y-s.y)/6,u=o.x-(a.x-i.x)/6,f=o.y-(a.y-i.y)/6;n+=` C ${yr(l)} ${yr(c)}, ${yr(u)} ${yr(f)}, ${yr(o.x)} ${yr(o.y)}`}return n+=" Z",n}function yr(e){return e.toFixed(2)}function Au(e){let t=typeof e=="string"?TL(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function TL(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 Mu(){const e=b.useId();return b.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 Xi(e){const t=Mu();return b.useMemo(()=>({blob:CL({seed:t,wobble:e}),ring:jL(t,e)}),[t,e])}const NL="button-module__button___Z331g",RL="button-module__blobBg___QQFzf",IL="button-module__blobFill___XwLjV",AL="button-module__blobRing___567UW",ML="button-module__isActive___FXNSJ",LL="button-module__primary___ppbyq",DL="button-module__secondary___esy5L",FL="button-module__ghost___NisA0",OL="button-module__danger___Wnvuq",$L="button-module__chalkboard___d3Nqb",zL="button-module__tiny___8ZZ7A",BL="button-module__small___u7y8a",VL="button-module__medium___HBIAj",UL="button-module__large___RPzNy",WL="button-module__fullWidth___H0P0F",HL="button-module__iconLeft___s60SZ",GL="button-module__iconRight___75eFu",KL="button-module__label___pXAyM",qt={button:NL,blobBg:RL,blobFill:IL,blobRing:AL,isActive:ML,primary:LL,secondary:DL,ghost:FL,danger:OL,chalkboard:$L,tiny:zL,small:BL,medium:VL,large:UL,fullWidth:WL,iconLeft:HL,iconRight:GL,label:KL},oe=b.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:c,...u},f){const h=Xi(o);return d.jsxs("button",{ref:f,type:"button",className:Q(qt.button,qt[e],qt[n],t==="chalkboard"&&qt.chalkboard,a&&qt.isActive,i&&qt.fullWidth,c),...u,children:[d.jsxs("svg",{className:qt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:h.blob,className:qt.blobFill}),d.jsx("path",{d:h.ring,className:qt.blobRing})]}),r&&d.jsx("span",{className:qt.iconLeft,children:r}),d.jsx("span",{className:qt.label,children:l}),s&&d.jsx("span",{className:qt.iconRight,children:s})]})});function qm(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const $e=wN.generator(),YL="sketch-border-module__svg___whV4x",qL="sketch-border-module__behind___lgdYV",QL="sketch-border-module__stroke___vAm-v",XL="sketch-border-module__fill___zlpd6",kl={svg:YL,behind:qL,stroke:QL,fill:XL},JL=1.2,ZL=.7;function jt({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:c=!0,strokeInset:u=!0,className:f}){const[h]=b.useState(Math.random),p=b.useRef(null),[m,g]=b.useState(null);b.useEffect(()=>{var x;const w=(x=p.current)==null?void 0:x.parentElement;if(!w)return;const k=new ResizeObserver(()=>{const S=w.offsetWidth,C=w.offsetHeight;g(P=>P&&P.width===S&&P.height===C?P:{width:S,height:C})});return k.observe(w),()=>k.disconnect()},[]);const{parts:v,clipPath:y}=b.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),w=x,k=x*2654435761%2147483647,S=T=>$e.toPaths($e.path(T,{seed:w,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(j=>!j.fill||j.fill==="none").map(j=>({d:j.d,filled:!1}));if(l){const T={seed:w,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},j=I=>$e.toPaths(I).filter(L=>!L.fill||L.fill==="none").map(L=>({d:L.d,filled:!1}));if(a){const I=_l(e,m,i,t,cs(k),n*1.1),L=u?Tv(s,n):0,O=L?_l(e,m,i+L,t,cs(k),n*1.1):I;return{parts:j($e.path(O,{...T,preserveVertices:!0})),clipPath:I}}const N=e==="circle"?$e.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):$e.path(Jd(m,i,t,cs(w)),{...T,preserveVertices:!0});return{parts:j(N),clipPath:null}}if(a){if(c){const I=Jd(m,i,t,cs(k)),L=$e.toPaths($e.path(I,{seed:w,roughness:JL,bowing:ZL,preserveVertices:!0,strokeWidth:s})).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));return{parts:L.length?L:[{d:I,filled:!1}],clipPath:I}}const T=_l(e,m,i,t,cs(k),n*1.1),j=u?Tv(s,n):0,N=j?_l(e,m,i+j,t,cs(k),n*1.1):T;return{parts:S(N),clipPath:T}}const C=(T,j)=>{const N=j?{fill:"#000",fillStyle:"solid"}:{},I=e==="circle"?$e.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...N}):$e.path(Jd(m,i,t,cs(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...N});return $e.toPaths(I)},P=o?C(k,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],E=C(w,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...P,...E],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return b.useEffect(()=>{var x;const w=(x=p.current)==null?void 0:x.parentElement;if(w)return y?w.style.setProperty("--sketch-clip",`path("${y}")`):w.style.removeProperty("--sketch-clip"),()=>{w.style.removeProperty("--sketch-clip")}},[y]),d.jsx("svg",{ref:p,className:Q(kl.svg,o&&kl.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:v==null?void 0:v.map((x,w)=>x.filled?d.jsx("path",{className:kl.fill,d:x.d},`f-${w}`):d.jsx("path",{className:kl.stroke,d:x.d,strokeWidth:s},`s-${w}`))})}function Tv(e,t){return e/2+t*1.5}function cs(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function _l(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,f=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;f.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,g=(x,w,k)=>{for(const S of[0,45,90]){const C=(k+S)*Math.PI/180;f.push({x:x+Math.cos(C)*h+u(),y:w+Math.sin(C)*h+u()})}},v=(x,w,k,S)=>{const C=Math.hypot(k-x,S-w),P=Math.min(12,Math.max(1,Math.round(C/160)));for(let E=1;E<=P;E++){const T=E/(P+1);f.push({x:x+(k-x)*T+u(),y:w+(S-w)*T+u()})}};g(p+h,m+h,180),v(p+h,m,p+o-h,m),g(p+o-h,m+h,270),v(p+o,m+h,p+o,m+a-h),g(p+o-h,m+a-h,0),v(p+o-h,m+a,p+h,m+a),g(p+h,m+a-h,90),v(p,m+a-h,p,m+h);const y=3;return Nv([...f.slice(y),...f.slice(0,y)])}return Nv(f)}function Nv(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],c=n(i,o),u=n(o,a),f=n(a,l),h=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),p=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/f-(l.x-o.x)/(u+f)),g=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),v=o.x+h/3,y=o.y+p/3,x=a.x-m/3,w=a.y-g/3;r+=` C ${v.toFixed(2)} ${y.toFixed(2)}, ${x.toFixed(2)} ${w.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function Jd(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return eD(t,t,e.width-t*2,e.height-t*2,s)}function eD(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${we(e+o)} ${we(t)}`,`L ${we(e+n-a)} ${we(t)}`,`Q ${we(e+n)} ${we(t)} ${we(e+n)} ${we(t+a)}`,`L ${we(e+n)} ${we(t+r-l)}`,`Q ${we(e+n)} ${we(t+r)} ${we(e+n-l)} ${we(t+r)}`,`L ${we(e+c)} ${we(t+r)}`,`Q ${we(e)} ${we(t+r)} ${we(e)} ${we(t+r-c)}`,`L ${we(e)} ${we(t+o)}`,`Q ${we(e)} ${we(t)} ${we(e+o)} ${we(t)}`,"Z"].join(" ")}function we(e){return e.toFixed(2)}const Pt={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}},tD="page-module__page___-uHnG",nD="page-module__outlined___Wwtyg",rD="page-module__surface___sWfI6",sD="page-module__flat___HlOaY",iD="page-module__withAccent___lsv-m",oD="page-module__accentBlue___XxbMV",aD="page-module__accentGreen___Ne6Q8",lD="page-module__accentAmber___kLAwa",cD="page-module__accentRose___O9ZbZ",uD="page-module__accentSlate___xCB66",ti={page:tD,outlined:nD,surface:rD,flat:sD,withAccent:iD,accentBlue:oD,accentGreen:aD,accentAmber:lD,accentRose:cD,accentSlate:uD},dD=qm(ti),fD={all:14,top:14,none:2};function q_({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 c=Qi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:Q(ti.page,a&&ti.outlined,s&&ti.withAccent,s&&dD[i],!l&&ti.flat,t),style:n,children:[d.jsx(jt,{clip:!0,...Pt.surface,radius:fD[o],straight:!l}),d.jsx("div",{className:ti.surface,style:c,children:e})]})}const hD="layout-module__layout___O1aWi",pD="layout-module__header___I-kxe",mD="layout-module__headerLeft___JChJQ",gD="layout-module__headerTitles___aqSUG",yD="layout-module__headerTitle___wvr39",xD="layout-module__headerSubtitle___6f5BD",vD="layout-module__headerActions___adC12",wD="layout-module__mobileToggle___4WpVG",bD="layout-module__body___tywNf",kD="layout-module__mobileOverlay___tzbBC",_D="layout-module__sidebar___8VKGq",SD="layout-module__sidebarOpen___47rtr",CD="layout-module__sidebarInner___tq2X6",jD="layout-module__logoArea___RLnC0",PD="layout-module__logoText___pAmfV",ED="layout-module__nav___FxcrZ",TD="layout-module__main___9z7bu",ND="layout-module__navIslandFixed___H4TwP",RD="layout-module__content___jL-VB",ID="layout-module__contentWithPage___vVdfN",AD="layout-module__footer___LyakU",MD="layout-module__footerText___8BYxc",Ie={layout:hD,header:pD,headerLeft:mD,headerTitles:gD,headerTitle:yD,headerSubtitle:xD,headerActions:vD,mobileToggle:wD,body:bD,mobileOverlay:kD,sidebar:_D,sidebarOpen:SD,sidebarInner:CD,logoArea:jD,logoText:PD,nav:ED,main:TD,navIslandFixed:ND,content:RD,contentWithPage:ID,footer:AD,footerText:MD};function LD(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"}:Bi(e)}function DD({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:f=[],activeItemId:h,onNavigate:p,logo:m,footerContent:g,navigationIsland:v,style:y,bleedBottom:x=!0,routeKey:w,stackOpen:k}){const[S,C]=b.useState(!1),P=xL();Ru(S,()=>C(!1));const E=LD(i),T=r&&f.length>0,j=c!==void 0||u!==void 0?{...u!==void 0?Bi(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Ie.layout,style:{...E,...y},children:[t&&d.jsxs("header",{className:Ie.header,style:j,children:[d.jsxs("div",{className:Ie.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Ie.mobileToggle,onClick:()=>C(!0),"aria-label":"Open navigation",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),d.jsxs("div",{className:Ie.headerTitles,children:[o&&d.jsx("h1",{className:Ie.headerTitle,children:o}),a&&d.jsx("span",{className:Ie.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Ie.headerActions,children:l})]}),d.jsxs("div",{className:Ie.body,children:[S&&d.jsx("button",{type:"button",className:Ie.mobileOverlay,onClick:()=>C(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:Q(Ie.sidebar,S&&Ie.sidebarOpen),children:d.jsxs("div",{className:Ie.sidebarInner,children:[d.jsx("div",{className:Ie.logoArea,children:m||d.jsx("span",{className:Ie.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Ie.nav,"aria-label":"Main navigation",children:f.map(N=>{const I=N.id===h;return d.jsx(oe,{variant:"ghost",size:"small",isActive:I,onClick:()=>{p==null||p(N),C(!1)},"aria-current":I?"page":void 0,icon:N.icon,style:wL,children:N.label},N.id)})})]})}),d.jsx("div",{className:Ie.main,children:d.jsx("main",{className:s?Ie.contentWithPage:Ie.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const N=w!==void 0?d.jsx(uM,{mode:"wait",children:d.jsx(Pv.div,{initial:P?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:P?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},w)}):e;return s?d.jsx(q_,{rounded:x?"top":"all",style:x&&v?{paddingBottom:`calc(${Xd.navIslandBottom} + ${Xd.navIslandHeight} + ${vL[4]})`}:void 0,children:N}):N})()})})]}),v&&d.jsx("div",{className:Ie.navIslandFixed,children:k!==void 0?d.jsx(Pv.div,{animate:{x:k?`-${Xd.stackPanelWidth/2}px`:0},transition:{duration:P?0:.3,ease:[.4,0,.2,1]},children:v}):v}),n&&d.jsx("footer",{className:Ie.footer,children:g||d.jsx("p",{className:Ie.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const FD="checkbox-module__wrapper___uLYMI",OD="checkbox-module__blobFill___mPJSR",$D="checkbox-module__input___Ptgt7",zD="checkbox-module__blobBg___bw3sn",BD="checkbox-module__labelLeft___-vAmH",VD="checkbox-module__box___yAh-r",UD="checkbox-module__checkmark___tTyBz",WD="checkbox-module__indeterminateLine___IosI-",HD="checkbox-module__boxWrapper___byjoS",GD="checkbox-module__icon___RO-yn",KD="checkbox-module__labelText___bAnLr",YD="checkbox-module__chalkboard___sv6SL",At={wrapper:FD,blobFill:OD,input:$D,blobBg:zD,labelLeft:BD,box:VD,checkmark:UD,indeterminateLine:WD,boxWrapper:HD,icon:GD,labelText:KD,chalkboard:YD},Q_=b.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...c},u){const f=b.useId(),h=l??f,p=Xi(r),m=b.useRef(null);return b.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:Q(At.wrapper,t==="left"&&At.labelLeft,s==="chalkboard"&&At.chalkboard,i),htmlFor:h,children:[d.jsxs("span",{className:At.boxWrapper,children:[d.jsx("input",{ref:g=>{m.current=g,typeof u=="function"?u(g):u&&(u.current=g)},id:h,type:"checkbox",className:At.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:At.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:At.blobFill})}),d.jsxs("span",{className:At.box,"aria-hidden":"true",children:[d.jsx(jt,{smooth:!0,...Pt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:At.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:At.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:At.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:At.checkmark})})]})]}),e&&d.jsx("span",{className:At.labelText,children:e})]})}),qD="icon-button-module__iconButton___avg6i",QD="icon-button-module__blobBg___466Vy",XD="icon-button-module__blobFill___FTN1g",JD="icon-button-module__blobRing___hRdQb",ZD="icon-button-module__isActive___XlvtM",e3="icon-button-module__icon___h204x",t3="icon-button-module__ghost___Wbxog",n3="icon-button-module__danger___p0Xz5",r3="icon-button-module__tiny___4WYvA",s3="icon-button-module__small___bPnCU",i3="icon-button-module__medium___nOxPf",o3="icon-button-module__large___UBU5z",a3="icon-button-module__chalkboard___mi0sQ",qn={iconButton:qD,blobBg:QD,blobFill:XD,blobRing:JD,isActive:ZD,icon:e3,default:"icon-button-module__default___9frNR",ghost:t3,danger:n3,tiny:r3,small:s3,medium:i3,large:o3,chalkboard:a3},et=b.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=Xi(i);return d.jsxs("button",{ref:c,type:"button",className:Q(qn.iconButton,qn[t],n==="chalkboard"&&qn.chalkboard,qn[r],o&&qn.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:qn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:qn.blobFill}),d.jsx("path",{d:u.ring,className:qn.blobRing})]}),d.jsx("span",{className:qn.icon,children:e})]})}),l3="stamp-module__stamp___5qaNY",c3="stamp-module__small___BBlBg",u3="stamp-module__medium___HG2YD",d3="stamp-module__large___aUT0I",f3="stamp-module__blobBg___Mdrdd",h3="stamp-module__blobFill___QyCeB",p3="stamp-module__blobRing___EUDx7",m3="stamp-module__dot___qZyCR",g3="stamp-module__label___T89iH",y3="stamp-module__chalkboard___syI4T",xr={stamp:l3,small:c3,medium:u3,large:d3,blobBg:f3,blobFill:h3,blobRing:p3,dot:m3,label:g3,chalkboard:y3},Zd={neutral:{fill:rt(J.accentSlate,.14),text:J.accentSlateDark,ring:rt(J.accentSlateDark,.35)},info:{fill:rt(J.accentBlue,.14),text:J.accentBlueDark,ring:rt(J.accentBlueDark,.35)},success:{fill:rt(J.accentGreen,.16),text:J.accentGreenDark,ring:rt(J.accentGreenDark,.35)},warning:{fill:rt(J.accentAmber,.16),text:J.accentAmberDark,ring:rt(J.accentAmberDark,.4)},error:{fill:rt(J.accentRose,.16),text:J.accentRoseDark,ring:rt(J.accentRoseDark,.35)}},Rv={fill:rt(J.chalkboardBorderBase,.1),ring:rt(J.chalkboardBorderBase,.35)};function le({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=Xi(o),u=a==="chalkboard",f=n?u?Rv.ring:Zd[n].ring:void 0,h=s??(n?u?Rv.fill:Zd[n].fill:"transparent"),p=i??(n&&!u?Zd[n].text:void 0);return d.jsxs("span",{className:Q(xr.stamp,xr[t],u&&xr.chalkboard,l),style:p?{color:p}:void 0,children:[d.jsxs("svg",{className:xr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:xr.blobFill,style:{fill:h}}),f&&d.jsx("path",{d:c.ring,className:xr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:xr.dot,"aria-hidden":"true"}),d.jsx("span",{className:xr.label,children:e})]})}const x3="copy-button-module__copyButton___-hTo4",v3="copy-button-module__dark___O45N-",w3="copy-button-module__chalkboard___hW4aw",b3="copy-button-module__copied___XlHFr",Sl={copyButton:x3,dark:v3,chalkboard:w3,copied:b3};function Xh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=b.useState(!1),a=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return d.jsx("button",{type:"button",onClick:a,className:Q(Sl.copyButton,t==="dark"&&Sl.dark,n==="chalkboard"&&Sl.chalkboard,i&&Sl.copied,r),...s,children:i?"Copied!":"Copy"})}const k3="code-block-module__codeBlock___dq28o",_3="code-block-module__header___42Fek",S3="code-block-module__relative___oO-zy",C3="code-block-module__copyOverlay___PjAuq",j3="code-block-module__pre___zXzLZ",P3="code-block-module__chalkboard___bdo9J",E3="code-block-module__chalkboardHeader___3RiVd",T3="code-block-module__chalkboardPre___iRBFR",vr={codeBlock:k3,header:_3,relative:S3,copyOverlay:C3,pre:j3,chalkboard:P3,chalkboardHeader:E3,chalkboardPre:T3};function wG({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:Q(vr.codeBlock,n==="chalkboard"&&vr.chalkboard),children:[t&&d.jsxs("div",{className:Q(vr.header,n==="chalkboard"&&vr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(Xh,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:vr.relative,children:d.jsx("div",{className:vr.copyOverlay,children:d.jsx(Xh,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:Q(vr.pre,n==="chalkboard"&&vr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Lu({size:e=16}){return d.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:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function X_({size:e=16}){return d.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:[d.jsx("path",{d:"M9 18h6"}),d.jsx("path",{d:"M10 22h4"}),d.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 J_({size:e=16}){return d.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:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function N3({size:e=16}){return d.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:d.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 R3({size:e=16}){return d.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:[d.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Z_({size:e=16}){return d.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:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const I3="table-module__tableFrame___KP-90",A3="table-module__tableWrapper___gc3Y3",M3="table-module__toolbar___zhCel",L3="table-module__toolbarTitle___D8oH-",D3="table-module__panelFooter___lCCKo",F3="table-module__compact___mG-2Y",O3="table-module__toolbarActions___EX6qS",$3="table-module__search___zIBk2",z3="table-module__searchIcon___ayhK8",B3="table-module__searchInput___PqsEG",V3="table-module__tableScroll___1gvc4",U3="table-module__table___tdU5g",W3="table-module__th___GQbKk",H3="table-module__td___WktB5",G3="table-module__footerCell___bM-jv",K3="table-module__tr___xeZno",Y3="table-module__expandTh___uxkR4",q3="table-module__expandTd___VoBRC",Q3="table-module__expandIcon___8V45X",X3="table-module__expandable___R7o2l",J3="table-module__footerRow___ik1DH",Z3="table-module__expandedRow___1TbTQ",eF="table-module__expandedCell___sKAaD",tF="table-module__boardScroll___Y1yqm",nF="table-module__board___kFAI-",rF="table-module__boardColumn___-W9bP",sF="table-module__boardColumnHeader___kY3Fj",iF="table-module__accentBlue___PEJ1V",oF="table-module__accentGreen___wJ53r",aF="table-module__accentAmber___Iezjv",lF="table-module__accentRose___W8zxc",cF="table-module__accentSlate___oUZCX",uF="table-module__boardColumnLabel___JBEed",dF="table-module__boardColumnCount___Pkpiq",fF="table-module__boardColumnBody___uAgRF",hF="table-module__boardRow___C1P60",pF="table-module__boardEmpty___IKv2W",mF="table-module__chalkboardFrame___xB3N5",gF="table-module__chalkboardWrapper___KjY5r",yF="table-module__chalkboard___v0m3A",re={tableFrame:I3,tableWrapper:A3,toolbar:M3,toolbarTitle:L3,panelFooter:D3,compact:F3,toolbarActions:O3,search:$3,searchIcon:z3,searchInput:B3,tableScroll:V3,table:U3,th:W3,td:H3,footerCell:G3,tr:K3,expandTh:Y3,expandTd:q3,expandIcon:Q3,expandable:X3,footerRow:J3,expandedRow:Z3,expandedCell:eF,boardScroll:tF,board:nF,boardColumn:rF,boardColumnHeader:sF,accentBlue:iF,accentGreen:oF,accentAmber:aF,accentRose:lF,accentSlate:cF,boardColumnLabel:uF,boardColumnCount:dF,boardColumnBody:fF,boardRow:hF,boardEmpty:pF,chalkboardFrame:mF,chalkboardWrapper:gF,chalkboard:yF},xF=qm(re);function vF({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,rowFooter:f,hideHeader:h=!1,density:p="comfortable",panelFooter:m,className:g}){const v=Qi(s,r==="chalkboard"?"chalkboard":"paper"),y=!!i,[x,w]=b.useState(new Set),k=P=>{w(E=>{const T=new Set(E);return T.has(P)?T.delete(P):T.add(P),T})},S=!!(o&&a),C=S?t.length+1:t.length;return d.jsxs("div",{className:Q(re.tableFrame,r==="chalkboard"&&re.chalkboardFrame,g),children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsxs("div",{className:Q(re.tableWrapper,r==="chalkboard"&&re.chalkboardWrapper,p==="compact"&&re.compact),style:v,children:[y&&d.jsxs("div",{className:re.toolbar,children:[i.title&&d.jsx("div",{className:re.toolbarTitle,children:i.title}),i.search&&d.jsxs("div",{className:re.search,children:[d.jsx(wF,{className:re.searchIcon}),d.jsx("input",{type:"text",className:re.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:P=>{var E,T;return(T=(E=i.search)==null?void 0:E.onChange)==null?void 0:T.call(E,P.target.value)}}),d.jsx(jt,{fill:!0,...Pt.field})]}),i.actions&&d.jsx("div",{className:re.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?d.jsx("div",{className:re.boardScroll,children:d.jsx("div",{className:re.board,children:n.map(P=>d.jsxs("div",{className:re.boardColumn,children:[d.jsxs("div",{className:Q(re.boardColumnHeader,r==="chalkboard"&&re.chalkboard,P.accent&&xF[P.accent]),children:[d.jsx("span",{className:re.boardColumnLabel,children:P.label}),d.jsx("span",{className:re.boardColumnCount,children:P.items.length})]}),d.jsx("div",{className:re.boardColumnBody,children:P.items.length===0?d.jsx("div",{className:re.boardEmpty,children:P.emptyLabel??"empty"}):P.items.map((E,T)=>d.jsx("div",{className:Q(re.boardRow,r==="chalkboard"&&re.chalkboard),children:P.renderItem(E,T,r)},P.getKey?P.getKey(E,T):T))})]},P.key))})}):d.jsx("div",{className:re.tableScroll,children:d.jsxs("table",{className:Q(re.table,r==="chalkboard"&&re.chalkboard,p==="compact"&&re.compact),children:[d.jsxs("colgroup",{children:[S&&d.jsx("col",{style:{width:"48px"}}),t.map(P=>d.jsx("col",{style:P.width?{width:`${P.width*32}px`}:void 0},P.key))]}),!h&&d.jsx("thead",{children:d.jsxs("tr",{children:[S&&d.jsx("th",{className:Q(re.th,re.expandTh),"aria-label":"Expand"}),t.map(P=>d.jsx("th",{className:re.th,style:P.align?{textAlign:P.align}:void 0,children:P.header},P.key))]})}),d.jsx("tbody",{children:e.map((P,E)=>{const T=l?l(P,E):E,j=o==null?void 0:o.render(P,E,r),N=f==null?void 0:f(P,E,r),I=!!j,L=I&&x.has(T),O=u==null?void 0:u(P,E);return d.jsxs(b.Fragment,{children:[d.jsxs("tr",{className:Q(re.tr,I&&re.expandable,c==null?void 0:c(P,E)),style:O?Bi(O):void 0,onClick:()=>I&&k(T),children:[S&&d.jsx("td",{className:Q(re.td,re.expandTd),children:I&&d.jsx("button",{type:"button",className:re.expandIcon,"aria-expanded":L,"aria-label":L?"Collapse row":"Expand row",onClick:A=>{A.stopPropagation(),k(T)},children:d.jsx(Z_,{size:14})})}),t.map(A=>d.jsx("td",{className:re.td,style:A.align?{textAlign:A.align}:void 0,children:A.cell(P,E,r)},A.key))]}),N&&d.jsx("tr",{className:re.footerRow,style:O?Bi(O):void 0,children:d.jsx("td",{colSpan:C,className:re.footerCell,children:N})}),L&&d.jsx("tr",{className:re.expandedRow,children:d.jsx("td",{colSpan:C,className:re.expandedCell,children:j})})]},T)})})]})}),m&&d.jsx("div",{className:re.panelFooter,children:m})]})]})}function wF({className:e}){return d.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:[d.jsx("circle",{cx:"11",cy:"11",r:"8"}),d.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const bF="card-module__borderLayer___WSpJq",kF="card-module__elevated___uhWj9",_F="card-module__textureLayer___Kcofz",SF="card-module__flat___KnG5z",CF="card-module__small___HXUTr",jF="card-module__withAccent___2t7bV",PF="card-module__accentBlue___a1KIq",EF="card-module__accentGreen___RNWoA",TF="card-module__accentAmber___uMhom",NF="card-module__accentRose___VPI3t",RF="card-module__accentSlate___-l4jE",IF="card-module__chalkboard___bQ48O",Cr={borderLayer:bF,default:"card-module__default___glPy-",elevated:kF,textureLayer:_F,flat:SF,small:CF,withAccent:jF,accentBlue:PF,accentGreen:EF,accentAmber:TF,accentRose:NF,accentSlate:RF,chalkboard:IF},AF=qm(Cr);function _e({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:c=!1,className:u}){const f=n==="chalkboard"||s===!1?void 0:Ym({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:Q(Cr.borderLayer,Cr[t],n==="chalkboard"&&Cr.chalkboard,Cr[r],a&&Cr.withAccent,a&&AF[l],!c&&Cr.flat,u),children:[d.jsx(jt,{clip:!0,...Pt.surface,straight:!c}),d.jsx("div",{className:Cr.textureLayer,style:f,children:e})]})}const MF="input-module__wrapper___xaEw6",LF="input-module__label___lu7R1",DF="input-module__field___khFpX",FF="input-module__input___h7K-F",OF="input-module__small___SkByh",$F="input-module__medium___0QPuV",zF="input-module__large___zGwRu",BF="input-module__error___QDqga",VF="input-module__disabled___K-5hi",UF="input-module__helperText___njeLH",WF="input-module__helperError___qDBpD",HF="input-module__chalkboard___Xh-5s",Tn={wrapper:MF,label:LF,field:DF,input:FF,small:OF,medium:$F,large:zF,error:BF,disabled:VF,helperText:UF,helperError:WF,chalkboard:HF},Du=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c;return d.jsxs("div",{className:Q(Tn.wrapper,s==="chalkboard"&&Tn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:Tn.label,children:e}),d.jsxs("span",{className:Q(Tn.field,Tn[r],n&&Tn.error,a.disabled&&Tn.disabled),children:[d.jsx("input",{ref:l,id:u,className:Tn.input,...a}),d.jsx(jt,{fill:!0,...Pt.field})]}),t&&d.jsx("span",{className:Q(Tn.helperText,n&&Tn.helperError),children:t})]})}),GF="select-module__wrapper___Hc5F3",KF="select-module__label___ay-3s",YF="select-module__nativeSelect___UA2d-",qF="select-module__trigger___xMYHi",QF="select-module__open___w3mbZ",XF="select-module__triggerLabel___ihpER",JF="select-module__placeholder___0VOFP",ZF="select-module__small___iU9W9",eO="select-module__chevron___0dCTg",tO="select-module__medium___B-XBN",nO="select-module__large___iII2c",rO="select-module__chevronOpen___cFOYe",sO="select-module__error___P5RBk",iO="select-module__dropdown___Q-uK3",oO="select-module__slideDown___sT374",aO="select-module__options___HmrQ0",lO="select-module__option___vNnue",cO="select-module__optionDisabled___ex2zq",uO="select-module__optionSelected___tAFjn",dO="select-module__optionHighlighted___zYQLq",fO="select-module__helperText___r5gyn",hO="select-module__helperError___ydSPT",pO="select-module__chalkboard___sXBw8",Le={wrapper:GF,label:KF,nativeSelect:YF,trigger:qF,open:QF,triggerLabel:XF,placeholder:JF,small:ZF,chevron:eO,medium:tO,large:nO,chevronOpen:rO,error:sO,dropdown:iO,slideDown:oO,options:aO,option:lO,optionDisabled:cO,optionSelected:uO,optionHighlighted:dO,helperText:fO,helperError:hO,chalkboard:pO};function mO({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:f=!1,width:h,texture:p=!1,className:m}){const g=b.useId(),[v,y]=b.useState(!1),[x,w]=b.useState(-1),[k,S]=b.useState(l??""),[C,P]=b.useState(null),E=b.useRef(null),T=b.useRef(null),j=a!==void 0,N=j?a:k,I=i.find(_=>_.value===N),L=(I==null?void 0:I.label)??o??"Select...",O=b.useCallback(()=>{if(f)return;y(!0);const _=i.findIndex(B=>B.value===N);w(_>=0?_:0)},[f,i,N]),A=b.useCallback(()=>{y(!1),w(-1)},[]),$=b.useCallback(_=>{var B;_.disabled||(j||S(_.value),c==null||c(_.value),A(),(B=E.current)==null||B.focus())},[j,c,A]),U=b.useCallback(_=>{if(!f)switch(_.key){case"Enter":case" ":_.preventDefault(),v&&x>=0?$(i[x]):O();break;case"Escape":_.preventDefault(),v&&A();break;case"ArrowDown":_.preventDefault(),v?w(B=>{let q=B+1;for(;q<i.length&&i[q].disabled;)q++;return q<i.length?q:B}):O();break;case"ArrowUp":_.preventDefault(),v?w(B=>{let q=B-1;for(;q>=0&&i[q].disabled;)q--;return q>=0?q:B}):O();break;case"Home":if(_.preventDefault(),v){let B=0;for(;B<i.length&&i[B].disabled;)B++;B<i.length&&w(B)}break;case"End":if(_.preventDefault(),v){let B=i.length-1;for(;B>=0&&i[B].disabled;)B--;B>=0&&w(B)}break;case"Tab":v&&A();break}},[f,v,x,i,O,A,$]);b.useEffect(()=>{if(!v)return;const _=B=>{var q,R;const ue=B.target;(q=E.current)!=null&&q.contains(ue)||(R=T.current)!=null&&R.contains(ue)||A()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[v,A]),b.useEffect(()=>{if(!v||x<0||!T.current)return;const _=T.current.querySelector(`[data-option-index="${x}"]`);_==null||_.scrollIntoView({block:"nearest"})},[v,x]),b.useEffect(()=>{if(!v){P(null);return}const _=()=>{if(!E.current)return;const B=E.current.getBoundingClientRect();if(B.bottom<0||B.top>window.innerHeight){A();return}P(B)};return _(),document.addEventListener("scroll",_,{capture:!0,passive:!0}),window.addEventListener("resize",_,{passive:!0}),()=>{document.removeEventListener("scroll",_,{capture:!0}),window.removeEventListener("resize",_)}},[v,A]);const F=Qi(p),z=F?{"--sketch-fill":F.backgroundColor}:void 0;return d.jsxs("div",{className:Q(Le.wrapper,s==="chalkboard"&&Le.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&d.jsx("label",{htmlFor:g,className:Le.label,children:e}),d.jsxs("select",{id:g,name:u,className:Le.nativeSelect,value:N,onChange:_=>c==null?void 0:c(_.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(_=>d.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))]}),d.jsxs("button",{ref:E,type:"button",role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-controls":v?`${g}-listbox`:void 0,"aria-activedescendant":v&&x>=0?`${g}-option-${x}`:void 0,className:Q(Le.trigger,Le[r],n&&Le.error,v&&Le.open,f&&Le.disabled),onClick:()=>v?A():O(),onKeyDown:U,disabled:f,children:[d.jsx("span",{className:Q(Le.triggerLabel,!I&&Le.placeholder),children:L}),d.jsx(gO,{className:Q(Le.chevron,v&&Le.chevronOpen)}),d.jsx(jt,{fill:!0,...Pt.field})]}),v&&C&&$s.createPortal(d.jsxs("div",{ref:T,id:`${g}-listbox`,role:"listbox",tabIndex:-1,className:Le.dropdown,style:{...z,position:"fixed",top:C.bottom+6,left:C.left,width:C.width},onKeyDown:_=>{var B;_.key==="Escape"&&(_.preventDefault(),A(),(B=E.current)==null||B.focus())},children:[d.jsx(jt,{fill:!0,...Pt.surface}),d.jsx("div",{className:Le.options,children:i.map((_,B)=>d.jsx("div",{id:`${g}-option-${B}`,role:"option","aria-selected":_.value===N,tabIndex:-1,"data-option-index":B,className:Q(Le.option,_.value===N&&Le.optionSelected,B===x&&Le.optionHighlighted,_.disabled&&Le.optionDisabled),onClick:q=>{q.stopPropagation(),$(_)},onMouseEnter:()=>w(B),children:_.label},_.value))})]}),document.body),t&&d.jsx("span",{className:Q(Le.helperText,n&&Le.helperError),children:t})]})}function gO({className:e}){return d.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:d.jsx("polyline",{points:"6 9 12 15 18 9"})})}function eS({variant:e}){switch(e){case"info":return d.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:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),d.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return d.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:[d.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),d.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return d.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:[d.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"}),d.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),d.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return d.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:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),d.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const yO="alert-module__alert___j7ZRS",xO="alert-module__surface___IaVgU",vO="alert-module__iconWrapper___kLoxT",wO="alert-module__message___klR2U",bO="alert-module__dismiss___f2uoG",kO="alert-module__info___PBo1l",_O="alert-module__success___AVBKS",SO="alert-module__warning___zkMaJ",CO="alert-module__error___cxg96",jO="alert-module__chalkboard___7pgWk",us={alert:yO,surface:xO,iconWrapper:vO,message:wO,dismiss:bO,info:kO,success:_O,warning:SO,error:CO,chalkboard:jO};function tS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return d.jsxs("div",{className:Q(us.alert,us[t],a&&us.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:us.surface,style:a?void 0:Qi(r)}),d.jsx("span",{className:us.iconWrapper,children:d.jsx(eS,{variant:t})}),d.jsx("div",{className:us.message,children:e}),s&&d.jsx("button",{type:"button",className:us.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Lu,{size:16})})]})}const PO="modal-module__overlay___a52Ni",EO="modal-module__fadeIn___5OWd5",TO="modal-module__backdrop___RS4yj",NO="modal-module__modal___ZioOV",RO="modal-module__slideUp___vfFrm",IO="modal-module__small___hcxwF",AO="modal-module__medium___mjbM5",MO="modal-module__large___1dzyf",LO="modal-module__header___iP09B",DO="modal-module__title___nj06m",FO="modal-module__close___gQou9",OO="modal-module__body___Y-EdA",$O="modal-module__chalkboard___qY8qo",Qn={overlay:PO,fadeIn:EO,backdrop:TO,modal:NO,slideUp:RO,small:IO,medium:AO,large:MO,header:LO,title:DO,close:FO,body:OO,chalkboard:$O},zO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ia({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=b.useId(),c=b.useRef(null),u=b.useRef(null);if(Ru(e,t),b.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=g=>{var v;if(g.key!=="Tab")return;const y=(v=c.current)==null?void 0:v.querySelectorAll(zO);if(!y||y.length===0){g.preventDefault();return}const x=y[0],w=y[y.length-1];g.shiftKey&&document.activeElement===x?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var g,v;document.removeEventListener("keydown",p),document.body.style.overflow=m,(v=(g=u.current)==null?void 0:g.focus)==null||v.call(g)}},[e]),!e||typeof document>"u")return null;const f=Qi(o);return $s.createPortal(d.jsxs("div",{className:Qn.overlay,children:[d.jsx("button",{type:"button",className:Qn.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:Q(Qn.modal,Qn[s],i==="chalkboard"&&Qn.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Qn.header,children:[n&&d.jsx("h2",{id:l,className:Qn.title,children:n}),d.jsx("button",{type:"button",className:Qn.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Lu,{size:18})})]}),d.jsx("div",{className:Qn.body,children:r})]})]}),document.body)}const BO="textarea-module__wrapper___NbiNO",VO="textarea-module__label___ejhyZ",UO="textarea-module__field___KluQf",WO="textarea-module__textarea___0y-7v",HO="textarea-module__resizeGrip___lONlE",GO="textarea-module__small___yPyr8",KO="textarea-module__medium___ezQxA",YO="textarea-module__large___xfeKi",qO="textarea-module__error___EkXKJ",QO="textarea-module__disabled___9CKbb",XO="textarea-module__helperText___l1sPh",JO="textarea-module__helperError___VfTLy",ZO="textarea-module__chalkboard___zZ0X0",pn={wrapper:BO,label:VO,field:UO,textarea:WO,resizeGrip:HO,small:GO,medium:KO,large:YO,error:qO,disabled:QO,helperText:XO,helperError:JO,chalkboard:ZO},e$=48,Qm=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c,f=b.useRef(null),h=b.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=b.useCallback(m=>{const g=f.current;if(!g)return;m.preventDefault();const v=m.clientY,y=g.offsetHeight,x=k=>{g.style.height=`${Math.max(e$,y+k.clientY-v)}px`},w=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",w)},[]);return d.jsxs("div",{className:Q(pn.wrapper,s==="chalkboard"&&pn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:pn.label,children:e}),d.jsxs("span",{className:Q(pn.field,pn[r],n&&pn.error,a.disabled&&pn.disabled),children:[d.jsx("textarea",{ref:h,id:u,className:pn.textarea,...a}),d.jsx(jt,{fill:!0,...Pt.field}),!a.disabled&&d.jsx("span",{className:pn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:Q(pn.helperText,n&&pn.helperError),children:t})]})}),t$="progress-module__track___a5BMO",n$="progress-module__svg___3U0-E",Iv={track:t$,svg:n$},ef=300,wr=1;function r$({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(Mu()*1e6)),c=a?rt(J.chalkboardBorderBase,.16):rt(J.textPrimary,.12),u=n??(a?J.chalkboardChalk:J.textSecondary),f=b.useMemo(()=>$e.toPaths($e.rectangle(wr,wr,ef-wr*2,r-wr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(ef-wr*2),0),p=b.useMemo(()=>h>0?$e.toPaths($e.rectangle(wr,wr,h,r-wr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return d.jsx("div",{className:Q(Iv.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:Iv.svg,viewBox:`0 0 ${ef} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g)),p.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g))]})})}function s$(e){const t=Mu();return b.useMemo(()=>({blob:PL({seed:t,wobble:e}),ring:EL(t,e)}),[t,e])}const i$="list-item-module__listItem___-tw9O",o$="list-item-module__clickable___GLJmd",a$="list-item-module__blobBg___O3Mzh",l$="list-item-module__blobFill___dXHk1",c$="list-item-module__blobRing___S9mas",u$="list-item-module__active___UsL8O",d$="list-item-module__small___9dphK",f$="list-item-module__medium___yGZCr",h$="list-item-module__icon___2b4wU",p$="list-item-module__label___SIzJ4",m$="list-item-module__action___qGh0-",g$="list-item-module__chalkboard___qpWuM",Qt={listItem:i$,static:"list-item-module__static___qtEX6",clickable:o$,blobBg:a$,blobFill:l$,blobRing:c$,active:u$,small:d$,medium:f$,icon:h$,label:p$,action:m$,chalkboard:g$};function On({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=s$(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:Q(Qt.listItem,Qt[r],u&&Qt.clickable,!u&&!e&&Qt.static,e&&Qt.active,i==="chalkboard"&&Qt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:Qt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Qt.blobFill}),d.jsx("path",{d:c.ring,className:Qt.blobRing})]}),t&&d.jsx("span",{className:Qt.icon,children:t}),d.jsx("span",{className:Qt.label,children:o}),n&&d.jsx("span",{className:Qt.action,children:n})]})}const y$="accordion-module__accordion___mqGl-",x$="accordion-module__header___mLfbd",v$="accordion-module__icon___Z90NR",w$="accordion-module__title___HusgG",b$="accordion-module__content___1K0td",k$="accordion-module__chalkboard___am8r4",_$="accordion-module__expanded___836xG",ds={accordion:y$,header:x$,icon:v$,title:w$,content:b$,chalkboard:k$,expanded:_$};function bG({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:Q(ds.accordion,n&&ds.expanded,s==="chalkboard"&&ds.chalkboard,i),children:[d.jsxs("button",{type:"button",className:ds.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:ds.icon,"aria-hidden":"true",children:d.jsx(Z_,{size:14})}),d.jsx("span",{className:ds.title,children:e})]}),n&&d.jsx("div",{className:ds.content,children:t})]})}const S$="icon-module__icon___2vrJz",C$="icon-module__blobBg___ENPYJ",j$="icon-module__blobFill___IPbwQ",P$="icon-module__blobRing___1awqV",E$="icon-module__content___TaZR6",T$="icon-module__small___Xp--F",N$="icon-module__medium___tCjMB",R$="icon-module__large___vBtP7",qs={icon:S$,blobBg:C$,blobFill:j$,blobRing:P$,content:E$,small:T$,medium:N$,large:R$},I$={small:20,medium:24,large:28};function A$({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Xi(n),o=I$[t];return d.jsxs("span",{className:Q(qs.icon,qs[t],s),children:[d.jsxs("svg",{className:qs.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:qs.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:qs.blobRing})]}),d.jsx("span",{className:qs.content,style:{width:o,height:o},children:e})]})}const M$="radio-module__wrapper___BB05E",L$="radio-module__blobFill___p5BX4",D$="radio-module__labelLeft___ijB93",F$="radio-module__input___M2nFJ",O$="radio-module__box___H7ofS",$$="radio-module__dot___jVJ-d",z$="radio-module__boxWrapper___Y3qis",B$="radio-module__blobBg___IR-M5",V$="radio-module__labelText___I-nu3",U$="radio-module__chalkboard___IIBqI",Nn={wrapper:M$,blobFill:L$,labelLeft:D$,input:F$,box:O$,dot:$$,boxWrapper:z$,blobBg:B$,labelText:V$,chalkboard:U$};b.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u,h=Xi(n);return d.jsxs("label",{className:Q(Nn.wrapper,t==="left"&&Nn.labelLeft,r==="chalkboard"&&Nn.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:Nn.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:Nn.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:Nn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:Nn.blobFill})}),d.jsxs("span",{className:Nn.box,"aria-hidden":"true",children:[d.jsx(jt,{smooth:!0,shape:"circle",...Pt.control}),d.jsx("span",{className:Nn.dot})]})]}),e&&d.jsx("span",{className:Nn.labelText,children:e})]})});const W$="switch-module__wrapper___5-2P1",H$="switch-module__labelLeft___WlT-N",G$="switch-module__input___YKZRj",K$="switch-module__track___QNvnO",Y$="switch-module__thumb___cunvF",q$="switch-module__small___WPIxc",Q$="switch-module__medium___yPulW",X$="switch-module__large___VlKV1",J$="switch-module__labelText___9Qg39",Z$="switch-module__chalkboard___qKTMz",br={wrapper:W$,labelLeft:H$,input:G$,track:K$,thumb:Y$,small:q$,medium:Q$,large:X$,labelText:J$,chalkboard:Z$},nS=b.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u;return d.jsxs("label",{className:Q(br.wrapper,br[n],t==="left"&&br.labelLeft,r==="chalkboard"&&br.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:br.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:br.track,"aria-hidden":"true",children:[d.jsx(jt,{...Pt.pill}),d.jsx("span",{className:br.thumb})]}),e&&d.jsx("span",{className:br.labelText,children:e})]})}),ez="spinner-module__spinner___FDTk2",tz="spinner-module__chalkboard___DLE1z",nz="spinner-module__svg___JnCWN",rz="spinner-module__track___xbnbo",sz="spinner-module__head___j5dWe",ko={spinner:ez,chalkboard:tz,svg:nz,track:rz,head:sz},iz={small:18,medium:28,large:40},Av=25,oz=18,Mv=$e.toPaths($e.circle(Av,Av,oz*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function ur({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=iz[e];return d.jsx("span",{className:Q(ko.spinner,r==="chalkboard"&&ko.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:ko.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:ko.track,d:Mv,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:ko.head,d:Mv,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const az="skeleton-module__skeleton___HCSvg",lz="skeleton-module__pulse___6eCq1",cz="skeleton-module__svg___OzxGp",uz="skeleton-module__text___v17Nv",dz="skeleton-module__rect___wqIJy",fz="skeleton-module__circle___RCmyR",tf={skeleton:az,pulse:lz,svg:cz,text:uz,rect:dz,circle:fz},Lv={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Qs=2;function Lt({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Mu()*1e6)),l=o?rt(J.chalkboardBorderBase,.16):rt(J.textPrimary,.09),c=b.useMemo(()=>{const[,,u,f]=Lv[e],h=e==="circle"?$e.ellipse(u/2,f/2,u-Qs*2,f-Qs*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):$e.rectangle(Qs,Qs,u-Qs*2,f-Qs*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return $e.toPaths(h)},[e,a,l]);return d.jsx("span",{className:Q(tf.skeleton,tf[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:tf.svg,viewBox:Lv[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,f)=>d.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},f))})})}const hz="divider-module__horizontal___tP3rG",pz="divider-module__line___KnBes",mz="divider-module__label___WiUwZ",gz="divider-module__vertical___wBSrT",yz="divider-module__chalkboard___gXTde",Xs={horizontal:hz,line:pz,label:mz,vertical:gz,chalkboard:yz};function rS({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Xs.chalkboard;return e==="vertical"?d.jsx("span",{className:Q(Xs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:Q(Xs.horizontal,s,r),role:"separator",children:[d.jsx("span",{className:Xs.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Xs.label,children:t}),d.jsx("span",{className:Xs.line})]})]})}const xz="tooltip-module__wrapper___XeVNe",vz="tooltip-module__tooltip___e-rkz",wz="tooltip-module__tooltipIn___CZbRw",bz="tooltip-module__top___78WWU",kz="tooltip-module__bottom___Irl3O",_z="tooltip-module__left___C1Ec4",Sz="tooltip-module__right___oUA-Z",Cz="tooltip-module__chalkboard___Um6dx",Cl={wrapper:xz,tooltip:vz,tooltipIn:wz,top:bz,bottom:kz,left:_z,right:Sz,chalkboard:Cz},jl=8,Pl=8,jz=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Pz(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+jl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-jl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+jl;break;default:r=e.top-jl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,Pl),window.innerWidth-n.width-Pl),r=Math.min(Math.max(r,Pl),window.innerHeight-n.height-Pl),{top:r,left:s}}function xe({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=b.useId(),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(null),[g,v]=b.useState(null),y=b.useRef(null),x=b.useRef(null),w=b.useRef(),k=!s&&!!e&&!f&&(a||c),S=()=>{clearTimeout(w.current),w.current=setTimeout(()=>l(!0),r)},C=()=>{clearTimeout(w.current),l(!1),h(!1)},P=()=>{h(!1),u(!0)},E=()=>{u(!1),h(!1)};Ru(k,()=>h(!0)),b.useEffect(()=>{if(!k){m(null);return}const j=()=>{y.current&&m(y.current.getBoundingClientRect())};return j(),window.addEventListener("scroll",j,{capture:!0,passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j,{capture:!0}),window.removeEventListener("resize",j)}},[k]),jz(()=>{if(!k){v(null);return}const j=x.current;j&&v({width:j.offsetWidth,height:j.offsetHeight})},[k,e,n]),b.useEffect(()=>()=>clearTimeout(w.current),[]);const T=t.props;return d.jsxs("span",{ref:y,className:Cl.wrapper,onMouseEnter:S,onMouseLeave:C,onFocus:P,onBlur:E,children:[b.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&p&&typeof document<"u"&&$s.createPortal(d.jsx("span",{ref:x,id:o,role:"tooltip",className:Q(Cl.tooltip,Cl[n],i==="chalkboard"&&Cl.chalkboard),style:g?{position:"fixed",...Pz(p,n,g)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const Ez="toast-module__stack___hDi0s",Tz="toast-module__topLeft___Luw-F",Nz="toast-module__topCenter___N1DwF",Rz="toast-module__topRight___Dtgau",Iz="toast-module__bottomLeft___Eb2lo",Az="toast-module__bottomCenter___gs-Yb",Mz="toast-module__bottomRight___-0e2j",Lz="toast-module__item___RFjtm",Dz="toast-module__toastIn___9m9iN",Fz="toast-module__card___ZCvJS",Oz="toast-module__surface___mfMl0",$z="toast-module__iconWrapper___lnjcC",zz="toast-module__content___AlliM",Bz="toast-module__title___1Oqh8",Vz="toast-module__description___eiUSB",Uz="toast-module__dismiss___tUGx4",Wz="toast-module__info___Nh8S9",Hz="toast-module__success___hlKLc",Gz="toast-module__warning___XUMJt",Kz="toast-module__error___pSFFC",Yz="toast-module__chalkboard___c49gt",Xt={stack:Ez,topLeft:Tz,topCenter:Nz,topRight:Rz,bottomLeft:Iz,bottomCenter:Az,bottomRight:Mz,item:Lz,toastIn:Dz,card:Fz,surface:Oz,iconWrapper:$z,content:zz,title:Bz,description:Vz,dismiss:Uz,info:Wz,success:Hz,warning:Gz,error:Kz,chalkboard:Yz};function qz({record:e,surface:t="paper",onDismiss:n}){const r=b.useRef(e.duration),s=b.useRef(0),i=b.useRef(),o=b.useCallback(f=>{clearTimeout(i.current),!(f<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),f))},[n,e.id]);b.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),c=t==="chalkboard",u=e.variant==="warning"||e.variant==="error"?"alert":"status";return d.jsx("div",{className:Xt.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:Q(Xt.card,Xt[e.variant],c&&Xt.chalkboard),role:u,children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:Xt.surface,style:c?void 0:Qi("kraft")}),d.jsx("span",{className:Xt.iconWrapper,children:d.jsx(eS,{variant:e.variant})}),d.jsxs("div",{className:Xt.content,children:[e.title&&d.jsx("div",{className:Xt.title,children:e.title}),d.jsx("div",{className:Xt.description,children:e.description})]}),d.jsx("button",{type:"button",className:Xt.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Lu,{size:16})})]})})}const sS=b.createContext(null);function Qz(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Xz({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=b.useState([]),o=b.useRef(0),a=b.useCallback(u=>{i(f=>f.filter(h=>h.id!==u))},[]),l=b.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(h=>[...h,{id:f,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),f},[r]),c=t.startsWith("top")?[...s].reverse():s;return d.jsxs(sS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&$s.createPortal(d.jsx("div",{className:Q(Xt.stack,Xt[Qz(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(qz,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function He(){const e=b.useContext(sS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const Jz="breadcrumb-module__breadcrumb___r-ILp",Zz="breadcrumb-module__list___V3YFy",eB="breadcrumb-module__item___dDwYf",tB="breadcrumb-module__link___CHC9k",nB="breadcrumb-module__linkButton___XoMW-",rB="breadcrumb-module__current___dprI9",sB="breadcrumb-module__separator___uLhtn",iB="breadcrumb-module__chalkboard___COJpw",Rn={breadcrumb:Jz,list:Zz,item:eB,link:tB,linkButton:nB,current:rB,static:"breadcrumb-module__static___affaf",separator:sB,chalkboard:iB};function oB({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:Q(Rn.breadcrumb,t==="chalkboard"&&Rn.chalkboard,n),children:d.jsx("ol",{className:Rn.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:Rn.item,children:[i?d.jsx("span",{className:Rn.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:Rn.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:Q(Rn.link,Rn.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:Rn.static,children:r.label}),!i&&d.jsx(aB,{className:Rn.separator})]},r.id)})})})}function aB({className:e}){return d.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:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const lB="menu-module__wrapper___WCtoy",cB="menu-module__menu___i40Wj",uB="menu-module__surface___SJbaB",dB="menu-module__list___YjCfD",fB="menu-module__item___aqcgg",hB="menu-module__icon___1qUvA",pB="menu-module__label___MtQMh",mB="menu-module__danger___p9oZo",gB="menu-module__itemDisabled___HByLP",yB="menu-module__separator___g2uay",xB="menu-module__chalkboard___5jIwI",mn={wrapper:lB,menu:cB,surface:uB,list:dB,item:fB,icon:hB,label:pB,danger:mB,itemDisabled:gB,separator:yB,chalkboard:xB},vB=6;function wB(e){return"type"in e&&e.type==="separator"}function iS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=b.useId(),[o,a]=b.useState(!1),[l,c]=b.useState(null),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(()=>{var y,x;(x=(y=u.current)==null?void 0:y.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=b.useCallback(()=>a(!1),[]);Ru(o,()=>{p(),h()}),b.useEffect(()=>{if(!o)return;const y=x=>{var w,k;const S=x.target;(w=u.current)!=null&&w.contains(S)||(k=f.current)!=null&&k.contains(S)||p()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,p]),b.useEffect(()=>{if(!o){c(null);return}const y=()=>{u.current&&c(u.current.getBoundingClientRect())};return y(),document.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{document.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[o]),b.useEffect(()=>{var y,x;!o||!l||(x=(y=f.current)==null?void 0:y.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=y=>{var x,w,k,S,C;const P=Array.from(((x=f.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(P.length===0)return;const E=P.indexOf(document.activeElement);switch(y.key){case"ArrowDown":y.preventDefault(),(w=P[(E+1)%P.length])==null||w.focus();break;case"ArrowUp":y.preventDefault(),(k=P[(E-1+P.length)%P.length])==null||k.focus();break;case"Home":y.preventDefault(),(S=P[0])==null||S.focus();break;case"End":y.preventDefault(),(C=P[P.length-1])==null||C.focus();break;case"Tab":p();break}},g=y=>{var x;y.disabled||(p(),h(),(x=y.onSelect)==null||x.call(y))},v=e.props;return d.jsxs("span",{ref:u,className:mn.wrapper,children:[b.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:y=>{var x;(x=v.onClick)==null||x.call(v,y),a(w=>!w)}}),o&&l&&typeof document<"u"&&$s.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:Q(mn.menu,r==="chalkboard"&&mn.chalkboard,s),style:{position:"fixed",top:l.bottom+vB,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:mn.surface}),d.jsx("div",{className:mn.list,children:t.map(y=>wB(y)?d.jsx("div",{role:"separator",className:mn.separator},y.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:y.disabled,className:Q(mn.item,y.danger&&mn.danger,y.disabled&&mn.itemDisabled),onClick:()=>g(y),children:[y.icon&&d.jsx("span",{className:mn.icon,children:y.icon}),d.jsx("span",{className:mn.label,children:y.label})]},y.id))})]}),document.body)]})}const oS=({size:e=16})=>d.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:[d.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"}),d.jsx("path",{d:"M19 3v3"}),d.jsx("path",{d:"M20.5 4.5h-3"})]}),bB=({size:e=16})=>d.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:[d.jsx("path",{d:"M12 19V5"}),d.jsx("path",{d:"m5 12 7-7 7 7"})]}),kB=({size:e=16})=>d.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:[d.jsx("path",{d:"M12 5v14"}),d.jsx("path",{d:"m5 12 7 7 7-7"})]}),aS=({size:e=16})=>d.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:[d.jsx("circle",{cx:"18",cy:"18",r:"3"}),d.jsx("circle",{cx:"6",cy:"6",r:"3"}),d.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),d.jsx("path",{d:"M12 17v2"})]}),_B=({size:e=16})=>d.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:[d.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),d.jsx("polyline",{points:"21 3 21 9 15 9"})]}),lS=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"5",cy:"12",r:"2"}),d.jsx("circle",{cx:"12",cy:"12",r:"2"}),d.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),SB=({size:e=16})=>d.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:[d.jsx("path",{d:"m18 4 3 3-3 3"}),d.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),d.jsx("path",{d:"m18 20 3-3-3-3"}),d.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),d.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),CB=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M6 4l11 6-11 6z"})}),jB=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("rect",{x:"5",y:"5",width:"10",height:"10",rx:"1.5"})}),PB=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m7 4 6 6-6 6"})}),Dv=({size:e=12})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"10",cy:"10",r:"3"}),d.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),EB=({size:e=16})=>d.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:[d.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),d.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),Fv=({size:e=16})=>d.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:[d.jsx("path",{d:"M6 3v12"}),d.jsx("circle",{cx:"18",cy:"6",r:"3"}),d.jsx("circle",{cx:"6",cy:"18",r:"3"}),d.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),TB=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:d.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"})}),cS=({size:e=14})=>d.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:[d.jsx("title",{children:"Idea"}),d.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"})]}),Xm=({size:e=14})=>d.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:[d.jsx("title",{children:"Note"}),d.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),d.jsx("path",{d:"M15 3v6h6"})]}),kG=({size:e=14})=>d.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:[d.jsx("path",{d:"m3 12 4 4 7-8"}),d.jsx("path",{d:"m11 15 2 2 8-9"})]}),NB=({state:e,filesEmpty:t})=>d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(tS,{dismissible:!0,onDismiss:()=>e.setSuggestError(null),children:e.suggestError}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"flex-1 min-w-[140px]",children:d.jsx(Du,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:n=>e.setCommitTitle(n.currentTarget.value)})}),d.jsx(et,{icon:d.jsx(oS,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]});let uS="";function RB(e){uS=e}function G(e){return`${uS}${e}`}const un=45e3;async function Cn(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const IB=async()=>{const e=await fetch(G("/api/git/status"),{signal:AbortSignal.timeout(un)});return await Cn(e,"Failed to load git status"),e.json()},AB=async()=>{const e=await fetch(G("/api/git/diff"),{signal:AbortSignal.timeout(un)});return await Cn(e,"Failed to load diff"),(await e.json()).files},MB=async e=>{const t=await fetch(G(`/api/git/stash-diff?index=${e}`),{signal:AbortSignal.timeout(un)});return await Cn(t,"Failed to load stash diff"),(await t.json()).patch},Jh=async(e,t,n)=>{const r=await fetch(G("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n}),signal:AbortSignal.timeout(un)});await Cn(r,"Commit failed")},LB=async e=>{const t=await fetch(G("/api/git/stage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(un)});await Cn(t,"Stage failed")},_G=async e=>{const t=await fetch(G("/api/git/unstage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(un)});await Cn(t,"Unstage failed")},DB=async()=>{const e=await fetch(G("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(un)});await Cn(e,"Push failed")},dS=async e=>{const t=await fetch(G("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Cn(t,"Failed to suggest a commit message"),t.json()},FB=async()=>{const e=await fetch(G("/api/git/sync"),{method:"POST",signal:AbortSignal.timeout(un)});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 Cn(e,"Sync failed"),{ok:!0}},OB=async()=>{const e=await fetch(G("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(un)});await Cn(e,"Pull failed")},$B=async()=>{const e=await fetch(G("/api/git/fix-divergence"),{method:"POST",signal:AbortSignal.timeout(un)});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 Cn(e,"Fix failed"),{ok:!0}},zB=async e=>{const t=await fetch(G("/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})`}}},BB=async e=>{const t=await fetch(G("/api/git/complete-idea"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(un)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to complete idea");return{branch:n.branch,remoteDeleted:n.remoteDeleted,needsAttention:n.needsAttention}},VB=async e=>{const t=await fetch(G("/api/git/branch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(un)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return{branch:n.branch,warning:n.warning}},UB={},Ov=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(UB?"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()}},c=t=e(r,s,l);return l},WB=e=>e?Ov(e):Ov,fS={},{useDebugValue:HB}=Ei,{useSyncExternalStoreWithSelector:GB}=KT;let $v=!1;const KB=e=>e;function YB(e,t=KB,n){(fS?"production":void 0)!=="production"&&n&&!$v&&(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"),$v=!0);const r=GB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return HB(r),r}const qB=e=>{(fS?"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"?WB(e):e,n=(r,s)=>YB(t,r,s);return Object.assign(n,t),n},QB=e=>qB,hS=async()=>{const e=await fetch(G("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},XB=async()=>{const e=await fetch(G("/api/agent/auth-status"));return e.ok?await e.json():null},SG=async()=>{try{const e=await fetch(G("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},CG=async e=>{try{const t=await fetch(G(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},Jm=async()=>{try{const e=await fetch(G("/api/config"));return e.ok?e.json():null}catch{return null}},jG=async e=>{try{const t=await fetch(G("/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}}},JB=async()=>{try{const e=await fetch(G("/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}},PG=async e=>{try{return(await fetch(G("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},ZB=async()=>{try{const e=await fetch(G("/api/package-name"));return e.ok?e.json():null}catch{return null}},Kt=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},e4=async()=>(await fetch(G("/api/agent/status"))).json(),t4=async()=>(await fetch(G("/api/agent/reconcile-queue"))).json(),n4=async(e,t)=>{const n=await fetch(G("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await Kt(n)},r4=async(e,t)=>{const n=await fetch(G("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Kt(n)},s4=async(e,t)=>{const n=await fetch(G("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Kt(n)},i4=async(e,t)=>{const n=await fetch(G("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Kt(n)},o4=async(e,t)=>{const n=await fetch(G("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Kt(n)},a4=async e=>{const t=await fetch(G("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await Kt(t)},l4=async()=>{const e=await fetch(G("/api/agent/launch-reconcile-all"),{method:"POST"});await Kt(e)},c4=async e=>{const t=await fetch(G("/api/agent/launch-draft-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})});await Kt(t)},u4=async e=>{const t=await fetch(G("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Kt(t)},d4=async e=>{const t=await fetch(G("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Kt(t)},f4=async e=>{const t=await fetch(G("/api/agent/launch-pr-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Kt(t)},h4=async(e,t,n,r)=>{const s=await fetch(G("/api/agent/issue-fix"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e,title:t,reason:n,output:r})});await Kt(s)},EG=async e=>{const t=await fetch(G("/api/agent/promote-issue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issue:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to promote issue (${t.status})`);return n},p4=async e=>{try{const t=await fetch(G(`/api/agent/pr-review-status?planId=${encodeURIComponent(e)}`));return t.ok?t.json():null}catch{return null}},m4=async(e,t,n)=>{const r=await fetch(G("/api/agent/feedback-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t,context:n})}),s=await r.json();if(!r.ok)throw new Error(s.error??"Failed to send message");return s},zv=async(e,t,n,r)=>{const s=await fetch(G("/api/agent/feedback-promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,index:t,target:n,note:r})});if(!s.ok){const i=await s.json().catch(()=>null);throw new Error((i==null?void 0:i.error)??`Failed to promote message (${s.status})`)}},g4=async e=>{const t=await fetch(G("/api/agent/feedback-summarize"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to summarize feedback (${t.status})`);return n},y4=async(e,t)=>{const n=await fetch(G("/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},x4=async e=>{const t=await fetch(G("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await Kt(t,"Stop failed")},v4=async()=>(await fetch(G("/api/agent/login-relay/start"),{method:"POST"})).json(),w4=async()=>(await fetch(G("/api/agent/login-relay/status"))).json(),b4=async()=>{await fetch(G("/api/agent/login-relay/cancel"),{method:"POST"})},k4=async()=>{const e=await fetch(G("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},pS=async e=>{const t=await fetch(G(`/api/checks/run?name=${encodeURIComponent(e)}`),{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to run check"}));throw new Error(n.error??"Failed to run check")}};function dt(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 gn(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let _4=0;const Bv=()=>`preview-${++_4}`;function S4(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:dt(e,XB,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await e4(),r=t().agentStatus;if(e({agentStatus:n}),n.some(u=>{if(u.taskKind!=="issue-fix"||u.status!=="done"&&u.status!=="error")return!1;const f=r.find(h=>h.id===u.id);return f&&f.status!=="done"&&f.status!=="error"})&&t().loadTaskLog(),n.find(u=>{var h;if(u.status!=="done"||u.taskKind!=="run-all"&&u.taskKind!=="phase")return!1;const f=r.find(p=>p.id===u.id);if(!f||f.status==="done"||f.status==="error")return!1;if(u.taskKind==="phase"){const p=(h=t().plans)==null?void 0:h.entries.find(m=>m.id===u.planId);if(!p||u.phaseIndex!==p.phases.length-1)return!1}return!0})){t().runConsistencyCheck();for(const u of["lint","test"])pS(u).catch(()=>{})}const o=t().pendingReconcile,a=o?n.find(u=>u.taskKind==="reconcile"&&u.planId===o.planId):void 0;o&&a&&(a.status==="done"?(await t().loadPlans(),e(u=>({reconcileQueue:[...u.reconcileQueue,{...o,previewId:Bv()}],pendingReconcile:null}))):a.status==="error"&&e({pendingReconcile:null}));const l=n.find(u=>u.taskKind==="batch-reconcile"||u.taskKind==="batch-draft"),c=(l==null?void 0:l.taskKind)==="batch-draft"?l.status==="done"||l.status==="error":(l==null?void 0:l.status)==="done";if(l&&c&&!t().batchReconcileConsumed){if(l.taskKind==="batch-reconcile"){const u=await t4();u&&u.length>0&&(await t().loadPlans(),e(f=>({reconcileQueue:[...f.reconcileQueue,...u.map(h=>({planId:h.planId,before:h.before,previewId:Bv()}))]})))}else await t().loadPlans();e({batchReconcileConsumed:!0})}}catch{}},launchAgent:gn(t,n4),launchPlanAudit:gn(t,r4),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 s4(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:gn(t,i4),launchIdeaExtend:gn(t,o4),launchBatchReconcile:gn(t,async()=>{e({batchReconcileConsumed:!1}),await l4()}),launchBatchDraft:gn(t,async n=>{e({batchReconcileConsumed:!1}),await c4(n)}),launchSuggestIdeas:gn(t,a4),launchRunAll:gn(t,u4),launchFixReview:gn(t,d4),launchPrReview:gn(t,f4),launchIssueFix:gn(t,h4),stopAgent:async n=>{try{await x4(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await v4();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:dt(e,w4,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await b4()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}function C4(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:dt(e,AB,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})},manuallyExpandedDiffPaths:new Set,manuallyCollapsedDiffPaths:new Set,setDiffCollapsed:(n,r)=>{e(s=>{const i=new Set(s.manuallyExpandedDiffPaths),o=new Set(s.manuallyCollapsedDiffPaths);return r?(o.add(n),i.delete(n)):(i.add(n),o.delete(n)),{manuallyExpandedDiffPaths:i,manuallyCollapsedDiffPaths:o}})},expandDiffPath:n=>t().setDiffCollapsed(n,!1)}}const j4=async()=>(await fetch(G("/api/tasks"))).json(),TG=async e=>{const t=await fetch(G(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},P4=async()=>(await fetch(G("/api/suggestions"))).json(),E4=async e=>{const t=await fetch(G("/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()},T4=async e=>{const t=await fetch(G("/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)}},N4=async()=>(await fetch(G("/api/docs"))).json(),mS=async()=>{const e=await fetch(G("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},R4=async(e,t,n,r)=>{const s=await fetch(G("/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()},NG=async(e,t,n)=>{const r=await fetch(G("/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)}},RG=async(e,t,n)=>{const r=await fetch(G("/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)}},I4=async()=>(await fetch(G("/api/consistency"))).json(),A4=async()=>(await fetch(G("/api/doctor"))).json(),M4=45e3,gS=async()=>(await fetch(G("/api/ideas"),{signal:AbortSignal.timeout(M4)})).json(),L4=async()=>(await fetch(G("/api/archivable-ideas"))).json(),D4=async e=>{const t=await fetch(G("/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},yS=async e=>{const t=await fetch(G("/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},F4=async(e,t)=>{const n=await fetch(G("/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},O4=async()=>{const e=await fetch(G("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},$4=async()=>{const e=await fetch(G("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},z4=async e=>{const t=await fetch(G("/api/notifications/mark-read"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(!t.ok)throw new Error(`Failed to mark notification read: ${t.status}`)},B4=async()=>{const e=await fetch(G("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},V4=45e3,xS=async()=>(await fetch(G("/api/plans"),{signal:AbortSignal.timeout(V4)})).json(),U4=async(e,t)=>{const n=await fetch(G(`/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})`)}},W4=async()=>{const e=await fetch(G("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},IG=async e=>{const t=await fetch(G(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function H4(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await N4();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}),releaseVersions:[],releaseVersionsLoading:!0,loadReleaseVersions:async()=>{e({releaseVersionsLoading:!0});try{const n=await W4();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function G4(e,t){return{ideaEntries:[],loadIdeas:dt(e,gS,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:dt(e,L4,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await D4(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function K4(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:dt(e,$4,n=>({notifications:n,notificationsError:null}),n=>({notificationsError:String(n)}),"notificationsLoading"),markRead:async n=>{const r=t().notifications;if(r){e({notifications:r.map(s=>s.kind!=="question"&&s.id===n?{...s,read:!0}:s)});try{await z4(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function Y4(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:dt(e,B4,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Zh=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`},vS=e=>{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),s=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?`as of ${s}`:`as of ${t.toLocaleDateString()} ${s}`},wS=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)}},bS=e=>wS(e.phases),Vv=e=>{var t;return((t=bS(e))==null?void 0:t.pct)??null},q4=e=>wS([...e.phases,...e.fixes??[]]),Q4=(e,t)=>{const n=q4(e);if(!n)return null;const r=Math.min(n.total,n.done+t);return{done:n.done,total:n.total,pct:r/n.total*100}},Fu=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,X4=(e,t)=>e?t.find(n=>n.planId===e&&n.taskKind==="pr-review"&&n.status!=="done"&&n.status!=="error"):void 0,J4=e=>{var t;return(t=[...e??[]].reverse().find(n=>n.kind==="review"))==null?void 0:t.text},Ou=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:Fu(e.id,t)?"in-progress":e.status,Z4=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done),e5=(e,t)=>{const n=[];return e.phases.length>0&&e.phases.every(r=>r.done)||n.push("open phases"),(e.fixes??[]).every(r=>r.done)||n.push("open fixes"),e.pr?e.pr.reviewDecision==="changes-requested"&&n.push("requested changes"):n.push("an open PR"),t!==!0&&n.push("CI"),{ready:n.length===0,missing:n}};function nf(e,t){const n=e.split(/(\s+)/).filter(u=>u!==""),r=t.split(/(\s+)/).filter(u=>u!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let u=s-1;u>=0;u--)for(let f=i-1;f>=0;f--)o[u][f]=n[u]===r[f]?o[u+1][f+1]+1:Math.max(o[u+1][f],o[u][f+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l]===r[c]?(a.push({type:"same",text:n[l]}),l++,c++):o[l+1][c]>=o[l][c+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[c]}),c++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;c<i;)a.push({type:"added",text:r[c]}),c++;return t5(a)}function t5(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 n5=["idea","planned","in-progress","review","done","dropped"],AG=["claude-code","opencode"],r5={"claude-code":"Claude Code",opencode:"OpenCode"},MG={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},LG={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"},codeReview:{agent:"claude-code",model:"opus",effort:"high"}};function DG(e,t){return e.agent===t.agent&&(e.model??"")===(t.model??"")}const s5=["in-progress","review","planned","idea"],i5=["open"],Zm={statuses:s5,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:i5,subject:null,groupBySubject:!0},Uv={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},El=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},Wv=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Hv=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},rf=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Gv=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),ac=(e,t)=>t===null||e===t,Kv=e=>e.status==="in-progress"||e.status==="review"?0:1,kS=(e,t,n,r="asc")=>{const s=Kv(e)-Kv(t);if(s!==0)return s;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:Wv(e)-Wv(t);const i=(()=>{switch(n){case"status":{const o=Uv[e.status]-Uv[t.status];return o!==0?o:El(t)-El(e)}case"updated":return El(t)-El(e);case"title":return e.title.localeCompare(t.title);case"id":return Hv(e)-Hv(t);case"progress":return(Vv(t)??-1)-(Vv(e)??-1);default:return 0}})();return r==="desc"?-i:i},ep=(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},Wo=(e,t=Zm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=ep(e.filter(a=>Gv(a,n)&&rf(a,t.search)&&ac(a.subject,t.subject)),a=>[a.status]);for(const a of n5)s[a]??(s[a]=0);const i=ep(e.filter(a=>r.has(a.status)&&rf(a,t.search)&&ac(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Gv(a,n)&&rf(a,t.search)&&ac(a.subject,t.subject)).sort((a,l)=>kS(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},o5=["open","done","dropped"],a5={open:"idea",done:"done",dropped:"dropped"},Yv=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},l5=e=>e.type==="plan"?e.plan.subject:e.type==="fix"?e.fix.subject:e.idea.subject,c5=e=>e.type==="plan"?e.plan.order:e.type==="fix"?e.fix.order:e.idea.order,u5=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.type==="fix"?e.fix.updated??e.fix.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},qv=(e,t)=>e.reduce((n,r)=>{const s=c5(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Qv=e=>e.reduce((t,n)=>Math.max(t,u5(n)),0),d5=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=l5(l);if(!c||n&&!n.includes(c)){s.push(l);continue}r.has(c)||r.set(c,[]),(a=r.get(c))==null||a.push(l)}const i=t==="desc"?-1:1,o=[...r.entries()].map(([l,c])=>({subject:l,rows:c})).sort((l,c)=>{const u=qv(l.rows,t),f=qv(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:Qv(c.rows)-Qv(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Xv=e=>e.type==="plan"?e.plan:e.type==="fix"?e.fix:{title:e.idea.title,id:e.idea.id??void 0,status:a5[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order},f5=(e,t,n=Zm)=>{const r=new Map(e.map(p=>[p.id,p.subject])),s=e.map(p=>p.entityKind==="fix"?{...p,subject:p.idea&&r.get(p.idea)||void 0}:p),i=s.filter(p=>p.entityKind==="fix"),o=s.filter(p=>p.entityKind!=="fix"),{statusCounts:a,tagCounts:l}=Wo(s,n),c=t.filter(p=>p.kind==="note"),u=new Set(n.noteStatuses),f=ep(c.filter(p=>Yv(p,n.search)),p=>[p.status??"open"]);for(const p of o5)f[p]??(f[p]=0);const h=Wo(o,n).rows.map(p=>({type:"plan",plan:p}));h.push(...Wo(i,n).rows.map(p=>({type:"fix",fix:p})));for(const p of c)u.has(p.status??"open")&&Yv(p,n.search)&&ac(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>kS(Xv(p),Xv(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:a,tagCounts:l,noteStatusCounts:f}},h5=.2,p5=5,_S=3,SS=2,CS=1,m5=_S+SS+CS,g5=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"]),Tl=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!g5.has(n));return new Set(t)},sf=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function y5(e,t,n={}){const{threshold:r=h5,limit:s=p5}=n,i=Tl(e);if(i.size===0)return[];const o=[];for(const a of t){const l=Tl(a.title),c=Tl(a.body),u=Tl((a.tags??[]).join(" ")),h=(sf(i,l)*_S+sf(i,u)*SS+sf(i,c)*CS)/(i.size*m5);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const x5=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}`},v5=(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=[x5(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},w5=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)=>v5(r,s))},b5=e=>`Fix the failing "${e}" check`,k5=({cmd:e,output:t})=>`The command was \`${e}\`.
|
|
66
|
+
|
|
67
|
+
Output from the last run:
|
|
68
|
+
|
|
69
|
+
${t||"(no output captured)"}`,_5=(e,t)=>{const n=i=>t.find(o=>o.name===i),r=n("lint"),s=n("test");return[{name:"Quality",results:r?[r]:[]},{name:"Tests",results:s?[s]:[]},{name:"Consistency",results:[e.consistency]}]},S5=(e,t)=>_5(e,t).flatMap(({name:n,results:r})=>{const s=r.filter(o=>o.status==="fail");if(s.length===0)return[];const i=s.map(k5).join(`
|
|
70
|
+
|
|
71
|
+
`);return[{done:!1,text:b5(n),description:`Fix the failing "${n}" check in this repo.
|
|
72
|
+
|
|
73
|
+
${i}`}]}),C5=(e,t,n)=>{const r=new Map(S5(t,n).map(i=>[i.text,i]));return[...e.map(i=>{const o=r.get(i.text);return o?(r.delete(i.text),o):i}),...r.values()]},j5=/^[a-z]+\([a-z-]+\):\s+/,P5=e=>e.replace(j5,""),E5=(e,t)=>[...e,{done:!0,text:P5(t),source:"manual"}],jS="papercamp/",T5=e=>e.length>0&&e.every(t=>t.startsWith(jS)),N5=e=>`${jS}ideas/${e}.md`,R5=14*24*60*60*1e3;function Aa(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.storedAt>R5?(localStorage.removeItem(e),null):n.value}catch{return null}}function Ma(e,t){try{const n={value:t,storedAt:Date.now()};localStorage.setItem(e,JSON.stringify(n))}catch{}}function eg(e){try{localStorage.removeItem(e)}catch{}}const PS="plan-filters",ES="detail-view";function I5(){return Aa(PS)??Zm}function A5(){return Aa(ES)??"details"}function kr(e){return Ma(PS,e),e}function M5(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:dt(e,xS,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:I5(),togglePlanStatus:n=>e(r=>({planFilters:kr({...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]})})),togglePlanTag:n=>e(r=>({planFilters:kr({...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]})})),toggleNoteStatus:n=>e(r=>({planFilters:kr({...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]})})),setPlanSearch:n=>e(r=>({planFilters:kr({...r.planFilters,search:n})})),setSubjectFilter:n=>e(r=>({planFilters:kr({...r.planFilters,subject:n})})),setPlanSortKey:n=>e(r=>({planFilters:kr({...r.planFilters,sortKey:n,groupBySubject:!1})})),togglePlanSortDirection:()=>e(n=>({planFilters:kr({...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc",groupBySubject:!1})})),toggleGroupBySubject:()=>e(n=>({planFilters:kr({...n.planFilters,groupBySubject:!n.planFilters.groupBySubject})})),detailView:A5(),setDetailView:n=>{Ma(ES,n),e({detailView:n})}}}const L5={horizons:[],statuses:[]},D5=e=>[...new Set(e.links.map(t=>t.status))],TS=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),NS=(e,t)=>t.length===0||t.includes(e),FG=(e,t)=>e.horizons.filter(n=>NS(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>TS(r,t.statuses))})),OG=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>TS(r,t.statuses)).length])),$G=(e,t)=>{const n={};for(const r of e.horizons)if(NS(r.title,t.horizons))for(const s of r.items)for(const i of D5(s))n[i]=(n[i]??0)+1;return n};function F5(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:dt(e,mS,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:L5,toggleRoadmapHorizon:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,horizons:r.roadmapFilters.horizons.includes(n)?r.roadmapFilters.horizons.filter(s=>s!==n):[...r.roadmapFilters.horizons,n]}})),toggleRoadmapStatus:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,statuses:r.roadmapFilters.statuses.includes(n)?r.roadmapFilters.statuses.filter(s=>s!==n):[...r.roadmapFilters.statuses,n]}}))}}const O5=async()=>(await fetch(G("/api/status"))).json(),$5=async()=>{await fetch(G("/api/status/check?name=consistency"),{method:"POST"})},z5=async()=>{const e=await fetch(G("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function B5(e,t){return{status:null,refreshing:!1,loadStatus:dt(e,O5,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await z5().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDoctor(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runConsistencyCheck:async()=>{try{await $5()}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 dS(i);return await Jh(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:dt(e,I4,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:dt(e,A4,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,gitStashes:[],loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a,stashes:l}=await IB();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a,gitStashes:l}),!0}catch{return!1}},capabilities:[],loadCapabilities:dt(e,hS,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function V5(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:dt(e,P4,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await E4(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await T4(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await R4(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await O4();return await t().refreshAll(),n}}}function U5(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:dt(e,j4,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const M=QB()((e,t)=>({...M5(e),...F5(e),...G4(e,t),...V5(e,t),...U5(e),...H4(e,t),...B5(e,t),...S4(e,t),...C4(e,t),...Y4(e),...K4(e,t)})),$u=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),fr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),RS=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},W5=e=>e.capabilities.filter(t=>t.status!=="ok").length,H5=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},G5=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null},K5=({children:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"bg-transparent border-none p-0 text-watercolor-amber-dark cursor-pointer underline [font:inherit]",children:e}),Y5=e=>e<=0?"today":e===1?"1 day ago":`${e} days ago`,q5="A sync pop failed and left work parked here. Recover with `git restore --source=origin/main --staged --worktree .` then `git merge --ff-only`.",Q5=({entry:e})=>{const[t,n]=b.useState(null),[r,s]=b.useState(!1),[i,o]=b.useState(null),[a,l]=b.useState(!1),c=async()=>{if(a){l(!1);return}if(l(!0),!(t!==null||r)){s(!0),o(null);try{n(await MB(e.index))}catch(u){o(u.message)}finally{s(!1)}}};return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs(K5,{onClick:c,children:[e.branch,": ",e.message," · ",Y5(e.ageDays)]}),a&&d.jsx("pre",{className:"m-0 max-h-64 overflow-auto whitespace-pre-wrap font-mono text-2xs opacity-80",children:r?"Loading…":i??t})]})},X5=()=>{const e=M(s=>s.gitStashes),[t,n]=b.useState(!1);if(e.length===0)return null;const r=e.some(s=>s.own);return d.jsxs("div",{children:[d.jsx("button",{type:"button",onClick:()=>n(s=>!s),className:"inline-flex bg-none bg-transparent border-none p-0 cursor-pointer","aria-expanded":t,children:d.jsxs(le,{size:"small",variant:r?"warning":"neutral",children:[e.length," stash",e.length===1?"":"es"]})}),t&&d.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r&&d.jsx("p",{className:"m-0 text-2xs opacity-80",children:q5}),e.map(s=>d.jsx(Q5,{entry:s},s.index))]})]})};function Fe(e){const t=e.split(`
|
|
74
|
+
`).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}function Nl(e,t){const{toast:n}=He(),r=M(o=>o.activeGitAction),s=M(o=>o.setActiveGitAction),i=b.useCallback(async o=>{if(!M.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Fe(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function J5(){const e=M(S=>S.loadGitStatus),t=M(S=>S.loadPlans),n=M(S=>S.loadIdeas),r=M(S=>S.loadDiffFiles),s=M(S=>S.activeGitAction!==null),{toast:i,dismiss:o}=He(),a=()=>Promise.all([e(),t(),n(),r()]),[l,c]=Nl("push","Push failed"),[u,f]=Nl("sync","Sync failed"),[h,p]=Nl("pull","Pull failed"),[m,g]=Nl("fix-divergence","Fix failed"),v=b.useCallback((S,C)=>{if(C.recovering)return i({title:`${S} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in C){const{conflictPrompt:P,message:E}=C,T=i({title:`${S} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:Fe(E)}),d.jsx(oe,{size:"small",onClick:async()=>{const j=await zB(P).catch(N=>({ok:!1,error:Fe(N.message)}));j.ok&&o(T),i({title:j.ok?"Resolving conflict":"Could not start the agent",description:j.ok?"Handed off to the agent — see Stack for progress":j.error??"The agent did not start.",variant:j.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[i,o]);return{pushing:l,syncing:u,pulling:h,fixingDivergence:m,gitActionBusy:s,handlePush:()=>c(async()=>{await DB(),await Promise.all([e(),r()])}),handleSync:()=>f(async()=>{const S=await FB();if(!S.ok){if(v("Sync",S)){await e();return}throw new Error(S.message)}await a()}),handlePull:()=>p(async()=>{await OB(),await a()}),handleFixDivergence:()=>g(async()=>{const S=await $B();if(!S.ok){if(v("Fix",S)){await e();return}throw new Error(S.message)}await a()})}}const Z5=()=>{const e=M(c=>c.gitAhead),t=M(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=J5();return d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[d.jsx(xe,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(oe,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx(aS,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(oe,{size:"small",className:"whitespace-nowrap",icon:d.jsx(bB,{size:14}),disabled:i||e===0,onClick:o,children:n?"Pushing…":e>0?`Push (${e})`:"Push"}),d.jsx(oe,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx(kB,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})};function eV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const tV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rV={};function Jv(e,t){return(rV.jsx?nV:tV).test(e)}const sV=/[ \t\n\f\r]/g;function iV(e){return typeof e=="object"?e.type==="text"?Zv(e.value):!1:Zv(e)}function Zv(e){return e.replace(sV,"")===""}class La{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}La.prototype.normal={};La.prototype.property={};La.prototype.space=void 0;function IS(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new La(n,r,t)}function tp(e){return e.toLowerCase()}class Et{constructor(t,n){this.attribute=n,this.property=t}}Et.prototype.attribute="";Et.prototype.booleanish=!1;Et.prototype.boolean=!1;Et.prototype.commaOrSpaceSeparated=!1;Et.prototype.commaSeparated=!1;Et.prototype.defined=!1;Et.prototype.mustUseProperty=!1;Et.prototype.number=!1;Et.prototype.overloadedBoolean=!1;Et.prototype.property="";Et.prototype.spaceSeparated=!1;Et.prototype.space=void 0;let oV=0;const te=Vs(),Oe=Vs(),np=Vs(),W=Vs(),ge=Vs(),Rs=Vs(),Mt=Vs();function Vs(){return 2**++oV}const rp=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Oe,commaOrSpaceSeparated:Mt,commaSeparated:Rs,number:W,overloadedBoolean:np,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),of=Object.keys(rp);class tg extends Et{constructor(t,n,r,s){let i=-1;if(super(t,n),e0(this,"space",s),typeof r=="number")for(;++i<of.length;){const o=of[i];e0(this,of[i],(r&rp[o])===rp[o])}}}tg.prototype.defined=!0;function e0(e,t,n){n&&(e[t]=n)}function Ji(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new tg(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[tp(r)]=r,n[tp(i.attribute)]=r}return new La(t,n,e.space)}const AS=Ji({properties:{ariaActiveDescendant:null,ariaAtomic:Oe,ariaAutoComplete:null,ariaBusy:Oe,ariaChecked:Oe,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Oe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Oe,ariaFlowTo:ge,ariaGrabbed:Oe,ariaHasPopup:null,ariaHidden:Oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:W,ariaLive:null,ariaModal:Oe,ariaMultiLine:Oe,ariaMultiSelectable:Oe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Oe,ariaReadOnly:Oe,ariaRelevant:null,ariaRequired:Oe,ariaRoleDescription:ge,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Oe,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 MS(e,t){return t in e?e[t]:t}function LS(e,t){return MS(e,t.toLowerCase())}const aV=Ji({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Rs,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alpha:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:ge,autoFocus:te,autoPlay:te,blocking:ge,capture:null,charSet:null,checked:te,cite:null,className:ge,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:Oe,controls:te,controlsList:ge,coords:W|Rs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:np,draggable:Oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:ge,height:W,hidden:np,high:W,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:ge,itemRef:ge,itemScope:te,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:W,pattern:null,ping:ge,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:ge,required:te,reversed:te,rows:W,rowSpan:W,sandbox:ge,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootCustomElementRegistry:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shadowRootSerializable:te,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Oe,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:te,useMap:null,value:Oe,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,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:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Oe,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:te,disablePictureInPicture:te,disableRemotePlayback:te,exportParts:Rs,part:ge,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:LS}),lV=Ji({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:Mt,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:ge,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:te,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:Rs,g2:Rs,glyphName:Rs,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:Mt,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:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mt,rev:Mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mt,requiredFeatures:Mt,requiredFonts:Mt,requiredFormats:Mt,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:Mt,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:Mt,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:Mt,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:MS}),DS=Ji({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()}}),FS=Ji({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LS}),OS=Ji({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),cV={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"},uV=/[A-Z]/g,t0=/-[a-z]/g,dV=/^data[-\w.:]+$/i;function fV(e,t){const n=tp(t);let r=t,s=Et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(t0,pV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!t0.test(i)){let o=i.replace(uV,hV);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=tg}return new s(r,t)}function hV(e){return"-"+e.toLowerCase()}function pV(e){return e.charAt(1).toUpperCase()}const mV=IS([AS,aV,DS,FS,OS],"html"),ng=IS([AS,lV,DS,FS,OS],"svg");function gV(e){return e.join(" ").trim()}var rg={},n0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,yV=/\n/g,xV=/^\s*/,vV=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wV=/^:\s*/,bV=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,kV=/^[;\s]*/,_V=/^\s+|\s+$/g,SV=`
|
|
75
|
+
`,r0="/",s0="*",gs="",CV="comment",jV="declaration";function PV(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 g=m.match(yV);g&&(n+=g.length);var v=m.lastIndexOf(SV);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var v=g[0];return s(v),e=e.slice(v.length),g}}function c(){l(xV)}function u(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(r0!=e.charAt(0)||s0!=e.charAt(1))){for(var g=2;gs!=e.charAt(g)&&(s0!=e.charAt(g)||r0!=e.charAt(g+1));)++g;if(g+=2,gs===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,s(v),e=e.slice(g),r+=2,m({type:CV,comment:v})}}function h(){var m=i(),g=l(vV);if(g){if(f(),!l(wV))return a("property missing ':'");var v=l(bV),y=m({type:jV,property:i0(g[0].replace(n0,gs)),value:v?i0(v[0].replace(n0,gs)):gs});return l(kV),y}}function p(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),p()}function i0(e){return e?e.replace(_V,gs):gs}var EV=PV,TV=uc&&uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rg,"__esModule",{value:!0});rg.default=RV;const NV=TV(EV);function RV(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,NV.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 zu={};Object.defineProperty(zu,"__esModule",{value:!0});zu.camelCase=void 0;var IV=/^--[a-zA-Z0-9_-]+$/,AV=/-([a-z])/g,MV=/^[^-]+$/,LV=/^-(webkit|moz|ms|o|khtml)-/,DV=/^-(ms)-/,FV=function(e){return!e||MV.test(e)||IV.test(e)},OV=function(e,t){return t.toUpperCase()},o0=function(e,t){return"".concat(t,"-")},$V=function(e,t){return t===void 0&&(t={}),FV(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(DV,o0):e=e.replace(LV,o0),e.replace(AV,OV))};zu.camelCase=$V;var zV=uc&&uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},BV=zV(rg),VV=zu;function sp(e,t){var n={};return!e||typeof e!="string"||(0,BV.default)(e,function(r,s){r&&s&&(n[(0,VV.camelCase)(r,t)]=s)}),n}sp.default=sp;var UV=sp;const WV=su(UV),$S=zS("end"),sg=zS("start");function zS(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 HV(e){const t=sg(e),n=$S(e);if(t&&n)return{start:t,end:n}}function Ho(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?a0(e.position):"start"in e||"end"in e?a0(e):"line"in e||"column"in e?ip(e):""}function ip(e){return l0(e&&e.line)+":"+l0(e&&e.column)}function a0(e){return ip(e&&e.start)+"-"+ip(e&&e.end)}function l0(e){return e&&typeof e=="number"?e:1}class at 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=Ho(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}}at.prototype.file="";at.prototype.name="";at.prototype.reason="";at.prototype.message="";at.prototype.stack="";at.prototype.column=void 0;at.prototype.line=void 0;at.prototype.ancestors=void 0;at.prototype.cause=void 0;at.prototype.fatal=void 0;at.prototype.place=void 0;at.prototype.ruleId=void 0;at.prototype.source=void 0;const ig={}.hasOwnProperty,GV=new Map,KV=/[A-Z]/g,YV=new Set(["table","tbody","thead","tfoot","tr"]),qV=new Set(["td","th"]),BS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function QV(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=s6(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=r6(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"?ng:mV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=VS(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function VS(e,t,n){if(t.type==="element")return XV(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return JV(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return e6(e,t,n);if(t.type==="mdxjsEsm")return ZV(e,t);if(t.type==="root")return t6(e,t,n);if(t.type==="text")return n6(e,t)}function XV(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ng,e.schema=s),e.ancestors.push(t);const i=WS(e,t.tagName,!1),o=i6(e,t);let a=ag(e,t);return YV.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!iV(l):!0})),US(e,o,i,t),og(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function JV(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)}ba(e,t.position)}function ZV(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ba(e,t.position)}function e6(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ng,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:WS(e,t.name,!0),o=o6(e,t),a=ag(e,t);return US(e,o,i,t),og(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function t6(e,t,n){const r={};return og(r,ag(e,t)),e.create(t,e.Fragment,r,n)}function n6(e,t){return t.value}function US(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function og(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function r6(e,t,n){return r;function r(s,i,o,a){const c=Array.isArray(o.children)?n:t;return a?c(i,o,a):c(i,o)}}function s6(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=sg(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 i6(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&ig.call(t.properties,s)){const i=a6(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&qV.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 o6(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 ba(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 ba(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function ag(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:GV;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 c=s.get(l)||0;o=l+"-"+c,s.set(l,c+1)}}const a=VS(e,i,o);a!==void 0&&n.push(a)}return n}function a6(e,t,n){const r=fV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?eV(n):gV(n)),r.property==="style"){let s=typeof n=="object"?n:l6(e,String(n));return e.stylePropertyNameCase==="css"&&(s=c6(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?cV[r.property]||r.property:r.attribute,n]}}function l6(e,t){try{return WV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new at("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=BS+"#cannot-parse-style-attribute",s}}function WS(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=Jv(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=Jv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return ig.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ba(e)}function ba(e,t){const n=new at("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=BS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function c6(e){const t={};let n;for(n in e)ig.call(e,n)&&(t[u6(n)]=e[n]);return t}function u6(e){let t=e.replace(KV,d6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function d6(e){return"-"+e.toLowerCase()}const af={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"]},f6={};function h6(e,t){const n=f6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return HS(e,r,s)}function HS(e,t,n){if(p6(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 c0(e.children,t,n)}return Array.isArray(e)?c0(e,t,n):""}function c0(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=HS(e[s],t,n);return r.join("")}function p6(e){return!!(e&&typeof e=="object")}const u0=document.createElement("i");function lg(e){const t="&"+e+";";u0.innerHTML=t;const n=u0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(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 en(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const d0={}.hasOwnProperty;function m6(e){const t={};let n=-1;for(;++n<e.length;)g6(t,e[n]);return t}function g6(e,t){let n;for(n in t){const s=(d0.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){d0.call(s,o)||(s[o]=[]);const a=i[o];y6(s[o],Array.isArray(a)?a:a?[a]:[])}}}function y6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Wn(e,0,0,r)}function GS(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 ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $n=ss(/[A-Za-z]/),Ot=ss(/[\dA-Za-z]/),x6=ss(/[#-'*+\--9=?A-Z^-~]/);function op(e){return e!==null&&(e<32||e===127)}const ap=ss(/\d/),v6=ss(/[\dA-Fa-f]/),w6=ss(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function St(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const b6=ss(new RegExp("\\p{P}|\\p{S}","u")),k6=ss(/\s/);function ss(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Zi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Ot(e.charCodeAt(n+1))&&Ot(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 ke(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ce(l)?(e.enter(n),a(l)):t(l)}function a(l){return ce(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const _6={tokenize:S6};function S6(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"),ke(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 Z(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const C6={tokenize:j6},f0={tokenize:P6};function j6(e){const t=this,n=[];let r=0,s,i,o;return a;function a(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const k=t.events.length;let S=k,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}y(r);let P=k;for(;P<t.events.length;)t.events[P][1].end={...C},P++;return Wn(t.events,S+1,0,t.events.slice(k)),t.events.length=P,c(w)}return a(w)}function c(w){if(r===n.length){if(!s)return h(w);if(s.currentConstruct&&s.currentConstruct.concrete)return m(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(f0,u,f)(w)}function u(w){return s&&x(),y(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(f0,p,m)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){s&&x(),y(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(w)}function g(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return Z(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),g)}function v(w,k){const S=t.sliceStream(w);if(k&&S.push(null),w.previous=i,i&&(i.next=w),i=w,s.defineSkip(w.start),s.write(S),t.parser.lazy[w.start.line]){let C=s.events.length;for(;C--;)if(s.events[C][1].start.offset<o&&(!s.events[C][1].end||s.events[C][1].end.offset>o))return;const P=t.events.length;let E=P,T,j;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(T){j=t.events[E][1].end;break}T=!0}for(y(r),C=P;C<t.events.length;)t.events[C][1].end={...j},C++;Wn(t.events,E+1,0,t.events.slice(P)),t.events.length=C}}function y(w){let k=n.length;for(;k-- >w;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function P6(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function h0(e){if(e===null||St(e)||k6(e))return 1;if(b6(e))return 2}function cg(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 lp={name:"attention",resolveAll:E6,tokenize:T6};function E6(e,t){let n=-1,r,s,i,o,a,l,c,u;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 f={...e[r][1].end},h={...e[n][1].start};p0(f,-l),p0(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,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},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=en(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=en(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=en(c,cg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=en(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=en(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Wn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=h0(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 c=e.exit("attentionSequence"),u=h0(l),f=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function p0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const N6={name:"autolink",tokenize:R6};function R6(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 $n(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||Ot(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ot(p))&&r++<32?(e.consume(p),a):(r=0,c(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||op(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):x6(p)?(e.consume(p),c):n(p)}function u(p){return Ot(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):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||Ot(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const Bu={partial:!0,tokenize:I6};function I6(e,t,n){return r;function r(i){return ce(i)?ke(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Z(i)?t(i):n(i)}}const KS={continuation:{tokenize:M6},exit:L6,name:"blockQuote",tokenize:A6};function A6(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 ce(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function M6(e,t,n){const r=this;return s;function s(o){return ce(o)?ke(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(KS,t,n)(o)}}function L6(e){e.exit("blockQuote")}const YS={name:"characterEscape",tokenize:D6};function D6(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 w6(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const qS={name:"characterReference",tokenize:F6};function F6(e,t,n){const r=this;let s=0,i,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=Ot,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=v6,u):(e.enter("characterReferenceValue"),i=7,o=ap,u(f))}function u(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return o===Ot&&!lg(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),u):n(f)}}const m0={partial:!0,tokenize:$6},g0={concrete:!0,name:"codeFenced",tokenize:O6};function O6(e,t,n){const r=this,s={partial:!0,tokenize:S};let i=0,o=0,a;return l;function l(C){return c(C)}function c(C){const P=r.events[r.events.length-1];return i=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===a?(o++,e.consume(C),u):o<3?n(C):(e.exit("codeFencedFenceSequence"),ce(C)?ke(e,f,"whitespace")(C):f(C))}function f(C){return C===null||Z(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(m0,g,k)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(C)):ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function p(C){return C===null||Z(C)?f(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(C)):C===96&&C===a?n(C):(e.consume(C),m)}function g(C){return e.attempt(s,k,v)(C)}function v(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return i>0&&ce(C)?ke(e,x,"linePrefix",i+1)(C):x(C)}function x(C){return C===null||Z(C)?e.check(m0,g,k)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||Z(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),w)}function k(C){return e.exit("codeFenced"),t(C)}function S(C,P,E){let T=0;return j;function j(A){return C.enter("lineEnding"),C.consume(A),C.exit("lineEnding"),N}function N(A){return C.enter("codeFencedFence"),ce(A)?ke(C,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):I(A)}function I(A){return A===a?(C.enter("codeFencedFenceSequence"),L(A)):E(A)}function L(A){return A===a?(T++,C.consume(A),L):T>=o?(C.exit("codeFencedFenceSequence"),ce(A)?ke(C,O,"whitespace")(A):O(A)):E(A)}function O(A){return A===null||Z(A)?(C.exit("codeFencedFence"),P(A)):E(A)}}}function $6(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 lf={name:"codeIndented",tokenize:B6},z6={partial:!0,tokenize:V6};function B6(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ke(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(z6,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function V6(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ke(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):Z(o)?s(o):n(o)}}const U6={name:"codeText",previous:H6,resolve:W6,tokenize:G6};function W6(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 H6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function G6(e,t,n){let r=0,s,i;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),s=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class K6{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&&_o(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),_o(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_o(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);_o(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_o(this.left,n.reverse())}}}function _o(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function QS(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new K6(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.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,Y6(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.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={...u.get(s)[1].start},a=u.slice(s,n),a.unshift(r),u.splice(s,n-s+1,a))}}return Wn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Y6(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=[],c={};let u,f,h=-1,p=n,m=0,g=0;const v=[g];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=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&&(g=h+1,v.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const y=a.slice(v[h],v[h+1]),x=i.pop();l.push([x,x+y.length-1]),e.splice(x,2,y)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const q6={resolve:X6,tokenize:J6},Q6={partial:!0,tokenize:Z6};function X6(e){return QS(e),e}function J6(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):Z(a)?e.check(Q6,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 Z6(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ke(e,i,"linePrefix")}function i(o){if(o===null||Z(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 XS(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||op(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||Z(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||St(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||op(y)?n(y):(e.consume(y),y===92?v:g)}function v(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function JS(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(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):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ce(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function ZS(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),c(h))}function c(h){return h===o?(e.exit(i),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Go(e,t){let n;return r;function r(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ce(s)?ke(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const e8={name:"definition",tokenize:n8},t8={partial:!0,tokenize:r8};function n8(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return JS.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=ji(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 St(p)?Go(e,c)(p):c(p)}function c(p){return XS(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(t8,f,f)(p)}function f(p){return ce(p)?ke(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function r8(e,t,n){return r;function r(a){return St(a)?Go(e,s)(a):n(a)}function s(a){return ZS(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ce(a)?ke(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const s8={name:"hardBreakEscape",tokenize:i8};function i8(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Z(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const o8={name:"headingAtx",resolve:a8,tokenize:l8};function a8(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"},Wn(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function l8(e,t,n){let r=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||St(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):ce(u)?ke(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||St(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const c8=["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"],y0=["pre","script","style","textarea"],u8={concrete:!0,name:"htmlFlow",resolveTo:h8,tokenize:p8},d8={partial:!0,tokenize:g8},f8={partial:!0,tokenize:m8};function h8(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 p8(e,t,n){const r=this;let s,i,o,a,l;return c;function c(R){return u(R)}function u(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),i=!0,g):R===63?(e.consume(R),s=3,r.interrupt?t:_):$n(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function h(R){return R===45?(e.consume(R),s=2,p):R===91?(e.consume(R),s=5,a=0,m):$n(R)?(e.consume(R),s=4,r.interrupt?t:_):n(R)}function p(R){return R===45?(e.consume(R),r.interrupt?t:_):n(R)}function m(R){const ue="CDATA[";return R===ue.charCodeAt(a++)?(e.consume(R),a===ue.length?r.interrupt?t:I:m):n(R)}function g(R){return $n(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||St(R)){const ue=R===47,pe=o.toLowerCase();return!ue&&!i&&y0.includes(pe)?(s=1,r.interrupt?t(R):I(R)):c8.includes(o.toLowerCase())?(s=6,ue?(e.consume(R),y):r.interrupt?t(R):I(R)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):i?x(R):w(R))}return R===45||Ot(R)?(e.consume(R),o+=String.fromCharCode(R),v):n(R)}function y(R){return R===62?(e.consume(R),r.interrupt?t:I):n(R)}function x(R){return ce(R)?(e.consume(R),x):j(R)}function w(R){return R===47?(e.consume(R),j):R===58||R===95||$n(R)?(e.consume(R),k):ce(R)?(e.consume(R),w):j(R)}function k(R){return R===45||R===46||R===58||R===95||Ot(R)?(e.consume(R),k):S(R)}function S(R){return R===61?(e.consume(R),C):ce(R)?(e.consume(R),S):w(R)}function C(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,P):ce(R)?(e.consume(R),C):E(R)}function P(R){return R===l?(e.consume(R),l=null,T):R===null||Z(R)?n(R):(e.consume(R),P)}function E(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||St(R)?S(R):(e.consume(R),E)}function T(R){return R===47||R===62||ce(R)?w(R):n(R)}function j(R){return R===62?(e.consume(R),N):n(R)}function N(R){return R===null||Z(R)?I(R):ce(R)?(e.consume(R),N):n(R)}function I(R){return R===45&&s===2?(e.consume(R),$):R===60&&s===1?(e.consume(R),U):R===62&&s===4?(e.consume(R),B):R===63&&s===3?(e.consume(R),_):R===93&&s===5?(e.consume(R),z):Z(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(d8,q,L)(R)):R===null||Z(R)?(e.exit("htmlFlowData"),L(R)):(e.consume(R),I)}function L(R){return e.check(f8,O,q)(R)}function O(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),A}function A(R){return R===null||Z(R)?L(R):(e.enter("htmlFlowData"),I(R))}function $(R){return R===45?(e.consume(R),_):I(R)}function U(R){return R===47?(e.consume(R),o="",F):I(R)}function F(R){if(R===62){const ue=o.toLowerCase();return y0.includes(ue)?(e.consume(R),B):I(R)}return $n(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),F):I(R)}function z(R){return R===93?(e.consume(R),_):I(R)}function _(R){return R===62?(e.consume(R),B):R===45&&s===2?(e.consume(R),_):I(R)}function B(R){return R===null||Z(R)?(e.exit("htmlFlowData"),q(R)):(e.consume(R),B)}function q(R){return e.exit("htmlFlow"),t(R)}}function m8(e,t,n){const r=this;return s;function s(o){return Z(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 g8(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Bu,t,n)}}const y8={name:"htmlText",tokenize:x8};function x8(e,t,n){const r=this;let s,i,o;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),c):_===47?(e.consume(_),S):_===63?(e.consume(_),w):$n(_)?(e.consume(_),E):n(_)}function c(_){return _===45?(e.consume(_),u):_===91?(e.consume(_),i=0,m):$n(_)?(e.consume(_),x):n(_)}function u(_){return _===45?(e.consume(_),p):n(_)}function f(_){return _===null?n(_):_===45?(e.consume(_),h):Z(_)?(o=f,U(_)):(e.consume(_),f)}function h(_){return _===45?(e.consume(_),p):f(_)}function p(_){return _===62?$(_):_===45?h(_):f(_)}function m(_){const B="CDATA[";return _===B.charCodeAt(i++)?(e.consume(_),i===B.length?g:m):n(_)}function g(_){return _===null?n(_):_===93?(e.consume(_),v):Z(_)?(o=g,U(_)):(e.consume(_),g)}function v(_){return _===93?(e.consume(_),y):g(_)}function y(_){return _===62?$(_):_===93?(e.consume(_),y):g(_)}function x(_){return _===null||_===62?$(_):Z(_)?(o=x,U(_)):(e.consume(_),x)}function w(_){return _===null?n(_):_===63?(e.consume(_),k):Z(_)?(o=w,U(_)):(e.consume(_),w)}function k(_){return _===62?$(_):w(_)}function S(_){return $n(_)?(e.consume(_),C):n(_)}function C(_){return _===45||Ot(_)?(e.consume(_),C):P(_)}function P(_){return Z(_)?(o=P,U(_)):ce(_)?(e.consume(_),P):$(_)}function E(_){return _===45||Ot(_)?(e.consume(_),E):_===47||_===62||St(_)?T(_):n(_)}function T(_){return _===47?(e.consume(_),$):_===58||_===95||$n(_)?(e.consume(_),j):Z(_)?(o=T,U(_)):ce(_)?(e.consume(_),T):$(_)}function j(_){return _===45||_===46||_===58||_===95||Ot(_)?(e.consume(_),j):N(_)}function N(_){return _===61?(e.consume(_),I):Z(_)?(o=N,U(_)):ce(_)?(e.consume(_),N):T(_)}function I(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),s=_,L):Z(_)?(o=I,U(_)):ce(_)?(e.consume(_),I):(e.consume(_),O)}function L(_){return _===s?(e.consume(_),s=void 0,A):_===null?n(_):Z(_)?(o=L,U(_)):(e.consume(_),L)}function O(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||St(_)?T(_):(e.consume(_),O)}function A(_){return _===47||_===62||St(_)?T(_):n(_)}function $(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function U(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),F}function F(_){return ce(_)?ke(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):z(_)}function z(_){return e.enter("htmlTextData"),o(_)}}const ug={name:"labelEnd",resolveAll:k8,resolveTo:_8,tokenize:S8},v8={tokenize:C8},w8={tokenize:j8},b8={tokenize:P8};function k8(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&&Wn(e,0,e.length,n),e}function _8(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}},c={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=en(a,e.slice(i+1,i+r+3)),a=en(a,[["enter",u,t]]),a=en(a,cg(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=en(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=en(a,e.slice(o+1)),a=en(a,[["exit",l,t]]),Wn(e,i,e.length,a),e}function S8(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?f(h):(o=r.parser.defined.includes(ji(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(v8,u,o?u:f)(h):h===91?e.attempt(w8,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(b8,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function C8(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return St(f)?Go(e,i)(f):i(f)}function i(f){return f===41?u(f):XS(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return St(f)?Go(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?ZS(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return St(f)?Go(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function j8(e,t,n){const r=this;return s;function s(a){return JS.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function P8(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 E8={name:"labelStartImage",resolveAll:ug.resolveAll,tokenize:T8};function T8(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 N8={name:"labelStartLink",resolveAll:ug.resolveAll,tokenize:R8};function R8(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 cf={name:"lineEnding",tokenize:I8};function I8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const lc={name:"thematicBreak",tokenize:A8};function A8(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ce(c)?ke(e,a,"whitespace")(c):a(c))}}const yt={continuation:{tokenize:F8},exit:$8,name:"list",tokenize:D8},M8={partial:!0,tokenize:z8},L8={partial:!0,tokenize:O8};function D8(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:ap(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(lc,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return ap(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"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Bu,r.interrupt?n:u,e.attempt(M8,h,f))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return ce(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 F8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ce(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(L8,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(yt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function O8(e,t,n){const r=this;return ke(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 $8(e){e.exit(this.containerState.type)}function z8(e,t,n){const r=this;return ke(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!ce(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const x0={name:"setextUnderline",resolveTo:B8,tokenize:V8};function B8(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 V8(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ce(c)?ke(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const U8={tokenize:W8};function W8(e){const t=this,n=e.attempt(Bu,r,e.attempt(this.parser.constructs.flowInitial,s,ke(e,e.attempt(this.parser.constructs.flow,s,e.attempt(q6,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 H8={resolveAll:tC()},G8=eC("string"),K8=eC("text");function eC(e){return{resolveAll:tC(e==="text"?Y8: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(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=s[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function tC(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 Y8(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 c=s[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={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={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const q8={42:yt,43:yt,45:yt,48:yt,49:yt,50:yt,51:yt,52:yt,53:yt,54:yt,55:yt,56:yt,57:yt,62:KS},Q8={91:e8},X8={[-2]:lf,[-1]:lf,32:lf},J8={35:o8,42:lc,45:[x0,lc],60:u8,61:x0,95:lc,96:g0,126:g0},Z8={38:qS,92:YS},eU={[-5]:cf,[-4]:cf,[-3]:cf,33:E8,38:qS,42:lp,60:[N6,y8],91:N8,92:[s8,YS],93:ug,95:lp,96:U6},tU={null:[lp,H8]},nU={null:[42,95]},rU={null:[]},sU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nU,contentInitial:Q8,disable:rU,document:q8,flow:J8,flowInitial:X8,insideSpan:tU,string:Z8,text:eU},Symbol.toStringTag,{value:"Module"}));function iU(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:P(S),check:P(C),consume:x,enter:w,exit:k,interrupt:P(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(N){return o=en(o,N),v(),o[o.length-1]!==null?[]:(E(t,0),c.events=cg(i,c.events,c),c.events)}function h(N,I){return aU(p(N),I)}function p(N){return oU(o,N)}function m(){const{_bufferIndex:N,_index:I,line:L,column:O,offset:A}=r;return{_bufferIndex:N,_index:I,line:L,column:O,offset:A}}function g(N){s[N.line]=N.column,j()}function v(){let N;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<I.length;)y(I.charCodeAt(r._bufferIndex));else y(I)}}function y(N){u=u(N)}function x(N){Z(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,j()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function w(N,I){const L=I||{};return L.type=N,L.start=m(),c.events.push(["enter",L,c]),a.push(L),L}function k(N){const I=a.pop();return I.end=m(),c.events.push(["exit",I,c]),I}function S(N,I){E(N,I.from)}function C(N,I){I.restore()}function P(N,I){return L;function L(O,A,$){let U,F,z,_;return Array.isArray(O)?q(O):"tokenize"in O?q([O]):B(O);function B(fe){return Nt;function Nt(Ge){const Yt=Ge!==null&&fe[Ge],jn=Ge!==null&&fe.null,Hn=[...Array.isArray(Yt)?Yt:Yt?[Yt]:[],...Array.isArray(jn)?jn:jn?[jn]:[]];return q(Hn)(Ge)}}function q(fe){return U=fe,F=0,fe.length===0?$:R(fe[F])}function R(fe){return Nt;function Nt(Ge){return _=T(),z=fe,fe.partial||(c.currentConstruct=fe),fe.name&&c.parser.constructs.disable.null.includes(fe.name)?pe():fe.tokenize.call(I?Object.assign(Object.create(c),I):c,l,ue,pe)(Ge)}}function ue(fe){return N(z,_),A}function pe(fe){return _.restore(),++F<U.length?R(U[F]):$}}}function E(N,I){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&Wn(c.events,I,c.events.length-I,N.resolve(c.events.slice(I),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function T(){const N=m(),I=c.previous,L=c.currentConstruct,O=c.events.length,A=Array.from(a);return{from:O,restore:$};function $(){r=N,c.previous=I,c.currentConstruct=L,c.events.length=O,a=A,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function oU(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 aU(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=`
|
|
76
|
+
`;break}case-3:{o=`\r
|
|
77
|
+
`;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 lU(e){const r={constructs:m6([sU,...(e||{}).extensions||[]]),content:s(_6),defined:[],document:s(C6),flow:s(U8),lazy:{},string:s(G8),text:s(K8)};return r;function s(i){return o;function o(a){return iU(r,i,a)}}}function cU(e){for(;!QS(e););return e}const v0=/[\0\t\n\r]/g;function uU(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(v0.lastIndex=f,c=v0.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const dU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fU(e){return e.replace(dU,hU)}function hU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return GS(n.slice(i?2:1),i?16:10)}return lg(n)||e}const nC={}.hasOwnProperty;function pU(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),mU(n)(cU(lU(n).document().write(uU()(e,t,!0))))}function mU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ws),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(Wa),blockQuote:i(jn),characterEscape:T,characterReference:T,codeFenced:i(Hn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(Hn,o),codeText:i(Us,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(Va),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ua),hardBreakEscape:i(eo),hardBreakTrailing:i(eo),htmlFlow:i(to,o),htmlFlowData:T,htmlText:i(to,o),htmlTextData:T,image:i(hr),label:o,link:i(Ws),listItem:i(Gu),listItemValue:h,listOrdered:i(Pn,f),listUnordered:i(Pn),paragraph:i(Ha),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Wa),strong:i(Ku),thematicBreak:i(he)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Yt,autolinkProtocol:Ge,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:fe,characterReference:Nt,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(y),codeText:l(A),codeTextData:j,data:j,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(L),htmlFlowData:j,htmlText:l(O),htmlTextData:j,image:l(U),label:z,labelText:F,lineEnding:N,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ue,resourceDestinationString:_,resourceTitleString:B,resource:q,setextHeading:l(E),setextHeadingLineSequence:P,setextHeadingText:C,strong:l(),thematicBreak:l()}};rC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const ee={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ie=[];let me=-1;for(;++me<D.length;)if(D[me][1].type==="listOrdered"||D[me][1].type==="listUnordered")if(D[me][0]==="enter")ie.push(me);else{const dn=ie.pop();me=s(D,dn,me)}for(me=-1;++me<D.length;){const dn=t[D[me][0]];nC.call(dn,D[me][1].type)&&dn[D[me][1].type].call(Object.assign({sliceSerialize:D[me][2].sliceSerialize},ee),D[me][1])}if(ee.tokenStack.length>0){const dn=ee.tokenStack[ee.tokenStack.length-1];(dn[1]||w0).call(ee,void 0,dn[0])}for(H.position={start:_r(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:_r(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<t.transforms.length;)H=t.transforms[me](H)||H;return H}function s(D,H,ee){let ie=H-1,me=-1,dn=!1,os,Gn,no,ro;for(;++ie<=ee;){const Rt=D[ie];switch(Rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Rt[0]==="enter"?me++:me--,ro=void 0;break}case"lineEndingBlank":{Rt[0]==="enter"&&(os&&!ro&&!me&&!no&&(no=ie),ro=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ro=void 0}if(!me&&Rt[0]==="enter"&&Rt[1].type==="listItemPrefix"||me===-1&&Rt[0]==="exit"&&(Rt[1].type==="listUnordered"||Rt[1].type==="listOrdered")){if(os){let Hs=ie;for(Gn=void 0;Hs--;){const Kn=D[Hs];if(Kn[1].type==="lineEnding"||Kn[1].type==="lineEndingBlank"){if(Kn[0]==="exit")continue;Gn&&(D[Gn][1].type="lineEndingBlank",dn=!0),Kn[1].type="lineEnding",Gn=Hs}else if(!(Kn[1].type==="linePrefix"||Kn[1].type==="blockQuotePrefix"||Kn[1].type==="blockQuotePrefixWhitespace"||Kn[1].type==="blockQuoteMarker"||Kn[1].type==="listItemIndent"))break}no&&(!Gn||no<Gn)&&(os._spread=!0),os.end=Object.assign({},Gn?D[Gn][1].start:Rt[1].end),D.splice(Gn||ie,0,["exit",os,Rt[2]]),ie++,ee++}if(Rt[1].type==="listItemPrefix"){const Hs={type:"listItem",_spread:!1,start:Object.assign({},Rt[1].start),end:void 0};os=Hs,D.splice(ie,0,["enter",Hs,Rt[2]]),ie++,ee++,no=void 0,ro=!0}}}return D[H][1]._spread=dn,ee}function i(D,H){return ee;function ee(ie){a.call(this,D(ie),ie),H&&H.call(this,ie)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(D,H,ee){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,ee||void 0]),D.position={start:_r(H.start),end:void 0}}function l(D){return H;function H(ee){D&&D.call(this,ee),c.call(this,ee)}}function c(D,H){const ee=this.stack.pop(),ie=this.tokenStack.pop();if(ie)ie[0].type!==D.type&&(H?H.call(this,D,ie[0]):(ie[1]||w0).call(this,D,ie[0]));else throw new Error("Cannot close `"+D.type+"` ("+Ho({start:D.start,end:D.end})+"): it’s not open");ee.position.end=_r(D.end)}function u(){return h6(this.stack.pop())}function f(){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 g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){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 y(){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(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=ji(this.sliceSerialize(D)).toLowerCase()}function w(){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 ee=this.sliceSerialize(D).length;H.depth=ee}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function P(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(D){const ee=this.stack[this.stack.length-1].children;let ie=ee[ee.length-1];(!ie||ie.type!=="text")&&(ie=Ga(),ie.position={start:_r(D.start),end:void 0},ee.push(ie)),this.stack.push(ie)}function j(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=_r(D.end)}function N(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=H.children[H.children.length-1];ee.position.end=_r(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(T.call(this,D),j.call(this,D))}function I(){this.data.atHardBreak=!0}function L(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}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 $(){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 U(){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 F(D){const H=this.sliceSerialize(D),ee=this.stack[this.stack.length-2];ee.label=fU(H),ee.identifier=ji(H).toLowerCase()}function z(){const D=this.stack[this.stack.length-1],H=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const ie=D.children;ee.children=ie}else ee.alt=H}function _(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function B(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ue(D){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=ji(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function pe(D){this.data.characterReferenceType=D.type}function fe(D){const H=this.sliceSerialize(D),ee=this.data.characterReferenceType;let ie;ee?(ie=GS(H,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ie=lg(H);const me=this.stack[this.stack.length-1];me.value+=ie}function Nt(D){const H=this.stack.pop();H.position.end=_r(D.end)}function Ge(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function Yt(D){j.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function jn(){return{type:"blockquote",children:[]}}function Hn(){return{type:"code",lang:null,meta:null,value:""}}function Us(){return{type:"inlineCode",value:""}}function Va(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ua(){return{type:"emphasis",children:[]}}function Wa(){return{type:"heading",depth:0,children:[]}}function eo(){return{type:"break"}}function to(){return{type:"html",value:""}}function hr(){return{type:"image",title:null,url:"",alt:null}}function Ws(){return{type:"link",title:null,url:"",children:[]}}function Pn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Gu(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Ha(){return{type:"paragraph",children:[]}}function Ku(){return{type:"strong",children:[]}}function Ga(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function _r(e){return{line:e.line,column:e.column,offset:e.offset}}function rC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rC(e,r):gU(e,r)}}function gU(e,t){let n;for(n in t)if(nC.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 w0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ho({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+") is still open")}function yU(e){const t=this;t.parser=n;function n(r){return pU(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xU(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 vU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
78
|
+
`}]}function wU(e,t){const n=t.value?t.value+`
|
|
79
|
+
`:"",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 bU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kU(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _U(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Zi(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 c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function SU(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 CU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sC(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 jU(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sC(e,t);const s={src:Zi(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 PU(e,t){const n={src:Zi(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 EU(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 TU(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sC(e,t);const s={href:Zi(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 NU(e,t){const n={href:Zi(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 RU(e,t,n){const r=e.all(t),s=n?IU(n):iC(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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 u=r[a];(s||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
80
|
+
`}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
81
|
+
`});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function IU(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=iC(n[r])}return t}function iC(e){const t=e.spread;return t??e.children.length>1}function AU(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 MU(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LU(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function DU(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FU(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=sg(t.children[1]),l=$S(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 OU(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 c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function $U(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const b0=9,k0=32;function zU(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(_0(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(_0(t.slice(s),s>0,!1)),i.join("")}function _0(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===b0||i===k0;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===b0||i===k0;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function BU(e,t){const n={type:"text",value:zU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VU(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UU={blockquote:xU,break:vU,code:wU,delete:bU,emphasis:kU,footnoteReference:_U,heading:SU,html:CU,imageReference:jU,image:PU,inlineCode:EU,linkReference:TU,link:NU,listItem:RU,list:AU,paragraph:MU,root:LU,strong:DU,table:FU,tableCell:$U,tableRow:OU,text:BU,thematicBreak:VU,toml:Rl,yaml:Rl,definition:Rl,footnoteDefinition:Rl};function Rl(){}const oC=-1,Vu=0,Ko=1,tu=2,dg=3,fg=4,hg=5,pg=6,aC=7,lC=8,WU=typeof self=="object"?self:globalThis,S0=(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 WU[e](t)},HU=(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 Vu:case oC:return n(o,s);case Ko:{const a=n([],s);for(const l of o)a.push(r(l));return a}case tu:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case dg:return n(new Date(o),s);case fg:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case hg:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case pg:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case aC:{const{name:a,message:l}=o;return n(S0(a,l),s)}case lC: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(S0(i,o),s)};return r},C0=e=>HU(new Map,e)(0),Js="",{toString:GU}={},{keys:KU}=Object,So=e=>{const t=typeof e;if(t!=="object"||!e)return[Vu,t];const n=GU.call(e).slice(8,-1);switch(n){case"Array":return[Ko,Js];case"Object":return[tu,Js];case"Date":return[dg,Js];case"RegExp":return[fg,Js];case"Map":return[hg,Js];case"Set":return[pg,Js];case"DataView":return[Ko,n]}return n.includes("Array")?[Ko,n]:n.includes("Error")?[aC,n]:[tu,n]},Il=([e,t])=>e===Vu&&(t==="function"||t==="symbol"),YU=(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]=So(o);switch(a){case Vu:{let u=o;switch(l){case"bigint":a=lC,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([oC],o)}return s([a,u],o)}case Ko:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),s([l,[...h]],o)}const u=[],f=s([a,u],o);for(const h of o)u.push(i(h));return f}case tu:{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 u=[],f=s([a,u],o);for(const h of KU(o))(e||!Il(So(o[h])))&&u.push([i(h),i(o[h])]);return f}case dg:return s([a,o.toISOString()],o);case fg:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case hg:{const u=[],f=s([a,u],o);for(const[h,p]of o)(e||!(Il(So(h))||Il(So(p))))&&u.push([i(h),i(p)]);return f}case pg:{const u=[],f=s([a,u],o);for(const h of o)(e||!Il(So(h)))&&u.push(i(h));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},j0=(e,{json:t,lossy:n}={})=>{const r=[];return YU(!(t||n),!!t,new Map,r)(e),r},nu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?C0(j0(e,t)):structuredClone(e):(e,t)=>C0(j0(e,t));function qU(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 QU(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function XU(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||qU,r=e.options.footnoteBackLabel||QU,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 c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=Zi(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){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 v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...nu(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
82
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
83
|
+
`}]}}const cC=function(e){if(e==null)return tW;if(typeof e=="function")return Uu(e);if(typeof e=="object")return Array.isArray(e)?JU(e):ZU(e);if(typeof e=="string")return eW(e);throw new Error("Expected function, string, or object as test")};function JU(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cC(e[n]);return Uu(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function ZU(e){const t=e;return Uu(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function eW(e){return Uu(t);function t(n){return n&&n.type===e}}function Uu(e){return t;function t(n,r,s){return!!(nW(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function tW(){return!0}function nW(e){return e!==null&&typeof e=="object"&&"type"in e}const uC=[],rW=!0,P0=!1,sW="skip";function iW(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=cC(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=uC,m,g,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=oW(n(l,u)),p[0]===P0))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==sW)for(g=(r?y.children.length:-1)+o,v=u.concat(y);g>-1&&g<y.children.length;){const x=y.children[g];if(m=a(x,g,v)(),m[0]===P0)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function oW(e){return Array.isArray(e)?e:typeof e=="number"?[rW,e]:e==null?uC:[e]}function dC(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),iW(e,i,a,s);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const cp={}.hasOwnProperty,aW={};function lW(e,t){const n=t||aW,r=new Map,s=new Map,i=new Map,o={...UU,...n.handlers},a={all:c,applyData:uW,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:cW,wrap:fW};return dC(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(cp.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...v}=u,y=nu(v);return y.children=a.all(u),y}return nu(u)}return(a.options.unknownHandler||dW)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=E0(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=E0(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function cW(e,t){e.position&&(t.position=HV(e))}function uW(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,nu(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function dW(e,t){const n=t.data||{},r="value"in t&&!(cp.call(n,"hProperties")||cp.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 fW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
84
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
85
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
86
|
+
`}),n}function E0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function T0(e,t){const n=lW(e,t),r=n.one(e,void 0),s=XU(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
87
|
+
`},s),i}function hW(e,t){return e&&"run"in e?async function(n,r){const s=T0(n,{file:r,...t});await e.run(s,r)}:function(n,r){return T0(n,{file:r,...e||t})}}function N0(e){if(e)throw e}var cc=Object.prototype.hasOwnProperty,fC=Object.prototype.toString,R0=Object.defineProperty,I0=Object.getOwnPropertyDescriptor,A0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):fC.call(t)==="[object Array]"},M0=function(t){if(!t||fC.call(t)!=="[object Object]")return!1;var n=cc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||cc.call(t,s)},L0=function(t,n){R0&&n.name==="__proto__"?R0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},D0=function(t,n){if(n==="__proto__")if(cc.call(t,n)){if(I0)return I0(t,n).value}else return;return t[n]},pW=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=D0(a,n),s=D0(t,n),a!==s&&(u&&s&&(M0(s)||(i=A0(s)))?(i?(i=!1,o=r&&A0(r)?r:[]):o=r&&M0(r)?r:{},L0(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&L0(a,{name:n,newValue:s}));return a};const uf=su(pW);function up(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 mW(){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,...c){const u=e[++i];let f=-1;if(l){o(l);return}for(;++f<s.length;)(c[f]===null||c[f]===void 0)&&(c[f]=s[f]);s=c,u?gW(u,a)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function gW(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(c){const u=c;if(a&&n)throw u;return s(u)}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 Mn={basename:yW,dirname:xW,extname:vW,join:wW,sep:"/"};function yW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Da(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 xW(e){if(Da(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 vW(e){Da(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 wW(...e){let t=-1,n;for(;++t<e.length;)Da(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bW(n)}function bW(e){Da(e);const t=e.codePointAt(0)===47;let n=kW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kW(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 Da(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _W={cwd:SW};function SW(){return"/"}function dp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function CW(e){if(typeof e=="string")e=new URL(e);else if(!dp(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 jW(e)}function jW(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 df=["history","path","basename","stem","extname","dirname"];class hC{constructor(t){let n;t?dp(t)?n={path:t}:typeof t=="string"||PW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_W.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<df.length;){const i=df[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)df.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Mn.basename(this.path):void 0}set basename(t){hf(t,"basename"),ff(t,"basename"),this.path=Mn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mn.dirname(this.path):void 0}set dirname(t){F0(this.basename,"dirname"),this.path=Mn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mn.extname(this.path):void 0}set extname(t){if(ff(t,"extname"),F0(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=Mn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dp(t)&&(t=CW(t)),hf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mn.basename(this.path,this.extname):void 0}set stem(t){hf(t,"stem"),ff(t,"stem"),this.path=Mn.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 at(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 ff(e,t){if(e&&e.includes(Mn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mn.sep+"`")}function hf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function F0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EW=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},TW={}.hasOwnProperty;class mg extends EW{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=mW()}copy(){const t=new mg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(uf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gf("data",this.frozen),this.namespace[t]=n,this):TW.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gf("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=Al(t),r=this.parser||this.Parser;return pf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),pf("process",this.parser||this.Parser),mf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=Al(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,m=r.stringify(p,h);IW(m)?h.value=m:h.result=m,c(u,h)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),pf("processSync",this.parser||this.Parser),mf("processSync",this.compiler||this.Compiler),this.process(t,s),$0("processSync","process",n),r;function s(i,o){n=!0,N0(i),r=o}}run(t,n,r){O0(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=Al(n);s.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),$0("runSync","run",r),s;function i(o,a){N0(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=Al(n),s=this.compiler||this.Compiler;return mf("stringify",s),O0(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(gf("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(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(s.settings=uf(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];up(g)&&up(p)&&(p=uf(!0,g,p)),r[h]=[c,p,...m]}}}}const NW=new mg().freeze();function pf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gf(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 O0(e){if(!up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Al(e){return RW(e)?e:new hC(e)}function RW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IW(e){return typeof e=="string"||AW(e)}function AW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",z0=[],B0={allowDangerousHtml:!0},LW=/^(https?|ircs?|mailto|xmpp)$/i,DW=[{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 FW(e){const t=OW(e),n=$W(e);return zW(t.runSync(t.parse(n),n),e)}function OW(e){const t=e.rehypePlugins||z0,n=e.remarkPlugins||z0,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...B0}:B0;return NW().use(yU).use(n).use(hW,r).use(t)}function $W(e){const t=e.children||"",n=new hC;return typeof t=="string"&&(n.value=t),n}function zW(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||BW;for(const u of DW)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+MW+u.id,void 0);return dC(e,c),QV(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in af)if(Object.hasOwn(af,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=af[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function BW(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||LW.test(e.slice(0,t))?e:""}const yf=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,VW={p:({children:e})=>d.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>d.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>d.jsx("h1",{className:yf("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:yf("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:yf("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>d.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>d.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>d.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})=>d.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>d.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>d.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>d.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},pC=({children:e})=>d.jsx(FW,{components:VW,children:e}),gg=1e3,UW=3e4;let rn=null,yi=null,Yo=gg;const qo=new Set;function WW(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of qo)n(t)}function HW(){Yo=gg}function GW(){rn==null||rn.close(),rn=null,qo.size!==0&&(yi=setTimeout(()=>{yi=null,mC()},Yo),Yo=Math.min(Yo*2,UW))}function mC(){rn=new EventSource(G("/api/activity/stream")),rn.onmessage=WW,rn.onopen=HW,rn.onerror=GW}function Fa(e){return qo.add(e),!rn&&!yi&&mC(),()=>{qo.delete(e),!(qo.size>0)&&(yi&&(clearTimeout(yi),yi=null),rn&&(rn.close(),rn=null),Yo=gg)}}function Oa(){const[e,t]=b.useState([]),n=b.useCallback(async()=>{try{t(await k4())}catch{}},[]);b.useEffect(()=>{n()},[n]),b.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=Fa(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=b.useCallback(async s=>{await pS(s),await n()},[n]);return{checks:e,run:r}}const Pi={accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",chalkPass:"#2d5a3b",chalkPassText:"#b5d6b5",chalkFail:"#5a2d2d",chalkFailText:"#d6a0a0",chalkRunning:"#5a4a2d",chalkRunningText:"#d6c4a0"},gC="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",Wu="text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",er={pass:Pi.chalkPass,fail:Pi.chalkFail,running:Pi.chalkRunning},tr={pass:Pi.chalkPassText,fail:Pi.chalkFailText,running:Pi.chalkRunningText},fp=({tooltip:e,onClick:t,disabled:n,disabledCursor:r="not-allowed",ariaExpanded:s,fillColor:i,textColor:o,variant:a,children:l})=>d.jsx(xe,{content:e,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?r==="default"?"cursor-default":"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:t,disabled:n,"aria-expanded":s,children:d.jsx(le,{surface:"chalkboard",size:"small",fillColor:i,textColor:o,variant:a,children:l})})}),KW=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),yC=e=>{if(!e)return"";const t=new Date(e),n=t.toLocaleTimeString();return KW(t,new Date)?n:`${t.toLocaleDateString()} ${n}`},YW=1,qW="h-[4.625rem]",QW="basis-[6.625rem]",XW=e=>{var t,n;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"batch-draft":return"batch draft";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";case"pr-review":{const r=(n=(t=e.prReviewUrl)==null?void 0:t.match(/\/pull\/(\d+)/))==null?void 0:n[1];return r?`reviewing PR #${r}`:"reviewing PR"}default:return""}},JW=e=>{const t=XW(e);return!t||t.toLowerCase()===e.planTitle.trim().toLowerCase()?"":` — ${t}`},V0={starting:er.running,running:er.running,stopping:er.running,done:er.pass,error:er.fail,superseded:er.running},U0={starting:tr.running,running:tr.running,stopping:tr.running,done:tr.pass,error:tr.fail,superseded:tr.running},ZW=({task:e,onStop:t})=>{const n=mt(),{toast:r}=He(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async o=>{o.stopPropagation();try{await t(e.id)}catch(a){r({title:"Failed to stop agent",description:Fe(a.message),variant:"error"})}};return d.jsx(_e,{surface:"chalkboard",size:"small",className:`stack-task-card ${qW}`,children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:o=>{o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())},className:"flex h-full min-w-0 cursor-pointer flex-col justify-center gap-1 rounded-[10px]",children:[d.jsxs("span",{className:"block min-w-[6ch] overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,JW(e)]}),d.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[d.jsxs("span",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-2xs text-desk-text-muted",children:[r5[e.agentId]," · ",yC(e.startedAt)]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(le,{surface:"chalkboard",size:"small",fillColor:V0.error,textColor:U0.error,children:"stopped — agent signed out"})}):d.jsx(le,{surface:"chalkboard",size:"small",fillColor:V0[e.status],textColor:U0[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(et,{icon:d.jsx(Lu,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})]})})},e9=()=>{const e=M(i=>i.agentStatus),t=M(i=>i.stopAgent),n=mt(),r=e.slice(0,YW),s=e.length-r.length;return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-[var(--pc-stack-pad)]",children:[d.jsx("h3",{className:`${gC} m-0`,children:"Agent"}),d.jsxs("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${QW} ${r.length>0?"justify-start":"justify-center"}`,children:[r.length>0?r.map(i=>d.jsx(ZW,{task:i,onStop:t},i.id)):d.jsx(_e,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})}),s>0&&d.jsxs("button",{type:"button",onClick:()=>n({to:"/tasks"}),className:"shrink-0 cursor-pointer border-none bg-transparent p-0 text-left text-xs text-desk-text-muted underline",children:[s," more…"]})]})]})},xC=({label:e="Refresh data",refreshingLabel:t="Refreshing…",surface:n}={})=>{const r=M(l=>l.refreshAll),s=M(l=>l.refreshing),i=M(l=>{var c;return((c=l.status)==null?void 0:c.prFetchedAt)??null}),{toast:o}=He(),a=async()=>{if(s)return;const l=await r();l.ok?o({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):o({title:"Couldn't refresh",description:l.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsxs("span",{className:"inline-flex items-center gap-2",children:[i!=null&&d.jsx("span",{className:`text-xs whitespace-nowrap ${n==="chalkboard"?"text-desk-text-muted":"opacity-[0.45]"}`,children:vS(i)}),d.jsx(et,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(_B,{size:16})}),label:s?t:e,size:"small",variant:"ghost",surface:n,disabled:s,onClick:a})]})},t9=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(!0);return b.useEffect(()=>{let s=!1;return Jm().then(i=>{s||(t((i==null?void 0:i.desk)??null),r(!1))}),()=>{s=!0}},[]),{desk:e,loading:n}},n9=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),r9=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return i(!0),Promise.all([ZB().then(a=>{!o&&a&&t(n9(a))}),JB().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},s9=["repo-docs","release-notes"],i9=["subjects","setup","merge-policy"];function vC(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}function wC(e,t){return e.find(n=>vC(n.id)===t)??e.find(n=>!n.id&&n.title===t)??null}function Yr(e,t){return vC(e)??encodeURIComponent(t)}function yg(){const{planId:e}=Bs({strict:!1}),t=M(n=>n.plans);return typeof e!="string"||!t?null:wC(t.entries,decodeURIComponent(e))}function o9(){const{ideaId:e}=Bs({strict:!1}),t=M(n=>n.ideaEntries);return typeof e!="string"?null:wC(t,decodeURIComponent(e))}function a9(){const{section:e}=Bs({strict:!1});return s9.includes(e)?e:null}function zG(){const{section:e}=Bs({strict:!1});return i9.includes(e)?e:null}function BG(){const e=a9(),t=M(r=>r.activeDocTitle),n=M(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const l9=250;function c9(e,t,n={}){const{debounceMs:r=l9,...s}=n,[i,o]=b.useState(e);b.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return b.useMemo(()=>y5(i,t,{threshold:a,limit:l}),[i,t,a,l])}const bC=()=>{const[e,t]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return Jm().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},kC="Checks",u9={...er,stale:void 0},d9={...tr,stale:void 0},W0=e=>e.errorCount>0?"fail":e.warningCount>0?"running":"pass",f9=e=>`Fix the failing "${e.name}" check in this repo. The command was \`${e.cmd}\`.
|
|
88
|
+
|
|
89
|
+
Output from the last run:
|
|
90
|
+
|
|
91
|
+
${e.output||"(no output captured)"}`,h9=({check:e,onRun:t})=>{const n=e.status==="running",r=yC(e.lastRun);return d.jsxs(fp,{tooltip:r?`${e.cmd} — last run ${r}. Click to run.`:`${e.cmd} — click to run.`,onClick:()=>t(e.name),disabled:n,fillColor:u9[e.status],textColor:d9[e.status],variant:e.status==="stale"?"neutral":void 0,children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]})},p9=({finding:e})=>d.jsxs("div",{className:"font-mono text-2xs opacity-70",children:[e.file,":",e.line," — ",e.message]}),m9=({issue:e,linkedPlan:t,onNavigate:n})=>d.jsx("div",{className:"font-mono text-2xs opacity-70",children:t?d.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:e.message}):d.jsx("span",{className:"text-left",children:e.message})}),g9=()=>{const{checks:e,run:t}=Oa(),n=M(v=>v.doctor),r=M(v=>v.consistency),s=M(v=>v.plans),i=mt(),o=e.find(v=>v.status==="fail"),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,h]=b.useState(!1),p=n.findings.length>0,m=r.length>0,g=b.useCallback(v=>v.planId?s==null?void 0:s.entries.find(y=>y.id===v.planId):void 0,[s==null?void 0:s.entries]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:kC}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.map(v=>d.jsx(h9,{check:v,onRun:t},v.name)),d.jsx(fp,{tooltip:p?`${n.errorCount} error(s), ${n.warningCount} warning(s) — click to show.`:"Corpus doctor — no findings.",onClick:()=>u(v=>!v),disabled:!p,disabledCursor:"default",ariaExpanded:p?c:void 0,fillColor:er[W0(n)],textColor:tr[W0(n)],children:"doctor"}),d.jsx(fp,{tooltip:m?"Plan/idea doc findings — orphan subjects & title style. Click to show.":"Plan/idea docs — no findings.",onClick:()=>h(v=>!v),disabled:!m,disabledCursor:"default",ariaExpanded:m?f:void 0,fillColor:er[m?"fail":"pass"],textColor:tr[m?"fail":"pass"],children:"docs"})]}),o&&d.jsxs("div",{className:"flex flex-col gap-1 text-center font-handwritten text-sm",children:[d.jsxs("span",{className:"text-desk-text-muted",children:["The ",o.name," check failed."]}),d.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",d.jsx(Xh,{text:f9(o),surface:"chalkboard"}),o.output&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("button",{type:"button",onClick:()=>l(v=>!v),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-desk-chalk","aria-expanded":a,children:a?"Hide output":"Show output"})]})]}),a&&o.output&&d.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap text-left font-mono text-2xs opacity-70",children:o.output})]}),c&&p&&d.jsx("div",{className:"flex flex-col gap-1",children:n.findings.map(v=>d.jsx(p9,{finding:v},`${v.file}:${v.line}:${v.rule}`))}),f&&m&&d.jsx("div",{className:"flex flex-col gap-1",children:r.map((v,y)=>{const x=g(v);return d.jsx(m9,{issue:v,linkedPlan:x,onNavigate:()=>x&&i({to:"/plans/$planId",params:{planId:Yr(x.id,x.title)}})},`${v.kind}-${v.title}-${y}`)})})]})]})},y9=async()=>{try{const e=await fetch(G("/api/ci"));return e.ok?e.json():null}catch{return null}};function x9(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await y9())}finally{r(!1)}},[]);return b.useEffect(()=>{s()},[s]),{ci:e,loading:n,refresh:s}}const _C="CI & release",v9={success:"bg-chalk-pass-text",failure:"bg-chalk-fail-text",in_progress:"bg-chalk-running-text",queued:"bg-chalk-running-text",cancelled:"bg-desk-text-muted",unknown:"bg-desk-text-muted"},xf="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",w9=({run:e})=>{const t=d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${v9[e.status]}`}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-desk-chalk",children:e.workflow}),d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:e.status})]});return e.url?d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"no-underline",children:t}):t},b9=()=>{const{ci:e,loading:t,refresh:n}=x9(),r=M(o=>o.refreshing),s=b.useRef(!1);b.useEffect(()=>{s.current&&!r&&n(),s.current=r},[r,n]);const i=()=>{var a;if(!e)return d.jsx(_e,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:t?"Checking CI…":"No CI source declared."})});const o=`https://github.com/${e.repo}/actions`;return e.available?d.jsx(_e,{surface:"chalkboard",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(l=>d.jsx(w9,{run:l},l.workflow)):d.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),d.jsxs("div",{className:"font-mono text-2xs text-desk-text-muted",children:["Released ",e.releasedVersion??"—"," · Queued ",((a=e.releasePr)==null?void 0:a.version)??"none"]}),d.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&d.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:xf,children:["Release PR #",e.releasePr.number]}),d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:xf,children:"Open Actions"})]})]})}):d.jsx(_e,{surface:"chalkboard",size:"small",children:d.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:xf,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:_C}),i()]})},SC=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},k9=async()=>{const e=await fetch(G("/api/services"));return e.ok?(await e.json()).services??[]:[]},_9=async e=>{const t=await fetch(G(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await SC(t,"Failed to start service")},S9=async e=>{const t=await fetch(G(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await SC(t,"Failed to stop service")},C9=async e=>{const t=await fetch(G(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function j9(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await k9())}catch{}finally{r(!1)}},[]);b.useEffect(()=>{s()},[s]),b.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=Fa(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=b.useCallback(async a=>{await _9(a),await s()},[s]),o=b.useCallback(async a=>{await S9(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const P9=1500,CC="Services",E9=e=>e.status==="crashed"?"bg-chalk-fail-text":e.status==="running"?e.health==="up"?"bg-chalk-pass-text":"bg-chalk-running-text":e.status==="stopping"?"bg-chalk-running-text":"bg-desk-text-muted",T9=({service:e})=>{const t=e.status==="running"?`running · ${e.health}`:e.status;return d.jsx("span",{role:"img","aria-label":t,className:`h-2 w-2 shrink-0 rounded-full ${E9(e)}`,title:t})},N9=({name:e,running:t})=>{const[n,r]=b.useState(""),s=b.useRef(null);return b.useEffect(()=>{let i=!1;const o=async()=>{const l=await C9(e);i||r(l)};o();const a=t?setInterval(o,P9):void 0;return()=>{i=!0,a&&clearInterval(a)}},[e,t]),b.useEffect(()=>{const i=s.current;i&&n&&(i.scrollTop=i.scrollHeight)},[n]),d.jsx("pre",{ref:s,className:"m-0 mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-[8px] bg-desk-bg/60 p-2 font-mono text-2xs leading-relaxed text-desk-text-muted",children:n||"No output yet."})},R9=({service:e,onStart:t,onStop:n})=>{const{toast:r}=He(),[s,i]=b.useState(!1),[o,a]=b.useState(!1),l=e.status==="running"||e.status==="stopping",c=e.pid!==null,u=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(f){r({title:l?"Failed to stop service":"Failed to start service",description:f.message,variant:"error"})}finally{i(!1)}}};return d.jsxs(_e,{surface:"chalkboard",size:"small",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(f=>!f),"aria-expanded":o,className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx("span",{className:`shrink-0 text-desk-text-muted transition-transform ${o?"rotate-90":""}`,children:d.jsx(PB,{})}),d.jsx(T9,{service:e}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:e.name}),e.port&&d.jsxs("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:[":",e.port]})]}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s?d.jsx(ur,{size:"small",surface:"chalkboard",label:"Working"}):!l||c?d.jsx(et,{icon:l?d.jsx(jB,{}):d.jsx(CB,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:u}):null})]}),o&&d.jsx(N9,{name:e.name,running:l})]})},I9=()=>{const{services:e,start:t,stop:n}=j9(),r=b.useCallback(i=>t(i),[t]),s=b.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:CC}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(R9,{service:i,onStart:r,onStop:s},i.name)):d.jsx(_e,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},A9=[CC,kC,_C],M9=()=>d.jsx("div",{className:"flex flex-col gap-4","aria-hidden":"true",children:A9.map(e=>d.jsxs("div",{children:[d.jsx("div",{className:Wu,children:e}),d.jsx(Lt,{variant:"rect",width:"100%",height:28,surface:"chalkboard"})]},e))}),L9=()=>d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsxs("p",{className:"m-0 text-center text-xs text-desk-text-muted",children:["Desk isn't configured — add ",d.jsx("code",{children:"desk"})," to ",d.jsx("code",{children:"papercamp/config.json"}),"."]})}),D9=()=>{const{desk:e,loading:t}=t9();return d.jsxs(d.Fragment,{children:[d.jsx(rS,{surface:"chalkboard"}),d.jsxs("div",{className:"flex flex-1 flex-col p-[var(--pc-stack-pad)]",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[d.jsx("h3",{className:`${gC} m-0`,children:"Desk"}),d.jsx(xC,{label:"Fetch from GitHub",refreshingLabel:"Fetching…",surface:"chalkboard"})]}),t?d.jsx(M9,{}):e?d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(I9,{}),d.jsx(g9,{}),d.jsx(b9,{})]}):d.jsx(L9,{})]})]})},F9=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=b.useRef(null);b.useEffect(()=>{s.current&&(s.current.inert=!r)},[r]),b.useEffect(()=>{if(!r||n)return;const h=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r,n,t]);const i=M(h=>h.consistency),o=M(h=>h.doctor),a=M(h=>h.agentStatus);b.useEffect(()=>{const{loadStatus:h,loadConsistency:p,loadDoctor:m,loadGitStatus:g,loadAgentStatus:v,loadArchivableIdeas:y}=M.getState();h(),p(),m(),g(),v(),y()},[]),b.useEffect(()=>{const h=()=>{M.getState().loadPlans(),M.getState().loadGitStatus()};return window.addEventListener("focus",h),()=>window.removeEventListener("focus",h)},[]),b.useEffect(()=>{const h={},p=(g,v,y)=>{h[g]&&clearTimeout(h[g]),h[g]=setTimeout(v,y)},m=Fa(g=>{if(g.type==="status"){p("status",()=>M.getState().loadStatus(),80);return}if(g.type==="agent"){p("agent",()=>M.getState().loadAgentStatus(),120);return}g.message==="changed"&&p("activity",()=>{const{loadPlans:v,loadSuggestions:y,loadStatus:x,loadConsistency:w,loadDoctor:k,loadGitStatus:S,loadAgentStatus:C,loadArchivableIdeas:P}=M.getState();v(),y(),x(),w(),k(),S(),C(),P()},250)});return()=>{for(const g of Object.values(h))g&&clearTimeout(g);m()}},[]);const{checks:l}=Oa(),c=i.length>0,u=l.some(h=>h.status==="fail")||c||o.errorCount>0,f=a.some(h=>h.status==="running"||h.status==="starting"||h.status==="stopping");return d.jsxs(d.Fragment,{children:[!r&&d.jsx("div",{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:d.jsx(et,{icon:f?d.jsx(ur,{size:"small",surface:"chalkboard",label:"Agent running"}):u?d.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)]"}):d.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:f?"Open stack panel — agent running":u?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${f?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":u?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("aside",{ref:s,"aria-label":"Stack",className:"fixed inset-y-0 right-0 z-[300] flex w-[min(var(--pc-stack-width),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]",style:{transform:r?"translateX(0)":"translateX(100%)"},children:[d.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between px-[var(--pc-stack-pad)]",children:[d.jsx("h2",{className:"m-0 font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&d.jsx(et,{icon:d.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"})]}),d.jsx(rS,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[d.jsx(e9,{}),d.jsx(D9,{})]})]})]})},jC=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=r9();return d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?d.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):d.jsx(A$,{icon:d.jsx(N3,{}),size:"small"}),d.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"})]})},O9=()=>{const[e,t]=b.useState(null);return b.useEffect(()=>{},[]),e?d.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},$9=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=b.useRef(null);return b.useEffect(()=>{if(!n)return;const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,r]),b.useEffect(()=>{var o;if(!n)return;const i=document.activeElement;return(o=s.current)==null||o.focus(),()=>{var a;return(a=i==null?void 0:i.focus)==null?void 0:a.call(i)}},[n]),d.jsxs(d.Fragment,{children:[n&&d.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}),d.jsxs("aside",{ref:s,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 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:[d.jsx("div",{className:"shrink-0 h-[66px] flex items-center",children:d.jsx(jC,{size:"sm"})}),d.jsx("div",{className:"flex-1 overflow-y-auto relative",children:d.jsx("div",{children:t},e)})]})]})};function vf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function z9(e){return e<1e12?e*1e3:e}function B9(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(z9(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const V9="flex items-center gap-3 h-8 px-4 border-b border-black/[0.08] text-xs shrink-0 box-border overflow-x-auto overflow-y-hidden whitespace-nowrap",U9="flex items-center gap-3 shrink-0",W9="flex items-center gap-1",H9="opacity-50",G9="text-[var(--pui-text-primary)]",H0="opacity-60",K9="flex-1",G0="flex items-center gap-2 shrink-0",K0="bg-transparent border-none p-0 cursor-pointer",Y9="relative inline-flex",q9="absolute -top-1 -right-1 pointer-events-none",Q9=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:f,trailing:h})=>d.jsxs("div",{className:V9,style:Bi("kraft"),children:[d.jsxs("div",{className:U9,children:[d.jsxs("span",{className:W9,children:[d.jsx("span",{className:H9,children:d.jsx(Fv,{size:12})}),d.jsx("code",{className:G9,children:e??"no branch"})]}),t>0&&d.jsxs("span",{className:H0,children:["↑",t]}),d.jsx("span",{className:H0,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(ur,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(xe,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,className:K0,children:d.jsx(le,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(xe,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,className:K0,children:d.jsxs(le,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&vf(a.status)!=="allowed"&&d.jsx(xe,{content:B9(a),children:d.jsx(le,{size:"small",variant:vf(a.status)==="rejected"?"error":"warning",children:vf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{className:K9}),h&&d.jsx("div",{className:G0,children:h}),d.jsxs("div",{className:G0,children:[d.jsx(xe,{content:"Git",children:d.jsx(et,{variant:"ghost",size:"small",icon:d.jsx(Fv,{}),label:"Git",onClick:u})}),d.jsx(xe,{content:"Notifications",children:d.jsxs("span",{className:Y9,children:[d.jsx(et,{variant:"ghost",size:"small",icon:d.jsx(EB,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{className:q9,children:d.jsx(le,{size:"small",variant:"warning",children:l})})]})})]})]}),X9=()=>{const e=M(g=>g.agentStatus),t=M(g=>g.gitStatus),n=M(g=>g.gitBranch),r=M(g=>g.gitAhead),s=M(W5),i=M(H5),o=M(G5),a=M(g=>{var v;return((v=g.notifications)==null?void 0:v.filter(y=>y.kind==="question"||!y.read).length)??0}),l=mt(),c=e.find(g=>g.status==="running"||g.status==="starting"||g.status==="stopping"),u=c!==void 0,f=(t==null?void 0:t.length)??0,h=()=>l({to:"/settings/$section",params:{section:"setup"}}),p=()=>l({to:"/git"}),m=()=>l({to:"/inbox"});return d.jsx(Q9,{gitBranch:n,gitAhead:r,changedFileCount:f,agentActive:u,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:h,onOpenGit:p,onOpenNotifications:m})},J9=({children:e,className:t=""})=>d.jsx("h1",{className:`text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1] ${t}`,children:e}),Z9=3*6e4,eH=(e,t)=>{const n=M(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;b.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{g4(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},Z9);return()=>clearTimeout(o)},[t,i,s,n])},$a=()=>{const e=M(i=>i.loadPlans),{toast:t}=He(),[n,r]=b.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await U4(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}},tH=e=>{const t=M(a=>a.loadPlans),{toast:n}=He(),[r,s]=b.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await zv(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:Fe(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await yS(l);return await zv(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:Fe(c.message),variant:"error"}),!1}finally{s(null)}}}},hp=.95,nH=3e4,pp={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function rH(e){const t=[...e].sort((r,s)=>r-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function sH(e){const t=e.filter(s=>s.taskKind==="phase"&&s.outcome==="done").map(s=>Date.parse(s.endedAt)-Date.parse(s.startedAt)).filter(s=>Number.isFinite(s)&&s>0);if(t.length===0)return{};const n=rH(t),r={};for(const s of["implement","verify"]){const i=pp[s].to-pp[s].from;r[s]=n*i/hp}return r}function iH({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=pp[e],o=Math.min(i.from,hp),a=s==null?void 0:s[e];if(!a||a<=0||t===void 0||i.to===i.from)return o;const l=n===void 0?r:Math.min(r,n+nH),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),hp)}const oH=new Set(["starting","running","stopping"]),aH=1e3;function lH(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&oH.has(e.status),[r,s]=b.useState(()=>Date.now());return b.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),aH);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:iH({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:sH(t)})}}const cH=(e,{reload:t,notify:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(!1),[a,l]=b.useState(null);return b.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async f=>{if(!e.id)return!1;s(!0),l(null);try{const h={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:p,undo:m}=await m4(e.id,f,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:Fe(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Fe(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await y4(e.id,a.commitSha);if(f){n({title:"Undo failed",description:Fe(f),variant:"error"});return}l(null),await t()}catch(f){n({title:"Undo failed",description:Fe(f.message),variant:"error"})}finally{o(!1)}}}}},uH=async e=>{const t=await fetch(G(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},dH=e=>{const[t,n]=b.useState(null);return b.useEffect(()=>{if(n(null),!e)return;let r=!1;return uH(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function PC(){const[e,t]=b.useState("idle"),[n,r]=b.useState(null),s=b.useRef(null),i=b.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=b.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 xg="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.",EC="A title is a noun/verb phrase, at most 40 characters (roughly 3-6 words), no em-dash subtitles or trailing clauses — the symptom, mechanism, and detail belong in the body's first paragraph, not the title.";function fH(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
92
|
+
`),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
93
|
+
`):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
94
|
+
`):"(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.
|
|
95
|
+
|
|
96
|
+
Plan body: ${e.body}
|
|
97
|
+
|
|
98
|
+
Current phases:
|
|
99
|
+
${t}
|
|
100
|
+
|
|
101
|
+
Log entries (issues, bugs, and review notes recorded so far):
|
|
102
|
+
${n}
|
|
103
|
+
|
|
104
|
+
Clarifications (answered scope/design questions):
|
|
105
|
+
${r}
|
|
106
|
+
|
|
107
|
+
${xg}
|
|
108
|
+
|
|
109
|
+
Task:
|
|
110
|
+
1. Read the plan above, then inspect the relevant code in this repo.
|
|
111
|
+
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.
|
|
112
|
+
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.
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
Rules:
|
|
116
|
+
- Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
|
|
117
|
+
- Never touch the YAML frontmatter.
|
|
118
|
+
- Append only: new unchecked phases at the end of the list, plus the single Log line.`}function hH(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(`
|
|
119
|
+
`):"(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.
|
|
120
|
+
|
|
121
|
+
${t?"Plan":"Idea"} body: ${e.body}
|
|
122
|
+
|
|
123
|
+
Current phases:
|
|
124
|
+
${r}
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
|
|
129
|
+
2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
|
|
130
|
+
3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
|
|
131
|
+
|
|
132
|
+
Hard guardrails, never violate these:
|
|
133
|
+
- Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
|
|
134
|
+
- Never un-check, check, delete, or reorder any phase line, checked or unchecked.
|
|
135
|
+
- Never add or remove phases.
|
|
136
|
+
- Never touch the Log or Clarifications sections.
|
|
137
|
+
- If nothing is stale, make no edits at all.`}function vg(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.
|
|
138
|
+
|
|
139
|
+
${n}
|
|
140
|
+
|
|
141
|
+
${xg}
|
|
142
|
+
|
|
143
|
+
Task:
|
|
144
|
+
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.
|
|
145
|
+
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.
|
|
146
|
+
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).
|
|
147
|
+
|
|
148
|
+
Keep unchanged:
|
|
149
|
+
${r}
|
|
150
|
+
|
|
151
|
+
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function pH(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
152
|
+
`):"(none)",n=`Current idea body, in full (do not modify this):
|
|
153
|
+
${e.body}
|
|
154
|
+
|
|
155
|
+
Prior Log entries:
|
|
156
|
+
${t}`,r=`- the YAML frontmatter (id, title)
|
|
157
|
+
- the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return vg(e,"expanding",n,r)}const TC=`- the YAML frontmatter (id, title, status)
|
|
158
|
+
- the original body prose beneath the frontmatter`;function mH(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:
|
|
159
|
+
${e.body}`;return vg(e,"fleshing out",t,TC)}function VG(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:
|
|
160
|
+
${e.body}`;return vg(e,"fleshing out",n,TC)}function gH(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(`
|
|
161
|
+
`):"(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.
|
|
162
|
+
|
|
163
|
+
Idea body, in full:
|
|
164
|
+
${e.body}
|
|
165
|
+
|
|
166
|
+
## What drafting adds to the file (see papercamp/about.md)
|
|
167
|
+
|
|
168
|
+
The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
|
|
169
|
+
|
|
170
|
+
1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
|
|
171
|
+
2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
|
|
172
|
+
3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
|
|
173
|
+
|
|
174
|
+
\`\`\`
|
|
175
|
+
### Phases
|
|
176
|
+
- [ ] Short phase title
|
|
177
|
+
Optional description of the phase, indented with 6 spaces.
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
${xg}
|
|
181
|
+
|
|
182
|
+
Hard rules:
|
|
183
|
+
- Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${EC} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
|
|
184
|
+
- Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
|
|
185
|
+
- Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
|
|
186
|
+
|
|
187
|
+
## Every other open (non-done) plan, for scope context
|
|
188
|
+
|
|
189
|
+
${r}
|
|
190
|
+
|
|
191
|
+
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 yH(e,t){const n=e.length?e.map(s=>s.status==="done"||s.status==="dropped"?`- ${s.id??"no id"}: ${s.title} (status: ${s.status})`:`### ${s.id??"no id"}: ${s.title}
|
|
192
|
+
${s.body}`).join(`
|
|
193
|
+
|
|
194
|
+
`):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
|
|
195
|
+
`):"(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.
|
|
196
|
+
|
|
197
|
+
Existing ideas (do not repeat anything already covered here):
|
|
198
|
+
${n}
|
|
199
|
+
|
|
200
|
+
Existing suggestions already in the holding pen (do not repeat these either):
|
|
201
|
+
${r}
|
|
202
|
+
|
|
203
|
+
Task:
|
|
204
|
+
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.
|
|
205
|
+
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. ${EC} Keep the description to a single physical line (no literal line breaks).
|
|
206
|
+
3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
|
|
207
|
+
|
|
208
|
+
Rules:
|
|
209
|
+
- Append only — never modify, reorder, or delete any existing line in suggestions.md.
|
|
210
|
+
- Never create papercamp/ideas/ files — a suggestion is not an idea until a human promotes it.
|
|
211
|
+
- Never touch any other file in the repo.`}const NC=({idea:e,otherPlans:t,className:n=""})=>{const r=M(h=>h.launchPlanDraft),s=M(fr),{state:i,errorMessage:o,run:a}=PC(),{toast:l}=He(),c=()=>{const h=e.id;h&&a(async()=>{try{await r(h,gH(e,t))}catch(p){throw l({title:"Draft failed",description:Fe(p.message),variant:"error"}),p}})},u=i==="loading"?"Drafting…":i==="success"?"Draft sent!":i==="error"?"Draft failed":"Draft plan",f=i==="error"?o??"Draft failed":e.id?s?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(xe,{content:f,children:d.jsx(oe,{variant:"ghost",size:"small",onClick:c,disabled:i==="loading"||!e.id||!s,className:`${i==="error"?"text-watercolor-rose-dark":"text-ink-500"} ${n}`,children:u})})},xH=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=b.useRef(null),[s,i]=b.useState(!1),[o,a]=b.useState(!1);return b.useLayoutEffect(()=>i(!1),[n]),b.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const c=()=>a(l.scrollHeight-l.clientHeight>1);c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[s,n]),d.jsxs("div",{children:[d.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&d.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"})]})},wf=new Map,Y0=new Map,vH=e=>`commit-draft:${e}`;function wH(e,t){const{formKey:n,suggestedTitle:r,matchesSuggestionTask:s,beforeCommit:i}=t,o=M(N=>N.agentStatus),a=M(N=>N.loadGitStatus),l=M(N=>N.loadDiffFiles),c=M(N=>N.commitInFlight),u=M(N=>N.setCommitInFlight),{toast:f}=He(),[h,p]=b.useState(""),[m,g]=b.useState(""),[v,y]=b.useState(!1),[x,w]=b.useState(!1),[k,S]=b.useState(null),C=b.useMemo(()=>e.map(N=>N.path),[e]),P=b.useMemo(()=>e.filter(N=>N.staged).length,[e]);b.useEffect(()=>{r&&!h&&p(r)},[r,h]);const E=vH(n);b.useEffect(()=>{const N=Aa(E);p((N==null?void 0:N.title)??""),g((N==null?void 0:N.message)??"")},[E]),b.useEffect(()=>{!h&&!m||Ma(E,{title:h,message:m})},[E,h,m]),b.useEffect(()=>{const N=wf.get(n)??Date.now();wf.set(n,N);const I=Y0.get(n)??new Set,L=o.find(O=>s(O)&&O.suggestedCommit&&!I.has(O.id)&&(O.lastStreamAt??0)>N);L!=null&&L.suggestedCommit&&(I.add(L.id),Y0.set(n,I),p(L.suggestedCommit.title),g(L.suggestedCommit.message))},[o,n,s]);const T=b.useCallback(async()=>{if(!h.trim()||c)return;y(!0),u(!0);let N;try{const I=i?await i(h.trim()):void 0;N=I==null?void 0:I.onFailure;const L=I==null?void 0:I.extraPath;if(P>0)L&&await LB(L),await Jh([],h.trim(),m.trim()||void 0);else{const O=L&&!C.includes(L)?[...C,L]:C;await Jh(O,h.trim(),m.trim()||void 0)}p(""),g(""),wf.set(n,Date.now()),eg(E),await Promise.all([a(),l()])}catch(I){N&&await N(),f({title:"Commit failed",description:Fe(I.message),variant:"error"}),await Promise.all([a(),l()])}finally{y(!1),u(!1)}},[h,m,C,P,a,l,c,u,f,n,E,i]),j=b.useCallback(async()=>{if(C.length!==0){w(!0),S(null);try{const N=await dS(C);p(N.title),g(N.message)}catch(N){S(N.message)}finally{w(!1)}}},[C]);return{commitTitle:h,setCommitTitle:p,commitMessage:m,setCommitMessage:g,committing:v,commitInFlight:c,stagedCount:P,suggesting:x,suggestError:k,setSuggestError:S,handleCommit:T,handleSuggestFromChanges:j}}const q0=(e,t)=>{var n;return((n=e.find(r=>r.name===t))==null?void 0:n.status)??"stale"};function RC(e,t){var n;return{qualityStatus:q0(t,"lint"),testStatus:q0(t,"test"),consistencyStatus:((n=e==null?void 0:e.consistency)==null?void 0:n.status)??"stale"}}const bH=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function kH(e){var r;if(e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>bH.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const _H={pass:"success",fail:"error",running:"warning",stale:"neutral"},bf=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(xe,{content:n,children:d.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] ${r?"cursor-not-allowed":"cursor-pointer"} ${r&&t!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{r||s()},disabled:r,children:d.jsxs(le,{size:"small",variant:_H[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),SH=()=>{const e=M(g=>g.status),t=M(g=>g.runConsistencyCheck),{checks:n,run:r}=Oa(),s=M(g=>g.consistency),i=M(g=>g.plans),o=mt(),[a,l]=b.useState(!1),{qualityStatus:c,testStatus:u,consistencyStatus:f}=b.useMemo(()=>RC(e,n),[e,n]),h=c==="running"||u==="running"||f==="running",p=s.length>0,m=b.useCallback(g=>g.planId?i==null?void 0:i.entries.find(v=>v.id===g.planId):void 0,[i==null?void 0:i.entries]);return d.jsx("div",{className:"flex flex-col items-center gap-2",children:d.jsxs("div",{className:"flex flex-wrap items-start justify-center gap-2",children:[d.jsx(bf,{label:"Quality",status:c,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:h,onClick:()=>r("lint")}),d.jsx(bf,{label:"Tests",status:u,title:"Unit tests (Vitest). Click to run.",anyRunning:h,onClick:()=>r("test")}),d.jsx(bf,{label:"Consistency",status:f,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:h,onClick:()=>t()}),d.jsxs("div",{children:[d.jsx(xe,{content:p?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${p?"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:!p,"aria-expanded":p?a:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{p&&l(g=>!g)},children:d.jsx(le,{size:"small",variant:p?"error":"success",children:"Docs"})})}),a&&p&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:s.map((g,v)=>{const y=m(g);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:y?d.jsx("button",{type:"button",onClick:()=>o({to:"/plans/$planId",params:{planId:Yr(y.id,y.title)}}),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:g.message}):d.jsx("span",{className:"text-left",children:g.message})},`${g.kind}-${g.title}-${v}`)})})]}),d.jsx(X5,{})]})})},CH=({count:e})=>{const t=mt();return d.jsxs("button",{type:"button",onClick:()=>t({to:"/git"}),className:"bg-none bg-transparent border-none p-0 font-handwritten text-xs opacity-[0.6] underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},jH=(e,t)=>{const n=M(v=>v.status),{checks:r}=Oa(),s=M($u),i=M(v=>v.launchRunAll),{patch:o}=$a(),[a,l]=b.useState(!1),{title:c}=b.useMemo(()=>kH(e),[e]),u=b.useMemo(()=>t.map(v=>v.path),[t]),f=b.useCallback(async v=>{if(!e.id||T5(u))return{};const y=e.id;return await o(e.title,{phases:E5(e.phases,v)})?{extraPath:N5(y),onFailure:async()=>{await o(e.title,{phases:e.phases})}}:{}},[e,u,o]),h=b.useCallback(v=>v.planId===e.id,[e.id]),p=wH(t,{formKey:e.id??"__plan-draft__",suggestedTitle:c,matchesSuggestionTask:h,beforeCommit:f}),m=!!e.id&&!s,g=b.useCallback(async()=>{if(!e.id||!n||a||s)return;const v=e.id;l(!0);try{const y=C5(e.fixes??[],n,r);await o(e.title,{fixes:y})&&await i(v)}finally{l(!1)}},[e,a,s,n,r,o,i]);return{...p,canFix:m,fixing:a,handleFix:g}},PH=({state:e,filesEmpty:t})=>{const n=M(u=>u.status),{checks:r}=Oa(),{qualityStatus:s,testStatus:i,consistencyStatus:o}=b.useMemo(()=>RC(n,r),[n,r]);if(s==="fail"||i==="fail"||o==="fail"){const u=e.fixing?"Fixing…":"Fix",f=!e.canFix||e.fixing;return d.jsxs("div",{className:"[container-type:inline-size]",children:[d.jsx(oe,{className:"commit-btn-full",size:"small",disabled:f,onClick:e.handleFix,children:u}),d.jsx(et,{className:"commit-btn-compact",icon:d.jsx(Dv,{size:14}),size:"small",label:u,disabled:f,onClick:e.handleFix})]})}const l=e.committing||e.commitInFlight?"Committing…":e.stagedCount>0?`Commit ${e.stagedCount} staged`:"Commit",c=t||!e.commitTitle.trim()||e.committing||e.commitInFlight;return d.jsxs("div",{className:"[container-type:inline-size]",children:[d.jsx(oe,{className:"commit-btn-full",size:"small",disabled:c,onClick:e.handleCommit,children:l}),d.jsx(et,{className:"commit-btn-compact",icon:d.jsx(Dv,{size:14}),size:"small",label:l,disabled:c,onClick:e.handleCommit})]})},EH=()=>{const e=M(t=>t.gitAhead);return d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:e>0?`All changes committed — ${e} commit${e===1?"":"s"} ready to push.`:"No changed files."}),d.jsx(Z5,{})]})},TH={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},NH=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=TH[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(J_,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(Xm,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(X_,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return d.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[d.jsx("div",{className:"max-w-[85%]",children:d.jsx(_e,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:d.jsx(xH,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),d.jsxs("div",{className:"flex items-center gap-2",children:[c&&d.jsx(le,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(xe,{content:"Revert this run's plan edit",children:d.jsx(oe,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&d.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&d.jsx(le,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(ur,{size:"small",label:"Promoting…"}):d.jsx(iS,{align:"end",trigger:d.jsx(et,{icon:d.jsx(lS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),is=({id:e})=>e?d.jsx(le,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,IC={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},za={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},Vt={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"}},AC={open:"Open",done:"Done",dropped:"Dropped"},ru={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"}},RH={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},Q0={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"}},IH={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},X0={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"}},J0=({pr:e,reviewing:t})=>{const n=M(s=>{var i;return((i=s.status)==null?void 0:i.prFetchedAt)??null}),r=d.jsx(le,{size:"small",fillColor:Q0[e.state].fill,textColor:Q0[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(TB,{}),"#",e.number," ",RH[e.state]]})});return d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"no-underline inline-flex",children:n!=null?d.jsx(xe,{content:`Fetched from GitHub ${vS(n)}`,children:r}):r}),t&&d.jsx(ur,{size:"small",label:`Reviewing PR #${e.number}`})]})},MC=({pct:e,color:t,height:n=6})=>d.jsx(r$,{value:e,color:t,height:n}),Z0=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&d.jsx(le,{size:"small",fillColor:X0[t].fill,textColor:X0[t].text,children:IH[t]}),!!n&&d.jsxs(le,{size:"small",fillColor:Vt["in-progress"].fill,textColor:Vt["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},ew={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},tw={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Ml=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(le,{size:"small",fillColor:e?ew.fill:tw.fill,textColor:e?ew.text:tw.text,children:t}),i=r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?d.jsx(xe,{content:n,children:i}):i},kf=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),nw=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function AH(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const MH=({trail:e,released:t,reviewing:n,reviewNote:r})=>{var u,f;const{taskRuns:s,commits:i,pr:o,releaseLine:a}=e,l=a.data?AH(a.data):void 0,c=t?`Released ${t}`:l?`Released ${l.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Ml,{reached:s.reached,label:s.data?nw(s.data.length,"task run"):"Tasks",tooltip:(u=s.data)==null?void 0:u.map(h=>h.taskKind).join(", ")}),d.jsx(kf,{}),d.jsx(Ml,{reached:i.reached,label:i.data?nw(i.data.length,"commit"):"Commits",tooltip:(f=i.data)==null?void 0:f.join(`
|
|
212
|
+
`)}),d.jsx(kf,{}),o.data?r&&!n?d.jsx(xe,{content:r,children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(J0,{pr:o.data,reviewing:n}),d.jsx(Z0,{pr:o.data})]})}):d.jsxs(d.Fragment,{children:[d.jsx(J0,{pr:o.data,reviewing:n}),!n&&d.jsx(Z0,{pr:o.data})]}):d.jsx(Ml,{reached:!1,label:"PR"}),d.jsx(kf,{}),d.jsx(Ml,{reached:a.reached||!!t,label:c,tooltip:a.data,href:l==null?void 0:l.url})]})},LC=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=b.useState(""),[o,a]=b.useState(""),[l,c]=b.useState(!1),[u,f]=b.useState(!1),[h,p]=b.useState(null),[m,g]=b.useState(null),[v,y]=b.useState(!1),[x,w]=b.useState(null),[k,S]=b.useState(null),C=M(A=>{var $;return(($=A.plans)==null?void 0:$.entries)??[]}),{patch:P}=$a(),E=mt(),T=c9(s,C.map(A=>({id:A.id,title:A.title,body:A.body,tags:A.tags,log:A.log})));b.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),p(null),y(!1),w(null),S(null))},[e,r]);const j=(A,$)=>{t(),E({to:"/plans/$planId",params:{planId:Yr(A,$)}})},N=async()=>{const A=`${s.trim()}${o.trim()?`
|
|
213
|
+
|
|
214
|
+
${o.trim()}`:""}`;if(A){y(!0),S(null),w(null);try{const $=C.map(U=>({id:U.id,title:U.title,body:U.body,tags:U.tags}));w(await F4(A,$))}catch($){S($.message)}finally{y(!1)}}},I=A=>{const $=C.find(U=>U.id===A);$&&j($.id,$.title)},L=async(A,$,U)=>{g(A);const z={date:new Date().toISOString().slice(0,10),text:s.trim()},_=await P($,{log:[...U??[],z]},{errorTitle:"Extend failed"});g(null),_&&t()},O=async A=>{if(A.preventDefault(),!(!s.trim()||u)){p(null),f(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch($){p($.message)}finally{f(!1)}}};return d.jsx(Ia,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:O,className:"flex flex-col gap-4",children:[d.jsx(Du,{label:"Title",value:s,onChange:A=>i(A.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),T.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),T.map(({candidate:A})=>{const $={id:A.id??null,title:A.title,body:A.body,log:A.log},U=C.filter(F=>F.id!==A.id);return d.jsx(_e,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(is,{id:A.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:A.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{type:"button",variant:"ghost",size:"small",onClick:()=>j(A.id,A.title),children:"Open it"}),d.jsx(oe,{type:"button",variant:"ghost",size:"small",disabled:!A.id||!s.trim()||m!==null,onClick:()=>A.id&&L(A.id,A.title,A.log),children:m===A.id?"Extending…":"Extend it instead"}),d.jsx(NC,{idea:$,otherPlans:U})]})]})},A.id??A.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(oe,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||v,onClick:N,children:v?"Checking overlap…":"Check overlap"})}),k&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:k}),x&&d.jsx(_e,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(oe,{type:"button",variant:"ghost",size:"small",onClick:()=>I(x.targetId),children:"Open it"})})]})})]}),d.jsx(Qm,{label:"Description",value:o,onChange:A=>a(A.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d.jsx(nS,{label:"Just a note (no plan needed)",checked:l,onChange:A=>c(A.target.checked),disabled:u}),h&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:h}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),d.jsx(oe,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},LH=({open:e,onClose:t,onConfirm:n})=>{const r=M(m=>{var g;return((g=m.plans)==null?void 0:g.entries)??[]}),[s,i]=b.useState([]),[o,a]=b.useState(new Set),[l,c]=b.useState(!1),[u,f]=b.useState(null);b.useEffect(()=>{if(e){const m=r.filter(g=>!!g.id&&g.phases.length===0&&g.status==="idea");i(m),a(new Set(m.map(g=>g.id))),c(!1),f(null)}},[e]);const h=m=>{a(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},p=async()=>{c(!0),f(null);try{await n([...o]),t()}catch(m){f(m.message)}finally{c(!1)}};return d.jsx(Ia,{open:e,onClose:t,title:"Draft all",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"m-0 opacity-80",children:[s.length," undrafted idea",s.length===1?"":"s"," will be turned into a plan."]}),s.length>0&&d.jsx("div",{className:"flex max-h-[16rem] flex-col gap-2 overflow-y-auto",children:s.map(m=>d.jsx(Q_,{label:m.title,checked:o.has(m.id),onChange:()=>h(m.id)},m.id))}),u&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:u}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Cancel"}),d.jsx(oe,{type:"button",variant:"primary",onClick:p,disabled:l||o.size===0,children:l?"Starting…":`Draft ${o.size}`})]})]})})},DH=({suggestion:e,onClose:t})=>{const n=M(u=>u.promoteSuggestion),r=M(u=>u.launchIdeaExtend),[s,i]=b.useState(!1),[o,a]=b.useState(null),{toast:l}=He();b.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),f=M.getState().ideaEntries.find(h=>h.id===u);if(f)try{await r(u,mH(f))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Fe(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Ia,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),d.jsx(oe,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},_f=({tokens:e})=>d.jsx(d.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return d.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return d.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}`)})}),rw=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),FH=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=b.useState(!1),[a,l]=b.useState(!1),c=e.body!==t.body,u=e.phases.map((m,g)=>({phase:m,before:t.phases[g],index:g})).filter(({phase:m,before:g})=>g!==void 0&&(m.text!==g.text||(m.description??"")!==(g.description??""))),f=i||a,h=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Ia,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:h,children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.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.']}),!c&&u.length===0&&d.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&d.jsxs("div",{children:[rw("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(_f,{tokens:nf(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[rw("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:g,index:v})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(_f,{tokens:nf(g.text,m.text)}),(m.description||g.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(_f,{tokens:nf(g.description??"",m.description??"")})})]},v))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{variant:"danger",size:"small",onClick:h,disabled:f,children:"Discard"}),d.jsx(oe,{variant:"primary",size:"small",onClick:p,disabled:f,children:"Approve"})]})]})})},Hu=({order:e,done:t,running:n,status:r,fallback:s})=>d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?d.jsx(ur,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?s?d.jsx(xe,{content:"Queue position based on a status guess — GitHub's PR state couldn't be resolved",children:d.jsx(le,{size:"small",variant:"warning",dot:!0,children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})})}):d.jsx(le,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?d.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:d.jsx(cS,{size:14})}):null}),Vi="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",OH=({plans:e,activePlanTitle:t,onOpen:n})=>{const r=Vi,s=M(i=>i.agentStatus);return d.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{var l;const o=bS(i),a=Ou(i,s);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(Hu,{order:i.order,done:i.status==="done",status:i.status,running:!!Fu(i.id,s),fallback:i.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(i.title):void 0,onKeyDown:n?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(i.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${i.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(_e,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:r,children:[d.jsx(is,{id:i.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:i.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:i.updated?Zh(i.updated):Zh(i.created)}),o?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(MC,{pct:o.pct,color:IC[a]})}),d.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[o.done,"/",o.total]})]}):d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(le,{size:"small",fillColor:Vt[a].fill,textColor:Vt[a].text,children:za[a]}),i.statusFallback&&d.jsx(xe,{content:"GitHub's PR state couldn't be resolved — this status is a guess from local data",children:d.jsx(le,{size:"small",variant:"warning",dot:!0,children:"Guess"})}),((l=i.pr)==null?void 0:l.state)==="merged"&&d.jsx(xe,{content:`Merged in #${i.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(aS,{size:14})})})]})]})})})]},i.title)})})},$H=({onOpen:e})=>{const t=M(m=>m.archivableIdeas),n=M(m=>m.archiveIdeas),r=M(m=>m.planFilters.search),[s,i]=b.useState(null),[o,a]=b.useState(!1),{toast:l}=He(),c=r.trim().toLowerCase(),u=c?t.filter(m=>m.title.toLowerCase().includes(c)):t,f=b.useCallback(async m=>{try{await n(m)}catch(g){l({title:"Archive failed",description:g.message,variant:"error"})}},[n,l]),h=b.useCallback(async m=>{i(m.id);try{await f([m.id])}finally{i(null)}},[f]),p=b.useCallback(async()=>{a(!0);try{await f(u.map(m=>m.id))}finally{a(!1)}},[f,u]);return u.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[d.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",u.length,")"]}),d.jsx(oe,{variant:"ghost",size:"small",disabled:o||s!==null,onClick:p,children:o?"Archiving…":"Archive all"})]}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(m=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(Hu,{done:!0}),d.jsx("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(m):void 0,onKeyDown:e?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),e(m))}:void 0,className:`${e?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:d.jsx(_e,{size:"small",texture:"canvas",shade:!0,className:"plan-row-card",children:d.jsxs("div",{className:Vi,children:[d.jsx(is,{id:m.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:m.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-30",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(oe,{variant:"ghost",size:"small",className:"archive-row-action",disabled:s===m.id||o,onClick:g=>{g.stopPropagation(),h(m)},onKeyDown:g=>g.stopPropagation(),children:s===m.id?"Archiving…":"Archive"})]})})})]},m.id))})]})},zH="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function sw(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function wg(e){const t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?r>0?`${n}h${r}m`:`${n}h`:r>0?s>0?`${r}m${s}s`:`${r}m`:`${s}s`}function ys(e){return e>=1e6?`${sw(e/1e6,1)}M`:e>=1e3?`${sw(e/1e3,1)}k`:`${Math.round(e)}`}function BH(e,t){var s;const n={runs:0,durationMs:0,inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=i=>{n.runs+=1,n.durationMs+=i.durationMs,n.inputTokens+=i.inputTokens,n.outputTokens+=i.outputTokens,n.cacheCreationTokens+=i.cacheCreationTokens,n.cacheReadTokens+=i.cacheReadTokens};for(const i of e)if(!(t&&i.planId!==t))if((s=i.phaseRuns)!=null&&s.length)for(const o of i.phaseRuns)r(o.usage);else i.usage&&r(i.usage);return n}const VH=({onAdd:e,disabled:t,entityId:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(""),[a,l]=b.useState(null),[c,u]=b.useState(!1),f=`review-phases-draft:${n}`;b.useEffect(()=>{o(Aa(f)??"")},[f]),b.useEffect(()=>{i&&Ma(f,i)},[f,i]);const h=()=>{s(!1),o(""),l(null),eg(f)},p=async()=>{let m;try{m=w5(i)}catch(g){l(g instanceof Error?g.message:"Could not parse findings");return}u(!0),l(null);try{await e(m),h()}finally{u(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(xe,{content:"Add code-review findings as phases",children:d.jsx(et,{variant:"ghost",size:"small",onClick:()=>s(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(R3,{size:16})})}),d.jsx(Ia,{open:r,onClose:h,title:"Add code-review findings",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",d.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),d.jsx(Qm,{value:i,onChange:m=>o(m.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:c}),a&&d.jsxs(tS,{variant:"warning",children:["Could not add phases — ",a]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(oe,{type:"button",variant:"ghost",onClick:h,disabled:c,children:"Cancel"}),d.jsx(oe,{type:"button",variant:"primary",onClick:p,disabled:c||!i.trim(),children:"Add phases"})]})]})})]})},UH=({planId:e,phaseIndex:t,disabled:n})=>{const r=M(u=>u.launchAgent),s=M(fr),{toast:i}=He(),[o,a]=b.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(f){i({title:"Failed to start agent",description:Fe(f.message),variant:"error"})}finally{a(!1)}}},c=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 d.jsx(et,{icon:d.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"text-ink-500"})},WH=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanAudit),r=M(fr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,fH(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 d.jsx(xe,{content:a,children:d.jsx(oe,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})};function DC(e){const[t,n]=b.useState(null),r=b.useCallback(async()=>{n(e?await p4(e):null)},[e]);return b.useEffect(()=>{r()},[r]),b.useEffect(()=>{let s;const i=Fa(o=>{o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(r,250))});return()=>{s&&clearTimeout(s),i()}},[r]),t}const HH=({plan:e,disabled:t})=>{const n=M(u=>u.refreshAll),[r,s]=b.useState(!1),{toast:i}=He(),o=DC(e.id),a=e5(e,o==null?void 0:o.ciGreen),l=async()=>{if(e.id){s(!0);try{const u=await BB(e.id);u.needsAttention?i({title:"Merged — main needs manual sync",description:Fe(u.needsAttention),variant:"error"}):i({title:"Idea complete",description:`${e.id} merged — main is up to date`,variant:"success"}),await n()}catch(u){i({title:"Complete failed",description:Fe(u.message),variant:"error"})}finally{s(!1)}}},c=t||r||!e.id||!a.ready;return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:l,disabled:c,className:`pc-row text-xs ${c?"opacity-50":""}`,children:r?"Completing…":"Complete idea"}),!a.ready&&a.missing.length>0&&d.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:["Waiting on ",a.missing.join(", ")]})]})},FC=({idea:e,compact:t})=>{const n=M(h=>h.launchIdeaExtend),r=M(fr),{state:s,errorMessage:i,run:o}=PC(),{toast:a}=He(),l=e.id,c=()=>{l&&o(async()=>{const h=M.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,pH(h))}catch(p){throw a({title:"Extension failed",description:Fe(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",f=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 d.jsx(xe,{content:f,children:d.jsx(oe,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},GH=({plan:e,disabled:t})=>{const n=M(u=>u.launchFixReview),r=M(fr),s=M(RS),[i,o]=b.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,c=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 d.jsx(xe,{content:c,children:d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:`text-xs leading-4 py-2 ${l?"opacity-50":""}`,children:i?"Starting…":"Fix review comments"})})},KH=()=>{const e=M(s=>s.loadIdeas),[t,n]=b.useState(!1),r=async s=>{await yS(s),await e(),n(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(oe,{icon:d.jsx(X_,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),d.jsx(LC,{open:t,onClose:()=>n(!1),onAdd:r})]})},YH=({plan:e,disabled:t})=>{const n=M(m=>m.launchPrReview),r=M(fr),s=M(RS),[i,o]=b.useState(!1),a=DC(e.id),l=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(m){alert(m.message)}finally{o(!1)}}},c=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",f=!!(a!=null&&a.lastReviewedSha&&a.headSha&&a.lastReviewedSha===a.headSha),h=i?"Starting…":f?`Review again — last reviewed at ${((a==null?void 0:a.lastReviewedSha)??"").slice(0,7)}`:"Review PR",p=[a&&!a.ready&&"draft",(a==null?void 0:a.ciGreen)===!1&&"CI not green"].filter(Boolean);return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(xe,{content:u,children:d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-watercolor-blue-dark",children:"◎"}),onClick:l,disabled:c,className:`text-xs leading-4 py-2 ${c?"opacity-50":""}`,children:h})}),p.length>0&&d.jsx("div",{className:"text-2xs text-ink-300 px-2",children:p.join(" · ")})]})},qH=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanReconcile),r=M(fr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,hH(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 d.jsx(xe,{content:a,children:d.jsx(oe,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},QH=({plan:e,disabled:t})=>{const n=M(c=>c.launchRunAll),r=M(fr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(c){alert(c.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 d.jsx(xe,{content:l,children:d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:`text-xs leading-4 py-2 ${a?"opacity-50":""}`,children:s?"Starting…":"Run all phases"})})},XH=()=>{const e=M(k=>k.launchSuggestIdeas),t=M(k=>k.launchBatchReconcile),n=M(k=>k.launchBatchDraft),r=M(k=>k.launchPrioritise),s=M(k=>k.refreshAll),i=M(k=>k.ideaEntries),o=M(k=>k.suggestions),a=M($u),l=M(fr),{toast:c}=He(),[u,f]=b.useState(null),[h,p]=b.useState(!1),m=async()=>{f("suggest");try{await e(yH(i,o))}catch(k){c({title:"Failed to launch",description:Fe(k.message),variant:"error"})}finally{f(null)}},g=async()=>{f("reconcile");try{await t()}catch(k){c({title:"Failed to launch",description:Fe(k.message),variant:"error"})}finally{f(null)}},v=async k=>{f("draft-all");try{await n(k)}finally{f(null)}},y=async()=>{f("prioritise");try{const k=await r(),S=k.moved.length-k.annotated.length;c({title:k.moved.length>0?"Queue reordered":"Already in order",description:S>0?`${S} of ${k.moved.length} ideas could not be annotated`:k.why||void 0,variant:S>0?"warning":"success"})}catch(k){c({title:"Failed to prioritise",description:Fe(k.message),variant:"error"}),await s()}finally{f(null)}},x=u!==null||a,w=[{id:"suggest-ideas",label:u==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx(oS,{size:16}),disabled:x||!l,onSelect:m},{id:"reconcile-all",label:u==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(J_,{size:16}),disabled:x||!l,onSelect:g},{id:"draft-all",label:"Draft all",icon:d.jsx(Xm,{size:16}),disabled:x||!l,onSelect:()=>p(!0)},{id:"prioritise",label:u==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(SB,{size:16}),disabled:x||!l,onSelect:y}];return d.jsxs(d.Fragment,{children:[d.jsx(iS,{align:"end",trigger:d.jsx(et,{icon:d.jsx(lS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:w}),d.jsx(LH,{open:h,onClose:()=>p(!1),onConfirm:v})]})};function JH(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Ba="font-display-luminari text-sm font-semibold opacity-[0.65]";function ZH(e){return`${ys(e.inputTokens+e.outputTokens)} tokens · ${wg(e.durationMs)}${e.attempts>1?` ×${e.attempts}`:""}${e.model?` · ${e.model}`:""}`}const e7=({rollup:e})=>e.runs===0?null:d.jsx("span",{className:"shrink-0",children:d.jsx(xe,{content:`${ys(e.inputTokens)} in · ${ys(e.outputTokens)} out · cache ${ys(e.cacheCreationTokens)} write · ${ys(e.cacheReadTokens)} read`,children:d.jsx(le,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[ys(e.inputTokens+e.outputTokens)," tokens ·"," ",wg(e.durationMs)," · ",e.runs," ",e.runs===1?"run":"runs"]})})})}),t7=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a,ideaView:l,otherPlans:c})=>{const u=M(g=>g.launchRunAll),f=e.fixes??[],h=f.some(g=>!g.done),p=[...e.phases.map((g,v)=>({kind:"phase",item:g,index:v})),...f.map((g,v)=>({kind:"fix",item:g,index:v}))],m=g=>g.kind==="phase"&&!g.item.done&&(r==null?void 0:r.index)===g.index;return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx(vF,{data:p,toolbar:{title:d.jsx("h3",{className:`${Ba} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(ur,{size:"small",label:"Audit running…"}),p.length===0&&d.jsx(FC,{idea:l}),p.length>0&&(e.status==="review"||e.status==="done")&&d.jsx(WH,{plan:e}),p.length>0&&e.status!=="done"&&d.jsx(qH,{plan:e}),p.length>0&&d.jsx(VH,{onAdd:a,disabled:s,entityId:e.id??e.title}),e.id&&h&&d.jsx(xe,{content:"Run the open fixes with an agent",children:d.jsx(oe,{size:"small",onClick:()=>e.id&&u(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:p.length===0?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(NC,{idea:l,otherPlans:c,className:"font-handwritten !text-base underline"})}):d.jsx(l7,{plan:e}),columns:[{key:"checkbox",header:"",cell:g=>m(g)?d.jsx(ur,{size:"small"}):d.jsx(Q_,{checked:g.item.done,onChange:()=>g.kind==="phase"?i(g.index):o(g.index),disabled:s}),width:1},{key:"title",header:"Title",cell:g=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${g.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:g.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:g.item.text}),m(g)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),g.kind==="phase"&&g.item.source==="review"&&d.jsx(le,{size:"small",fillColor:Vt.review.fill,textColor:Vt.review.text,children:"review"}),g.kind==="phase"&&g.item.source==="manual"&&d.jsx(le,{size:"small",variant:"neutral",children:"manual"}),g.kind==="fix"&&d.jsx(le,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"",align:"end",width:6,cell:g=>{if(m(g))return null;if(g.item.done){const v=g.item.run;return v?d.jsx("div",{className:"flex w-full justify-end [container-type:inline-size]",children:d.jsx(le,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[d.jsxs("span",{children:[ys(v.inputTokens+v.outputTokens)," tokens"]}),d.jsxs("span",{className:"run-meta-full",children:[" ","· ",wg(v.durationMs),v.attempts>1&&` ×${v.attempts}`,v.model&&` · ${v.model}`]})]})})}):null}return g.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(UH,{planId:e.id,phaseIndex:g.index,disabled:n})})}}],expandable:{render:g=>{const v=g.item.run?ZH(g.item.run):null;return!g.item.description&&!v?null:d.jsxs("div",{className:"flex flex-col gap-1",children:[g.item.description&&d.jsx("span",{children:g.item.description}),v&&d.jsx("span",{className:"font-mono text-3xs opacity-[0.7]",children:v})]})}},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:g=>{if(g.kind==="fix")return"kraft";if(g.kind==="phase"&&g.item.done)return"canvas"},rowClassName:g=>{if(m(g))return"phase-running-row";if(g.kind==="phase"&&g.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},n7=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return i?d.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-3 min-h-8",children:[i&&!n&&d.jsx(_e,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs("span",{className:"text-xs",children:[d.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&d.jsx(xe,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:d.jsx(oe,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&d.jsx(_e,{size:"small",texture:"paper",children:d.jsx("span",{className:"text-xs opacity-[0.6]",children:d.jsx("code",{children:t})})})]}):null},r7=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:d.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-min",children:[e!==null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-w-16",children:d.jsx(MC,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0 font-handwritten",children:[Math.round(e.pct),"%"]})]}),d.jsx(e7,{rollup:n})]}),s7=({plan:e})=>e.body?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:`${Ba} mb-2`,children:"Description"}),d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(pC,{children:e.body})})]}):null,i7=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Ba} mb-3`,children:"Clarifications"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>d.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:d.jsxs("span",{children:[d.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),o7=({plan:e,otherPlans:t})=>{const n=mt();if(e.entityKind!=="fix"||!e.idea)return null;const r=e.idea,s=t.find(i=>i.id===r);return d.jsx("div",{className:"mb-3",children:d.jsxs("button",{type:"button",onClick:()=>n({to:"/plans/$planId",params:{planId:Yr(r,(s==null?void 0:s.title)??r)}}),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left",children:[d.jsx(le,{size:"small",variant:"warning",children:"fix"}),d.jsxs("span",{className:"text-sm opacity-70",children:["Fixes ",d.jsx("span",{className:"font-mono",children:r}),s&&` — ${s.title}`]})]})})},a7=({plan:e,otherPlans:t})=>{const n=mt(),r=t.filter(s=>s.entityKind==="fix"&&s.idea===e.id);return r.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Ba} mb-3`,children:"Fixes"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:r.map(s=>d.jsxs("button",{type:"button",onClick:()=>n({to:"/plans/$planId",params:{planId:Yr(s.id,s.title)}}),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left text-sm",children:[d.jsx(is,{id:s.id}),d.jsx("span",{className:"flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),d.jsx(le,{size:"small",fillColor:Vt[s.status].fill,textColor:Vt[s.status].text,children:za[s.status]})]},s.title))})]})},l7=({plan:e})=>{const t=M(i=>i.gitStatus),n=b.useMemo(()=>(t==null?void 0:t.map(i=>({path:i.path,staged:i.staged})))??[],[t]),r=jH(e,n),s=n.length>0;return d.jsxs("div",{className:"flex min-h-[7rem] flex-col items-center justify-center gap-3",children:[d.jsx(SH,{}),s?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-full max-w-md",children:d.jsx(NB,{state:r,filesEmpty:!1})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[d.jsx(CH,{count:n.length}),d.jsx(PH,{state:r,filesEmpty:!1})]})]}):d.jsx(EH,{})]})},c7=({planId:e,released:t,reviewing:n,reviewNote:r})=>{const s=dH(e);return e?d.jsx("div",{className:"text-xs opacity-80 shrink-0",children:s?d.jsx(MH,{trail:s,released:t,reviewing:n,reviewNote:r}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(Lt,{variant:"text",height:32})})}):null};function u7(e){return`feedback-draft:${e.id??e.title}`}const d7=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var k;const[o,a]=b.useState(""),[l,c]=b.useState(null),[u,f]=b.useState(null),h=e.thread??[],{promotingIndex:p,promoteToDurable:m,promoteToIdea:g}=tH(e);eH(e,!0);const v=u7(e);b.useEffect(()=>{a(Aa(v)??"")},[v]),b.useEffect(()=>{o&&Ma(v,o)},[v,o]);const y=async()=>{const S=o.trim();S&&(c(S),a(""),await n(S)?eg(v):a(C=>C||S),c(null))},x=(S,C)=>{C==="idea"?f(S):m(S,C)},w=async S=>{u!==null&&await g(u,S)&&f(null)};return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${Ba} mb-3`,children:"Feedback"}),d.jsxs(_e,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[d.jsx("div",{className:"flex flex-col gap-3 mb-4",children:h.length>0||l?d.jsxs(d.Fragment,{children:[d.jsx(NH,{messages:h,undo:r,undoing:s,onUndo:i,onPromote:x,promotingIndex:p}),l&&d.jsx("div",{className:"flex flex-col gap-1 items-end",children:d.jsx("div",{className:"max-w-[85%]",children:d.jsx(_e,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:l})})}),t&&d.jsx("div",{className:"flex flex-col gap-1 items-start",children:d.jsx(_e,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:d.jsx(ur,{size:"small",label:"Agent thinking…"})})})]}):d.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."})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Qm,{value:o,onChange:S=>a(S.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),d.jsx("div",{className:"flex justify-end items-center gap-3",children:d.jsx(oe,{size:"small",onClick:y,disabled:t||!o.trim(),children:"Send"})})]})]}),d.jsx(LC,{open:u!==null,onClose:()=>f(null),onAdd:w,initialContent:u!==null?(k=h[u])==null?void 0:k.text:void 0})]})},f7=({plan:e})=>{const t=M(z=>z.plans),n=M(z=>z.gitBranch),r=M(z=>z.loadGitStatus),s=M(z=>z.loadPlans),{toast:i}=He(),{patch:o,updating:a}=$a(),[l,c]=b.useState(!1),u=M(z=>z.agentStatus),f=M($u),h=M(z=>z.detailView),p=M(z=>z.taskLog),m=M(z=>z.loadTaskLog),g=Fu(e.id,u),v=!!X4(e.id,u),y=J4(e.thread),x=lH(g,p),w=b.useMemo(()=>BH(p,e.id),[p,e.id]),k=(g==null?void 0:g.taskKind)==="audit",S=Q4(e,(x==null?void 0:x.fraction)??0);e.phases.length>0;const C=h==="feedback",P={id:e.id??null,title:e.title,body:e.body,log:e.log},E=((t==null?void 0:t.entries)??[]).filter(z=>z.id!==e.id),T=e.id!==void 0&&JH(n)===e.id;b.useEffect(()=>{m()},[m]);const j=async()=>{if(e.id){c(!0);try{const{branch:z,warning:_}=await VB(e.id);i({title:"Branch ready",description:`Now on ${z}`,variant:"success"}),_&&i({title:"Stale fork",description:_,variant:"warning"}),await r()}catch(z){i({title:"Branch failed",description:Fe(z.message),variant:"error"})}finally{c(!1)}}},N=async z=>{const _=e.phases.map((q,R)=>R===z?{...q,done:!q.done}:q);_.every(q=>q.done)&&e.status==="in-progress"?await o(e.title,{phases:_,status:"review"}):await o(e.title,{phases:_})},I=async z=>{await o(e.title,{phases:[...e.phases,...z]})},L=async z=>{const _=(e.fixes??[]).map((q,R)=>R===z?{...q,done:!q.done}:q);_.every(q=>q.done)&&e.status==="in-progress"?await o(e.title,{fixes:_,status:"review"}):await o(e.title,{fixes:_})},{sending:O,send:A,undo:$,undoing:U,undoEdit:F}=cH(e,{reload:s,notify:i});return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2",children:[d.jsxs("h2",{className:`${zH} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(is,{id:e.id}),e.title]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-handwritten",children:[d.jsxs("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:[d.jsx("span",{className:"max-[480px]:hidden",children:e.updated?"updated ":"created "}),Zh(e.updated??e.created)]}),d.jsx(xC,{})]})]}),d.jsx(o7,{plan:e,otherPlans:E}),d.jsxs("div",{className:"flex items-center gap-x-4 gap-y-1 flex-wrap mb-3",children:[d.jsx(c7,{planId:e.id,released:e.released,reviewing:v,reviewNote:y}),!C&&d.jsx(r7,{progress:S,color:IC[Ou(e,u)],rollup:w})]}),C?d.jsx(d7,{plan:e,updating:O,onSend:A,undo:$,undoing:U,onUndo:F}):d.jsxs(d.Fragment,{children:[d.jsx(n7,{plan:e,gitBranch:n,onOwnBranch:T,branching:l,onCreateBranch:j}),d.jsx(t7,{plan:e,auditRunning:k,agentBusy:f,runningFill:x,updating:a,onTogglePhase:N,onToggleFix:L,onAddReviewPhases:I,ideaView:P,otherPlans:E}),d.jsx(a7,{plan:e,otherPlans:E}),d.jsx(i7,{clarifications:e.clarifications??[]}),d.jsx(s7,{plan:e})]})]})},h7=()=>{const[e,t]=b.useState(new Set);return b.useEffect(()=>{let n=!1;return mS().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},p7="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",iw="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",m7="font-handwritten text-xs font-semibold opacity-55 leading-none",ow=`${p7} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,g7=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],OC="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",$C="overflow-hidden text-ellipsis whitespace-nowrap",y7=()=>{const e=M(n=>n.planFilters.groupBySubject),t=M(n=>n.toggleGroupBySubject);return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:m7,children:"Group by subject"}),d.jsx(nS,{size:"small",checked:e,onChange:t,"aria-label":"Group by subject"})]})},x7=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const{subjects:s,loading:i,available:o}=bC(),a=h7(),l=mt(),c=Vi,u=M(k=>k.planFilters.sortKey),f=M(k=>k.planFilters.sortDirection),h=M(k=>k.planFilters.groupBySubject),p=M(k=>k.setPlanSortKey),m=M(k=>k.togglePlanSortDirection),g=k=>{k===u?m():p(k)},v=k=>k.type==="plan"?d.jsx(OH,{plans:[k.plan],activePlanTitle:t,onOpen:n},k.plan.title):k.type==="note"?d.jsx(v7,{row:k,onOpen:r},k.idea.title):d.jsx(b7,{row:k,activePlanTitle:t,onOpen:n},k.fix.title),y=d5(e,f,i||!o?void 0:s),x=h&&y.length>1,w=!x;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":w&&u==="order"?f==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:ow,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",u==="order"&&(f==="asc"?"▲":"▼")]})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(_e,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:c,children:g7.map(({key:k,label:S})=>{const C=k===u;return d.jsx("span",{role:"columnheader",className:k==="updated"?"max-lg:hidden":void 0,"aria-sort":w&&C?f==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:ow,onClick:()=>g(k),children:[S,C&&(f==="asc"?" ▲":" ▼")]})},k)})})})})]}),x?y.map(k=>{const S=k.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:S&&a.has(S)?d.jsx("button",{type:"button",className:`${iw} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>l({to:"/roadmap",search:{item:S}}),children:S}):d.jsx("div",{className:iw,children:S??"No subject"})}),k.rows.map(C=>v(C))]},S??"__no-subject__")}):e.map(k=>v(k))]})},v7=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(Hu,{order:n.order,done:r==="done",status:r}),d.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:d.jsx(_e,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:Vi,children:[n.id?d.jsx(is,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${OC} [cursor:inherit]`,children:[d.jsx(Xm,{}),d.jsx("span",{className:$C,children:n.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(le,{size:"small",fillColor:ru[r].fill,textColor:ru[r].text,children:AC[r]})]})})})]})},w7="grid grid-cols-[76px_minmax(0,1fr)_112px] gap-2.5 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",b7=({row:e,activePlanTitle:t,onOpen:n})=>{const r=M(o=>o.agentStatus),s=e.fix,i=Ou(s,r);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(Hu,{order:s.order,done:s.status==="done",status:s.status,running:!!Fu(s.id,r),fallback:s.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(s.title):void 0,onKeyDown:n?o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(s.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${s.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(_e,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:w7,children:[d.jsx(is,{id:s.id}),d.jsxs("span",{className:`${OC} [cursor:inherit]`,children:[d.jsx(le,{size:"small",variant:"warning",children:"fix"}),d.jsx("span",{className:$C,children:s.title}),s.idea&&d.jsxs("span",{className:"text-xs opacity-45 whitespace-nowrap font-mono",children:["→ ",s.idea]})]}),d.jsx(le,{size:"small",fillColor:Vt[i].fill,textColor:Vt[i].text,children:za[i]})]})})})]})},k7=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=b.useRef(null);return b.useEffect(()=>{var o;if(!t)return;const i=(o=s.current)==null?void 0:o.querySelector(".plan-row-highlighted");i==null||i.scrollIntoView({behavior:"smooth",block:"center"})},[t]),d.jsx("div",{ref:s,children:e.length>0?d.jsx(x7,{rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r}):d.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."})})},_7=({idea:e})=>d.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[d.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:[d.jsx(is,{id:e.id??void 0}),e.title,e.status&&d.jsx(le,{size:"small",fillColor:ru[e.status].fill,textColor:ru[e.status].text,children:AC[e.status]})]}),d.jsx(pC,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(FC,{idea:e})})]}),Sf="__no-subject__",aw="pc-row-label font-handwritten text-xs font-semibold opacity-[0.45]",S7=()=>{var O,A;const e=yg(),t=M($u),n=M($=>$.agentStatus),{patch:r,updating:s}=$a(),{subjects:i,available:o}=bC(),a=M($=>$.detailView),l=M($=>$.setDetailView),c=M($=>$.archiveIdeas),{toast:u}=He(),[f,h]=b.useState(""),[p,m]=b.useState(!1);if(b.useEffect(()=>{h((e==null?void 0:e.order)!==void 0?String(e==null?void 0:e.order):"")},[e==null?void 0:e.order]),!e)return null;const g=Ou(e,n),v=e.status==="in-progress",y=e.status==="review",x=e.status==="dropped",w=e.status==="done",k=e.phases.some($=>!$.done),S=(e.status==="planned"||v)&&k,C=Z4(e),P=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),E=((O=e.pr)==null?void 0:O.state)==="open"||((A=e.pr)==null?void 0:A.state)==="draft",T=o&&e.subject&&!i.includes(e.subject)?e.subject:void 0,j=$=>r(e.title,$),N=async()=>{if(e.id){m(!0);try{await c([e.id])}catch($){u({title:"Archive failed",description:$.message,variant:"error"})}finally{m(!1)}}},I=v||y||e.status==="planned",L=async()=>{const $=f.trim(),U=Number($);if($===""||!Number.isInteger(U)||U<1){h(e.order!==void 0?String(e.order):"");return}U!==e.order&&await j({order:U})};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{children:d.jsxs("div",{className:"flex flex-col",children:[d.jsx(On,{size:"small",active:a==="details",onClick:()=>l("details"),className:"pc-row text-xs",children:"Details"}),d.jsx(On,{size:"small",active:a==="feedback",onClick:()=>l("feedback"),className:"pc-row text-xs",children:"Feedback"})]})}),d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(le,{size:"small",fillColor:Vt[g].fill,textColor:Vt[g].text,children:za[g]})}),d.jsxs("div",{children:[d.jsx("div",{className:aw,children:"Subject"}),d.jsx("div",{className:"h-[32px] flex items-center",children:d.jsx(mO,{className:"w-full",size:"small",value:e.subject??Sf,onChange:$=>j({subject:$===Sf?null:$}),disabled:s||!o,options:[{value:Sf,label:"No subject"},...T?[{value:T,label:`${T} (orphan)`}]:[],...!o&&e.subject&&!T?[{value:e.subject,label:e.subject}]:[],...i.map($=>({value:$,label:$}))]})})]}),I&&d.jsxs("div",{className:"flex items-center justify-between h-[64px]",children:[d.jsx("div",{className:aw,children:"Order"}),d.jsx(Du,{type:"number",size:"small","aria-label":"Run order",min:1,value:f,onChange:$=>h($.target.value),onBlur:L,disabled:s,className:"w-20"})]}),d.jsx(_e,{size:"small",children:d.jsxs("div",{className:"flex flex-col",children:[S&&d.jsx(QH,{plan:e,disabled:t||s}),P&&d.jsx(GH,{plan:e,disabled:t||s}),E&&d.jsx(YH,{plan:e,disabled:t||s}),y&&d.jsx(HH,{plan:e,disabled:t||s}),w&&d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:N,disabled:p||!e.id,className:`pc-row text-xs ${p||!e.id?"opacity-50":""}`,children:p?"Archiving…":"Archive"}),C&&d.jsx(On,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:N,disabled:p||!e.id,className:`pc-row text-xs ${p||!e.id?"opacity-50":""}`,children:p?"Marking done…":"Mark done"}),!w&&d.jsx(On,{size:"small",icon:d.jsx("span",{className:x?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:x?"↺":"⊘"}),onClick:()=>j({status:x?null:"dropped"}),disabled:s,className:`pc-row text-xs ${s?"opacity-50":""}`,children:x?"Reopen plan":"Mark dropped"})]})})]})},C7=["in-progress","review","planned","idea","done","dropped"],j7=()=>{const e=M(h=>h.plans),t=yg(),n=M(h=>h.planFilters),r=M(h=>h.togglePlanStatus),s=M(h=>h.setPlanSearch),i=M(h=>h.setSubjectFilter),o=mt();if(!e||t)return null;const{statusCounts:a}=Wo(e.entries,n),{statusCounts:l}=Wo(e.entries),c=new Set(n.statuses),u=C7.filter(h=>l[h]>0);return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(Du,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:h=>s(h.target.value)})}),n.subject!==null&&d.jsxs("div",{className:"flex items-center gap-2 h-[32px]","data-testid":"subject-filter-chip",children:[d.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),d.jsx("button",{type:"button",onClick:()=>{i(null),o({to:"/",search:{}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",children:"Clear"})]}),d.jsx("div",{children:d.jsx("div",{className:"flex flex-col",children:u.map(h=>{const p=c.has(h);return d.jsx(On,{size:"small",active:p,onClick:()=>r(h),className:"pc-row text-xs",icon:d.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:Vt[h].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[h]}),children:za[h]},h)})})})]})},lw=({showGroupingToggle:e=!1})=>d.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[d.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),e&&d.jsx(y7,{}),d.jsx(KH,{}),d.jsx(XH,{})]}),P7=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],E7=()=>d.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(_e,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:Vi,children:[d.jsx(Lt,{variant:"text",width:28}),d.jsx(Lt,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Lt,{variant:"text",width:56})}),d.jsx(Lt,{variant:"text",width:64}),d.jsx(Lt,{variant:"text",width:48})]})})})]}),P7.map(e=>d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:d.jsx(Lt,{variant:"text",width:16})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(_e,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:Vi,children:[d.jsx(Lt,{variant:"rect",width:44,height:18}),d.jsx(Lt,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Lt,{variant:"text",width:52})}),d.jsx(Lt,{variant:"rect",width:80,height:8}),d.jsx(Lt,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),T7=()=>{const e=M(u=>u.reconcileQueue),t=M(u=>u.removeFromReconcileQueue),n=M(u=>u.plans),{patch:r}=$a(),{toast:s}=He(),i=b.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(b.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),b.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.`})},c=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return d.jsx(FH,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},N7=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),d.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(_e,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.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:[d.jsx(cS,{}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),d.jsx(et,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),bg=()=>{const e=M(T=>T.plans),t=M(T=>T.plansError),n=M(T=>T.ideaEntries),r=M(T=>T.suggestions);M(T=>T.loadPlans);const s=M(T=>T.setDetailView),i=M(T=>T.planFilters),o=M(T=>T.setSubjectFilter),a=yg(),l=o9(),{planId:c,ideaId:u}=Bs({strict:!1}),f=M(T=>T.dismissSuggestion),h=mt(),{toast:p}=He(),{subject:m}=mm({strict:!1});b.useEffect(()=>{o(m??null)},[m,o]);const g=c??u,v=b.useRef(g);b.useEffect(()=>{v.current!==g&&s("details"),v.current=g},[g,s]);const y=()=>{h({to:"/"})},x=T=>{var N;const j=(N=e==null?void 0:e.entries.find(I=>I.title===T))==null?void 0:N.id;h({to:"/plans/$planId",params:{planId:Yr(j,T)}})},w=T=>{var N;const j=(N=n.find(I=>I.title===T))==null?void 0:N.id;h({to:"/ideas/$ideaId",params:{ideaId:Yr(j,T)}})},k=T=>{h({to:"/plans/$planId",params:{planId:Yr(T.id,T.title)}})},[S,C]=b.useState(null),P=async T=>{try{await f(T)}catch(j){p({title:"Failed to dismiss suggestion",description:j.message,variant:"error"})}};if(t)return d.jsxs("div",{children:[d.jsx(J9,{children:"Plans"}),d.jsxs(_e,{size:"small",accent:!0,accentColor:"rose",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),d.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return c||u?d.jsxs("div",{children:[d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading…"}),d.jsx("p",{className:"opacity-50",children:"Loading…"})]}):d.jsxs("div",{children:[d.jsx(lw,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(E7,{})]});const{rows:E}=f5(e.entries,n,i);return d.jsxs(d.Fragment,{children:[d.jsx(T7,{}),a?d.jsx("div",{children:d.jsx(f7,{plan:a})}):l?d.jsxs("div",{children:[d.jsx("div",{className:"mb-4",children:d.jsx(oB,{items:[{id:"plans",label:"Plans",onClick:y},{id:"idea",label:l.title}]})}),d.jsx(_7,{idea:l})]}):d.jsxs("div",{children:[d.jsx(lw,{showGroupingToggle:e.entries.length>0}),e.warnings.length>0&&d.jsxs(_e,{size:"small",accent:!0,accentColor:"amber",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),d.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(T=>d.jsxs("li",{children:[T.title,": ",T.message]},T.title))})]}),e.entries.length===0?d.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",d.jsx("strong",{children:"New idea"})," above, or click"," ",d.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):d.jsx(k7,{rows:E,activePlanTitle:null,onOpenPlan:x,onOpenIdea:w}),d.jsx($H,{onOpen:k}),d.jsx(N7,{suggestions:r,onOpen:C,onDismiss:P}),d.jsx(DH,{suggestion:S,onClose:()=>C(null)})]})]})};function R7(e){return e.filter(t=>t.kind!=="question")}function I7(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function A7(){const e=M(r=>r.notifications),t=M(r=>r.loadNotifications),n=b.useRef(null);b.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),b.useEffect(()=>{if(!e)return;const r=R7(e),s=I7(r,n.current);if(n.current=new Set(r.map(i=>i.id)),s.length!==0&&!(typeof Notification>"u"||Notification.permission!=="granted")&&!document.hasFocus())for(const i of s)new Notification(i.entityTitle,{body:i.text})},[e]),b.useEffect(()=>{let r;const s=Fa(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const M7="data-paper-camp-mount";function L7(e){return(e==null?void 0:e.getAttribute(M7))??""}const zC=typeof document>"u"?"":L7(document.getElementById("root")),BC=b.lazy(()=>cn(()=>import("./index-DfekHwwU.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),D7=b.lazy(()=>cn(()=>import("./index-DfekHwwU.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),VC=b.lazy(()=>cn(()=>import("./index-CkLeljbk.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),F7=b.lazy(()=>cn(()=>import("./index-CkLeljbk.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),O7=b.lazy(()=>cn(()=>import("./index-DMDqfoCe.js"),[],import.meta.url).then(e=>({default:e.TasksPage}))),$7=b.lazy(()=>cn(()=>import("./index-Gi97Lmex.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),z7=b.lazy(()=>cn(()=>import("./index-Gi97Lmex.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),B7=b.lazy(()=>cn(()=>import("./index-BHmWkgBW.js"),[],import.meta.url).then(e=>({default:e.StatsPage}))),V7=b.lazy(()=>cn(()=>import("./index-D_Lo8ptS.js"),[],import.meta.url).then(e=>({default:e.GitPage}))),U7=b.lazy(()=>cn(()=>import("./index-D_Lo8ptS.js"),[],import.meta.url).then(e=>({default:e.GitFileList}))),W7=b.lazy(()=>cn(()=>import("./index-BuzzfADD.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),H7=b.lazy(()=>cn(()=>import("./index-3pzg7Iyw.js"),[],import.meta.url).then(e=>({default:e.IssuesPage}))),Cf=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"issues",label:"Issues",path:"/issues"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],cw=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),G7=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M12 4l-5 6 5 6",strokeLinecap:"round",strokeLinejoin:"round"})}),uw=()=>d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),UC="stack-open";function K7(){try{return localStorage.getItem(UC)==="true"}catch{return!1}}function Y7(e){try{localStorage.setItem(UC,String(e))}catch{}}const q7=224,Q7=480,X7=495,J7=q7+X7+Q7,Z7=`(min-width: ${J7}px)`;function eG(e){const[t,n]=b.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return b.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 tG=()=>{var T;const e=mt(),t=k2({select:j=>j.location.pathname}),n=M(j=>j.loadPlans),r=M(j=>j.loadIdeas),s=M(j=>j.loadSuggestions),i=M(j=>j.loadCapabilities),o=M(j=>j.loadAgentAuthStatus),a=M(j=>j.loadParkedQuestions),l=M(j=>j.loadNotifications),c=M(j=>j.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),f=t.startsWith("/plans/")||t.startsWith("/ideas/"),h=t==="/docs"||t.startsWith("/docs/"),p=t==="/settings"||t.startsWith("/settings/"),m=t==="/roadmap",g=t==="/git",v=u?"plans":h?"docs":p?"settings":(T=Cf.find(j=>j.path===t))==null?void 0:T.id,y=u||h||p||m||g,x=u?"plans":h?"docs":p?"settings":m?"roadmap":"git",[w,k]=b.useState(K7),[S,C]=b.useState(!1),P=eG(Z7),E=b.useRef(!1);return A7(),b.useEffect(()=>{n(),r(),s(),i(),o(),a(),l()},[n,r,s,i,o,a,l]),b.useEffect(()=>{E.current||t!=="/"||(E.current=!0,Promise.all([Jm(),hS()]).then(([j,N])=>{if(!(j!=null&&j.setupDismissed)&&N!==null&&!N.every(I=>I.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([gS(),xS()]).then(([I,L])=>{I.entries.length>1||L.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),b.useEffect(()=>{C(!1)},[t]),d.jsxs(Xz,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border flex flex-col",children:[d.jsxs("div",{className:"shrink-0 min-[1199px]:pr-[var(--pc-stack-width)]",children:[d.jsx(O9,{}),d.jsx(X9,{})]}),d.jsx(DD,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:d.jsx("div",{className:"flex flex-col h-full min-h-0",children:d.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto [scrollbar-gutter:stable] -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom)]",children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full min-h-full",children:[y&&d.jsxs($9,{routeKey:x,mobileOpen:S,onMobileClose:()=>C(!1),children:[u&&d.jsxs(d.Fragment,{children:[d.jsx(j7,{}),d.jsx(S7,{})]}),h&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(D7,{})}),p&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(F7,{})}),m&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(z7,{})}),g&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(U7,{})})]}),d.jsxs("div",{className:"relative flex flex-col min-w-0 flex-[1_1_0%]",children:[d.jsxs("header",{className:"pc-page-header sticky top-0 z-20 shrink-0 flex items-center gap-3 h-[var(--pc-header-h)] max-[480px]:hidden",style:Ym({texture:"parchment",shade:!0}),children:[y?d.jsx(et,{variant:"ghost",size:"small",className:"lg:hidden",label:"Open sidebar",onClick:()=>C(!0),icon:d.jsx(uw,{})}):d.jsx(jC,{size:"sm"}),f&&d.jsx(oe,{variant:"ghost",size:"small",icon:d.jsx(G7,{}),onClick:()=>e({to:"/"}),className:"font-handwritten !text-sm opacity-70",children:"Back to plans"}),d.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 ml-auto",children:Cf.map(j=>d.jsx(oe,{variant:"ghost",size:"small",isActive:j.id===v,onClick:()=>e({to:j.path}),"aria-current":j.id===v?"page":void 0,children:d.jsx(cw,{item:j})},j.id))})]}),d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(q_,{texture:{texture:"parchment"},rounded:"none",className:"pc-page w-full max-w-none",children:d.jsx(b.Suspense,{fallback:null,children:d.jsx(X1,{})})})})]})]})})})})]}),d.jsx(F9,{open:w,pinned:P,onToggle:()=>{const j=!w;Y7(j),k(j)}}),d.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:[y&&d.jsx(et,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>C(!0),icon:d.jsx(uw,{}),className:"min-h-11"}),Cf.map(j=>d.jsx(oe,{variant:"ghost",size:"small",isActive:j.id===v,onClick:()=>e({to:j.path}),"aria-current":j.id===v?"page":void 0,className:"min-h-11",children:d.jsx(cw,{item:j})},j.id))]})]})},Tt=a2({component:tG}),nG=Gt({getParentRoute:()=>Tt,path:"/",component:bg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),rG=Gt({getParentRoute:()=>Tt,path:"/plans/$planId",component:bg}),sG=Gt({getParentRoute:()=>Tt,path:"/ideas/$ideaId",component:bg}),iG=Gt({getParentRoute:()=>Tt,path:"/docs",component:BC}),oG=Gt({getParentRoute:()=>Tt,path:"/docs/$section",component:BC}),aG=Gt({getParentRoute:()=>Tt,path:"/settings",component:VC}),lG=Gt({getParentRoute:()=>Tt,path:"/settings/$section",component:VC}),cG=Gt({getParentRoute:()=>Tt,path:"/roadmap",component:$7,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),uG=Gt({getParentRoute:()=>Tt,path:"/inbox",component:W7}),dG=Gt({getParentRoute:()=>Tt,path:"/stats",component:B7}),fG=Gt({getParentRoute:()=>Tt,path:"/git",component:V7}),hG=Gt({getParentRoute:()=>Tt,path:"/tasks",component:O7,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),pG=Gt({getParentRoute:()=>Tt,path:"/issues",component:H7}),mG=Tt.addChildren([nG,rG,sG,iG,oG,aG,lG,hG,pG,cG,dG,uG,fG]),gG=x2({routeTree:mG,basepath:zC||"/"});RB(zC);const WC=document.getElementById("root");if(!WC)throw new Error("#root element not found");_1(WC).render(d.jsx(b.StrictMode,{children:d.jsx(b2,{router:gG})}));export{xe as $,MG as A,DG as B,He as C,LG as D,oB as E,mm as F,TG as G,Ia as H,VG as I,oe as J,Fe as K,FG as L,pC as M,Yr as N,RG as O,J9 as P,J0 as Q,_e as R,Vt as S,za as T,NG as U,OG as V,$G as W,h7 as X,r$ as Y,n5 as Z,ys as _,mt as a,wg as a0,vf as a1,z9 as a2,bG as a3,wH as a4,Oa as a5,RC as a6,Fa as a7,ur as a8,NB as a9,Z5 as aa,X5 as ab,et as ac,kG as ad,Q_ as ae,_G as af,LB as ag,is as ah,cH as ai,Aa as aj,Ma as ak,NH as al,Qm as am,eg as an,EG as ao,BG as b,G as c,zH as d,tS as e,IG as f,le as g,SG as h,Du as i,d as j,Jm as k,CG as l,bC as m,zG as n,r9 as o,On as p,Pi as q,b as r,jG as s,wG as t,M as u,PG as v,rS as w,mO as x,AG as y,r5 as z};
|
|
215
|
+
//# sourceMappingURL=main-DP_okYxh.js.map
|