@sulala/agent 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +3 -3
  2. package/dashboard/dist/assets/index-DegBJNv6.css +1 -0
  3. package/dashboard/dist/assets/index-pVHpAj3h.js +83 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent/loop.d.ts.map +1 -1
  6. package/dist/agent/loop.js +21 -6
  7. package/dist/agent/loop.js.map +1 -1
  8. package/dist/agent/skill-generate.d.ts +1 -1
  9. package/dist/agent/skill-generate.d.ts.map +1 -1
  10. package/dist/agent/skill-generate.js +10 -3
  11. package/dist/agent/skill-generate.js.map +1 -1
  12. package/dist/agent/skill-install.d.ts +12 -1
  13. package/dist/agent/skill-install.d.ts.map +1 -1
  14. package/dist/agent/skill-install.js +130 -15
  15. package/dist/agent/skill-install.js.map +1 -1
  16. package/dist/agent/skills.d.ts +4 -3
  17. package/dist/agent/skills.d.ts.map +1 -1
  18. package/dist/agent/skills.js +53 -25
  19. package/dist/agent/skills.js.map +1 -1
  20. package/dist/agent/tool/spec-loader.d.ts +7 -0
  21. package/dist/agent/tool/spec-loader.d.ts.map +1 -0
  22. package/dist/agent/tool/spec-loader.js +540 -0
  23. package/dist/agent/tool/spec-loader.js.map +1 -0
  24. package/dist/agent/tools.d.ts.map +1 -1
  25. package/dist/agent/tools.integrations.test.js +4 -5
  26. package/dist/agent/tools.integrations.test.js.map +1 -1
  27. package/dist/agent/tools.js +144 -367
  28. package/dist/agent/tools.js.map +1 -1
  29. package/dist/ai/orchestrator.d.ts.map +1 -1
  30. package/dist/ai/orchestrator.js +82 -17
  31. package/dist/ai/orchestrator.js.map +1 -1
  32. package/dist/cli.d.ts +4 -1
  33. package/dist/cli.d.ts.map +1 -1
  34. package/dist/cli.js +25 -9
  35. package/dist/cli.js.map +1 -1
  36. package/dist/config.d.ts.map +1 -1
  37. package/dist/config.js +20 -5
  38. package/dist/config.js.map +1 -1
  39. package/dist/db/index.d.ts +14 -7
  40. package/dist/db/index.d.ts.map +1 -1
  41. package/dist/db/index.js +108 -30
  42. package/dist/db/index.js.map +1 -1
  43. package/dist/gateway/server.d.ts.map +1 -1
  44. package/dist/gateway/server.js +141 -15
  45. package/dist/gateway/server.js.map +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/onboard-env.d.ts +1 -1
  49. package/dist/onboard-env.d.ts.map +1 -1
  50. package/dist/onboard-env.js +2 -0
  51. package/dist/onboard-env.js.map +1 -1
  52. package/dist/types.d.ts +5 -3
  53. package/dist/types.d.ts.map +1 -1
  54. package/dist/watcher/index.d.ts.map +1 -1
  55. package/dist/watcher/index.js +1 -2
  56. package/dist/watcher/index.js.map +1 -1
  57. package/package.json +4 -5
  58. package/src/index.ts +1 -1
  59. package/context/00-rules.md +0 -1
  60. package/context/airtable.md +0 -35
  61. package/context/apple-notes.md +0 -99
  62. package/context/asana.md +0 -37
  63. package/context/bluesky.md +0 -46
  64. package/context/calendar.md +0 -63
  65. package/context/country-info.md +0 -13
  66. package/context/create-skill.md +0 -128
  67. package/context/discord.md +0 -30
  68. package/context/docs.md +0 -29
  69. package/context/drive.md +0 -49
  70. package/context/dropbox.md +0 -39
  71. package/context/facebook.md +0 -47
  72. package/context/fetch-form-api.md +0 -16
  73. package/context/figma.md +0 -30
  74. package/context/files.md +0 -30
  75. package/context/git.md +0 -37
  76. package/context/github.md +0 -58
  77. package/context/gmail.md +0 -52
  78. package/context/google.md +0 -28
  79. package/context/hellohub.md +0 -29
  80. package/context/jira.md +0 -46
  81. package/context/linear.md +0 -40
  82. package/context/news.md +0 -64
  83. package/context/notion.md +0 -45
  84. package/context/portal-integrations.md +0 -42
  85. package/context/post-to-x.md +0 -50
  86. package/context/sheets.md +0 -47
  87. package/context/slack.md +0 -48
  88. package/context/slides.md +0 -35
  89. package/context/stripe.md +0 -38
  90. package/context/tes.md +0 -7
  91. package/context/test.md +0 -7
  92. package/context/weather.md +0 -32
  93. package/context/zoom.md +0 -28
  94. package/dashboard/dist/assets/index-BTx-9jCj.css +0 -1
  95. package/dashboard/dist/assets/index-B_QGQ8c_.js +0 -83
  96. package/registry/apple-notes.md +0 -99
  97. package/registry/bluesky.md +0 -34
  98. package/registry/files.md +0 -30
  99. package/registry/git.md +0 -37
  100. package/registry/news.md +0 -64
  101. package/registry/skills-registry.json +0 -46
  102. package/registry/weather.md +0 -32
@@ -0,0 +1,83 @@
1
+ function b2(e,a){for(var r=0;r<a.length;r++){const l=a[r];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in e)){const u=Object.getOwnPropertyDescriptor(l,s);u&&Object.defineProperty(e,s,u.get?u:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function r(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=r(s);fetch(s.href,u)}})();function Mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Af={exports:{}},Ki={};var Ky;function S2(){if(Ky)return Ki;Ky=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(l,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var f in s)f!=="key"&&(u[f]=s[f])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:d,ref:s!==void 0?s:null,props:u}}return Ki.Fragment=a,Ki.jsx=r,Ki.jsxs=r,Ki}var Xy;function w2(){return Xy||(Xy=1,Af.exports=S2()),Af.exports}var c=w2(),Tf={exports:{}},De={};var Qy;function k2(){if(Qy)return De;Qy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function j(D,Z,T){this.props=D,this.context=Z,this.refs=E,this.updater=T||k}j.prototype.isReactComponent={},j.prototype.setState=function(D,Z){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,Z,"setState")},j.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=j.prototype;function O(D,Z,T){this.props=D,this.context=Z,this.refs=E,this.updater=T||k}var _=O.prototype=new R;_.constructor=O,C(_,j.prototype),_.isPureReactComponent=!0;var U=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Y(D,Z,T){var oe=T.ref;return{$$typeof:e,type:D,key:Z,ref:oe!==void 0?oe:null,props:T}}function P(D,Z){return Y(D.type,Z,D.props)}function W(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ee(D){var Z={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(T){return Z[T]})}var fe=/\/+/g;function ne(D,Z){return typeof D=="object"&&D!==null&&D.key!=null?ee(""+D.key):Z.toString(36)}function H(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function(Z){D.status==="pending"&&(D.status="fulfilled",D.value=Z)},function(Z){D.status==="pending"&&(D.status="rejected",D.reason=Z)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,Z,T,oe,ce){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var ge=!1;if(D===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(D.$$typeof){case e:case a:ge=!0;break;case y:return ge=D._init,z(ge(D._payload),Z,T,oe,ce)}}if(ge)return ce=ce(D),ge=oe===""?"."+ne(D,0):oe,U(ce)?(T="",ge!=null&&(T=ge.replace(fe,"$&/")+"/"),z(ce,Z,T,"",function(vt){return vt})):ce!=null&&(W(ce)&&(ce=P(ce,T+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(fe,"$&/")+"/")+ge)),Z.push(ce)),1;ge=0;var Le=oe===""?".":oe+":";if(U(D))for(var Ee=0;Ee<D.length;Ee++)oe=D[Ee],ue=Le+ne(oe,Ee),ge+=z(oe,Z,T,ue,ce);else if(Ee=b(D),typeof Ee=="function")for(D=Ee.call(D),Ee=0;!(oe=D.next()).done;)oe=oe.value,ue=Le+ne(oe,Ee++),ge+=z(oe,Z,T,ue,ce);else if(ue==="object"){if(typeof D.then=="function")return z(H(D),Z,T,oe,ce);throw Z=String(D),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return ge}function $(D,Z,T){if(D==null)return D;var oe=[],ce=0;return z(D,oe,"","",function(ue){return Z.call(T,ue,ce++)}),oe}function X(D){if(D._status===-1){var Z=D._result;Z=Z(),Z.then(function(T){(D._status===0||D._status===-1)&&(D._status=1,D._result=T)},function(T){(D._status===0||D._status===-1)&&(D._status=2,D._result=T)}),D._status===-1&&(D._status=0,D._result=Z)}if(D._status===1)return D._result.default;throw D._result}var G=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},A={map:$,forEach:function(D,Z,T){$(D,function(){Z.apply(this,arguments)},T)},count:function(D){var Z=0;return $(D,function(){Z++}),Z},toArray:function(D){return $(D,function(Z){return Z})||[]},only:function(D){if(!W(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return De.Activity=g,De.Children=A,De.Component=j,De.Fragment=r,De.Profiler=s,De.PureComponent=O,De.StrictMode=l,De.Suspense=h,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,De.__COMPILER_RUNTIME={__proto__:null,c:function(D){return L.H.useMemoCache(D)}},De.cache=function(D){return function(){return D.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(D,Z,T){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var oe=C({},D.props),ce=D.key;if(Z!=null)for(ue in Z.key!==void 0&&(ce=""+Z.key),Z)!F.call(Z,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&Z.ref===void 0||(oe[ue]=Z[ue]);var ue=arguments.length-2;if(ue===1)oe.children=T;else if(1<ue){for(var ge=Array(ue),Le=0;Le<ue;Le++)ge[Le]=arguments[Le+2];oe.children=ge}return Y(D.type,ce,oe)},De.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:u,_context:D},D},De.createElement=function(D,Z,T){var oe,ce={},ue=null;if(Z!=null)for(oe in Z.key!==void 0&&(ue=""+Z.key),Z)F.call(Z,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ce[oe]=Z[oe]);var ge=arguments.length-2;if(ge===1)ce.children=T;else if(1<ge){for(var Le=Array(ge),Ee=0;Ee<ge;Ee++)Le[Ee]=arguments[Ee+2];ce.children=Le}if(D&&D.defaultProps)for(oe in ge=D.defaultProps,ge)ce[oe]===void 0&&(ce[oe]=ge[oe]);return Y(D,ue,ce)},De.createRef=function(){return{current:null}},De.forwardRef=function(D){return{$$typeof:f,render:D}},De.isValidElement=W,De.lazy=function(D){return{$$typeof:y,_payload:{_status:-1,_result:D},_init:X}},De.memo=function(D,Z){return{$$typeof:m,type:D,compare:Z===void 0?null:Z}},De.startTransition=function(D){var Z=L.T,T={};L.T=T;try{var oe=D(),ce=L.S;ce!==null&&ce(T,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(M,G)}catch(ue){G(ue)}finally{Z!==null&&T.types!==null&&(Z.types=T.types),L.T=Z}},De.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},De.use=function(D){return L.H.use(D)},De.useActionState=function(D,Z,T){return L.H.useActionState(D,Z,T)},De.useCallback=function(D,Z){return L.H.useCallback(D,Z)},De.useContext=function(D){return L.H.useContext(D)},De.useDebugValue=function(){},De.useDeferredValue=function(D,Z){return L.H.useDeferredValue(D,Z)},De.useEffect=function(D,Z){return L.H.useEffect(D,Z)},De.useEffectEvent=function(D){return L.H.useEffectEvent(D)},De.useId=function(){return L.H.useId()},De.useImperativeHandle=function(D,Z,T){return L.H.useImperativeHandle(D,Z,T)},De.useInsertionEffect=function(D,Z){return L.H.useInsertionEffect(D,Z)},De.useLayoutEffect=function(D,Z){return L.H.useLayoutEffect(D,Z)},De.useMemo=function(D,Z){return L.H.useMemo(D,Z)},De.useOptimistic=function(D,Z){return L.H.useOptimistic(D,Z)},De.useReducer=function(D,Z,T){return L.H.useReducer(D,Z,T)},De.useRef=function(D){return L.H.useRef(D)},De.useState=function(D){return L.H.useState(D)},De.useSyncExternalStore=function(D,Z,T){return L.H.useSyncExternalStore(D,Z,T)},De.useTransition=function(){return L.H.useTransition()},De.version="19.2.4",De}var Zy;function Oc(){return Zy||(Zy=1,Tf.exports=k2()),Tf.exports}var S=Oc();const ur=Mc(S),Yb=b2({__proto__:null,default:ur},[S]);var _f={exports:{}},Xi={},Rf={exports:{}},Mf={};var Jy;function j2(){return Jy||(Jy=1,(function(e){function a(z,$){var X=z.length;z.push($);e:for(;0<X;){var G=X-1>>>1,A=z[G];if(0<s(A,$))z[G]=$,z[X]=A,X=G;else break e}}function r(z){return z.length===0?null:z[0]}function l(z){if(z.length===0)return null;var $=z[0],X=z.pop();if(X!==$){z[0]=X;e:for(var G=0,A=z.length,D=A>>>1;G<D;){var Z=2*(G+1)-1,T=z[Z],oe=Z+1,ce=z[oe];if(0>s(T,X))oe<A&&0>s(ce,T)?(z[G]=ce,z[oe]=X,G=oe):(z[G]=T,z[Z]=X,G=Z);else if(oe<A&&0>s(ce,X))z[G]=ce,z[oe]=X,G=oe;else break e}}return $}function s(z,$){var X=z.sortIndex-$.sortIndex;return X!==0?X:z.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],m=[],y=1,g=null,v=3,b=!1,k=!1,C=!1,E=!1,j=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function _(z){for(var $=r(m);$!==null;){if($.callback===null)l(m);else if($.startTime<=z)l(m),$.sortIndex=$.expirationTime,a(h,$);else break;$=r(m)}}function U(z){if(C=!1,_(z),!k)if(r(h)!==null)k=!0,M||(M=!0,ee());else{var $=r(m);$!==null&&H(U,$.startTime-z)}}var M=!1,L=-1,F=5,Y=-1;function P(){return E?!0:!(e.unstable_now()-Y<F)}function W(){if(E=!1,M){var z=e.unstable_now();Y=z;var $=!0;try{e:{k=!1,C&&(C=!1,R(L),L=-1),b=!0;var X=v;try{t:{for(_(z),g=r(h);g!==null&&!(g.expirationTime>z&&P());){var G=g.callback;if(typeof G=="function"){g.callback=null,v=g.priorityLevel;var A=G(g.expirationTime<=z);if(z=e.unstable_now(),typeof A=="function"){g.callback=A,_(z),$=!0;break t}g===r(h)&&l(h),_(z)}else l(h);g=r(h)}if(g!==null)$=!0;else{var D=r(m);D!==null&&H(U,D.startTime-z),$=!1}}break e}finally{g=null,v=X,b=!1}$=void 0}}finally{$?ee():M=!1}}}var ee;if(typeof O=="function")ee=function(){O(W)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ne=fe.port2;fe.port1.onmessage=W,ee=function(){ne.postMessage(null)}}else ee=function(){j(W,0)};function H(z,$){L=j(function(){z(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var X=v;v=$;try{return z()}finally{v=X}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(z,$){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var X=v;v=z;try{return $()}finally{v=X}},e.unstable_scheduleCallback=function(z,$,X){var G=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?G+X:G):X=G,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=X+A,z={id:y++,callback:$,priorityLevel:z,startTime:X,expirationTime:A,sortIndex:-1},X>G?(z.sortIndex=X,a(m,z),r(h)===null&&z===r(m)&&(C?(R(L),L=-1):C=!0,H(U,X-G))):(z.sortIndex=A,a(h,z),k||b||(k=!0,M||(M=!0,ee()))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var $=v;return function(){var X=v;v=$;try{return z.apply(this,arguments)}finally{v=X}}}})(Mf)),Mf}var Wy;function C2(){return Wy||(Wy=1,Rf.exports=j2()),Rf.exports}var Of={exports:{}},Qt={};var ev;function E2(){if(ev)return Qt;ev=1;var e=Oc();function a(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(h,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:h,containerInfo:m,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Qt.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(a(299));return u(h,m,null,y)},Qt.flushSync=function(h){var m=d.T,y=l.p;try{if(d.T=null,l.p=2,h)return h()}finally{d.T=m,l.p=y,l.d.f()}},Qt.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,l.d.C(h,m))},Qt.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},Qt.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?l.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):y==="script"&&l.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Qt.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);l.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&l.d.M(h)},Qt.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin);l.d.L(h,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Qt.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);l.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else l.d.m(h)},Qt.requestFormReset=function(h){l.d.r(h)},Qt.unstable_batchedUpdates=function(h,m){return h(m)},Qt.useFormState=function(h,m,y){return d.H.useFormState(h,m,y)},Qt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Qt.version="19.2.4",Qt}var tv;function Vb(){if(tv)return Of.exports;tv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Of.exports=E2(),Of.exports}var nv;function N2(){if(nv)return Xi;nv=1;var e=C2(),a=Oc(),r=Vb();function l(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(u(t)!==t)throw Error(l(188))}function m(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(l(188));return n!==t?null:t}for(var i=t,o=n;;){var p=i.return;if(p===null)break;var x=p.alternate;if(x===null){if(o=p.return,o!==null){i=o;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===i)return h(p),t;if(x===o)return h(p),n;x=x.sibling}throw Error(l(188))}if(i.return!==o.return)i=p,o=x;else{for(var w=!1,N=p.child;N;){if(N===i){w=!0,i=p,o=x;break}if(N===o){w=!0,o=p,i=x;break}N=N.sibling}if(!w){for(N=x.child;N;){if(N===i){w=!0,i=x,o=p;break}if(N===o){w=!0,o=x,i=p;break}N=N.sibling}if(!w)throw Error(l(189))}}if(i.alternate!==o)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),O=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function ee(t){return t===null||typeof t!="object"?null:(t=W&&t[W]||t["@@iterator"],typeof t=="function"?t:null)}var fe=Symbol.for("react.client.reference");function ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===fe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case j:return"Profiler";case E:return"StrictMode";case U:return"Suspense";case M:return"SuspenseList";case Y:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case O:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case _:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return n=t.displayName||null,n!==null?n:ne(t.type)||"Memo";case F:n=t._payload,t=t._init;try{return ne(t(n))}catch{}}return null}var H=Array.isArray,z=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},G=[],A=-1;function D(t){return{current:t}}function Z(t){0>A||(t.current=G[A],G[A]=null,A--)}function T(t,n){A++,G[A]=t.current,t.current=n}var oe=D(null),ce=D(null),ue=D(null),ge=D(null);function Le(t,n){switch(T(ue,n),T(ce,t),T(oe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?xy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=xy(n),t=yy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Z(oe),T(oe,t)}function Ee(){Z(oe),Z(ce),Z(ue)}function vt(t){t.memoizedState!==null&&T(ge,t);var n=oe.current,i=yy(n,t.type);n!==i&&(T(ce,t),T(oe,i))}function rt(t){ce.current===t&&(Z(oe),Z(ce)),ge.current===t&&(Z(ge),Gi._currentValue=X)}var ie,jt;function je(t){if(ie===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);ie=n&&n[1]||"",jt=-1<i.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ie+t+jt}var he=!1;function ze(t,n){if(!t||he)return"";he=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var Q=J}Reflect.construct(t,[],le)}else{try{le.call()}catch(J){Q=J}t.call(le.prototype)}}else{try{throw Error()}catch(J){Q=J}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&Q&&typeof J.stack=="string")return[J.stack,Q.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=o.DetermineComponentFrameRoot(),w=x[0],N=x[1];if(w&&N){var I=w.split(`
4
+ `),K=N.split(`
5
+ `);for(p=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;p<K.length&&!K[p].includes("DetermineComponentFrameRoot");)p++;if(o===I.length||p===K.length)for(o=I.length-1,p=K.length-1;1<=o&&0<=p&&I[o]!==K[p];)p--;for(;1<=o&&0<=p;o--,p--)if(I[o]!==K[p]){if(o!==1||p!==1)do if(o--,p--,0>p||I[o]!==K[p]){var te=`
6
+ `+I[o].replace(" at new "," at ");return t.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",t.displayName)),te}while(1<=o&&0<=p);break}}}finally{he=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?je(i):""}function se(t,n){switch(t.tag){case 26:case 27:case 5:return je(t.type);case 16:return je("Lazy");case 13:return t.child!==n&&n!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return ze(t.type,!1);case 11:return ze(t.type.render,!1);case 1:return ze(t.type,!0);case 31:return je("Activity");default:return""}}function Te(t){try{var n="",i=null;do n+=se(t,i),i=t,t=t.return;while(t);return n}catch(o){return`
7
+ Error generating stack: `+o.message+`
8
+ `+o.stack}}var Me=Object.prototype.hasOwnProperty,Tt=e.unstable_scheduleCallback,mt=e.unstable_cancelCallback,tt=e.unstable_shouldYield,Ft=e.unstable_requestPaint,Qe=e.unstable_now,sn=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,He=e.unstable_LowPriority,et=e.unstable_IdlePriority,vn=e.log,fa=e.unstable_setDisableYieldValue,tn=null,zt=null;function on(t){if(typeof vn=="function"&&fa(t),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(tn,t)}catch{}}var ot=Math.clz32?Math.clz32:ij,La=Math.log,$n=Math.LN2;function ij(t){return t>>>=0,t===0?32:31-(La(t)/$n|0)|0}var Ms=256,Os=262144,Ds=4194304;function Sr(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function zs(t,n,i){var o=t.pendingLanes;if(o===0)return 0;var p=0,x=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var N=o&134217727;return N!==0?(o=N&~x,o!==0?p=Sr(o):(w&=N,w!==0?p=Sr(w):i||(i=N&~t,i!==0&&(p=Sr(i))))):(N=o&~x,N!==0?p=Sr(N):w!==0?p=Sr(w):i||(i=o&~t,i!==0&&(p=Sr(i)))),p===0?0:n!==0&&n!==p&&(n&x)===0&&(x=p&-p,i=n&-n,x>=i||x===32&&(i&4194048)!==0)?n:p}function ai(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function sj(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jm(){var t=Ds;return Ds<<=1,(Ds&62914560)===0&&(Ds=4194304),t}function pu(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function ri(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function oj(t,n,i,o,p,x){var w=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var N=t.entanglements,I=t.expirationTimes,K=t.hiddenUpdates;for(i=w&~i;0<i;){var te=31-ot(i),le=1<<te;N[te]=0,I[te]=-1;var Q=K[te];if(Q!==null)for(K[te]=null,te=0;te<Q.length;te++){var J=Q[te];J!==null&&(J.lane&=-536870913)}i&=~le}o!==0&&Wm(t,o,0),x!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=x&~(w&~n))}function Wm(t,n,i){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-ot(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|i&261930}function ep(t,n){var i=t.entangledLanes|=n;for(t=t.entanglements;i;){var o=31-ot(i),p=1<<o;p&n|t[o]&n&&(t[o]|=n),i&=~p}}function tp(t,n){var i=n&-n;return i=(i&42)!==0?1:gu(i),(i&(t.suspendedLanes|n))!==0?0:i}function gu(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function np(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:Hy(t.type))}function ap(t,n){var i=$.p;try{return $.p=t,n()}finally{$.p=i}}var Pa=Math.random().toString(36).slice(2),qt="__reactFiber$"+Pa,cn="__reactProps$"+Pa,Xr="__reactContainer$"+Pa,yu="__reactEvents$"+Pa,cj="__reactListeners$"+Pa,uj="__reactHandles$"+Pa,rp="__reactResources$"+Pa,li="__reactMarker$"+Pa;function vu(t){delete t[qt],delete t[cn],delete t[yu],delete t[cj],delete t[uj]}function Qr(t){var n=t[qt];if(n)return n;for(var i=t.parentNode;i;){if(n=i[Xr]||i[qt]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(t=Cy(t);t!==null;){if(i=t[qt])return i;t=Cy(t)}return n}t=i,i=t.parentNode}return null}function Zr(t){if(t=t[qt]||t[Xr]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ii(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(l(33))}function Jr(t){var n=t[rp];return n||(n=t[rp]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function It(t){t[li]=!0}var lp=new Set,ip={};function wr(t,n){Wr(t,n),Wr(t+"Capture",n)}function Wr(t,n){for(ip[t]=n,t=0;t<n.length;t++)lp.add(n[t])}var dj=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sp={},op={};function fj(t){return Me.call(op,t)?!0:Me.call(sp,t)?!1:dj.test(t)?op[t]=!0:(sp[t]=!0,!1)}function Ls(t,n,i){if(fj(n))if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+i)}}function Ps(t,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+i)}}function ha(t,n,i,o){if(o===null)t.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(n,i,""+o)}}function Rn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function cp(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function hj(t,n,i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,x=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return p.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function bu(t){if(!t._valueTracker){var n=cp(t)?"checked":"value";t._valueTracker=hj(t,n,""+t[n])}}function up(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var i=n.getValue(),o="";return t&&(o=cp(t)?t.checked?"true":"false":t.value),t=o,t!==i?(n.setValue(t),!0):!1}function Us(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var mj=/[\n"\\]/g;function Mn(t){return t.replace(mj,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Su(t,n,i,o,p,x,w,N){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Rn(n)):t.value!==""+Rn(n)&&(t.value=""+Rn(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?wu(t,w,Rn(n)):i!=null?wu(t,w,Rn(i)):o!=null&&t.removeAttribute("value"),p==null&&x!=null&&(t.defaultChecked=!!x),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.name=""+Rn(N):t.removeAttribute("name")}function dp(t,n,i,o,p,x,w,N){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){bu(t);return}i=i!=null?""+Rn(i):"",n=n!=null?""+Rn(n):i,N||n===t.value||(t.value=n),t.defaultValue=n}o=o??p,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=N?t.checked:!!o,t.defaultChecked=!!o,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),bu(t)}function wu(t,n,i){n==="number"&&Us(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function el(t,n,i,o){if(t=t.options,n){n={};for(var p=0;p<i.length;p++)n["$"+i[p]]=!0;for(i=0;i<t.length;i++)p=n.hasOwnProperty("$"+t[i].value),t[i].selected!==p&&(t[i].selected=p),p&&o&&(t[i].defaultSelected=!0)}else{for(i=""+Rn(i),n=null,p=0;p<t.length;p++){if(t[p].value===i){t[p].selected=!0,o&&(t[p].defaultSelected=!0);return}n!==null||t[p].disabled||(n=t[p])}n!==null&&(n.selected=!0)}}function fp(t,n,i){if(n!=null&&(n=""+Rn(n),n!==t.value&&(t.value=n),i==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=i!=null?""+Rn(i):""}function hp(t,n,i,o){if(n==null){if(o!=null){if(i!=null)throw Error(l(92));if(H(o)){if(1<o.length)throw Error(l(93));o=o[0]}i=o}i==null&&(i=""),n=i}i=Rn(n),t.defaultValue=i,o=t.textContent,o===i&&o!==""&&o!==null&&(t.value=o),bu(t)}function tl(t,n){if(n){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=n;return}}t.textContent=n}var pj=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mp(t,n,i){var o=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,i):typeof i!="number"||i===0||pj.has(n)?n==="float"?t.cssFloat=i:t[n]=(""+i).trim():t[n]=i+"px"}function pp(t,n,i){if(n!=null&&typeof n!="object")throw Error(l(62));if(t=t.style,i!=null){for(var o in i)!i.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var p in n)o=n[p],n.hasOwnProperty(p)&&i[p]!==o&&mp(t,p,o)}else for(var x in n)n.hasOwnProperty(x)&&mp(t,x,n[x])}function ku(t){if(t.indexOf("-")===-1)return!1;switch(t){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 gj=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xj=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Is(t){return xj.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ma(){}var ju=null;function Cu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var nl=null,al=null;function gp(t){var n=Zr(t);if(n&&(t=n.stateNode)){var i=t[cn]||null;e:switch(t=n.stateNode,n.type){case"input":if(Su(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Mn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var o=i[n];if(o!==t&&o.form===t.form){var p=o[cn]||null;if(!p)throw Error(l(90));Su(o,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(n=0;n<i.length;n++)o=i[n],o.form===t.form&&up(o)}break e;case"textarea":fp(t,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&el(t,!!i.multiple,n,!1)}}}var Eu=!1;function xp(t,n,i){if(Eu)return t(n,i);Eu=!0;try{var o=t(n);return o}finally{if(Eu=!1,(nl!==null||al!==null)&&(No(),nl&&(n=nl,t=al,al=nl=null,gp(n),t)))for(n=0;n<t.length;n++)gp(t[n])}}function si(t,n){var i=t.stateNode;if(i===null)return null;var o=i[cn]||null;if(o===null)return null;i=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,n,typeof i));return i}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nu=!1;if(pa)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){Nu=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Nu=!1}var Ua=null,Au=null,Bs=null;function yp(){if(Bs)return Bs;var t,n=Au,i=n.length,o,p="value"in Ua?Ua.value:Ua.textContent,x=p.length;for(t=0;t<i&&n[t]===p[t];t++);var w=i-t;for(o=1;o<=w&&n[i-o]===p[x-o];o++);return Bs=p.slice(t,1<o?1-o:void 0)}function Hs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Fs(){return!0}function vp(){return!1}function un(t){function n(i,o,p,x,w){this._reactName=i,this._targetInst=p,this.type=o,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var N in t)t.hasOwnProperty(N)&&(i=t[N],this[N]=i?i(x):x[N]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Fs:vp,this.isPropagationStopped=vp,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Fs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Fs)},persist:function(){},isPersistent:Fs}),n}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=un(kr),ci=g({},kr,{view:0,detail:0}),yj=un(ci),Tu,_u,ui,Gs=g({},ci,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ui&&(ui&&t.type==="mousemove"?(Tu=t.screenX-ui.screenX,_u=t.screenY-ui.screenY):_u=Tu=0,ui=t),Tu)},movementY:function(t){return"movementY"in t?t.movementY:_u}}),bp=un(Gs),vj=g({},Gs,{dataTransfer:0}),bj=un(vj),Sj=g({},ci,{relatedTarget:0}),Ru=un(Sj),wj=g({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),kj=un(wj),jj=g({},kr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Cj=un(jj),Ej=g({},kr,{data:0}),Sp=un(Ej),Nj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Aj={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"},Tj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _j(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Tj[t])?!!n[t]:!1}function Mu(){return _j}var Rj=g({},ci,{key:function(t){if(t.key){var n=Nj[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Hs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Aj[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mu,charCode:function(t){return t.type==="keypress"?Hs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Hs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Mj=un(Rj),Oj=g({},Gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wp=un(Oj),Dj=g({},ci,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mu}),zj=un(Dj),Lj=g({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pj=un(Lj),Uj=g({},Gs,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Ij=un(Uj),Bj=g({},kr,{newState:0,oldState:0}),Hj=un(Bj),Fj=[9,13,27,32],Ou=pa&&"CompositionEvent"in window,di=null;pa&&"documentMode"in document&&(di=document.documentMode);var qj=pa&&"TextEvent"in window&&!di,kp=pa&&(!Ou||di&&8<di&&11>=di),jp=" ",Cp=!1;function Ep(t,n){switch(t){case"keyup":return Fj.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Np(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var rl=!1;function Gj(t,n){switch(t){case"compositionend":return Np(n);case"keypress":return n.which!==32?null:(Cp=!0,jp);case"textInput":return t=n.data,t===jp&&Cp?null:t;default:return null}}function $j(t,n){if(rl)return t==="compositionend"||!Ou&&Ep(t,n)?(t=yp(),Bs=Au=Ua=null,rl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return kp&&n.locale!=="ko"?null:n.data;default:return null}}var Yj={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 Ap(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Yj[t.type]:n==="textarea"}function Tp(t,n,i,o){nl?al?al.push(o):al=[o]:nl=o,n=Do(n,"onChange"),0<n.length&&(i=new qs("onChange","change",null,i,o),t.push({event:i,listeners:n}))}var fi=null,hi=null;function Vj(t){dy(t,0)}function $s(t){var n=ii(t);if(up(n))return t}function _p(t,n){if(t==="change")return n}var Rp=!1;if(pa){var Du;if(pa){var zu="oninput"in document;if(!zu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),zu=typeof Mp.oninput=="function"}Du=zu}else Du=!1;Rp=Du&&(!document.documentMode||9<document.documentMode)}function Op(){fi&&(fi.detachEvent("onpropertychange",Dp),hi=fi=null)}function Dp(t){if(t.propertyName==="value"&&$s(hi)){var n=[];Tp(n,hi,t,Cu(t)),xp(Vj,n)}}function Kj(t,n,i){t==="focusin"?(Op(),fi=n,hi=i,fi.attachEvent("onpropertychange",Dp)):t==="focusout"&&Op()}function Xj(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $s(hi)}function Qj(t,n){if(t==="click")return $s(n)}function Zj(t,n){if(t==="input"||t==="change")return $s(n)}function Jj(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var bn=typeof Object.is=="function"?Object.is:Jj;function mi(t,n){if(bn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var i=Object.keys(t),o=Object.keys(n);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var p=i[o];if(!Me.call(n,p)||!bn(t[p],n[p]))return!1}return!0}function zp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Lp(t,n){var i=zp(t);t=0;for(var o;i;){if(i.nodeType===3){if(o=t+i.textContent.length,t<=n&&o>=n)return{node:i,offset:n-t};t=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=zp(i)}}function Pp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Pp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Up(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Us(t.document);n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Us(t.document)}return n}function Lu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Wj=pa&&"documentMode"in document&&11>=document.documentMode,ll=null,Pu=null,pi=null,Uu=!1;function Ip(t,n,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Uu||ll==null||ll!==Us(o)||(o=ll,"selectionStart"in o&&Lu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),pi&&mi(pi,o)||(pi=o,o=Do(Pu,"onSelect"),0<o.length&&(n=new qs("onSelect","select",null,n,i),t.push({event:n,listeners:o}),n.target=ll)))}function jr(t,n){var i={};return i[t.toLowerCase()]=n.toLowerCase(),i["Webkit"+t]="webkit"+n,i["Moz"+t]="moz"+n,i}var il={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Iu={},Bp={};pa&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function Cr(t){if(Iu[t])return Iu[t];if(!il[t])return t;var n=il[t],i;for(i in n)if(n.hasOwnProperty(i)&&i in Bp)return Iu[t]=n[i];return t}var Hp=Cr("animationend"),Fp=Cr("animationiteration"),qp=Cr("animationstart"),eC=Cr("transitionrun"),tC=Cr("transitionstart"),nC=Cr("transitioncancel"),Gp=Cr("transitionend"),$p=new Map,Bu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Bu.push("scrollEnd");function Yn(t,n){$p.set(t,n),wr(n,[t])}var Ys=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},On=[],sl=0,Hu=0;function Vs(){for(var t=sl,n=Hu=sl=0;n<t;){var i=On[n];On[n++]=null;var o=On[n];On[n++]=null;var p=On[n];On[n++]=null;var x=On[n];if(On[n++]=null,o!==null&&p!==null){var w=o.pending;w===null?p.next=p:(p.next=w.next,w.next=p),o.pending=p}x!==0&&Yp(i,p,x)}}function Ks(t,n,i,o){On[sl++]=t,On[sl++]=n,On[sl++]=i,On[sl++]=o,Hu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Fu(t,n,i,o){return Ks(t,n,i,o),Xs(t)}function Er(t,n){return Ks(t,null,null,n),Xs(t)}function Yp(t,n,i){t.lanes|=i;var o=t.alternate;o!==null&&(o.lanes|=i);for(var p=!1,x=t.return;x!==null;)x.childLanes|=i,o=x.alternate,o!==null&&(o.childLanes|=i),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(p=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,p&&n!==null&&(p=31-ot(i),t=x.hiddenUpdates,o=t[p],o===null?t[p]=[n]:o.push(n),n.lane=i|536870912),x):null}function Xs(t){if(50<Pi)throw Pi=0,Zd=null,Error(l(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ol={};function aC(t,n,i,o){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(t,n,i,o){return new aC(t,n,i,o)}function qu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ga(t,n){var i=t.alternate;return i===null?(i=Sn(t.tag,n,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=n,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,n=t.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Vp(t,n){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,n=i.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Qs(t,n,i,o,p,x){var w=0;if(o=t,typeof t=="function")qu(t)&&(w=1);else if(typeof t=="string")w=o2(t,i,oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Y:return t=Sn(31,i,n,p),t.elementType=Y,t.lanes=x,t;case C:return Nr(i.children,p,x,n);case E:w=8,p|=24;break;case j:return t=Sn(12,i,n,p|2),t.elementType=j,t.lanes=x,t;case U:return t=Sn(13,i,n,p),t.elementType=U,t.lanes=x,t;case M:return t=Sn(19,i,n,p),t.elementType=M,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case O:w=10;break e;case R:w=9;break e;case _:w=11;break e;case L:w=14;break e;case F:w=16,o=null;break e}w=29,i=Error(l(130,t===null?"null":typeof t,"")),o=null}return n=Sn(w,i,n,p),n.elementType=t,n.type=o,n.lanes=x,n}function Nr(t,n,i,o){return t=Sn(7,t,o,n),t.lanes=i,t}function Gu(t,n,i){return t=Sn(6,t,null,n),t.lanes=i,t}function Kp(t){var n=Sn(18,null,null,0);return n.stateNode=t,n}function $u(t,n,i){return n=Sn(4,t.children!==null?t.children:[],t.key,n),n.lanes=i,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Xp=new WeakMap;function Dn(t,n){if(typeof t=="object"&&t!==null){var i=Xp.get(t);return i!==void 0?i:(n={value:t,source:n,stack:Te(n)},Xp.set(t,n),n)}return{value:t,source:n,stack:Te(n)}}var cl=[],ul=0,Zs=null,gi=0,zn=[],Ln=0,Ia=null,Wn=1,ea="";function xa(t,n){cl[ul++]=gi,cl[ul++]=Zs,Zs=t,gi=n}function Qp(t,n,i){zn[Ln++]=Wn,zn[Ln++]=ea,zn[Ln++]=Ia,Ia=t;var o=Wn;t=ea;var p=32-ot(o)-1;o&=~(1<<p),i+=1;var x=32-ot(n)+p;if(30<x){var w=p-p%5;x=(o&(1<<w)-1).toString(32),o>>=w,p-=w,Wn=1<<32-ot(n)+p|i<<p|o,ea=x+t}else Wn=1<<x|i<<p|o,ea=t}function Yu(t){t.return!==null&&(xa(t,1),Qp(t,1,0))}function Vu(t){for(;t===Zs;)Zs=cl[--ul],cl[ul]=null,gi=cl[--ul],cl[ul]=null;for(;t===Ia;)Ia=zn[--Ln],zn[Ln]=null,ea=zn[--Ln],zn[Ln]=null,Wn=zn[--Ln],zn[Ln]=null}function Zp(t,n){zn[Ln++]=Wn,zn[Ln++]=ea,zn[Ln++]=Ia,Wn=n.id,ea=n.overflow,Ia=t}var Gt=null,pt=null,Ve=!1,Ba=null,Pn=!1,Ku=Error(l(519));function Ha(t){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(Dn(n,t)),Ku}function Jp(t){var n=t.stateNode,i=t.type,o=t.memoizedProps;switch(n[qt]=t,n[cn]=o,i){case"dialog":qe("cancel",n),qe("close",n);break;case"iframe":case"object":case"embed":qe("load",n);break;case"video":case"audio":for(i=0;i<Ii.length;i++)qe(Ii[i],n);break;case"source":qe("error",n);break;case"img":case"image":case"link":qe("error",n),qe("load",n);break;case"details":qe("toggle",n);break;case"input":qe("invalid",n),dp(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":qe("invalid",n);break;case"textarea":qe("invalid",n),hp(n,o.value,o.defaultValue,o.children)}i=o.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||o.suppressHydrationWarning===!0||py(n.textContent,i)?(o.popover!=null&&(qe("beforetoggle",n),qe("toggle",n)),o.onScroll!=null&&qe("scroll",n),o.onScrollEnd!=null&&qe("scrollend",n),o.onClick!=null&&(n.onclick=ma),n=!0):n=!1,n||Ha(t,!0)}function Wp(t){for(Gt=t.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Gt=Gt.return}}function dl(t){if(t!==Gt)return!1;if(!Ve)return Wp(t),Ve=!0,!1;var n=t.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||hf(t.type,t.memoizedProps)),i=!i),i&&pt&&Ha(t),Wp(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));pt=jy(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));pt=jy(t)}else n===27?(n=pt,tr(t.type)?(t=yf,yf=null,pt=t):pt=n):pt=Gt?In(t.stateNode.nextSibling):null;return!0}function Ar(){pt=Gt=null,Ve=!1}function Xu(){var t=Ba;return t!==null&&(mn===null?mn=t:mn.push.apply(mn,t),Ba=null),t}function xi(t){Ba===null?Ba=[t]:Ba.push(t)}var Qu=D(null),Tr=null,ya=null;function Fa(t,n,i){T(Qu,n._currentValue),n._currentValue=i}function va(t){t._currentValue=Qu.current,Z(Qu)}function Zu(t,n,i){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===i)break;t=t.return}}function Ju(t,n,i,o){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var x=p.dependencies;if(x!==null){var w=p.child;x=x.firstContext;e:for(;x!==null;){var N=x;x=p;for(var I=0;I<n.length;I++)if(N.context===n[I]){x.lanes|=i,N=x.alternate,N!==null&&(N.lanes|=i),Zu(x.return,i,t),o||(w=null);break e}x=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(l(341));w.lanes|=i,x=w.alternate,x!==null&&(x.lanes|=i),Zu(w,i,t),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===t){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function fl(t,n,i,o){t=null;for(var p=n,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(l(387));if(w=w.memoizedProps,w!==null){var N=p.type;bn(p.pendingProps.value,w.value)||(t!==null?t.push(N):t=[N])}}else if(p===ge.current){if(w=p.alternate,w===null)throw Error(l(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(Gi):t=[Gi])}p=p.return}t!==null&&Ju(n,t,i,o),n.flags|=262144}function Js(t){for(t=t.firstContext;t!==null;){if(!bn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _r(t){Tr=t,ya=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return eg(Tr,t)}function Ws(t,n){return Tr===null&&_r(t),eg(t,n)}function eg(t,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},ya===null){if(t===null)throw Error(l(308));ya=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ya=ya.next=n;return i}var rC=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(i,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(i){return i()})}},lC=e.unstable_scheduleCallback,iC=e.unstable_NormalPriority,_t={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wu(){return{controller:new rC,data:new Map,refCount:0}}function yi(t){t.refCount--,t.refCount===0&&lC(iC,function(){t.controller.abort()})}var vi=null,ed=0,hl=0,ml=null;function sC(t,n){if(vi===null){var i=vi=[];ed=0,hl=af(),ml={status:"pending",value:void 0,then:function(o){i.push(o)}}}return ed++,n.then(tg,tg),n}function tg(){if(--ed===0&&vi!==null){ml!==null&&(ml.status="fulfilled");var t=vi;vi=null,hl=0,ml=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function oC(t,n){var i=[],o={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var p=0;p<i.length;p++)(0,i[p])(n)},function(p){for(o.status="rejected",o.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),o}var ng=z.S;z.S=function(t,n){Ix=Qe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&sC(t,n),ng!==null&&ng(t,n)};var Rr=D(null);function td(){var t=Rr.current;return t!==null?t:ct.pooledCache}function eo(t,n){n===null?T(Rr,Rr.current):T(Rr,n.pool)}function ag(){var t=td();return t===null?null:{parent:_t._currentValue,pool:t}}var pl=Error(l(460)),nd=Error(l(474)),to=Error(l(542)),no={then:function(){}};function rg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function lg(t,n,i){switch(i=t[i],i===void 0?t.push(n):i!==n&&(n.then(ma,ma),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,sg(t),t;default:if(typeof n.status=="string")n.then(ma,ma);else{if(t=ct,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var p=n;p.status="fulfilled",p.value=o}},function(o){if(n.status==="pending"){var p=n;p.status="rejected",p.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,sg(t),t}throw Or=n,pl}}function Mr(t){try{var n=t._init;return n(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Or=i,pl):i}}var Or=null;function ig(){if(Or===null)throw Error(l(459));var t=Or;return Or=null,t}function sg(t){if(t===pl||t===to)throw Error(l(483))}var gl=null,bi=0;function ao(t){var n=bi;return bi+=1,gl===null&&(gl=[]),lg(gl,t,n)}function Si(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function ro(t,n){throw n.$$typeof===v?Error(l(525)):(t=Object.prototype.toString.call(n),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function og(t){function n(q,B){if(t){var V=q.deletions;V===null?(q.deletions=[B],q.flags|=16):V.push(B)}}function i(q,B){if(!t)return null;for(;B!==null;)n(q,B),B=B.sibling;return null}function o(q){for(var B=new Map;q!==null;)q.key!==null?B.set(q.key,q):B.set(q.index,q),q=q.sibling;return B}function p(q,B){return q=ga(q,B),q.index=0,q.sibling=null,q}function x(q,B,V){return q.index=V,t?(V=q.alternate,V!==null?(V=V.index,V<B?(q.flags|=67108866,B):V):(q.flags|=67108866,B)):(q.flags|=1048576,B)}function w(q){return t&&q.alternate===null&&(q.flags|=67108866),q}function N(q,B,V,re){return B===null||B.tag!==6?(B=Gu(V,q.mode,re),B.return=q,B):(B=p(B,V),B.return=q,B)}function I(q,B,V,re){var Ne=V.type;return Ne===C?te(q,B,V.props.children,re,V.key):B!==null&&(B.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===F&&Mr(Ne)===B.type)?(B=p(B,V.props),Si(B,V),B.return=q,B):(B=Qs(V.type,V.key,V.props,null,q.mode,re),Si(B,V),B.return=q,B)}function K(q,B,V,re){return B===null||B.tag!==4||B.stateNode.containerInfo!==V.containerInfo||B.stateNode.implementation!==V.implementation?(B=$u(V,q.mode,re),B.return=q,B):(B=p(B,V.children||[]),B.return=q,B)}function te(q,B,V,re,Ne){return B===null||B.tag!==7?(B=Nr(V,q.mode,re,Ne),B.return=q,B):(B=p(B,V),B.return=q,B)}function le(q,B,V){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Gu(""+B,q.mode,V),B.return=q,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return V=Qs(B.type,B.key,B.props,null,q.mode,V),Si(V,B),V.return=q,V;case k:return B=$u(B,q.mode,V),B.return=q,B;case F:return B=Mr(B),le(q,B,V)}if(H(B)||ee(B))return B=Nr(B,q.mode,V,null),B.return=q,B;if(typeof B.then=="function")return le(q,ao(B),V);if(B.$$typeof===O)return le(q,Ws(q,B),V);ro(q,B)}return null}function Q(q,B,V,re){var Ne=B!==null?B.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ne!==null?null:N(q,B,""+V,re);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return V.key===Ne?I(q,B,V,re):null;case k:return V.key===Ne?K(q,B,V,re):null;case F:return V=Mr(V),Q(q,B,V,re)}if(H(V)||ee(V))return Ne!==null?null:te(q,B,V,re,null);if(typeof V.then=="function")return Q(q,B,ao(V),re);if(V.$$typeof===O)return Q(q,B,Ws(q,V),re);ro(q,V)}return null}function J(q,B,V,re,Ne){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return q=q.get(V)||null,N(B,q,""+re,Ne);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return q=q.get(re.key===null?V:re.key)||null,I(B,q,re,Ne);case k:return q=q.get(re.key===null?V:re.key)||null,K(B,q,re,Ne);case F:return re=Mr(re),J(q,B,V,re,Ne)}if(H(re)||ee(re))return q=q.get(V)||null,te(B,q,re,Ne,null);if(typeof re.then=="function")return J(q,B,V,ao(re),Ne);if(re.$$typeof===O)return J(q,B,V,Ws(B,re),Ne);ro(B,re)}return null}function xe(q,B,V,re){for(var Ne=null,Ze=null,we=B,Ue=B=0,Ye=null;we!==null&&Ue<V.length;Ue++){we.index>Ue?(Ye=we,we=null):Ye=we.sibling;var Je=Q(q,we,V[Ue],re);if(Je===null){we===null&&(we=Ye);break}t&&we&&Je.alternate===null&&n(q,we),B=x(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je,we=Ye}if(Ue===V.length)return i(q,we),Ve&&xa(q,Ue),Ne;if(we===null){for(;Ue<V.length;Ue++)we=le(q,V[Ue],re),we!==null&&(B=x(we,B,Ue),Ze===null?Ne=we:Ze.sibling=we,Ze=we);return Ve&&xa(q,Ue),Ne}for(we=o(we);Ue<V.length;Ue++)Ye=J(we,q,Ue,V[Ue],re),Ye!==null&&(t&&Ye.alternate!==null&&we.delete(Ye.key===null?Ue:Ye.key),B=x(Ye,B,Ue),Ze===null?Ne=Ye:Ze.sibling=Ye,Ze=Ye);return t&&we.forEach(function(ir){return n(q,ir)}),Ve&&xa(q,Ue),Ne}function Re(q,B,V,re){if(V==null)throw Error(l(151));for(var Ne=null,Ze=null,we=B,Ue=B=0,Ye=null,Je=V.next();we!==null&&!Je.done;Ue++,Je=V.next()){we.index>Ue?(Ye=we,we=null):Ye=we.sibling;var ir=Q(q,we,Je.value,re);if(ir===null){we===null&&(we=Ye);break}t&&we&&ir.alternate===null&&n(q,we),B=x(ir,B,Ue),Ze===null?Ne=ir:Ze.sibling=ir,Ze=ir,we=Ye}if(Je.done)return i(q,we),Ve&&xa(q,Ue),Ne;if(we===null){for(;!Je.done;Ue++,Je=V.next())Je=le(q,Je.value,re),Je!==null&&(B=x(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je);return Ve&&xa(q,Ue),Ne}for(we=o(we);!Je.done;Ue++,Je=V.next())Je=J(we,q,Ue,Je.value,re),Je!==null&&(t&&Je.alternate!==null&&we.delete(Je.key===null?Ue:Je.key),B=x(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je);return t&&we.forEach(function(v2){return n(q,v2)}),Ve&&xa(q,Ue),Ne}function st(q,B,V,re){if(typeof V=="object"&&V!==null&&V.type===C&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case b:e:{for(var Ne=V.key;B!==null;){if(B.key===Ne){if(Ne=V.type,Ne===C){if(B.tag===7){i(q,B.sibling),re=p(B,V.props.children),re.return=q,q=re;break e}}else if(B.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===F&&Mr(Ne)===B.type){i(q,B.sibling),re=p(B,V.props),Si(re,V),re.return=q,q=re;break e}i(q,B);break}else n(q,B);B=B.sibling}V.type===C?(re=Nr(V.props.children,q.mode,re,V.key),re.return=q,q=re):(re=Qs(V.type,V.key,V.props,null,q.mode,re),Si(re,V),re.return=q,q=re)}return w(q);case k:e:{for(Ne=V.key;B!==null;){if(B.key===Ne)if(B.tag===4&&B.stateNode.containerInfo===V.containerInfo&&B.stateNode.implementation===V.implementation){i(q,B.sibling),re=p(B,V.children||[]),re.return=q,q=re;break e}else{i(q,B);break}else n(q,B);B=B.sibling}re=$u(V,q.mode,re),re.return=q,q=re}return w(q);case F:return V=Mr(V),st(q,B,V,re)}if(H(V))return xe(q,B,V,re);if(ee(V)){if(Ne=ee(V),typeof Ne!="function")throw Error(l(150));return V=Ne.call(V),Re(q,B,V,re)}if(typeof V.then=="function")return st(q,B,ao(V),re);if(V.$$typeof===O)return st(q,B,Ws(q,V),re);ro(q,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,B!==null&&B.tag===6?(i(q,B.sibling),re=p(B,V),re.return=q,q=re):(i(q,B),re=Gu(V,q.mode,re),re.return=q,q=re),w(q)):i(q,B)}return function(q,B,V,re){try{bi=0;var Ne=st(q,B,V,re);return gl=null,Ne}catch(we){if(we===pl||we===to)throw we;var Ze=Sn(29,we,null,q.mode);return Ze.lanes=re,Ze.return=q,Ze}}}var Dr=og(!0),cg=og(!1),qa=!1;function ad(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ga(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function $a(t,n,i){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(We&2)!==0){var p=o.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),o.pending=n,n=Xs(t),Yp(t,null,i),n}return Ks(t,o,n,i),Xs(t)}function wi(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,i|=o,n.lanes=i,ep(t,i)}}function ld(t,n){var i=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var p=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?p=x=w:x=x.next=w,i=i.next}while(i!==null);x===null?p=x=n:x=x.next=n}else p=x=n;i={baseState:o.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:o.shared,callbacks:o.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}var id=!1;function ki(){if(id){var t=ml;if(t!==null)throw t}}function ji(t,n,i,o){id=!1;var p=t.updateQueue;qa=!1;var x=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var I=N,K=I.next;I.next=null,w===null?x=K:w.next=K,w=I;var te=t.alternate;te!==null&&(te=te.updateQueue,N=te.lastBaseUpdate,N!==w&&(N===null?te.firstBaseUpdate=K:N.next=K,te.lastBaseUpdate=I))}if(x!==null){var le=p.baseState;w=0,te=K=I=null,N=x;do{var Q=N.lane&-536870913,J=Q!==N.lane;if(J?($e&Q)===Q:(o&Q)===Q){Q!==0&&Q===hl&&(id=!0),te!==null&&(te=te.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=t,Re=N;Q=n;var st=i;switch(Re.tag){case 1:if(xe=Re.payload,typeof xe=="function"){le=xe.call(st,le,Q);break e}le=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Re.payload,Q=typeof xe=="function"?xe.call(st,le,Q):xe,Q==null)break e;le=g({},le,Q);break e;case 2:qa=!0}}Q=N.callback,Q!==null&&(t.flags|=64,J&&(t.flags|=8192),J=p.callbacks,J===null?p.callbacks=[Q]:J.push(Q))}else J={lane:Q,tag:N.tag,payload:N.payload,callback:N.callback,next:null},te===null?(K=te=J,I=le):te=te.next=J,w|=Q;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);te===null&&(I=le),p.baseState=I,p.firstBaseUpdate=K,p.lastBaseUpdate=te,x===null&&(p.shared.lanes=0),Qa|=w,t.lanes=w,t.memoizedState=le}}function ug(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function dg(t,n){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)ug(i[t],n)}var xl=D(null),lo=D(0);function fg(t,n){t=Aa,T(lo,t),T(xl,n),Aa=t|n.baseLanes}function sd(){T(lo,Aa),T(xl,xl.current)}function od(){Aa=lo.current,Z(xl),Z(lo)}var wn=D(null),Un=null;function Ya(t){var n=t.alternate;T(Nt,Nt.current&1),T(wn,t),Un===null&&(n===null||xl.current!==null||n.memoizedState!==null)&&(Un=t)}function cd(t){T(Nt,Nt.current),T(wn,t),Un===null&&(Un=t)}function hg(t){t.tag===22?(T(Nt,Nt.current),T(wn,t),Un===null&&(Un=t)):Va()}function Va(){T(Nt,Nt.current),T(wn,wn.current)}function kn(t){Z(wn),Un===t&&(Un=null),Z(Nt)}var Nt=D(0);function io(t){for(var n=t;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||gf(i)||xf(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(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 null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ba=0,Pe=null,lt=null,Rt=null,so=!1,yl=!1,zr=!1,oo=0,Ci=0,vl=null,cC=0;function Ct(){throw Error(l(321))}function ud(t,n){if(n===null)return!1;for(var i=0;i<n.length&&i<t.length;i++)if(!bn(t[i],n[i]))return!1;return!0}function dd(t,n,i,o,p,x){return ba=x,Pe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=t===null||t.memoizedState===null?Qg:Ed,zr=!1,x=i(o,p),zr=!1,yl&&(x=pg(n,i,o,p)),mg(t),x}function mg(t){z.H=Ai;var n=lt!==null&&lt.next!==null;if(ba=0,Rt=lt=Pe=null,so=!1,Ci=0,vl=null,n)throw Error(l(300));t===null||Mt||(t=t.dependencies,t!==null&&Js(t)&&(Mt=!0))}function pg(t,n,i,o){Pe=t;var p=0;do{if(yl&&(vl=null),Ci=0,yl=!1,25<=p)throw Error(l(301));if(p+=1,Rt=lt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=Zg,x=n(i,o)}while(yl);return x}function uC(){var t=z.H,n=t.useState()[0];return n=typeof n.then=="function"?Ei(n):n,t=t.useState()[0],(lt!==null?lt.memoizedState:null)!==t&&(Pe.flags|=1024),n}function fd(){var t=oo!==0;return oo=0,t}function hd(t,n,i){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~i}function md(t){if(so){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}so=!1}ba=0,Rt=lt=Pe=null,yl=!1,Ci=oo=0,vl=null}function nn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Pe.memoizedState=Rt=t:Rt=Rt.next=t,Rt}function At(){if(lt===null){var t=Pe.alternate;t=t!==null?t.memoizedState:null}else t=lt.next;var n=Rt===null?Pe.memoizedState:Rt.next;if(n!==null)Rt=n,lt=t;else{if(t===null)throw Pe.alternate===null?Error(l(467)):Error(l(310));lt=t,t={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Rt===null?Pe.memoizedState=Rt=t:Rt=Rt.next=t}return Rt}function co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ei(t){var n=Ci;return Ci+=1,vl===null&&(vl=[]),t=lg(vl,t,n),n=Pe,(Rt===null?n.memoizedState:Rt.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Qg:Ed),t}function uo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ei(t);if(t.$$typeof===O)return $t(t)}throw Error(l(438,String(t)))}function pd(t){var n=null,i=Pe.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var o=Pe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(p){return p.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=co(),Pe.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(t),o=0;o<t;o++)i[o]=P;return n.index++,i}function Sa(t,n){return typeof n=="function"?n(t):n}function fo(t){var n=At();return gd(n,lt,t)}function gd(t,n,i){var o=t.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=i;var p=t.baseQueue,x=o.pending;if(x!==null){if(p!==null){var w=p.next;p.next=x.next,x.next=w}n.baseQueue=p=x,o.pending=null}if(x=t.baseState,p===null)t.memoizedState=x;else{n=p.next;var N=w=null,I=null,K=n,te=!1;do{var le=K.lane&-536870913;if(le!==K.lane?($e&le)===le:(ba&le)===le){var Q=K.revertLane;if(Q===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),le===hl&&(te=!0);else if((ba&Q)===Q){K=K.next,Q===hl&&(te=!0);continue}else le={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(N=I=le,w=x):I=I.next=le,Pe.lanes|=Q,Qa|=Q;le=K.action,zr&&i(x,le),x=K.hasEagerState?K.eagerState:i(x,le)}else Q={lane:le,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(N=I=Q,w=x):I=I.next=Q,Pe.lanes|=le,Qa|=le;K=K.next}while(K!==null&&K!==n);if(I===null?w=x:I.next=N,!bn(x,t.memoizedState)&&(Mt=!0,te&&(i=ml,i!==null)))throw i;t.memoizedState=x,t.baseState=w,t.baseQueue=I,o.lastRenderedState=x}return p===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function xd(t){var n=At(),i=n.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var o=i.dispatch,p=i.pending,x=n.memoizedState;if(p!==null){i.pending=null;var w=p=p.next;do x=t(x,w.action),w=w.next;while(w!==p);bn(x,n.memoizedState)||(Mt=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),i.lastRenderedState=x}return[x,o]}function gg(t,n,i){var o=Pe,p=At(),x=Ve;if(x){if(i===void 0)throw Error(l(407));i=i()}else i=n();var w=!bn((lt||p).memoizedState,i);if(w&&(p.memoizedState=i,Mt=!0),p=p.queue,bd(vg.bind(null,o,p,t),[t]),p.getSnapshot!==n||w||Rt!==null&&Rt.memoizedState.tag&1){if(o.flags|=2048,bl(9,{destroy:void 0},yg.bind(null,o,p,i,n),null),ct===null)throw Error(l(349));x||(ba&127)!==0||xg(o,n,i)}return i}function xg(t,n,i){t.flags|=16384,t={getSnapshot:n,value:i},n=Pe.updateQueue,n===null?(n=co(),Pe.updateQueue=n,n.stores=[t]):(i=n.stores,i===null?n.stores=[t]:i.push(t))}function yg(t,n,i,o){n.value=i,n.getSnapshot=o,bg(n)&&Sg(t)}function vg(t,n,i){return i(function(){bg(n)&&Sg(t)})}function bg(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!bn(t,i)}catch{return!0}}function Sg(t){var n=Er(t,2);n!==null&&pn(n,t,2)}function yd(t){var n=nn();if(typeof t=="function"){var i=t;if(t=i(),zr){on(!0);try{i()}finally{on(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:t},n}function wg(t,n,i,o){return t.baseState=i,gd(t,lt,typeof o=="function"?o:Sa)}function dC(t,n,i,o,p){if(po(t))throw Error(l(485));if(t=n.action,t!==null){var x={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};z.T!==null?i(!0):x.isTransition=!1,o(x),i=n.pending,i===null?(x.next=n.pending=x,kg(n,x)):(x.next=i.next,n.pending=i.next=x)}}function kg(t,n){var i=n.action,o=n.payload,p=t.state;if(n.isTransition){var x=z.T,w={};z.T=w;try{var N=i(p,o),I=z.S;I!==null&&I(w,N),jg(t,n,N)}catch(K){vd(t,n,K)}finally{x!==null&&w.types!==null&&(x.types=w.types),z.T=x}}else try{x=i(p,o),jg(t,n,x)}catch(K){vd(t,n,K)}}function jg(t,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(o){Cg(t,n,o)},function(o){return vd(t,n,o)}):Cg(t,n,i)}function Cg(t,n,i){n.status="fulfilled",n.value=i,Eg(n),t.state=i,n=t.pending,n!==null&&(i=n.next,i===n?t.pending=null:(i=i.next,n.next=i,kg(t,i)))}function vd(t,n,i){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=i,Eg(n),n=n.next;while(n!==o)}t.action=null}function Eg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Ng(t,n){return n}function Ag(t,n){if(Ve){var i=ct.formState;if(i!==null){e:{var o=Pe;if(Ve){if(pt){t:{for(var p=pt,x=Pn;p.nodeType!==8;){if(!x){p=null;break t}if(p=In(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){pt=In(p.nextSibling),o=p.data==="F!";break e}}Ha(o)}o=!1}o&&(n=i[0])}}return i=nn(),i.memoizedState=i.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ng,lastRenderedState:n},i.queue=o,i=Vg.bind(null,Pe,o),o.dispatch=i,o=yd(!1),x=Cd.bind(null,Pe,!1,o.queue),o=nn(),p={state:n,dispatch:null,action:t,pending:null},o.queue=p,i=dC.bind(null,Pe,p,x,i),p.dispatch=i,o.memoizedState=t,[n,i,!1]}function Tg(t){var n=At();return _g(n,lt,t)}function _g(t,n,i){if(n=gd(t,n,Ng)[0],t=fo(Sa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ei(n)}catch(w){throw w===pl?to:w}else o=n;n=At();var p=n.queue,x=p.dispatch;return i!==n.memoizedState&&(Pe.flags|=2048,bl(9,{destroy:void 0},fC.bind(null,p,i),null)),[o,x,t]}function fC(t,n){t.action=n}function Rg(t){var n=At(),i=lt;if(i!==null)return _g(n,i,t);At(),n=n.memoizedState,i=At();var o=i.queue.dispatch;return i.memoizedState=t,[n,o,!1]}function bl(t,n,i,o){return t={tag:t,create:i,deps:o,inst:n,next:null},n=Pe.updateQueue,n===null&&(n=co(),Pe.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=t.next=t:(o=i.next,i.next=t,t.next=o,n.lastEffect=t),t}function Mg(){return At().memoizedState}function ho(t,n,i,o){var p=nn();Pe.flags|=t,p.memoizedState=bl(1|n,{destroy:void 0},i,o===void 0?null:o)}function mo(t,n,i,o){var p=At();o=o===void 0?null:o;var x=p.memoizedState.inst;lt!==null&&o!==null&&ud(o,lt.memoizedState.deps)?p.memoizedState=bl(n,x,i,o):(Pe.flags|=t,p.memoizedState=bl(1|n,x,i,o))}function Og(t,n){ho(8390656,8,t,n)}function bd(t,n){mo(2048,8,t,n)}function hC(t){Pe.flags|=4;var n=Pe.updateQueue;if(n===null)n=co(),Pe.updateQueue=n,n.events=[t];else{var i=n.events;i===null?n.events=[t]:i.push(t)}}function Dg(t){var n=At().memoizedState;return hC({ref:n,nextImpl:t}),function(){if((We&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function zg(t,n){return mo(4,2,t,n)}function Lg(t,n){return mo(4,4,t,n)}function Pg(t,n){if(typeof n=="function"){t=t();var i=n(t);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Ug(t,n,i){i=i!=null?i.concat([t]):null,mo(4,4,Pg.bind(null,n,t),i)}function Sd(){}function Ig(t,n){var i=At();n=n===void 0?null:n;var o=i.memoizedState;return n!==null&&ud(n,o[1])?o[0]:(i.memoizedState=[t,n],t)}function Bg(t,n){var i=At();n=n===void 0?null:n;var o=i.memoizedState;if(n!==null&&ud(n,o[1]))return o[0];if(o=t(),zr){on(!0);try{t()}finally{on(!1)}}return i.memoizedState=[o,n],o}function wd(t,n,i){return i===void 0||(ba&1073741824)!==0&&($e&261930)===0?t.memoizedState=n:(t.memoizedState=i,t=Hx(),Pe.lanes|=t,Qa|=t,i)}function Hg(t,n,i,o){return bn(i,n)?i:xl.current!==null?(t=wd(t,i,o),bn(t,n)||(Mt=!0),t):(ba&42)===0||(ba&1073741824)!==0&&($e&261930)===0?(Mt=!0,t.memoizedState=i):(t=Hx(),Pe.lanes|=t,Qa|=t,n)}function Fg(t,n,i,o,p){var x=$.p;$.p=x!==0&&8>x?x:8;var w=z.T,N={};z.T=N,Cd(t,!1,n,i);try{var I=p(),K=z.S;if(K!==null&&K(N,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var te=oC(I,o);Ni(t,n,te,En(t))}else Ni(t,n,o,En(t))}catch(le){Ni(t,n,{then:function(){},status:"rejected",reason:le},En())}finally{$.p=x,w!==null&&N.types!==null&&(w.types=N.types),z.T=w}}function mC(){}function kd(t,n,i,o){if(t.tag!==5)throw Error(l(476));var p=qg(t).queue;Fg(t,p,n,X,i===null?mC:function(){return Gg(t),i(o)})}function qg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:X},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:i},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Gg(t){var n=qg(t);n.next===null&&(n=t.alternate.memoizedState),Ni(t,n.next.queue,{},En())}function jd(){return $t(Gi)}function $g(){return At().memoizedState}function Yg(){return At().memoizedState}function pC(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var i=En();t=Ga(i);var o=$a(n,t,i);o!==null&&(pn(o,n,i),wi(o,n,i)),n={cache:Wu()},t.payload=n;return}n=n.return}}function gC(t,n,i){var o=En();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},po(t)?Kg(n,i):(i=Fu(t,n,i,o),i!==null&&(pn(i,t,o),Xg(i,n,o)))}function Vg(t,n,i){var o=En();Ni(t,n,i,o)}function Ni(t,n,i,o){var p={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(po(t))Kg(n,p);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var w=n.lastRenderedState,N=x(w,i);if(p.hasEagerState=!0,p.eagerState=N,bn(N,w))return Ks(t,n,p,0),ct===null&&Vs(),!1}catch{}if(i=Fu(t,n,p,o),i!==null)return pn(i,t,o),Xg(i,n,o),!0}return!1}function Cd(t,n,i,o){if(o={lane:2,revertLane:af(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},po(t)){if(n)throw Error(l(479))}else n=Fu(t,i,o,2),n!==null&&pn(n,t,2)}function po(t){var n=t.alternate;return t===Pe||n!==null&&n===Pe}function Kg(t,n){yl=so=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function Xg(t,n,i){if((i&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,i|=o,n.lanes=i,ep(t,i)}}var Ai={readContext:$t,use:uo,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Ai.useEffectEvent=Ct;var Qg={readContext:$t,use:uo,useCallback:function(t,n){return nn().memoizedState=[t,n===void 0?null:n],t},useContext:$t,useEffect:Og,useImperativeHandle:function(t,n,i){i=i!=null?i.concat([t]):null,ho(4194308,4,Pg.bind(null,n,t),i)},useLayoutEffect:function(t,n){return ho(4194308,4,t,n)},useInsertionEffect:function(t,n){ho(4,2,t,n)},useMemo:function(t,n){var i=nn();n=n===void 0?null:n;var o=t();if(zr){on(!0);try{t()}finally{on(!1)}}return i.memoizedState=[o,n],o},useReducer:function(t,n,i){var o=nn();if(i!==void 0){var p=i(n);if(zr){on(!0);try{i(n)}finally{on(!1)}}}else p=n;return o.memoizedState=o.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},o.queue=t,t=t.dispatch=gC.bind(null,Pe,t),[o.memoizedState,t]},useRef:function(t){var n=nn();return t={current:t},n.memoizedState=t},useState:function(t){t=yd(t);var n=t.queue,i=Vg.bind(null,Pe,n);return n.dispatch=i,[t.memoizedState,i]},useDebugValue:Sd,useDeferredValue:function(t,n){var i=nn();return wd(i,t,n)},useTransition:function(){var t=yd(!1);return t=Fg.bind(null,Pe,t.queue,!0,!1),nn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,i){var o=Pe,p=nn();if(Ve){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),ct===null)throw Error(l(349));($e&127)!==0||xg(o,n,i)}p.memoizedState=i;var x={value:i,getSnapshot:n};return p.queue=x,Og(vg.bind(null,o,x,t),[t]),o.flags|=2048,bl(9,{destroy:void 0},yg.bind(null,o,x,i,n),null),i},useId:function(){var t=nn(),n=ct.identifierPrefix;if(Ve){var i=ea,o=Wn;i=(o&~(1<<32-ot(o)-1)).toString(32)+i,n="_"+n+"R_"+i,i=oo++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=cC++,n="_"+n+"r_"+i.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:jd,useFormState:Ag,useActionState:Ag,useOptimistic:function(t){var n=nn();n.memoizedState=n.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Cd.bind(null,Pe,!0,i),i.dispatch=n,[t,n]},useMemoCache:pd,useCacheRefresh:function(){return nn().memoizedState=pC.bind(null,Pe)},useEffectEvent:function(t){var n=nn(),i={impl:t};return n.memoizedState=i,function(){if((We&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Ed={readContext:$t,use:uo,useCallback:Ig,useContext:$t,useEffect:bd,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Lg,useMemo:Bg,useReducer:fo,useRef:Mg,useState:function(){return fo(Sa)},useDebugValue:Sd,useDeferredValue:function(t,n){var i=At();return Hg(i,lt.memoizedState,t,n)},useTransition:function(){var t=fo(Sa)[0],n=At().memoizedState;return[typeof t=="boolean"?t:Ei(t),n]},useSyncExternalStore:gg,useId:$g,useHostTransitionStatus:jd,useFormState:Tg,useActionState:Tg,useOptimistic:function(t,n){var i=At();return wg(i,lt,t,n)},useMemoCache:pd,useCacheRefresh:Yg};Ed.useEffectEvent=Dg;var Zg={readContext:$t,use:uo,useCallback:Ig,useContext:$t,useEffect:bd,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Lg,useMemo:Bg,useReducer:xd,useRef:Mg,useState:function(){return xd(Sa)},useDebugValue:Sd,useDeferredValue:function(t,n){var i=At();return lt===null?wd(i,t,n):Hg(i,lt.memoizedState,t,n)},useTransition:function(){var t=xd(Sa)[0],n=At().memoizedState;return[typeof t=="boolean"?t:Ei(t),n]},useSyncExternalStore:gg,useId:$g,useHostTransitionStatus:jd,useFormState:Rg,useActionState:Rg,useOptimistic:function(t,n){var i=At();return lt!==null?wg(i,lt,t,n):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:pd,useCacheRefresh:Yg};Zg.useEffectEvent=Dg;function Nd(t,n,i,o){n=t.memoizedState,i=i(o,n),i=i==null?n:g({},n,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Ad={enqueueSetState:function(t,n,i){t=t._reactInternals;var o=En(),p=Ga(o);p.payload=n,i!=null&&(p.callback=i),n=$a(t,p,o),n!==null&&(pn(n,t,o),wi(n,t,o))},enqueueReplaceState:function(t,n,i){t=t._reactInternals;var o=En(),p=Ga(o);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=$a(t,p,o),n!==null&&(pn(n,t,o),wi(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var i=En(),o=Ga(i);o.tag=2,n!=null&&(o.callback=n),n=$a(t,o,i),n!==null&&(pn(n,t,i),wi(n,t,i))}};function Jg(t,n,i,o,p,x,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,x,w):n.prototype&&n.prototype.isPureReactComponent?!mi(i,o)||!mi(p,x):!0}function Wg(t,n,i,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,o),n.state!==t&&Ad.enqueueReplaceState(n,n.state,null)}function Lr(t,n){var i=n;if("ref"in n){i={};for(var o in n)o!=="ref"&&(i[o]=n[o])}if(t=t.defaultProps){i===n&&(i=g({},i));for(var p in t)i[p]===void 0&&(i[p]=t[p])}return i}function ex(t){Ys(t)}function tx(t){console.error(t)}function nx(t){Ys(t)}function go(t,n){try{var i=t.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function ax(t,n,i){try{var o=t.onCaughtError;o(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Td(t,n,i){return i=Ga(i),i.tag=3,i.payload={element:null},i.callback=function(){go(t,n)},i}function rx(t){return t=Ga(t),t.tag=3,t}function lx(t,n,i,o){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var x=o.value;t.payload=function(){return p(x)},t.callback=function(){ax(n,i,o)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){ax(n,i,o),typeof p!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var N=o.stack;this.componentDidCatch(o.value,{componentStack:N!==null?N:""})})}function xC(t,n,i,o,p){if(i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=i.alternate,n!==null&&fl(n,i,p,!0),i=wn.current,i!==null){switch(i.tag){case 31:case 13:return Un===null?Ao():i.alternate===null&&Et===0&&(Et=3),i.flags&=-257,i.flags|=65536,i.lanes=p,o===no?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([o]):n.add(o),ef(t,o,p)),!1;case 22:return i.flags|=65536,o===no?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([o]):i.add(o)),ef(t,o,p)),!1}throw Error(l(435,i.tag))}return ef(t,o,p),Ao(),!1}if(Ve)return n=wn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=p,o!==Ku&&(t=Error(l(422),{cause:o}),xi(Dn(t,i)))):(o!==Ku&&(n=Error(l(423),{cause:o}),xi(Dn(n,i))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,o=Dn(o,i),p=Td(t.stateNode,o,p),ld(t,p),Et!==4&&(Et=2)),!1;var x=Error(l(520),{cause:o});if(x=Dn(x,i),Li===null?Li=[x]:Li.push(x),Et!==4&&(Et=2),n===null)return!0;o=Dn(o,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,t=p&-p,i.lanes|=t,t=Td(i.stateNode,o,t),ld(i,t),!1;case 1:if(n=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Za===null||!Za.has(x))))return i.flags|=65536,p&=-p,i.lanes|=p,p=rx(p),lx(p,t,i,o),ld(i,p),!1}i=i.return}while(i!==null);return!1}var _d=Error(l(461)),Mt=!1;function Yt(t,n,i,o){n.child=t===null?cg(n,null,i,o):Dr(n,t.child,i,o)}function ix(t,n,i,o,p){i=i.render;var x=n.ref;if("ref"in o){var w={};for(var N in o)N!=="ref"&&(w[N]=o[N])}else w=o;return _r(n),o=dd(t,n,i,w,x,p),N=fd(),t!==null&&!Mt?(hd(t,n,p),wa(t,n,p)):(Ve&&N&&Yu(n),n.flags|=1,Yt(t,n,o,p),n.child)}function sx(t,n,i,o,p){if(t===null){var x=i.type;return typeof x=="function"&&!qu(x)&&x.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=x,ox(t,n,x,o,p)):(t=Qs(i.type,null,o,n,n.mode,p),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!Ud(t,p)){var w=x.memoizedProps;if(i=i.compare,i=i!==null?i:mi,i(w,o)&&t.ref===n.ref)return wa(t,n,p)}return n.flags|=1,t=ga(x,o),t.ref=n.ref,t.return=n,n.child=t}function ox(t,n,i,o,p){if(t!==null){var x=t.memoizedProps;if(mi(x,o)&&t.ref===n.ref)if(Mt=!1,n.pendingProps=o=x,Ud(t,p))(t.flags&131072)!==0&&(Mt=!0);else return n.lanes=t.lanes,wa(t,n,p)}return Rd(t,n,i,o,p)}function cx(t,n,i,o){var p=o.children,x=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,t!==null){for(o=n.child=t.child,p=0;o!==null;)p=p|o.lanes|o.childLanes,o=o.sibling;o=p&~x}else o=0,n.child=null;return ux(t,n,x,i,o)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&eo(n,x!==null?x.cachePool:null),x!==null?fg(n,x):sd(),hg(n);else return o=n.lanes=536870912,ux(t,n,x!==null?x.baseLanes|i:i,i,o)}else x!==null?(eo(n,x.cachePool),fg(n,x),Va(),n.memoizedState=null):(t!==null&&eo(n,null),sd(),Va());return Yt(t,n,p,i),n.child}function Ti(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ux(t,n,i,o,p){var x=td();return x=x===null?null:{parent:_t._currentValue,pool:x},n.memoizedState={baseLanes:i,cachePool:x},t!==null&&eo(n,null),sd(),hg(n),t!==null&&fl(t,n,o,!0),n.childLanes=p,null}function xo(t,n){return n=vo({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function dx(t,n,i){return Dr(n,t.child,null,i),t=xo(n,n.pendingProps),t.flags|=2,kn(n),n.memoizedState=null,t}function yC(t,n,i){var o=n.pendingProps,p=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ve){if(o.mode==="hidden")return t=xo(n,o),n.lanes=536870912,Ti(null,t);if(cd(n),(t=pt)?(t=ky(t,Pn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ia!==null?{id:Wn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},i=Kp(t),i.return=n,n.child=i,Gt=n,pt=null)):t=null,t===null)throw Ha(n);return n.lanes=536870912,null}return xo(n,o)}var x=t.memoizedState;if(x!==null){var w=x.dehydrated;if(cd(n),p)if(n.flags&256)n.flags&=-257,n=dx(t,n,i);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(l(558));else if(Mt||fl(t,n,i,!1),p=(i&t.childLanes)!==0,Mt||p){if(o=ct,o!==null&&(w=tp(o,i),w!==0&&w!==x.retryLane))throw x.retryLane=w,Er(t,w),pn(o,t,w),_d;Ao(),n=dx(t,n,i)}else t=x.treeContext,pt=In(w.nextSibling),Gt=n,Ve=!0,Ba=null,Pn=!1,t!==null&&Zp(n,t),n=xo(n,o),n.flags|=4096;return n}return t=ga(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function yo(t,n){var i=n.ref;if(i===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(n.flags|=4194816)}}function Rd(t,n,i,o,p){return _r(n),i=dd(t,n,i,o,void 0,p),o=fd(),t!==null&&!Mt?(hd(t,n,p),wa(t,n,p)):(Ve&&o&&Yu(n),n.flags|=1,Yt(t,n,i,p),n.child)}function fx(t,n,i,o,p,x){return _r(n),n.updateQueue=null,i=pg(n,o,i,p),mg(t),o=fd(),t!==null&&!Mt?(hd(t,n,x),wa(t,n,x)):(Ve&&o&&Yu(n),n.flags|=1,Yt(t,n,i,x),n.child)}function hx(t,n,i,o,p){if(_r(n),n.stateNode===null){var x=ol,w=i.contextType;typeof w=="object"&&w!==null&&(x=$t(w)),x=new i(o,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Ad,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=o,x.state=n.memoizedState,x.refs={},ad(n),w=i.contextType,x.context=typeof w=="object"&&w!==null?$t(w):ol,x.state=n.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(Nd(n,i,w,o),x.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&Ad.enqueueReplaceState(x,x.state,null),ji(n,o,x,p),ki(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){x=n.stateNode;var N=n.memoizedProps,I=Lr(i,N);x.props=I;var K=x.context,te=i.contextType;w=ol,typeof te=="object"&&te!==null&&(w=$t(te));var le=i.getDerivedStateFromProps;te=typeof le=="function"||typeof x.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,te||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N||K!==w)&&Wg(n,x,o,w),qa=!1;var Q=n.memoizedState;x.state=Q,ji(n,o,x,p),ki(),K=n.memoizedState,N||Q!==K||qa?(typeof le=="function"&&(Nd(n,i,le,o),K=n.memoizedState),(I=qa||Jg(n,i,I,o,Q,K,w))?(te||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=K),x.props=o,x.state=K,x.context=w,o=I):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{x=n.stateNode,rd(t,n),w=n.memoizedProps,te=Lr(i,w),x.props=te,le=n.pendingProps,Q=x.context,K=i.contextType,I=ol,typeof K=="object"&&K!==null&&(I=$t(K)),N=i.getDerivedStateFromProps,(K=typeof N=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==le||Q!==I)&&Wg(n,x,o,I),qa=!1,Q=n.memoizedState,x.state=Q,ji(n,o,x,p),ki();var J=n.memoizedState;w!==le||Q!==J||qa||t!==null&&t.dependencies!==null&&Js(t.dependencies)?(typeof N=="function"&&(Nd(n,i,N,o),J=n.memoizedState),(te=qa||Jg(n,i,te,o,Q,J,I)||t!==null&&t.dependencies!==null&&Js(t.dependencies))?(K||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(o,J,I),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(o,J,I)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),x.props=o,x.state=J,x.context=I,o=te):(typeof x.componentDidUpdate!="function"||w===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),o=!1)}return x=o,yo(t,n),o=(n.flags&128)!==0,x||o?(x=n.stateNode,i=o&&typeof i.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&o?(n.child=Dr(n,t.child,null,p),n.child=Dr(n,null,i,p)):Yt(t,n,i,p),n.memoizedState=x.state,t=n.child):t=wa(t,n,p),t}function mx(t,n,i,o){return Ar(),n.flags|=256,Yt(t,n,i,o),n.child}var Md={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(t){return{baseLanes:t,cachePool:ag()}}function Dd(t,n,i){return t=t!==null?t.childLanes&~i:0,n&&(t|=Cn),t}function px(t,n,i){var o=n.pendingProps,p=!1,x=(n.flags&128)!==0,w;if((w=x)||(w=t!==null&&t.memoizedState===null?!1:(Nt.current&2)!==0),w&&(p=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ve){if(p?Ya(n):Va(),(t=pt)?(t=ky(t,Pn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ia!==null?{id:Wn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},i=Kp(t),i.return=n,n.child=i,Gt=n,pt=null)):t=null,t===null)throw Ha(n);return xf(t)?n.lanes=32:n.lanes=536870912,null}var N=o.children;return o=o.fallback,p?(Va(),p=n.mode,N=vo({mode:"hidden",children:N},p),o=Nr(o,p,i,null),N.return=n,o.return=n,N.sibling=o,n.child=N,o=n.child,o.memoizedState=Od(i),o.childLanes=Dd(t,w,i),n.memoizedState=Md,Ti(null,o)):(Ya(n),zd(n,N))}var I=t.memoizedState;if(I!==null&&(N=I.dehydrated,N!==null)){if(x)n.flags&256?(Ya(n),n.flags&=-257,n=Ld(t,n,i)):n.memoizedState!==null?(Va(),n.child=t.child,n.flags|=128,n=null):(Va(),N=o.fallback,p=n.mode,o=vo({mode:"visible",children:o.children},p),N=Nr(N,p,i,null),N.flags|=2,o.return=n,N.return=n,o.sibling=N,n.child=o,Dr(n,t.child,null,i),o=n.child,o.memoizedState=Od(i),o.childLanes=Dd(t,w,i),n.memoizedState=Md,n=Ti(null,o));else if(Ya(n),xf(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var K=w.dgst;w=K,o=Error(l(419)),o.stack="",o.digest=w,xi({value:o,source:null,stack:null}),n=Ld(t,n,i)}else if(Mt||fl(t,n,i,!1),w=(i&t.childLanes)!==0,Mt||w){if(w=ct,w!==null&&(o=tp(w,i),o!==0&&o!==I.retryLane))throw I.retryLane=o,Er(t,o),pn(w,t,o),_d;gf(N)||Ao(),n=Ld(t,n,i)}else gf(N)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,pt=In(N.nextSibling),Gt=n,Ve=!0,Ba=null,Pn=!1,t!==null&&Zp(n,t),n=zd(n,o.children),n.flags|=4096);return n}return p?(Va(),N=o.fallback,p=n.mode,I=t.child,K=I.sibling,o=ga(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,K!==null?N=ga(K,N):(N=Nr(N,p,i,null),N.flags|=2),N.return=n,o.return=n,o.sibling=N,n.child=o,Ti(null,o),o=n.child,N=t.child.memoizedState,N===null?N=Od(i):(p=N.cachePool,p!==null?(I=_t._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=ag(),N={baseLanes:N.baseLanes|i,cachePool:p}),o.memoizedState=N,o.childLanes=Dd(t,w,i),n.memoizedState=Md,Ti(t.child,o)):(Ya(n),i=t.child,t=i.sibling,i=ga(i,{mode:"visible",children:o.children}),i.return=n,i.sibling=null,t!==null&&(w=n.deletions,w===null?(n.deletions=[t],n.flags|=16):w.push(t)),n.child=i,n.memoizedState=null,i)}function zd(t,n){return n=vo({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function vo(t,n){return t=Sn(22,t,null,n),t.lanes=0,t}function Ld(t,n,i){return Dr(n,t.child,null,i),t=zd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function gx(t,n,i){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Zu(t.return,n,i)}function Pd(t,n,i,o,p,x){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:p,treeForkCount:x}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=o,w.tail=i,w.tailMode=p,w.treeForkCount=x)}function xx(t,n,i){var o=n.pendingProps,p=o.revealOrder,x=o.tail;o=o.children;var w=Nt.current,N=(w&2)!==0;if(N?(w=w&1|2,n.flags|=128):w&=1,T(Nt,w),Yt(t,n,o,i),o=Ve?gi:0,!N&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&gx(t,i,n);else if(t.tag===19)gx(t,i,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(i=n.child,p=null;i!==null;)t=i.alternate,t!==null&&io(t)===null&&(p=i),i=i.sibling;i=p,i===null?(p=n.child,n.child=null):(p=i.sibling,i.sibling=null),Pd(n,!1,p,i,x,o);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=n.child,n.child=null;p!==null;){if(t=p.alternate,t!==null&&io(t)===null){n.child=p;break}t=p.sibling,p.sibling=i,i=p,p=t}Pd(n,!0,i,null,x,o);break;case"together":Pd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function wa(t,n,i){if(t!==null&&(n.dependencies=t.dependencies),Qa|=n.lanes,(i&n.childLanes)===0)if(t!==null){if(fl(t,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(l(153));if(n.child!==null){for(t=n.child,i=ga(t,t.pendingProps),n.child=i,i.return=n;t.sibling!==null;)t=t.sibling,i=i.sibling=ga(t,t.pendingProps),i.return=n;i.sibling=null}return n.child}function Ud(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Js(t)))}function vC(t,n,i){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),Fa(n,_t,t.memoizedState.cache),Ar();break;case 27:case 5:vt(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:Fa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,cd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ya(n),n.flags|=128,null):(i&n.child.childLanes)!==0?px(t,n,i):(Ya(n),t=wa(t,n,i),t!==null?t.sibling:null);Ya(n);break;case 19:var p=(t.flags&128)!==0;if(o=(i&n.childLanes)!==0,o||(fl(t,n,i,!1),o=(i&n.childLanes)!==0),p){if(o)return xx(t,n,i);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(Nt,Nt.current),o)break;return null;case 22:return n.lanes=0,cx(t,n,i,n.pendingProps);case 24:Fa(n,_t,t.memoizedState.cache)}return wa(t,n,i)}function yx(t,n,i){if(t!==null)if(t.memoizedProps!==n.pendingProps)Mt=!0;else{if(!Ud(t,i)&&(n.flags&128)===0)return Mt=!1,vC(t,n,i);Mt=(t.flags&131072)!==0}else Mt=!1,Ve&&(n.flags&1048576)!==0&&Qp(n,gi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Mr(n.elementType),n.type=t,typeof t=="function")qu(t)?(o=Lr(t,o),n.tag=1,n=hx(null,n,t,o,i)):(n.tag=0,n=Rd(null,n,t,o,i));else{if(t!=null){var p=t.$$typeof;if(p===_){n.tag=11,n=ix(null,n,t,o,i);break e}else if(p===L){n.tag=14,n=sx(null,n,t,o,i);break e}}throw n=ne(t)||t,Error(l(306,n,""))}}return n;case 0:return Rd(t,n,n.type,n.pendingProps,i);case 1:return o=n.type,p=Lr(o,n.pendingProps),hx(t,n,o,p,i);case 3:e:{if(Le(n,n.stateNode.containerInfo),t===null)throw Error(l(387));o=n.pendingProps;var x=n.memoizedState;p=x.element,rd(t,n),ji(n,o,null,i);var w=n.memoizedState;if(o=w.cache,Fa(n,_t,o),o!==x.cache&&Ju(n,[_t],i,!0),ki(),o=w.element,x.isDehydrated)if(x={element:o,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=mx(t,n,o,i);break e}else if(o!==p){p=Dn(Error(l(424)),n),xi(p),n=mx(t,n,o,i);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,pt=In(t.firstChild),Gt=n,Ve=!0,Ba=null,Pn=!0,i=cg(n,null,o,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ar(),o===p){n=wa(t,n,i);break e}Yt(t,n,o,i)}n=n.child}return n;case 26:return yo(t,n),t===null?(i=Ty(n.type,null,n.pendingProps,null))?n.memoizedState=i:Ve||(i=n.type,t=n.pendingProps,o=zo(ue.current).createElement(i),o[qt]=n,o[cn]=t,Vt(o,i,t),It(o),n.stateNode=o):n.memoizedState=Ty(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return vt(n),t===null&&Ve&&(o=n.stateNode=Ey(n.type,n.pendingProps,ue.current),Gt=n,Pn=!0,p=pt,tr(n.type)?(yf=p,pt=In(o.firstChild)):pt=p),Yt(t,n,n.pendingProps.children,i),yo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ve&&((p=o=pt)&&(o=XC(o,n.type,n.pendingProps,Pn),o!==null?(n.stateNode=o,Gt=n,pt=In(o.firstChild),Pn=!1,p=!0):p=!1),p||Ha(n)),vt(n),p=n.type,x=n.pendingProps,w=t!==null?t.memoizedProps:null,o=x.children,hf(p,x)?o=null:w!==null&&hf(p,w)&&(n.flags|=32),n.memoizedState!==null&&(p=dd(t,n,uC,null,null,i),Gi._currentValue=p),yo(t,n),Yt(t,n,o,i),n.child;case 6:return t===null&&Ve&&((t=i=pt)&&(i=QC(i,n.pendingProps,Pn),i!==null?(n.stateNode=i,Gt=n,pt=null,t=!0):t=!1),t||Ha(n)),null;case 13:return px(t,n,i);case 4:return Le(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Dr(n,null,o,i):Yt(t,n,o,i),n.child;case 11:return ix(t,n,n.type,n.pendingProps,i);case 7:return Yt(t,n,n.pendingProps,i),n.child;case 8:return Yt(t,n,n.pendingProps.children,i),n.child;case 12:return Yt(t,n,n.pendingProps.children,i),n.child;case 10:return o=n.pendingProps,Fa(n,n.type,o.value),Yt(t,n,o.children,i),n.child;case 9:return p=n.type._context,o=n.pendingProps.children,_r(n),p=$t(p),o=o(p),n.flags|=1,Yt(t,n,o,i),n.child;case 14:return sx(t,n,n.type,n.pendingProps,i);case 15:return ox(t,n,n.type,n.pendingProps,i);case 19:return xx(t,n,i);case 31:return yC(t,n,i);case 22:return cx(t,n,i,n.pendingProps);case 24:return _r(n),o=$t(_t),t===null?(p=td(),p===null&&(p=ct,x=Wu(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=i),p=x),n.memoizedState={parent:o,cache:p},ad(n),Fa(n,_t,p)):((t.lanes&i)!==0&&(rd(t,n),ji(n,null,null,i),ki()),p=t.memoizedState,x=n.memoizedState,p.parent!==o?(p={parent:o,cache:o},n.memoizedState=p,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=p),Fa(n,_t,o)):(o=x.cache,Fa(n,_t,o),o!==p.cache&&Ju(n,[_t],i,!0))),Yt(t,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function ka(t){t.flags|=4}function Id(t,n,i,o,p){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if($x())t.flags|=8192;else throw Or=no,nd}else t.flags&=-16777217}function vx(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Dy(n))if($x())t.flags|=8192;else throw Or=no,nd}function bo(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Jm():536870912,t.lanes|=n,jl|=n)}function _i(t,n){if(!Ve)switch(t.tailMode){case"hidden":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function gt(t){var n=t.alternate!==null&&t.alternate.child===t.child,i=0,o=0;if(n)for(var p=t.child;p!==null;)i|=p.lanes|p.childLanes,o|=p.subtreeFlags&65011712,o|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)i|=p.lanes|p.childLanes,o|=p.subtreeFlags,o|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=o,t.childLanes=i,n}function bC(t,n,i){var o=n.pendingProps;switch(Vu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(n),null;case 1:return gt(n),null;case 3:return i=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),va(_t),Ee(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(dl(n)?ka(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Xu())),gt(n),null;case 26:var p=n.type,x=n.memoizedState;return t===null?(ka(n),x!==null?(gt(n),vx(n,x)):(gt(n),Id(n,p,null,o,i))):x?x!==t.memoizedState?(ka(n),gt(n),vx(n,x)):(gt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&ka(n),gt(n),Id(n,p,t,o,i)),null;case 27:if(rt(n),i=ue.current,p=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ka(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return gt(n),null}t=oe.current,dl(n)?Jp(n):(t=Ey(p,o,i),n.stateNode=t,ka(n))}return gt(n),null;case 5:if(rt(n),p=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ka(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return gt(n),null}if(x=oe.current,dl(n))Jp(n);else{var w=zo(ue.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof o.is=="string"?w.createElement("select",{is:o.is}):w.createElement("select"),o.multiple?x.multiple=!0:o.size&&(x.size=o.size);break;default:x=typeof o.is=="string"?w.createElement(p,{is:o.is}):w.createElement(p)}}x[qt]=n,x[cn]=o;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=x;e:switch(Vt(x,p,o),p){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ka(n)}}return gt(n),Id(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,i),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ka(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=ue.current,dl(n)){if(t=n.stateNode,i=n.memoizedProps,o=null,p=Gt,p!==null)switch(p.tag){case 27:case 5:o=p.memoizedProps}t[qt]=n,t=!!(t.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||py(t.nodeValue,i)),t||Ha(n,!0)}else t=zo(t).createTextNode(o),t[qt]=n,n.stateNode=t}return gt(n),null;case 31:if(i=n.memoizedState,t===null||t.memoizedState!==null){if(o=dl(n),i!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[qt]=n}else Ar(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),t=!1}else i=Xu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return n.flags&256?(kn(n),n):(kn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return gt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=dl(n),o!==null&&o.dehydrated!==null){if(t===null){if(!p)throw Error(l(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));p[qt]=n}else Ar(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),p=!1}else p=Xu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return n.flags&256?(kn(n),n):(kn(n),null)}return kn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=o!==null,t=t!==null&&t.memoizedState!==null,i&&(o=n.child,p=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(p=o.alternate.memoizedState.cachePool.pool),x=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(x=o.memoizedState.cachePool.pool),x!==p&&(o.flags|=2048)),i!==t&&i&&(n.child.flags|=8192),bo(n,n.updateQueue),gt(n),null);case 4:return Ee(),t===null&&of(n.stateNode.containerInfo),gt(n),null;case 10:return va(n.type),gt(n),null;case 19:if(Z(Nt),o=n.memoizedState,o===null)return gt(n),null;if(p=(n.flags&128)!==0,x=o.rendering,x===null)if(p)_i(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=io(t),x!==null){for(n.flags|=128,_i(o,!1),t=x.updateQueue,n.updateQueue=t,bo(n,t),n.subtreeFlags=0,t=i,i=n.child;i!==null;)Vp(i,t),i=i.sibling;return T(Nt,Nt.current&1|2),Ve&&xa(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Qe()>Co&&(n.flags|=128,p=!0,_i(o,!1),n.lanes=4194304)}else{if(!p)if(t=io(x),t!==null){if(n.flags|=128,p=!0,t=t.updateQueue,n.updateQueue=t,bo(n,t),_i(o,!0),o.tail===null&&o.tailMode==="hidden"&&!x.alternate&&!Ve)return gt(n),null}else 2*Qe()-o.renderingStartTime>Co&&i!==536870912&&(n.flags|=128,p=!0,_i(o,!1),n.lanes=4194304);o.isBackwards?(x.sibling=n.child,n.child=x):(t=o.last,t!==null?t.sibling=x:n.child=x,o.last=x)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qe(),t.sibling=null,i=Nt.current,T(Nt,p?i&1|2:i&1),Ve&&xa(n,o.treeForkCount),t):(gt(n),null);case 22:case 23:return kn(n),od(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(i&536870912)!==0&&(n.flags&128)===0&&(gt(n),n.subtreeFlags&6&&(n.flags|=8192)):gt(n),i=n.updateQueue,i!==null&&bo(n,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==i&&(n.flags|=2048),t!==null&&Z(Rr),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),va(_t),gt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function SC(t,n){switch(Vu(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return va(_t),Ee(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return rt(n),null;case 31:if(n.memoizedState!==null){if(kn(n),n.alternate===null)throw Error(l(340));Ar()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(kn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Ar()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Z(Nt),null;case 4:return Ee(),null;case 10:return va(n.type),null;case 22:case 23:return kn(n),od(),t!==null&&Z(Rr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return va(_t),null;case 25:return null;default:return null}}function bx(t,n){switch(Vu(n),n.tag){case 3:va(_t),Ee();break;case 26:case 27:case 5:rt(n);break;case 4:Ee();break;case 31:n.memoizedState!==null&&kn(n);break;case 13:kn(n);break;case 19:Z(Nt);break;case 10:va(n.type);break;case 22:case 23:kn(n),od(),t!==null&&Z(Rr);break;case 24:va(_t)}}function Ri(t,n){try{var i=n.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var p=o.next;i=p;do{if((i.tag&t)===t){o=void 0;var x=i.create,w=i.inst;o=x(),w.destroy=o}i=i.next}while(i!==p)}}catch(N){at(n,n.return,N)}}function Ka(t,n,i){try{var o=n.updateQueue,p=o!==null?o.lastEffect:null;if(p!==null){var x=p.next;o=x;do{if((o.tag&t)===t){var w=o.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=n;var I=i,K=N;try{K()}catch(te){at(p,I,te)}}}o=o.next}while(o!==x)}}catch(te){at(n,n.return,te)}}function Sx(t){var n=t.updateQueue;if(n!==null){var i=t.stateNode;try{dg(n,i)}catch(o){at(t,t.return,o)}}}function wx(t,n,i){i.props=Lr(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(o){at(t,n,o)}}function Mi(t,n){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof i=="function"?t.refCleanup=i(o):i.current=o}}catch(p){at(t,n,p)}}function ta(t,n){var i=t.ref,o=t.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(p){at(t,n,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){at(t,n,p)}else i.current=null}function kx(t){var n=t.type,i=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(p){at(t,t.return,p)}}function Bd(t,n,i){try{var o=t.stateNode;qC(o,t.type,i,n),o[cn]=n}catch(p){at(t,t.return,p)}}function jx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&tr(t.type)||t.tag===4}function Hd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&tr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fd(t,n,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(t),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=ma));else if(o!==4&&(o===27&&tr(t.type)&&(i=t.stateNode,n=null),t=t.child,t!==null))for(Fd(t,n,i),t=t.sibling;t!==null;)Fd(t,n,i),t=t.sibling}function So(t,n,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(o!==4&&(o===27&&tr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(So(t,n,i),t=t.sibling;t!==null;)So(t,n,i),t=t.sibling}function Cx(t){var n=t.stateNode,i=t.memoizedProps;try{for(var o=t.type,p=n.attributes;p.length;)n.removeAttributeNode(p[0]);Vt(n,o,i),n[qt]=t,n[cn]=i}catch(x){at(t,t.return,x)}}var ja=!1,Ot=!1,qd=!1,Ex=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function wC(t,n){if(t=t.containerInfo,df=Fo,t=Up(t),Lu(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var p=o.anchorOffset,x=o.focusNode;o=o.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var w=0,N=-1,I=-1,K=0,te=0,le=t,Q=null;t:for(;;){for(var J;le!==i||p!==0&&le.nodeType!==3||(N=w+p),le!==x||o!==0&&le.nodeType!==3||(I=w+o),le.nodeType===3&&(w+=le.nodeValue.length),(J=le.firstChild)!==null;)Q=le,le=J;for(;;){if(le===t)break t;if(Q===i&&++K===p&&(N=w),Q===x&&++te===o&&(I=w),(J=le.nextSibling)!==null)break;le=Q,Q=le.parentNode}le=J}i=N===-1||I===-1?null:{start:N,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(ff={focusedElem:t,selectionRange:i},Fo=!1,Bt=n;Bt!==null;)if(n=Bt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Bt=t;else for(;Bt!==null;){switch(n=Bt,x=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)p=t[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,i=n,p=x.memoizedProps,x=x.memoizedState,o=i.stateNode;try{var xe=Lr(i.type,p);t=o.getSnapshotBeforeUpdate(xe,x),o.__reactInternalSnapshotBeforeUpdate=t}catch(Re){at(i,i.return,Re)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,i=t.nodeType,i===9)pf(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":pf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=n.sibling,t!==null){t.return=n.return,Bt=t;break}Bt=n.return}}function Nx(t,n,i){var o=i.flags;switch(i.tag){case 0:case 11:case 15:Ea(t,i),o&4&&Ri(5,i);break;case 1:if(Ea(t,i),o&4)if(t=i.stateNode,n===null)try{t.componentDidMount()}catch(w){at(i,i.return,w)}else{var p=Lr(i.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(p,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){at(i,i.return,w)}}o&64&&Sx(i),o&512&&Mi(i,i.return);break;case 3:if(Ea(t,i),o&64&&(t=i.updateQueue,t!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{dg(t,n)}catch(w){at(i,i.return,w)}}break;case 27:n===null&&o&4&&Cx(i);case 26:case 5:Ea(t,i),n===null&&o&4&&kx(i),o&512&&Mi(i,i.return);break;case 12:Ea(t,i);break;case 31:Ea(t,i),o&4&&_x(t,i);break;case 13:Ea(t,i),o&4&&Rx(t,i),o&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=RC.bind(null,i),ZC(t,i))));break;case 22:if(o=i.memoizedState!==null||ja,!o){n=n!==null&&n.memoizedState!==null||Ot,p=ja;var x=Ot;ja=o,(Ot=n)&&!x?Na(t,i,(i.subtreeFlags&8772)!==0):Ea(t,i),ja=p,Ot=x}break;case 30:break;default:Ea(t,i)}}function Ax(t){var n=t.alternate;n!==null&&(t.alternate=null,Ax(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&vu(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var bt=null,dn=!1;function Ca(t,n,i){for(i=i.child;i!==null;)Tx(t,n,i),i=i.sibling}function Tx(t,n,i){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(tn,i)}catch{}switch(i.tag){case 26:Ot||ta(i,n),Ca(t,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ot||ta(i,n);var o=bt,p=dn;tr(i.type)&&(bt=i.stateNode,dn=!1),Ca(t,n,i),Hi(i.stateNode),bt=o,dn=p;break;case 5:Ot||ta(i,n);case 6:if(o=bt,p=dn,bt=null,Ca(t,n,i),bt=o,dn=p,bt!==null)if(dn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(i.stateNode)}catch(x){at(i,n,x)}else try{bt.removeChild(i.stateNode)}catch(x){at(i,n,x)}break;case 18:bt!==null&&(dn?(t=bt,Sy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Ml(t)):Sy(bt,i.stateNode));break;case 4:o=bt,p=dn,bt=i.stateNode.containerInfo,dn=!0,Ca(t,n,i),bt=o,dn=p;break;case 0:case 11:case 14:case 15:Ka(2,i,n),Ot||Ka(4,i,n),Ca(t,n,i);break;case 1:Ot||(ta(i,n),o=i.stateNode,typeof o.componentWillUnmount=="function"&&wx(i,n,o)),Ca(t,n,i);break;case 21:Ca(t,n,i);break;case 22:Ot=(o=Ot)||i.memoizedState!==null,Ca(t,n,i),Ot=o;break;default:Ca(t,n,i)}}function _x(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ml(t)}catch(i){at(n,n.return,i)}}}function Rx(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ml(t)}catch(i){at(n,n.return,i)}}function kC(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Ex),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Ex),n;default:throw Error(l(435,t.tag))}}function wo(t,n){var i=kC(t);n.forEach(function(o){if(!i.has(o)){i.add(o);var p=MC.bind(null,t,o);o.then(p,p)}})}function fn(t,n){var i=n.deletions;if(i!==null)for(var o=0;o<i.length;o++){var p=i[o],x=t,w=n,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(tr(N.type)){bt=N.stateNode,dn=!1;break e}break;case 5:bt=N.stateNode,dn=!1;break e;case 3:case 4:bt=N.stateNode.containerInfo,dn=!0;break e}N=N.return}if(bt===null)throw Error(l(160));Tx(x,w,p),bt=null,dn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Mx(n,t),n=n.sibling}var Vn=null;function Mx(t,n){var i=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:fn(n,t),hn(t),o&4&&(Ka(3,t,t.return),Ri(3,t),Ka(5,t,t.return));break;case 1:fn(n,t),hn(t),o&512&&(Ot||i===null||ta(i,i.return)),o&64&&ja&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:var p=Vn;if(fn(n,t),hn(t),o&512&&(Ot||i===null||ta(i,i.return)),o&4){var x=i!==null?i.memoizedState:null;if(o=t.memoizedState,i===null)if(o===null)if(t.stateNode===null){e:{o=t.type,i=t.memoizedProps,p=p.ownerDocument||p;t:switch(o){case"title":x=p.getElementsByTagName("title")[0],(!x||x[li]||x[qt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(o),p.head.insertBefore(x,p.querySelector("head > title"))),Vt(x,o,i),x[qt]=t,It(x),o=x;break e;case"link":var w=My("link","href",p).get(o+(i.href||""));if(w){for(var N=0;N<w.length;N++)if(x=w[N],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(N,1);break t}}x=p.createElement(o),Vt(x,o,i),p.head.appendChild(x);break;case"meta":if(w=My("meta","content",p).get(o+(i.content||""))){for(N=0;N<w.length;N++)if(x=w[N],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(N,1);break t}}x=p.createElement(o),Vt(x,o,i),p.head.appendChild(x);break;default:throw Error(l(468,o))}x[qt]=t,It(x),o=x}t.stateNode=o}else Oy(p,t.type,t.stateNode);else t.stateNode=Ry(p,o,t.memoizedProps);else x!==o?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,o===null?Oy(p,t.type,t.stateNode):Ry(p,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Bd(t,t.memoizedProps,i.memoizedProps)}break;case 27:fn(n,t),hn(t),o&512&&(Ot||i===null||ta(i,i.return)),i!==null&&o&4&&Bd(t,t.memoizedProps,i.memoizedProps);break;case 5:if(fn(n,t),hn(t),o&512&&(Ot||i===null||ta(i,i.return)),t.flags&32){p=t.stateNode;try{tl(p,"")}catch(xe){at(t,t.return,xe)}}o&4&&t.stateNode!=null&&(p=t.memoizedProps,Bd(t,p,i!==null?i.memoizedProps:p)),o&1024&&(qd=!0);break;case 6:if(fn(n,t),hn(t),o&4){if(t.stateNode===null)throw Error(l(162));o=t.memoizedProps,i=t.stateNode;try{i.nodeValue=o}catch(xe){at(t,t.return,xe)}}break;case 3:if(Uo=null,p=Vn,Vn=Lo(n.containerInfo),fn(n,t),Vn=p,hn(t),o&4&&i!==null&&i.memoizedState.isDehydrated)try{Ml(n.containerInfo)}catch(xe){at(t,t.return,xe)}qd&&(qd=!1,Ox(t));break;case 4:o=Vn,Vn=Lo(t.stateNode.containerInfo),fn(n,t),hn(t),Vn=o;break;case 12:fn(n,t),hn(t);break;case 31:fn(n,t),hn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,wo(t,o)));break;case 13:fn(n,t),hn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(jo=Qe()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,wo(t,o)));break;case 22:p=t.memoizedState!==null;var I=i!==null&&i.memoizedState!==null,K=ja,te=Ot;if(ja=K||p,Ot=te||I,fn(n,t),Ot=te,ja=K,hn(t),o&8192)e:for(n=t.stateNode,n._visibility=p?n._visibility&-2:n._visibility|1,p&&(i===null||I||ja||Ot||Pr(t)),i=null,n=t;;){if(n.tag===5||n.tag===26){if(i===null){I=i=n;try{if(x=I.stateNode,p)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=I.stateNode;var le=I.memoizedProps.style,Q=le!=null&&le.hasOwnProperty("display")?le.display:null;N.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(xe){at(I,I.return,xe)}}}else if(n.tag===6){if(i===null){I=n;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(xe){at(I,I.return,xe)}}}else if(n.tag===18){if(i===null){I=n;try{var J=I.stateNode;p?wy(J,!0):wy(I.stateNode,!1)}catch(xe){at(I,I.return,xe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,wo(t,i))));break;case 19:fn(n,t),hn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,wo(t,o)));break;case 30:break;case 21:break;default:fn(n,t),hn(t)}}function hn(t){var n=t.flags;if(n&2){try{for(var i,o=t.return;o!==null;){if(jx(o)){i=o;break}o=o.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var p=i.stateNode,x=Hd(t);So(t,x,p);break;case 5:var w=i.stateNode;i.flags&32&&(tl(w,""),i.flags&=-33);var N=Hd(t);So(t,N,w);break;case 3:case 4:var I=i.stateNode.containerInfo,K=Hd(t);Fd(t,K,I);break;default:throw Error(l(161))}}catch(te){at(t,t.return,te)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Ox(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Ox(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ea(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Nx(t,n.alternate,n),n=n.sibling}function Pr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Ka(4,n,n.return),Pr(n);break;case 1:ta(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&wx(n,n.return,i),Pr(n);break;case 27:Hi(n.stateNode);case 26:case 5:ta(n,n.return),Pr(n);break;case 22:n.memoizedState===null&&Pr(n);break;case 30:Pr(n);break;default:Pr(n)}t=t.sibling}}function Na(t,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,p=t,x=n,w=x.flags;switch(x.tag){case 0:case 11:case 15:Na(p,x,i),Ri(4,x);break;case 1:if(Na(p,x,i),o=x,p=o.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(K){at(o,o.return,K)}if(o=x,p=o.updateQueue,p!==null){var N=o.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)ug(I[p],N)}catch(K){at(o,o.return,K)}}i&&w&64&&Sx(x),Mi(x,x.return);break;case 27:Cx(x);case 26:case 5:Na(p,x,i),i&&o===null&&w&4&&kx(x),Mi(x,x.return);break;case 12:Na(p,x,i);break;case 31:Na(p,x,i),i&&w&4&&_x(p,x);break;case 13:Na(p,x,i),i&&w&4&&Rx(p,x);break;case 22:x.memoizedState===null&&Na(p,x,i),Mi(x,x.return);break;case 30:break;default:Na(p,x,i)}n=n.sibling}}function Gd(t,n){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&yi(i))}function $d(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&yi(t))}function Kn(t,n,i,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Dx(t,n,i,o),n=n.sibling}function Dx(t,n,i,o){var p=n.flags;switch(n.tag){case 0:case 11:case 15:Kn(t,n,i,o),p&2048&&Ri(9,n);break;case 1:Kn(t,n,i,o);break;case 3:Kn(t,n,i,o),p&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&yi(t)));break;case 12:if(p&2048){Kn(t,n,i,o),t=n.stateNode;try{var x=n.memoizedProps,w=x.id,N=x.onPostCommit;typeof N=="function"&&N(w,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){at(n,n.return,I)}}else Kn(t,n,i,o);break;case 31:Kn(t,n,i,o);break;case 13:Kn(t,n,i,o);break;case 23:break;case 22:x=n.stateNode,w=n.alternate,n.memoizedState!==null?x._visibility&2?Kn(t,n,i,o):Oi(t,n):x._visibility&2?Kn(t,n,i,o):(x._visibility|=2,Sl(t,n,i,o,(n.subtreeFlags&10256)!==0||!1)),p&2048&&Gd(w,n);break;case 24:Kn(t,n,i,o),p&2048&&$d(n.alternate,n);break;default:Kn(t,n,i,o)}}function Sl(t,n,i,o,p){for(p=p&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=t,w=n,N=i,I=o,K=w.flags;switch(w.tag){case 0:case 11:case 15:Sl(x,w,N,I,p),Ri(8,w);break;case 23:break;case 22:var te=w.stateNode;w.memoizedState!==null?te._visibility&2?Sl(x,w,N,I,p):Oi(x,w):(te._visibility|=2,Sl(x,w,N,I,p)),p&&K&2048&&Gd(w.alternate,w);break;case 24:Sl(x,w,N,I,p),p&&K&2048&&$d(w.alternate,w);break;default:Sl(x,w,N,I,p)}n=n.sibling}}function Oi(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=t,o=n,p=o.flags;switch(o.tag){case 22:Oi(i,o),p&2048&&Gd(o.alternate,o);break;case 24:Oi(i,o),p&2048&&$d(o.alternate,o);break;default:Oi(i,o)}n=n.sibling}}var Di=8192;function wl(t,n,i){if(t.subtreeFlags&Di)for(t=t.child;t!==null;)zx(t,n,i),t=t.sibling}function zx(t,n,i){switch(t.tag){case 26:wl(t,n,i),t.flags&Di&&t.memoizedState!==null&&c2(i,Vn,t.memoizedState,t.memoizedProps);break;case 5:wl(t,n,i);break;case 3:case 4:var o=Vn;Vn=Lo(t.stateNode.containerInfo),wl(t,n,i),Vn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Di,Di=16777216,wl(t,n,i),Di=o):wl(t,n,i));break;default:wl(t,n,i)}}function Lx(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function zi(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];Bt=o,Ux(o,t)}Lx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Px(t),t=t.sibling}function Px(t){switch(t.tag){case 0:case 11:case 15:zi(t),t.flags&2048&&Ka(9,t,t.return);break;case 3:zi(t);break;case 12:zi(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,ko(t)):zi(t);break;default:zi(t)}}function ko(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];Bt=o,Ux(o,t)}Lx(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Ka(8,n,n.return),ko(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,ko(n));break;default:ko(n)}t=t.sibling}}function Ux(t,n){for(;Bt!==null;){var i=Bt;switch(i.tag){case 0:case 11:case 15:Ka(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var o=i.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:yi(i.memoizedState.cache)}if(o=i.child,o!==null)o.return=i,Bt=o;else e:for(i=t;Bt!==null;){o=Bt;var p=o.sibling,x=o.return;if(Ax(o),o===i){Bt=null;break e}if(p!==null){p.return=x,Bt=p;break e}Bt=x}}}var jC={getCacheForType:function(t){var n=$t(_t),i=n.data.get(t);return i===void 0&&(i=t(),n.data.set(t,i)),i},cacheSignal:function(){return $t(_t).controller.signal}},CC=typeof WeakMap=="function"?WeakMap:Map,We=0,ct=null,Fe=null,$e=0,nt=0,jn=null,Xa=!1,kl=!1,Yd=!1,Aa=0,Et=0,Qa=0,Ur=0,Vd=0,Cn=0,jl=0,Li=null,mn=null,Kd=!1,jo=0,Ix=0,Co=1/0,Eo=null,Za=null,Lt=0,Ja=null,Cl=null,Ta=0,Xd=0,Qd=null,Bx=null,Pi=0,Zd=null;function En(){return(We&2)!==0&&$e!==0?$e&-$e:z.T!==null?af():np()}function Hx(){if(Cn===0)if(($e&536870912)===0||Ve){var t=Os;Os<<=1,(Os&3932160)===0&&(Os=262144),Cn=t}else Cn=536870912;return t=wn.current,t!==null&&(t.flags|=32),Cn}function pn(t,n,i){(t===ct&&(nt===2||nt===9)||t.cancelPendingCommit!==null)&&(El(t,0),Wa(t,$e,Cn,!1)),ri(t,i),((We&2)===0||t!==ct)&&(t===ct&&((We&2)===0&&(Ur|=i),Et===4&&Wa(t,$e,Cn,!1)),na(t))}function Fx(t,n,i){if((We&6)!==0)throw Error(l(327));var o=!i&&(n&127)===0&&(n&t.expiredLanes)===0||ai(t,n),p=o?AC(t,n):Wd(t,n,!0),x=o;do{if(p===0){kl&&!o&&Wa(t,n,0,!1);break}else{if(i=t.current.alternate,x&&!EC(i)){p=Wd(t,n,!1),x=!1;continue}if(p===2){if(x=n,t.errorRecoveryDisabledLanes&x)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var N=t;p=Li;var I=N.current.memoizedState.isDehydrated;if(I&&(El(N,w).flags|=256),w=Wd(N,w,!1),w!==2){if(Yd&&!I){N.errorRecoveryDisabledLanes|=x,Ur|=x,p=4;break e}x=mn,mn=p,x!==null&&(mn===null?mn=x:mn.push.apply(mn,x))}p=w}if(x=!1,p!==2)continue}}if(p===1){El(t,0),Wa(t,n,0,!0);break}e:{switch(o=t,x=p,x){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:Wa(o,n,Cn,!Xa);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(p=jo+300-Qe(),10<p)){if(Wa(o,n,Cn,!Xa),zs(o,0,!0)!==0)break e;Ta=n,o.timeoutHandle=vy(qx.bind(null,o,i,mn,Eo,Kd,n,Cn,Ur,jl,Xa,x,"Throttled",-0,0),p);break e}qx(o,i,mn,Eo,Kd,n,Cn,Ur,jl,Xa,x,null,-0,0)}}break}while(!0);na(t)}function qx(t,n,i,o,p,x,w,N,I,K,te,le,Q,J){if(t.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ma},zx(n,x,le);var xe=(x&62914560)===x?jo-Qe():(x&4194048)===x?Ix-Qe():0;if(xe=u2(le,xe),xe!==null){Ta=x,t.cancelPendingCommit=xe(Zx.bind(null,t,n,x,i,o,p,w,N,I,te,le,null,Q,J)),Wa(t,x,w,!K);return}}Zx(t,n,x,i,o,p,w,N,I)}function EC(t){for(var n=t;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var o=0;o<i.length;o++){var p=i[o],x=p.getSnapshot;p=p.value;try{if(!bn(x(),p))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Wa(t,n,i,o){n&=~Vd,n&=~Ur,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var p=n;0<p;){var x=31-ot(p),w=1<<x;o[x]=-1,p&=~w}i!==0&&Wm(t,i,n)}function No(){return(We&6)===0?(Ui(0),!1):!0}function Jd(){if(Fe!==null){if(nt===0)var t=Fe.return;else t=Fe,ya=Tr=null,md(t),gl=null,bi=0,t=Fe;for(;t!==null;)bx(t.alternate,t),t=t.return;Fe=null}}function El(t,n){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,YC(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),Ta=0,Jd(),ct=t,Fe=i=ga(t.current,null),$e=n,nt=0,jn=null,Xa=!1,kl=ai(t,n),Yd=!1,jl=Cn=Vd=Ur=Qa=Et=0,mn=Li=null,Kd=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var p=31-ot(o),x=1<<p;n|=t[p],o&=~x}return Aa=n,Vs(),i}function Gx(t,n){Pe=null,z.H=Ai,n===pl||n===to?(n=ig(),nt=3):n===nd?(n=ig(),nt=4):nt=n===_d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,jn=n,Fe===null&&(Et=1,go(t,Dn(n,t.current)))}function $x(){var t=wn.current;return t===null?!0:($e&4194048)===$e?Un===null:($e&62914560)===$e||($e&536870912)!==0?t===Un:!1}function Yx(){var t=z.H;return z.H=Ai,t===null?Ai:t}function Vx(){var t=z.A;return z.A=jC,t}function Ao(){Et=4,Xa||($e&4194048)!==$e&&wn.current!==null||(kl=!0),(Qa&134217727)===0&&(Ur&134217727)===0||ct===null||Wa(ct,$e,Cn,!1)}function Wd(t,n,i){var o=We;We|=2;var p=Yx(),x=Vx();(ct!==t||$e!==n)&&(Eo=null,El(t,n)),n=!1;var w=Et;e:do try{if(nt!==0&&Fe!==null){var N=Fe,I=jn;switch(nt){case 8:Jd(),w=6;break e;case 3:case 2:case 9:case 6:wn.current===null&&(n=!0);var K=nt;if(nt=0,jn=null,Nl(t,N,I,K),i&&kl){w=0;break e}break;default:K=nt,nt=0,jn=null,Nl(t,N,I,K)}}NC(),w=Et;break}catch(te){Gx(t,te)}while(!0);return n&&t.shellSuspendCounter++,ya=Tr=null,We=o,z.H=p,z.A=x,Fe===null&&(ct=null,$e=0,Vs()),w}function NC(){for(;Fe!==null;)Kx(Fe)}function AC(t,n){var i=We;We|=2;var o=Yx(),p=Vx();ct!==t||$e!==n?(Eo=null,Co=Qe()+500,El(t,n)):kl=ai(t,n);e:do try{if(nt!==0&&Fe!==null){n=Fe;var x=jn;t:switch(nt){case 1:nt=0,jn=null,Nl(t,n,x,1);break;case 2:case 9:if(rg(x)){nt=0,jn=null,Xx(n);break}n=function(){nt!==2&&nt!==9||ct!==t||(nt=7),na(t)},x.then(n,n);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:rg(x)?(nt=0,jn=null,Xx(n)):(nt=0,jn=null,Nl(t,n,x,7));break;case 5:var w=null;switch(Fe.tag){case 26:w=Fe.memoizedState;case 5:case 27:var N=Fe;if(w?Dy(w):N.stateNode.complete){nt=0,jn=null;var I=N.sibling;if(I!==null)Fe=I;else{var K=N.return;K!==null?(Fe=K,To(K)):Fe=null}break t}}nt=0,jn=null,Nl(t,n,x,5);break;case 6:nt=0,jn=null,Nl(t,n,x,6);break;case 8:Jd(),Et=6;break e;default:throw Error(l(462))}}TC();break}catch(te){Gx(t,te)}while(!0);return ya=Tr=null,z.H=o,z.A=p,We=i,Fe!==null?0:(ct=null,$e=0,Vs(),Et)}function TC(){for(;Fe!==null&&!tt();)Kx(Fe)}function Kx(t){var n=yx(t.alternate,t,Aa);t.memoizedProps=t.pendingProps,n===null?To(t):Fe=n}function Xx(t){var n=t,i=n.alternate;switch(n.tag){case 15:case 0:n=fx(i,n,n.pendingProps,n.type,void 0,$e);break;case 11:n=fx(i,n,n.pendingProps,n.type.render,n.ref,$e);break;case 5:md(n);default:bx(i,n),n=Fe=Vp(n,Aa),n=yx(i,n,Aa)}t.memoizedProps=t.pendingProps,n===null?To(t):Fe=n}function Nl(t,n,i,o){ya=Tr=null,md(n),gl=null,bi=0;var p=n.return;try{if(xC(t,p,n,i,$e)){Et=1,go(t,Dn(i,t.current)),Fe=null;return}}catch(x){if(p!==null)throw Fe=p,x;Et=1,go(t,Dn(i,t.current)),Fe=null;return}n.flags&32768?(Ve||o===1?t=!0:kl||($e&536870912)!==0?t=!1:(Xa=t=!0,(o===2||o===9||o===3||o===6)&&(o=wn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Qx(n,t)):To(n)}function To(t){var n=t;do{if((n.flags&32768)!==0){Qx(n,Xa);return}t=n.return;var i=bC(n.alternate,n,Aa);if(i!==null){Fe=i;return}if(n=n.sibling,n!==null){Fe=n;return}Fe=n=t}while(n!==null);Et===0&&(Et=5)}function Qx(t,n){do{var i=SC(t.alternate,t);if(i!==null){i.flags&=32767,Fe=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(t=t.sibling,t!==null)){Fe=t;return}Fe=t=i}while(t!==null);Et=6,Fe=null}function Zx(t,n,i,o,p,x,w,N,I){t.cancelPendingCommit=null;do _o();while(Lt!==0);if((We&6)!==0)throw Error(l(327));if(n!==null){if(n===t.current)throw Error(l(177));if(x=n.lanes|n.childLanes,x|=Hu,oj(t,i,x,w,N,I),t===ct&&(Fe=ct=null,$e=0),Cl=n,Ja=t,Ta=i,Xd=x,Qd=p,Bx=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,OC(Oe,function(){return ny(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=z.T,z.T=null,p=$.p,$.p=2,w=We,We|=4;try{wC(t,n,i)}finally{We=w,$.p=p,z.T=o}}Lt=1,Jx(),Wx(),ey()}}function Jx(){if(Lt===1){Lt=0;var t=Ja,n=Cl,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=z.T,z.T=null;var o=$.p;$.p=2;var p=We;We|=4;try{Mx(n,t);var x=ff,w=Up(t.containerInfo),N=x.focusedElem,I=x.selectionRange;if(w!==N&&N&&N.ownerDocument&&Pp(N.ownerDocument.documentElement,N)){if(I!==null&&Lu(N)){var K=I.start,te=I.end;if(te===void 0&&(te=K),"selectionStart"in N)N.selectionStart=K,N.selectionEnd=Math.min(te,N.value.length);else{var le=N.ownerDocument||document,Q=le&&le.defaultView||window;if(Q.getSelection){var J=Q.getSelection(),xe=N.textContent.length,Re=Math.min(I.start,xe),st=I.end===void 0?Re:Math.min(I.end,xe);!J.extend&&Re>st&&(w=st,st=Re,Re=w);var q=Lp(N,Re),B=Lp(N,st);if(q&&B&&(J.rangeCount!==1||J.anchorNode!==q.node||J.anchorOffset!==q.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var V=le.createRange();V.setStart(q.node,q.offset),J.removeAllRanges(),Re>st?(J.addRange(V),J.extend(B.node,B.offset)):(V.setEnd(B.node,B.offset),J.addRange(V))}}}}for(le=[],J=N;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var re=le[N];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Fo=!!df,ff=df=null}finally{We=p,$.p=o,z.T=i}}t.current=n,Lt=2}}function Wx(){if(Lt===2){Lt=0;var t=Ja,n=Cl,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=z.T,z.T=null;var o=$.p;$.p=2;var p=We;We|=4;try{Nx(t,n.alternate,n)}finally{We=p,$.p=o,z.T=i}}Lt=3}}function ey(){if(Lt===4||Lt===3){Lt=0,Ft();var t=Ja,n=Cl,i=Ta,o=Bx;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Lt=5:(Lt=0,Cl=Ja=null,ty(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(Za=null),xu(i),n=n.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(tn,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=z.T,p=$.p,$.p=2,z.T=null;try{for(var x=t.onRecoverableError,w=0;w<o.length;w++){var N=o[w];x(N.value,{componentStack:N.stack})}}finally{z.T=n,$.p=p}}(Ta&3)!==0&&_o(),na(t),p=t.pendingLanes,(i&261930)!==0&&(p&42)!==0?t===Zd?Pi++:(Pi=0,Zd=t):Pi=0,Ui(0)}}function ty(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,yi(n)))}function _o(){return Jx(),Wx(),ey(),ny()}function ny(){if(Lt!==5)return!1;var t=Ja,n=Xd;Xd=0;var i=xu(Ta),o=z.T,p=$.p;try{$.p=32>i?32:i,z.T=null,i=Qd,Qd=null;var x=Ja,w=Ta;if(Lt=0,Cl=Ja=null,Ta=0,(We&6)!==0)throw Error(l(331));var N=We;if(We|=4,Px(x.current),Dx(x,x.current,w,i),We=N,Ui(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(tn,x)}catch{}return!0}finally{$.p=p,z.T=o,ty(t,n)}}function ay(t,n,i){n=Dn(i,n),n=Td(t.stateNode,n,2),t=$a(t,n,2),t!==null&&(ri(t,2),na(t))}function at(t,n,i){if(t.tag===3)ay(t,t,i);else for(;n!==null;){if(n.tag===3){ay(n,t,i);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Za===null||!Za.has(o))){t=Dn(i,t),i=rx(2),o=$a(n,i,2),o!==null&&(lx(i,o,n,t),ri(o,2),na(o));break}}n=n.return}}function ef(t,n,i){var o=t.pingCache;if(o===null){o=t.pingCache=new CC;var p=new Set;o.set(n,p)}else p=o.get(n),p===void 0&&(p=new Set,o.set(n,p));p.has(i)||(Yd=!0,p.add(i),t=_C.bind(null,t,n,i),n.then(t,t))}function _C(t,n,i){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,ct===t&&($e&i)===i&&(Et===4||Et===3&&($e&62914560)===$e&&300>Qe()-jo?(We&2)===0&&El(t,0):Vd|=i,jl===$e&&(jl=0)),na(t)}function ry(t,n){n===0&&(n=Jm()),t=Er(t,n),t!==null&&(ri(t,n),na(t))}function RC(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),ry(t,i)}function MC(t,n){var i=0;switch(t.tag){case 31:case 13:var o=t.stateNode,p=t.memoizedState;p!==null&&(i=p.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),ry(t,i)}function OC(t,n){return Tt(t,n)}var Ro=null,Al=null,tf=!1,Mo=!1,nf=!1,er=0;function na(t){t!==Al&&t.next===null&&(Al===null?Ro=Al=t:Al=Al.next=t),Mo=!0,tf||(tf=!0,zC())}function Ui(t,n){if(!nf&&Mo){nf=!0;do for(var i=!1,o=Ro;o!==null;){if(t!==0){var p=o.pendingLanes;if(p===0)var x=0;else{var w=o.suspendedLanes,N=o.pingedLanes;x=(1<<31-ot(42|t)+1)-1,x&=p&~(w&~N),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,oy(o,x))}else x=$e,x=zs(o,o===ct?x:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(x&3)===0||ai(o,x)||(i=!0,oy(o,x));o=o.next}while(i);nf=!1}}function DC(){ly()}function ly(){Mo=tf=!1;var t=0;er!==0&&$C()&&(t=er);for(var n=Qe(),i=null,o=Ro;o!==null;){var p=o.next,x=iy(o,n);x===0?(o.next=null,i===null?Ro=p:i.next=p,p===null&&(Al=i)):(i=o,(t!==0||(x&3)!==0)&&(Mo=!0)),o=p}Lt!==0&&Lt!==5||Ui(t),er!==0&&(er=0)}function iy(t,n){for(var i=t.suspendedLanes,o=t.pingedLanes,p=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var w=31-ot(x),N=1<<w,I=p[w];I===-1?((N&i)===0||(N&o)!==0)&&(p[w]=sj(N,n)):I<=n&&(t.expiredLanes|=N),x&=~N}if(n=ct,i=$e,i=zs(t,t===n?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,i===0||t===n&&(nt===2||nt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&mt(o),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||ai(t,i)){if(n=i&-i,n===t.callbackPriority)return n;switch(o!==null&&mt(o),xu(i)){case 2:case 8:i=me;break;case 32:i=Oe;break;case 268435456:i=et;break;default:i=Oe}return o=sy.bind(null,t),i=Tt(i,o),t.callbackPriority=n,t.callbackNode=i,n}return o!==null&&o!==null&&mt(o),t.callbackPriority=2,t.callbackNode=null,2}function sy(t,n){if(Lt!==0&&Lt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(_o()&&t.callbackNode!==i)return null;var o=$e;return o=zs(t,t===ct?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Fx(t,o,n),iy(t,Qe()),t.callbackNode!=null&&t.callbackNode===i?sy.bind(null,t):null)}function oy(t,n){if(_o())return null;Fx(t,n,!0)}function zC(){VC(function(){(We&6)!==0?Tt(ae,DC):ly()})}function af(){if(er===0){var t=hl;t===0&&(t=Ms,Ms<<=1,(Ms&261888)===0&&(Ms=256)),er=t}return er}function cy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Is(""+t)}function uy(t,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,t.id&&i.setAttribute("form",t.id),n.parentNode.insertBefore(i,n),t=new FormData(t),i.parentNode.removeChild(i),t}function LC(t,n,i,o,p){if(n==="submit"&&i&&i.stateNode===p){var x=cy((p[cn]||null).action),w=o.submitter;w&&(n=(n=w[cn]||null)?cy(n.formAction):w.getAttribute("formAction"),n!==null&&(x=n,w=null));var N=new qs("action","action",null,o,p);t.push({event:N,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(er!==0){var I=w?uy(p,w):new FormData(p);kd(i,{pending:!0,data:I,method:p.method,action:x},null,I)}}else typeof x=="function"&&(N.preventDefault(),I=w?uy(p,w):new FormData(p),kd(i,{pending:!0,data:I,method:p.method,action:x},x,I))},currentTarget:p}]})}}for(var rf=0;rf<Bu.length;rf++){var lf=Bu[rf],PC=lf.toLowerCase(),UC=lf[0].toUpperCase()+lf.slice(1);Yn(PC,"on"+UC)}Yn(Hp,"onAnimationEnd"),Yn(Fp,"onAnimationIteration"),Yn(qp,"onAnimationStart"),Yn("dblclick","onDoubleClick"),Yn("focusin","onFocus"),Yn("focusout","onBlur"),Yn(eC,"onTransitionRun"),Yn(tC,"onTransitionStart"),Yn(nC,"onTransitionCancel"),Yn(Gp,"onTransitionEnd"),Wr("onMouseEnter",["mouseout","mouseover"]),Wr("onMouseLeave",["mouseout","mouseover"]),Wr("onPointerEnter",["pointerout","pointerover"]),Wr("onPointerLeave",["pointerout","pointerover"]),wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),IC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function dy(t,n){n=(n&4)!==0;for(var i=0;i<t.length;i++){var o=t[i],p=o.event;o=o.listeners;e:{var x=void 0;if(n)for(var w=o.length-1;0<=w;w--){var N=o[w],I=N.instance,K=N.currentTarget;if(N=N.listener,I!==x&&p.isPropagationStopped())break e;x=N,p.currentTarget=K;try{x(p)}catch(te){Ys(te)}p.currentTarget=null,x=I}else for(w=0;w<o.length;w++){if(N=o[w],I=N.instance,K=N.currentTarget,N=N.listener,I!==x&&p.isPropagationStopped())break e;x=N,p.currentTarget=K;try{x(p)}catch(te){Ys(te)}p.currentTarget=null,x=I}}}}function qe(t,n){var i=n[yu];i===void 0&&(i=n[yu]=new Set);var o=t+"__bubble";i.has(o)||(fy(n,t,2,!1),i.add(o))}function sf(t,n,i){var o=0;n&&(o|=4),fy(i,t,o,n)}var Oo="_reactListening"+Math.random().toString(36).slice(2);function of(t){if(!t[Oo]){t[Oo]=!0,lp.forEach(function(i){i!=="selectionchange"&&(IC.has(i)||sf(i,!1,t),sf(i,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Oo]||(n[Oo]=!0,sf("selectionchange",!1,n))}}function fy(t,n,i,o){switch(Hy(n)){case 2:var p=h2;break;case 8:p=m2;break;default:p=kf}i=p.bind(null,n,i,t),p=void 0,!Nu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),o?p!==void 0?t.addEventListener(n,i,{capture:!0,passive:p}):t.addEventListener(n,i,!0):p!==void 0?t.addEventListener(n,i,{passive:p}):t.addEventListener(n,i,!1)}function cf(t,n,i,o,p){var x=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var w=o.tag;if(w===3||w===4){var N=o.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=o.return;w!==null;){var I=w.tag;if((I===3||I===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Qr(N),w===null)return;if(I=w.tag,I===5||I===6||I===26||I===27){o=x=w;continue e}N=N.parentNode}}o=o.return}xp(function(){var K=x,te=Cu(i),le=[];e:{var Q=$p.get(t);if(Q!==void 0){var J=qs,xe=t;switch(t){case"keypress":if(Hs(i)===0)break e;case"keydown":case"keyup":J=Mj;break;case"focusin":xe="focus",J=Ru;break;case"focusout":xe="blur",J=Ru;break;case"beforeblur":case"afterblur":J=Ru;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=bp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=bj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=zj;break;case Hp:case Fp:case qp:J=kj;break;case Gp:J=Pj;break;case"scroll":case"scrollend":J=yj;break;case"wheel":J=Ij;break;case"copy":case"cut":case"paste":J=Cj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=wp;break;case"toggle":case"beforetoggle":J=Hj}var Re=(n&4)!==0,st=!Re&&(t==="scroll"||t==="scrollend"),q=Re?Q!==null?Q+"Capture":null:Q;Re=[];for(var B=K,V;B!==null;){var re=B;if(V=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||V===null||q===null||(re=si(B,q),re!=null&&Re.push(Bi(B,re,V))),st)break;B=B.return}0<Re.length&&(Q=new J(Q,xe,null,i,te),le.push({event:Q,listeners:Re}))}}if((n&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",Q&&i!==ju&&(xe=i.relatedTarget||i.fromElement)&&(Qr(xe)||xe[Xr]))break e;if((J||Q)&&(Q=te.window===te?te:(Q=te.ownerDocument)?Q.defaultView||Q.parentWindow:window,J?(xe=i.relatedTarget||i.toElement,J=K,xe=xe?Qr(xe):null,xe!==null&&(st=u(xe),Re=xe.tag,xe!==st||Re!==5&&Re!==27&&Re!==6)&&(xe=null)):(J=null,xe=K),J!==xe)){if(Re=bp,re="onMouseLeave",q="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Re=wp,re="onPointerLeave",q="onPointerEnter",B="pointer"),st=J==null?Q:ii(J),V=xe==null?Q:ii(xe),Q=new Re(re,B+"leave",J,i,te),Q.target=st,Q.relatedTarget=V,re=null,Qr(te)===K&&(Re=new Re(q,B+"enter",xe,i,te),Re.target=V,Re.relatedTarget=st,re=Re),st=re,J&&xe)t:{for(Re=BC,q=J,B=xe,V=0,re=q;re;re=Re(re))V++;re=0;for(var Ne=B;Ne;Ne=Re(Ne))re++;for(;0<V-re;)q=Re(q),V--;for(;0<re-V;)B=Re(B),re--;for(;V--;){if(q===B||B!==null&&q===B.alternate){Re=q;break t}q=Re(q),B=Re(B)}Re=null}else Re=null;J!==null&&hy(le,Q,J,Re,!1),xe!==null&&st!==null&&hy(le,st,xe,Re,!0)}}e:{if(Q=K?ii(K):window,J=Q.nodeName&&Q.nodeName.toLowerCase(),J==="select"||J==="input"&&Q.type==="file")var Ze=_p;else if(Ap(Q))if(Rp)Ze=Zj;else{Ze=Xj;var we=Kj}else J=Q.nodeName,!J||J.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&ku(K.elementType)&&(Ze=_p):Ze=Qj;if(Ze&&(Ze=Ze(t,K))){Tp(le,Ze,i,te);break e}we&&we(t,Q,K),t==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&wu(Q,"number",Q.value)}switch(we=K?ii(K):window,t){case"focusin":(Ap(we)||we.contentEditable==="true")&&(ll=we,Pu=K,pi=null);break;case"focusout":pi=Pu=ll=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Ip(le,i,te);break;case"selectionchange":if(Wj)break;case"keydown":case"keyup":Ip(le,i,te)}var Ue;if(Ou)e:{switch(t){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else rl?Ep(t,i)&&(Ye="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(kp&&i.locale!=="ko"&&(rl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&rl&&(Ue=yp()):(Ua=te,Au="value"in Ua?Ua.value:Ua.textContent,rl=!0)),we=Do(K,Ye),0<we.length&&(Ye=new Sp(Ye,t,null,i,te),le.push({event:Ye,listeners:we}),Ue?Ye.data=Ue:(Ue=Np(i),Ue!==null&&(Ye.data=Ue)))),(Ue=qj?Gj(t,i):$j(t,i))&&(Ye=Do(K,"onBeforeInput"),0<Ye.length&&(we=new Sp("onBeforeInput","beforeinput",null,i,te),le.push({event:we,listeners:Ye}),we.data=Ue)),LC(le,t,K,i,te)}dy(le,n)})}function Bi(t,n,i){return{instance:t,listener:n,currentTarget:i}}function Do(t,n){for(var i=n+"Capture",o=[];t!==null;){var p=t,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=si(t,i),p!=null&&o.unshift(Bi(t,p,x)),p=si(t,n),p!=null&&o.push(Bi(t,p,x))),t.tag===3)return o;t=t.return}return[]}function BC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function hy(t,n,i,o,p){for(var x=n._reactName,w=[];i!==null&&i!==o;){var N=i,I=N.alternate,K=N.stateNode;if(N=N.tag,I!==null&&I===o)break;N!==5&&N!==26&&N!==27||K===null||(I=K,p?(K=si(i,x),K!=null&&w.unshift(Bi(i,K,I))):p||(K=si(i,x),K!=null&&w.push(Bi(i,K,I)))),i=i.return}w.length!==0&&t.push({event:n,listeners:w})}var HC=/\r\n?/g,FC=/\u0000|\uFFFD/g;function my(t){return(typeof t=="string"?t:""+t).replace(HC,`
9
+ `).replace(FC,"")}function py(t,n){return n=my(n),my(t)===n}function it(t,n,i,o,p,x){switch(i){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||tl(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&tl(t,""+o);break;case"className":Ps(t,"class",o);break;case"tabIndex":Ps(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ps(t,i,o);break;case"style":pp(t,o,x);break;case"data":if(n!=="object"){Ps(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||i!=="href")){t.removeAttribute(i);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(i);break}o=Is(""+o),t.setAttribute(i,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(i==="formAction"?(n!=="input"&&it(t,n,"name",p.name,p,null),it(t,n,"formEncType",p.formEncType,p,null),it(t,n,"formMethod",p.formMethod,p,null),it(t,n,"formTarget",p.formTarget,p,null)):(it(t,n,"encType",p.encType,p,null),it(t,n,"method",p.method,p,null),it(t,n,"target",p.target,p,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(i);break}o=Is(""+o),t.setAttribute(i,o);break;case"onClick":o!=null&&(t.onclick=ma);break;case"onScroll":o!=null&&qe("scroll",t);break;case"onScrollEnd":o!=null&&qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}i=Is(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(i,""+o):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":o===!0?t.setAttribute(i,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(i,o):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(i,o):t.removeAttribute(i);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(i):t.setAttribute(i,o);break;case"popover":qe("beforetoggle",t),qe("toggle",t),Ls(t,"popover",o);break;case"xlinkActuate":ha(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ha(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ha(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ha(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ha(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ha(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ha(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ha(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ha(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ls(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=gj.get(i)||i,Ls(t,i,o))}}function uf(t,n,i,o,p,x){switch(i){case"style":pp(t,o,x);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof o=="string"?tl(t,o):(typeof o=="number"||typeof o=="bigint")&&tl(t,""+o);break;case"onScroll":o!=null&&qe("scroll",t);break;case"onScrollEnd":o!=null&&qe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ip.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),n=i.slice(2,p?i.length-7:void 0),x=t[cn]||null,x=x!=null?x[i]:null,typeof x=="function"&&t.removeEventListener(n,x,p),typeof o=="function")){typeof x!="function"&&x!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(n,o,p);break e}i in t?t[i]=o:o===!0?t.setAttribute(i,""):Ls(t,i,o)}}}function Vt(t,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",t),qe("load",t);var o=!1,p=!1,x;for(x in i)if(i.hasOwnProperty(x)){var w=i[x];if(w!=null)switch(x){case"src":o=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:it(t,n,x,w,i,null)}}p&&it(t,n,"srcSet",i.srcSet,i,null),o&&it(t,n,"src",i.src,i,null);return;case"input":qe("invalid",t);var N=x=w=p=null,I=null,K=null;for(o in i)if(i.hasOwnProperty(o)){var te=i[o];if(te!=null)switch(o){case"name":p=te;break;case"type":w=te;break;case"checked":I=te;break;case"defaultChecked":K=te;break;case"value":x=te;break;case"defaultValue":N=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,n));break;default:it(t,n,o,te,i,null)}}dp(t,x,N,I,K,w,p,!1);return;case"select":qe("invalid",t),o=w=x=null;for(p in i)if(i.hasOwnProperty(p)&&(N=i[p],N!=null))switch(p){case"value":x=N;break;case"defaultValue":w=N;break;case"multiple":o=N;default:it(t,n,p,N,i,null)}n=x,i=w,t.multiple=!!o,n!=null?el(t,!!o,n,!1):i!=null&&el(t,!!o,i,!0);return;case"textarea":qe("invalid",t),x=p=o=null;for(w in i)if(i.hasOwnProperty(w)&&(N=i[w],N!=null))switch(w){case"value":o=N;break;case"defaultValue":p=N;break;case"children":x=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(91));break;default:it(t,n,w,N,i,null)}hp(t,o,p,x);return;case"option":for(I in i)i.hasOwnProperty(I)&&(o=i[I],o!=null)&&(I==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":it(t,n,I,o,i,null));return;case"dialog":qe("beforetoggle",t),qe("toggle",t),qe("cancel",t),qe("close",t);break;case"iframe":case"object":qe("load",t);break;case"video":case"audio":for(o=0;o<Ii.length;o++)qe(Ii[o],t);break;case"image":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"embed":case"source":case"link":qe("error",t),qe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in i)if(i.hasOwnProperty(K)&&(o=i[K],o!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:it(t,n,K,o,i,null)}return;default:if(ku(n)){for(te in i)i.hasOwnProperty(te)&&(o=i[te],o!==void 0&&uf(t,n,te,o,i,void 0));return}}for(N in i)i.hasOwnProperty(N)&&(o=i[N],o!=null&&it(t,n,N,o,i,null))}function qC(t,n,i,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,w=null,N=null,I=null,K=null,te=null;for(J in i){var le=i[J];if(i.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=le;default:o.hasOwnProperty(J)||it(t,n,J,null,o,le)}}for(var Q in o){var J=o[Q];if(le=i[Q],o.hasOwnProperty(Q)&&(J!=null||le!=null))switch(Q){case"type":x=J;break;case"name":p=J;break;case"checked":K=J;break;case"defaultChecked":te=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(l(137,n));break;default:J!==le&&it(t,n,Q,J,o,le)}}Su(t,w,N,I,K,te,x,p);return;case"select":J=w=N=Q=null;for(x in i)if(I=i[x],i.hasOwnProperty(x)&&I!=null)switch(x){case"value":break;case"multiple":J=I;default:o.hasOwnProperty(x)||it(t,n,x,null,o,I)}for(p in o)if(x=o[p],I=i[p],o.hasOwnProperty(p)&&(x!=null||I!=null))switch(p){case"value":Q=x;break;case"defaultValue":N=x;break;case"multiple":w=x;default:x!==I&&it(t,n,p,x,o,I)}n=N,i=w,o=J,Q!=null?el(t,!!i,Q,!1):!!o!=!!i&&(n!=null?el(t,!!i,n,!0):el(t,!!i,i?[]:"",!1));return;case"textarea":J=Q=null;for(N in i)if(p=i[N],i.hasOwnProperty(N)&&p!=null&&!o.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:it(t,n,N,null,o,p)}for(w in o)if(p=o[w],x=i[w],o.hasOwnProperty(w)&&(p!=null||x!=null))switch(w){case"value":Q=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==x&&it(t,n,w,p,o,x)}fp(t,Q,J);return;case"option":for(var xe in i)Q=i[xe],i.hasOwnProperty(xe)&&Q!=null&&!o.hasOwnProperty(xe)&&(xe==="selected"?t.selected=!1:it(t,n,xe,null,o,Q));for(I in o)Q=o[I],J=i[I],o.hasOwnProperty(I)&&Q!==J&&(Q!=null||J!=null)&&(I==="selected"?t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":it(t,n,I,Q,o,J));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in i)Q=i[Re],i.hasOwnProperty(Re)&&Q!=null&&!o.hasOwnProperty(Re)&&it(t,n,Re,null,o,Q);for(K in o)if(Q=o[K],J=i[K],o.hasOwnProperty(K)&&Q!==J&&(Q!=null||J!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(l(137,n));break;default:it(t,n,K,Q,o,J)}return;default:if(ku(n)){for(var st in i)Q=i[st],i.hasOwnProperty(st)&&Q!==void 0&&!o.hasOwnProperty(st)&&uf(t,n,st,void 0,o,Q);for(te in o)Q=o[te],J=i[te],!o.hasOwnProperty(te)||Q===J||Q===void 0&&J===void 0||uf(t,n,te,Q,o,J);return}}for(var q in i)Q=i[q],i.hasOwnProperty(q)&&Q!=null&&!o.hasOwnProperty(q)&&it(t,n,q,null,o,Q);for(le in o)Q=o[le],J=i[le],!o.hasOwnProperty(le)||Q===J||Q==null&&J==null||it(t,n,le,Q,o,J)}function gy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,i=performance.getEntriesByType("resource"),o=0;o<i.length;o++){var p=i[o],x=p.transferSize,w=p.initiatorType,N=p.duration;if(x&&N&&gy(w)){for(w=0,N=p.responseEnd,o+=1;o<i.length;o++){var I=i[o],K=I.startTime;if(K>N)break;var te=I.transferSize,le=I.initiatorType;te&&gy(le)&&(I=I.responseEnd,w+=te*(I<N?1:(N-K)/(I-K)))}if(--o,n+=8*(x+w)/(p.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var df=null,ff=null;function zo(t){return t.nodeType===9?t:t.ownerDocument}function xy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yy(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function hf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var mf=null;function $C(){var t=window.event;return t&&t.type==="popstate"?t===mf?!1:(mf=t,!0):(mf=null,!1)}var vy=typeof setTimeout=="function"?setTimeout:void 0,YC=typeof clearTimeout=="function"?clearTimeout:void 0,by=typeof Promise=="function"?Promise:void 0,VC=typeof queueMicrotask=="function"?queueMicrotask:typeof by<"u"?function(t){return by.resolve(null).then(t).catch(KC)}:vy;function KC(t){setTimeout(function(){throw t})}function tr(t){return t==="head"}function Sy(t,n){var i=n,o=0;do{var p=i.nextSibling;if(t.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(o===0){t.removeChild(p),Ml(n);return}o--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")o++;else if(i==="html")Hi(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Hi(i);for(var x=i.firstChild;x;){var w=x.nextSibling,N=x.nodeName;x[li]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=w}}else i==="body"&&Hi(t.ownerDocument.body);i=p}while(i);Ml(n)}function wy(t,n){var i=t;t=0;do{var o=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=o}while(i)}function pf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":pf(i),vu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function XC(t,n,i,o){for(;t.nodeType===1;){var p=i;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[li])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=In(t.nextSibling),t===null)break}return null}function QC(t,n,i){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=In(t.nextSibling),t===null))return null;return t}function ky(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=In(t.nextSibling),t===null))return null;return t}function gf(t){return t.data==="$?"||t.data==="$~"}function xf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ZC(t,n){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||i.readyState!=="loading")n();else{var o=function(){n(),i.removeEventListener("DOMContentLoaded",o)};i.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function In(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var yf=null;function jy(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(n===0)return In(t.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}t=t.nextSibling}return null}function Cy(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return t;n--}else i!=="/$"&&i!=="/&"||n++}t=t.previousSibling}return null}function Ey(t,n,i){switch(n=zo(i),t){case"html":if(t=n.documentElement,!t)throw Error(l(452));return t;case"head":if(t=n.head,!t)throw Error(l(453));return t;case"body":if(t=n.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Hi(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);vu(t)}var Bn=new Map,Ny=new Set;function Lo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var _a=$.d;$.d={f:JC,r:WC,D:e2,C:t2,L:n2,m:a2,X:l2,S:r2,M:i2};function JC(){var t=_a.f(),n=No();return t||n}function WC(t){var n=Zr(t);n!==null&&n.tag===5&&n.type==="form"?Gg(n):_a.r(t)}var Tl=typeof document>"u"?null:document;function Ay(t,n,i){var o=Tl;if(o&&typeof n=="string"&&n){var p=Mn(n);p='link[rel="'+t+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),Ny.has(p)||(Ny.add(p),t={rel:t,crossOrigin:i,href:n},o.querySelector(p)===null&&(n=o.createElement("link"),Vt(n,"link",t),It(n),o.head.appendChild(n)))}}function e2(t){_a.D(t),Ay("dns-prefetch",t,null)}function t2(t,n){_a.C(t,n),Ay("preconnect",t,n)}function n2(t,n,i){_a.L(t,n,i);var o=Tl;if(o&&t&&n){var p='link[rel="preload"][as="'+Mn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+Mn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+Mn(i.imageSizes)+'"]')):p+='[href="'+Mn(t)+'"]';var x=p;switch(n){case"style":x=_l(t);break;case"script":x=Rl(t)}Bn.has(x)||(t=g({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:t,as:n},i),Bn.set(x,t),o.querySelector(p)!==null||n==="style"&&o.querySelector(Fi(x))||n==="script"&&o.querySelector(qi(x))||(n=o.createElement("link"),Vt(n,"link",t),It(n),o.head.appendChild(n)))}}function a2(t,n){_a.m(t,n);var i=Tl;if(i&&t){var o=n&&typeof n.as=="string"?n.as:"script",p='link[rel="modulepreload"][as="'+Mn(o)+'"][href="'+Mn(t)+'"]',x=p;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Rl(t)}if(!Bn.has(x)&&(t=g({rel:"modulepreload",href:t},n),Bn.set(x,t),i.querySelector(p)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qi(x)))return}o=i.createElement("link"),Vt(o,"link",t),It(o),i.head.appendChild(o)}}}function r2(t,n,i){_a.S(t,n,i);var o=Tl;if(o&&t){var p=Jr(o).hoistableStyles,x=_l(t);n=n||"default";var w=p.get(x);if(!w){var N={loading:0,preload:null};if(w=o.querySelector(Fi(x)))N.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},i),(i=Bn.get(x))&&vf(t,i);var I=w=o.createElement("link");It(I),Vt(I,"link",t),I._p=new Promise(function(K,te){I.onload=K,I.onerror=te}),I.addEventListener("load",function(){N.loading|=1}),I.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Po(w,n,o)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(x,w)}}}function l2(t,n){_a.X(t,n);var i=Tl;if(i&&t){var o=Jr(i).hoistableScripts,p=Rl(t),x=o.get(p);x||(x=i.querySelector(qi(p)),x||(t=g({src:t,async:!0},n),(n=Bn.get(p))&&bf(t,n),x=i.createElement("script"),It(x),Vt(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},o.set(p,x))}}function i2(t,n){_a.M(t,n);var i=Tl;if(i&&t){var o=Jr(i).hoistableScripts,p=Rl(t),x=o.get(p);x||(x=i.querySelector(qi(p)),x||(t=g({src:t,async:!0,type:"module"},n),(n=Bn.get(p))&&bf(t,n),x=i.createElement("script"),It(x),Vt(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},o.set(p,x))}}function Ty(t,n,i,o){var p=(p=ue.current)?Lo(p):null;if(!p)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=_l(i.href),i=Jr(p).hoistableStyles,o=i.get(n),o||(o={type:"style",instance:null,count:0,state:null},i.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=_l(i.href);var x=Jr(p).hoistableStyles,w=x.get(t);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,w),(x=p.querySelector(Fi(t)))&&!x._p&&(w.instance=x,w.state.loading=5),Bn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Bn.set(t,i),x||s2(p,t,i,w.state))),n&&o===null)throw Error(l(528,""));return w}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Rl(i),i=Jr(p).hoistableScripts,o=i.get(n),o||(o={type:"script",instance:null,count:0,state:null},i.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function _l(t){return'href="'+Mn(t)+'"'}function Fi(t){return'link[rel="stylesheet"]['+t+"]"}function _y(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function s2(t,n,i,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Vt(n,"link",i),It(n),t.head.appendChild(n))}function Rl(t){return'[src="'+Mn(t)+'"]'}function qi(t){return"script[async]"+t}function Ry(t,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Mn(i.href)+'"]');if(o)return n.instance=o,It(o),o;var p=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),It(o),Vt(o,"style",p),Po(o,i.precedence,t),n.instance=o;case"stylesheet":p=_l(i.href);var x=t.querySelector(Fi(p));if(x)return n.state.loading|=4,n.instance=x,It(x),x;o=_y(i),(p=Bn.get(p))&&vf(o,p),x=(t.ownerDocument||t).createElement("link"),It(x);var w=x;return w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),Vt(x,"link",o),n.state.loading|=4,Po(x,i.precedence,t),n.instance=x;case"script":return x=Rl(i.src),(p=t.querySelector(qi(x)))?(n.instance=p,It(p),p):(o=i,(p=Bn.get(x))&&(o=g({},i),bf(o,p)),t=t.ownerDocument||t,p=t.createElement("script"),It(p),Vt(p,"link",o),t.head.appendChild(p),n.instance=p);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Po(o,i.precedence,t));return n.instance}function Po(t,n,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=o.length?o[o.length-1]:null,x=p,w=0;w<o.length;w++){var N=o[w];if(N.dataset.precedence===n)x=N;else if(x!==p)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(t,n.firstChild))}function vf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function bf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Uo=null;function My(t,n,i){if(Uo===null){var o=new Map,p=Uo=new Map;p.set(i,o)}else p=Uo,o=p.get(i),o||(o=new Map,p.set(i,o));if(o.has(t))return o;for(o.set(t,null),i=i.getElementsByTagName(t),p=0;p<i.length;p++){var x=i[p];if(!(x[li]||x[qt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(n)||"";w=t+w;var N=o.get(w);N?N.push(x):o.set(w,[x])}}return o}function Oy(t,n,i){t=t.ownerDocument||t,t.head.insertBefore(i,n==="title"?t.querySelector("head > title"):null)}function o2(t,n,i){if(i===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Dy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function c2(t,n,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=_l(o.href),x=n.querySelector(Fi(p));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Io.bind(t),n.then(t,t)),i.state.loading|=4,i.instance=x,It(x);return}x=n.ownerDocument||n,o=_y(o),(p=Bn.get(p))&&vf(o,p),x=x.createElement("link"),It(x);var w=x;w._p=new Promise(function(N,I){w.onload=N,w.onerror=I}),Vt(x,"link",o),i.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Io.bind(t),n.addEventListener("load",i),n.addEventListener("error",i))}}var Sf=0;function u2(t,n){return t.stylesheets&&t.count===0&&Ho(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var o=setTimeout(function(){if(t.stylesheets&&Ho(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+n);0<t.imgBytes&&Sf===0&&(Sf=62500*GC());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ho(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>Sf?50:800)+n);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(p)}}:null}function Io(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ho(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bo=null;function Ho(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bo=new Map,n.forEach(d2,t),Bo=null,Io.call(t))}function d2(t,n){if(!(n.state.loading&4)){var i=Bo.get(t);if(i)var o=i.get(null);else{i=new Map,Bo.set(t,i);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var w=p[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),o=w)}o&&i.set(null,o)}p=n.instance,w=p.getAttribute("data-precedence"),x=i.get(w)||o,x===o&&i.set(null,p),i.set(w,p),this.count++,o=Io.bind(this),p.addEventListener("load",o),p.addEventListener("error",o),x?x.parentNode.insertBefore(p,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),n.state.loading|=4}}var Gi={$$typeof:O,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function f2(t,n,i,o,p,x,w,N,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.hiddenUpdates=pu(null),this.identifierPrefix=o,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function zy(t,n,i,o,p,x,w,N,I,K,te,le){return t=new f2(t,n,i,w,I,K,te,le,N),n=1,x===!0&&(n|=24),x=Sn(3,null,null,n),t.current=x,x.stateNode=t,n=Wu(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:o,isDehydrated:i,cache:n},ad(x),t}function Ly(t){return t?(t=ol,t):ol}function Py(t,n,i,o,p,x){p=Ly(p),o.context===null?o.context=p:o.pendingContext=p,o=Ga(n),o.payload={element:i},x=x===void 0?null:x,x!==null&&(o.callback=x),i=$a(t,o,n),i!==null&&(pn(i,t,n),wi(i,t,n))}function Uy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<n?i:n}}function wf(t,n){Uy(t,n),(t=t.alternate)&&Uy(t,n)}function Iy(t){if(t.tag===13||t.tag===31){var n=Er(t,67108864);n!==null&&pn(n,t,67108864),wf(t,67108864)}}function By(t){if(t.tag===13||t.tag===31){var n=En();n=gu(n);var i=Er(t,n);i!==null&&pn(i,t,n),wf(t,n)}}var Fo=!0;function h2(t,n,i,o){var p=z.T;z.T=null;var x=$.p;try{$.p=2,kf(t,n,i,o)}finally{$.p=x,z.T=p}}function m2(t,n,i,o){var p=z.T;z.T=null;var x=$.p;try{$.p=8,kf(t,n,i,o)}finally{$.p=x,z.T=p}}function kf(t,n,i,o){if(Fo){var p=jf(o);if(p===null)cf(t,n,o,qo,i),Fy(t,o);else if(g2(p,t,n,i,o))o.stopPropagation();else if(Fy(t,o),n&4&&-1<p2.indexOf(t)){for(;p!==null;){var x=Zr(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=Sr(x.pendingLanes);if(w!==0){var N=x;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var I=1<<31-ot(w);N.entanglements[1]|=I,w&=~I}na(x),(We&6)===0&&(Co=Qe()+500,Ui(0))}}break;case 31:case 13:N=Er(x,2),N!==null&&pn(N,x,2),No(),wf(x,2)}if(x=jf(o),x===null&&cf(t,n,o,qo,i),x===p)break;p=x}p!==null&&o.stopPropagation()}else cf(t,n,o,null,i)}}function jf(t){return t=Cu(t),Cf(t)}var qo=null;function Cf(t){if(qo=null,t=Qr(t),t!==null){var n=u(t);if(n===null)t=null;else{var i=n.tag;if(i===13){if(t=d(n),t!==null)return t;t=null}else if(i===31){if(t=f(n),t!==null)return t;t=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return qo=t,null}function Hy(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(sn()){case ae:return 2;case me:return 8;case Oe:case He:return 32;case et:return 268435456;default:return 32}default:return 32}}var Ef=!1,nr=null,ar=null,rr=null,$i=new Map,Yi=new Map,lr=[],p2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Fy(t,n){switch(t){case"focusin":case"focusout":nr=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":rr=null;break;case"pointerover":case"pointerout":$i.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yi.delete(n.pointerId)}}function Vi(t,n,i,o,p,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:i,eventSystemFlags:o,nativeEvent:x,targetContainers:[p]},n!==null&&(n=Zr(n),n!==null&&Iy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),t)}function g2(t,n,i,o,p){switch(n){case"focusin":return nr=Vi(nr,t,n,i,o,p),!0;case"dragenter":return ar=Vi(ar,t,n,i,o,p),!0;case"mouseover":return rr=Vi(rr,t,n,i,o,p),!0;case"pointerover":var x=p.pointerId;return $i.set(x,Vi($i.get(x)||null,t,n,i,o,p)),!0;case"gotpointercapture":return x=p.pointerId,Yi.set(x,Vi(Yi.get(x)||null,t,n,i,o,p)),!0}return!1}function qy(t){var n=Qr(t.target);if(n!==null){var i=u(n);if(i!==null){if(n=i.tag,n===13){if(n=d(i),n!==null){t.blockedOn=n,ap(t.priority,function(){By(i)});return}}else if(n===31){if(n=f(i),n!==null){t.blockedOn=n,ap(t.priority,function(){By(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Go(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var i=jf(t.nativeEvent);if(i===null){i=t.nativeEvent;var o=new i.constructor(i.type,i);ju=o,i.target.dispatchEvent(o),ju=null}else return n=Zr(i),n!==null&&Iy(n),t.blockedOn=i,!1;n.shift()}return!0}function Gy(t,n,i){Go(t)&&i.delete(n)}function x2(){Ef=!1,nr!==null&&Go(nr)&&(nr=null),ar!==null&&Go(ar)&&(ar=null),rr!==null&&Go(rr)&&(rr=null),$i.forEach(Gy),Yi.forEach(Gy)}function $o(t,n){t.blockedOn===n&&(t.blockedOn=null,Ef||(Ef=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,x2)))}var Yo=null;function $y(t){Yo!==t&&(Yo=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yo===t&&(Yo=null);for(var n=0;n<t.length;n+=3){var i=t[n],o=t[n+1],p=t[n+2];if(typeof o!="function"){if(Cf(o||i)===null)continue;break}var x=Zr(i);x!==null&&(t.splice(n,3),n-=3,kd(x,{pending:!0,data:p,method:i.method,action:o},o,p))}}))}function Ml(t){function n(I){return $o(I,t)}nr!==null&&$o(nr,t),ar!==null&&$o(ar,t),rr!==null&&$o(rr,t),$i.forEach(n),Yi.forEach(n);for(var i=0;i<lr.length;i++){var o=lr[i];o.blockedOn===t&&(o.blockedOn=null)}for(;0<lr.length&&(i=lr[0],i.blockedOn===null);)qy(i),i.blockedOn===null&&lr.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(o=0;o<i.length;o+=3){var p=i[o],x=i[o+1],w=p[cn]||null;if(typeof x=="function")w||$y(i);else if(w){var N=null;if(x&&x.hasAttribute("formAction")){if(p=x,w=x[cn]||null)N=w.formAction;else if(Cf(p)!==null)continue}else N=w.action;typeof N=="function"?i[o+1]=N:(i.splice(o,3),o-=3),$y(i)}}}function Yy(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function n(){p!==null&&(p(),p=null),o||setTimeout(i,20)}function i(){if(!o&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),p!==null&&(p(),p=null)}}}function Nf(t){this._internalRoot=t}Vo.prototype.render=Nf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,o=En();Py(i,o,t,n,null,null)},Vo.prototype.unmount=Nf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Py(t.current,2,null,t,null,null),No(),n[Xr]=null}};function Vo(t){this._internalRoot=t}Vo.prototype.unstable_scheduleHydration=function(t){if(t){var n=np();t={blockedOn:null,target:t,priority:n};for(var i=0;i<lr.length&&n!==0&&n<lr[i].priority;i++);lr.splice(i,0,t),i===0&&qy(t)}};var Vy=a.version;if(Vy!=="19.2.4")throw Error(l(527,Vy,"19.2.4"));$.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=m(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var y2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ko.isDisabled&&Ko.supportsFiber)try{tn=Ko.inject(y2),zt=Ko}catch{}}return Xi.createRoot=function(t,n){if(!s(t))throw Error(l(299));var i=!1,o="",p=ex,x=tx,w=nx;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(p=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=zy(t,1,!1,null,null,i,o,null,p,x,w,Yy),t[Xr]=n.current,of(t),new Nf(n)},Xi.hydrateRoot=function(t,n,i){if(!s(t))throw Error(l(299));var o=!1,p="",x=ex,w=tx,N=nx,I=null;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.formState!==void 0&&(I=i.formState)),n=zy(t,1,!0,n,i??null,o,p,I,x,w,N,Yy),n.context=Ly(null),i=n.current,o=En(),o=gu(o),p=Ga(o),p.callback=null,$a(i,p,o),i=o,n.current.lanes=i,ri(n,i),na(n),t[Xr]=n.current,of(t),new Vo(n)},Xi.version="19.2.4",Xi}var av;function A2(){if(av)return _f.exports;av=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),_f.exports=N2(),_f.exports}var T2=A2();function Kb(e){var a,r,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(a=0;a<s;a++)e[a]&&(r=Kb(e[a]))&&(l&&(l+=" "),l+=r)}else for(r in e)e[r]&&(l&&(l+=" "),l+=r);return l}function Xb(){for(var e,a,r=0,l="",s=arguments.length;r<s;r++)(e=arguments[r])&&(a=Kb(e))&&(l&&(l+=" "),l+=a);return l}const rv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lv=Xb,Dc=(e,a)=>r=>{var l;if(a?.variants==null)return lv(e,r?.class,r?.className);const{variants:s,defaultVariants:u}=a,d=Object.keys(s).map(m=>{const y=r?.[m],g=u?.[m];if(y===null)return null;const v=rv(y)||rv(g);return s[m][v]}),f=r&&Object.entries(r).reduce((m,y)=>{let[g,v]=y;return v===void 0||(m[g]=v),m},{}),h=a==null||(l=a.compoundVariants)===null||l===void 0?void 0:l.reduce((m,y)=>{let{class:g,className:v,...b}=y;return Object.entries(b).every(k=>{let[C,E]=k;return Array.isArray(E)?E.includes({...u,...f}[C]):{...u,...f}[C]===E})?[...m,g,v]:m},[]);return lv(e,d,h,r?.class,r?.className)};var Yh=Vb();const _2=Mc(Yh);function iv(e,a){if(typeof e=="function")return e(a);e!=null&&(e.current=a)}function zc(...e){return a=>{let r=!1;const l=e.map(s=>{const u=iv(s,a);return!r&&typeof u=="function"&&(r=!0),u});if(r)return()=>{for(let s=0;s<l.length;s++){const u=l[s];typeof u=="function"?u():iv(e[s],null)}}}}function yt(...e){return S.useCallback(zc(...e),e)}function ql(e){const a=R2(e),r=S.forwardRef((l,s)=>{const{children:u,...d}=l,f=S.Children.toArray(u),h=f.find(O2);if(h){const m=h.props.children,y=f.map(g=>g===h?S.Children.count(m)>1?S.Children.only(null):S.isValidElement(m)?m.props.children:null:g);return c.jsx(a,{...d,ref:s,children:S.isValidElement(m)?S.cloneElement(m,void 0,y):null})}return c.jsx(a,{...d,ref:s,children:u})});return r.displayName=`${e}.Slot`,r}var Lc=ql("Slot");function R2(e){const a=S.forwardRef((r,l)=>{const{children:s,...u}=r;if(S.isValidElement(s)){const d=z2(s),f=D2(u,s.props);return s.type!==S.Fragment&&(f.ref=l?zc(l,d):d),S.cloneElement(s,f)}return S.Children.count(s)>1?S.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}var Qb=Symbol("radix.slottable");function M2(e){const a=({children:r})=>c.jsx(c.Fragment,{children:r});return a.displayName=`${e}.Slottable`,a.__radixId=Qb,a}function O2(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qb}function D2(e,a){const r={...a};for(const l in a){const s=e[l],u=a[l];/^on[A-Z]/.test(l)?s&&u?r[l]=(...f)=>{const h=u(...f);return s(...f),h}:s&&(r[l]=s):l==="style"?r[l]={...s,...u}:l==="className"&&(r[l]=[s,u].filter(Boolean).join(" "))}return{...e,...r}}function z2(e){let a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var L2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=L2.reduce((e,a)=>{const r=ql(`Primitive.${a}`),l=S.forwardRef((s,u)=>{const{asChild:d,...f}=s,h=d?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(h,{...f,ref:u})});return l.displayName=`Primitive.${a}`,{...e,[a]:l}},{});function Zb(e,a){e&&Yh.flushSync(()=>e.dispatchEvent(a))}var P2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),U2="VisuallyHidden",Jb=S.forwardRef((e,a)=>c.jsx(Xe.span,{...e,ref:a,style:{...P2,...e.style}}));Jb.displayName=U2;var I2=Jb;function B2(e,a){const r=S.createContext(a),l=u=>{const{children:d,...f}=u,h=S.useMemo(()=>f,Object.values(f));return c.jsx(r.Provider,{value:h,children:d})};l.displayName=e+"Provider";function s(u){const d=S.useContext(r);if(d)return d;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[l,s]}function oa(e,a=[]){let r=[];function l(u,d){const f=S.createContext(d),h=r.length;r=[...r,d];const m=g=>{const{scope:v,children:b,...k}=g,C=v?.[e]?.[h]||f,E=S.useMemo(()=>k,Object.values(k));return c.jsx(C.Provider,{value:E,children:b})};m.displayName=u+"Provider";function y(g,v){const b=v?.[e]?.[h]||f,k=S.useContext(b);if(k)return k;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[m,y]}const s=()=>{const u=r.map(d=>S.createContext(d));return function(f){const h=f?.[e]||u;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return s.scopeName=e,[l,H2(s,...a)]}function H2(...e){const a=e[0];if(e.length===1)return a;const r=()=>{const l=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(u){const d=l.reduce((f,{useScope:h,scopeName:m})=>{const g=h(u)[`__scope${m}`];return{...f,...g}},{});return S.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])}};return r.scopeName=a.scopeName,r}function Wb(e){const a=e+"CollectionProvider",[r,l]=oa(a),[s,u]=r(a,{collectionRef:{current:null},itemMap:new Map}),d=C=>{const{scope:E,children:j}=C,R=ur.useRef(null),O=ur.useRef(new Map).current;return c.jsx(s,{scope:E,itemMap:O,collectionRef:R,children:j})};d.displayName=a;const f=e+"CollectionSlot",h=ql(f),m=ur.forwardRef((C,E)=>{const{scope:j,children:R}=C,O=u(f,j),_=yt(E,O.collectionRef);return c.jsx(h,{ref:_,children:R})});m.displayName=f;const y=e+"CollectionItemSlot",g="data-radix-collection-item",v=ql(y),b=ur.forwardRef((C,E)=>{const{scope:j,children:R,...O}=C,_=ur.useRef(null),U=yt(E,_),M=u(y,j);return ur.useEffect(()=>(M.itemMap.set(_,{ref:_,...O}),()=>{M.itemMap.delete(_)})),c.jsx(v,{[g]:"",ref:U,children:R})});b.displayName=y;function k(C){const E=u(e+"CollectionConsumer",C);return ur.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const O=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((M,L)=>O.indexOf(M.ref.current)-O.indexOf(L.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:d,Slot:m,ItemSlot:b},k,l]}function Ae(e,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}var qn=globalThis?.document?S.useLayoutEffect:()=>{},F2=Yb[" useInsertionEffect ".trim().toString()]||qn;function gs({prop:e,defaultProp:a,onChange:r=()=>{},caller:l}){const[s,u,d]=q2({defaultProp:a,onChange:r}),f=e!==void 0,h=f?e:s;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${l} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,l])}const m=S.useCallback(y=>{if(f){const g=G2(y)?y(e):y;g!==e&&d.current?.(g)}else u(y)},[f,e,u,d]);return[h,m]}function q2({defaultProp:e,onChange:a}){const[r,l]=S.useState(e),s=S.useRef(r),u=S.useRef(a);return F2(()=>{u.current=a},[a]),S.useEffect(()=>{s.current!==r&&(u.current?.(r),s.current=r)},[r,s]),[r,l,u]}function G2(e){return typeof e=="function"}function $2(e,a){return S.useReducer((r,l)=>a[r][l]??r,e)}var rn=e=>{const{present:a,children:r}=e,l=Y2(a),s=typeof r=="function"?r({present:l.isPresent}):S.Children.only(r),u=yt(l.ref,V2(s));return typeof r=="function"||l.isPresent?S.cloneElement(s,{ref:u}):null};rn.displayName="Presence";function Y2(e){const[a,r]=S.useState(),l=S.useRef(null),s=S.useRef(e),u=S.useRef("none"),d=e?"mounted":"unmounted",[f,h]=$2(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const m=Xo(l.current);u.current=f==="mounted"?m:"none"},[f]),qn(()=>{const m=l.current,y=s.current;if(y!==e){const v=u.current,b=Xo(m);e?h("MOUNT"):b==="none"||m?.display==="none"?h("UNMOUNT"):h(y&&v!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),qn(()=>{if(a){let m;const y=a.ownerDocument.defaultView??window,g=b=>{const C=Xo(l.current).includes(CSS.escape(b.animationName));if(b.target===a&&C&&(h("ANIMATION_END"),!s.current)){const E=a.style.animationFillMode;a.style.animationFillMode="forwards",m=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=E)})}},v=b=>{b.target===a&&(u.current=Xo(l.current))};return a.addEventListener("animationstart",v),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{y.clearTimeout(m),a.removeEventListener("animationstart",v),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[a,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(m=>{l.current=m?getComputedStyle(m):null,r(m)},[])}}function Xo(e){return e?.animationName||"none"}function V2(e){let a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var K2=Yb[" useId ".trim().toString()]||(()=>{}),X2=0;function hr(e){const[a,r]=S.useState(K2());return qn(()=>{r(l=>l??String(X2++))},[e]),e||(a?`radix-${a}`:"")}var Q2=S.createContext(void 0);function Pc(e){const a=S.useContext(Q2);return e||a||"ltr"}function Kt(e){const a=S.useRef(e);return S.useEffect(()=>{a.current=e}),S.useMemo(()=>(...r)=>a.current?.(...r),[])}function Z2(e,a=globalThis?.document){const r=Kt(e);S.useEffect(()=>{const l=s=>{s.key==="Escape"&&r(s)};return a.addEventListener("keydown",l,{capture:!0}),()=>a.removeEventListener("keydown",l,{capture:!0})},[r,a])}var J2="DismissableLayer",xh="dismissableLayer.update",W2="dismissableLayer.pointerDownOutside",eE="dismissableLayer.focusOutside",sv,e0=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uc=S.forwardRef((e,a)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...h}=e,m=S.useContext(e0),[y,g]=S.useState(null),v=y?.ownerDocument??globalThis?.document,[,b]=S.useState({}),k=yt(a,L=>g(L)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),j=C.indexOf(E),R=y?C.indexOf(y):-1,O=m.layersWithOutsidePointerEventsDisabled.size>0,_=R>=j,U=aE(L=>{const F=L.target,Y=[...m.branches].some(P=>P.contains(F));!_||Y||(s?.(L),d?.(L),L.defaultPrevented||f?.())},v),M=rE(L=>{const F=L.target;[...m.branches].some(P=>P.contains(F))||(u?.(L),d?.(L),L.defaultPrevented||f?.())},v);return Z2(L=>{R===m.layers.size-1&&(l?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},v),S.useEffect(()=>{if(y)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(sv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),ov(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=sv)}},[y,v,r,m]),S.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),ov())},[y,m]),S.useEffect(()=>{const L=()=>b({});return document.addEventListener(xh,L),()=>document.removeEventListener(xh,L)},[]),c.jsx(Xe.div,{...h,ref:k,style:{pointerEvents:O?_?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,U.onPointerDownCapture)})});Uc.displayName=J2;var tE="DismissableLayerBranch",nE=S.forwardRef((e,a)=>{const r=S.useContext(e0),l=S.useRef(null),s=yt(a,l);return S.useEffect(()=>{const u=l.current;if(u)return r.branches.add(u),()=>{r.branches.delete(u)}},[r.branches]),c.jsx(Xe.div,{...e,ref:s})});nE.displayName=tE;function aE(e,a=globalThis?.document){const r=Kt(e),l=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const u=f=>{if(f.target&&!l.current){let h=function(){t0(W2,r,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",s.current),s.current=h,a.addEventListener("click",s.current,{once:!0})):h()}else a.removeEventListener("click",s.current);l.current=!1},d=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),a.removeEventListener("pointerdown",u),a.removeEventListener("click",s.current)}},[a,r]),{onPointerDownCapture:()=>l.current=!0}}function rE(e,a=globalThis?.document){const r=Kt(e),l=S.useRef(!1);return S.useEffect(()=>{const s=u=>{u.target&&!l.current&&t0(eE,r,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",s),()=>a.removeEventListener("focusin",s)},[a,r]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function ov(){const e=new CustomEvent(xh);document.dispatchEvent(e)}function t0(e,a,r,{discrete:l}){const s=r.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});a&&s.addEventListener(e,a,{once:!0}),l?Zb(s,u):s.dispatchEvent(u)}var Df="focusScope.autoFocusOnMount",zf="focusScope.autoFocusOnUnmount",cv={bubbles:!1,cancelable:!0},lE="FocusScope",Vh=S.forwardRef((e,a)=>{const{loop:r=!1,trapped:l=!1,onMountAutoFocus:s,onUnmountAutoFocus:u,...d}=e,[f,h]=S.useState(null),m=Kt(s),y=Kt(u),g=S.useRef(null),v=yt(a,C=>h(C)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(l){let C=function(O){if(b.paused||!f)return;const _=O.target;f.contains(_)?g.current=_:dr(g.current,{select:!0})},E=function(O){if(b.paused||!f)return;const _=O.relatedTarget;_!==null&&(f.contains(_)||dr(g.current,{select:!0}))},j=function(O){if(document.activeElement===document.body)for(const U of O)U.removedNodes.length>0&&dr(f)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const R=new MutationObserver(j);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),R.disconnect()}}},[l,f,b.paused]),S.useEffect(()=>{if(f){dv.add(b);const C=document.activeElement;if(!f.contains(C)){const j=new CustomEvent(Df,cv);f.addEventListener(Df,m),f.dispatchEvent(j),j.defaultPrevented||(iE(dE(n0(f)),{select:!0}),document.activeElement===C&&dr(f))}return()=>{f.removeEventListener(Df,m),setTimeout(()=>{const j=new CustomEvent(zf,cv);f.addEventListener(zf,y),f.dispatchEvent(j),j.defaultPrevented||dr(C??document.body,{select:!0}),f.removeEventListener(zf,y),dv.remove(b)},0)}}},[f,m,y,b]);const k=S.useCallback(C=>{if(!r&&!l||b.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,j=document.activeElement;if(E&&j){const R=C.currentTarget,[O,_]=sE(R);O&&_?!C.shiftKey&&j===_?(C.preventDefault(),r&&dr(O,{select:!0})):C.shiftKey&&j===O&&(C.preventDefault(),r&&dr(_,{select:!0})):j===R&&C.preventDefault()}},[r,l,b.paused]);return c.jsx(Xe.div,{tabIndex:-1,...d,ref:v,onKeyDown:k})});Vh.displayName=lE;function iE(e,{select:a=!1}={}){const r=document.activeElement;for(const l of e)if(dr(l,{select:a}),document.activeElement!==r)return}function sE(e){const a=n0(e),r=uv(a,e),l=uv(a.reverse(),e);return[r,l]}function n0(e){const a=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const s=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||s?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)a.push(r.currentNode);return a}function uv(e,a){for(const r of e)if(!oE(r,{upTo:a}))return r}function oE(e,{upTo:a}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(a!==void 0&&e===a)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cE(e){return e instanceof HTMLInputElement&&"select"in e}function dr(e,{select:a=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cE(e)&&a&&e.select()}}var dv=uE();function uE(){let e=[];return{add(a){const r=e[0];a!==r&&r?.pause(),e=fv(e,a),e.unshift(a)},remove(a){e=fv(e,a),e[0]?.resume()}}}function fv(e,a){const r=[...e],l=r.indexOf(a);return l!==-1&&r.splice(l,1),r}function dE(e){return e.filter(a=>a.tagName!=="A")}var fE="Portal",Ic=S.forwardRef((e,a)=>{const{container:r,...l}=e,[s,u]=S.useState(!1);qn(()=>u(!0),[]);const d=r||s&&globalThis?.document?.body;return d?_2.createPortal(c.jsx(Xe.div,{...l,ref:a}),d):null});Ic.displayName=fE;var Lf=0;function a0(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hv()),document.body.insertAdjacentElement("beforeend",e[1]??hv()),Lf++,()=>{Lf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Lf--}},[])}function hv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ra=function(){return ra=Object.assign||function(a){for(var r,l=1,s=arguments.length;l<s;l++){r=arguments[l];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(a[u]=r[u])}return a},ra.apply(this,arguments)};function r0(e,a){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(e);s<l.length;s++)a.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(r[l[s]]=e[l[s]]);return r}function hE(e,a,r){if(r||arguments.length===2)for(var l=0,s=a.length,u;l<s;l++)(u||!(l in a))&&(u||(u=Array.prototype.slice.call(a,0,l)),u[l]=a[l]);return e.concat(u||Array.prototype.slice.call(a))}var cc="right-scroll-bar-position",uc="width-before-scroll-bar",mE="with-scroll-bars-hidden",pE="--removed-body-scroll-bar-size";function Pf(e,a){return typeof e=="function"?e(a):e&&(e.current=a),e}function gE(e,a){var r=S.useState(function(){return{value:e,callback:a,facade:{get current(){return r.value},set current(l){var s=r.value;s!==l&&(r.value=l,r.callback(l,s))}}}})[0];return r.callback=a,r.facade}var xE=typeof window<"u"?S.useLayoutEffect:S.useEffect,mv=new WeakMap;function yE(e,a){var r=gE(null,function(l){return e.forEach(function(s){return Pf(s,l)})});return xE(function(){var l=mv.get(r);if(l){var s=new Set(l),u=new Set(e),d=r.current;s.forEach(function(f){u.has(f)||Pf(f,null)}),u.forEach(function(f){s.has(f)||Pf(f,d)})}mv.set(r,e)},[e]),r}function vE(e){return e}function bE(e,a){a===void 0&&(a=vE);var r=[],l=!1,s={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(u){var d=a(u,l);return r.push(d),function(){r=r.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(l=!0;r.length;){var d=r;r=[],d.forEach(u)}r={push:function(f){return u(f)},filter:function(){return r}}},assignMedium:function(u){l=!0;var d=[];if(r.length){var f=r;r=[],f.forEach(u),d=r}var h=function(){var y=d;d=[],y.forEach(u)},m=function(){return Promise.resolve().then(h)};m(),r={push:function(y){d.push(y),m()},filter:function(y){return d=d.filter(y),r}}}};return s}function SE(e){e===void 0&&(e={});var a=bE(null);return a.options=ra({async:!0,ssr:!1},e),a}var l0=function(e){var a=e.sideCar,r=r0(e,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=a.read();if(!l)throw new Error("Sidecar medium not found");return S.createElement(l,ra({},r))};l0.isSideCarExport=!0;function wE(e,a){return e.useMedium(a),l0}var i0=SE(),Uf=function(){},Bc=S.forwardRef(function(e,a){var r=S.useRef(null),l=S.useState({onScrollCapture:Uf,onWheelCapture:Uf,onTouchMoveCapture:Uf}),s=l[0],u=l[1],d=e.forwardProps,f=e.children,h=e.className,m=e.removeScrollBar,y=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,k=e.noIsolation,C=e.inert,E=e.allowPinchZoom,j=e.as,R=j===void 0?"div":j,O=e.gapMode,_=r0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=v,M=yE([r,a]),L=ra(ra({},_),s);return S.createElement(S.Fragment,null,y&&S.createElement(U,{sideCar:i0,removeScrollBar:m,shards:g,noRelative:b,noIsolation:k,inert:C,setCallbacks:u,allowPinchZoom:!!E,lockRef:r,gapMode:O}),d?S.cloneElement(S.Children.only(f),ra(ra({},L),{ref:M})):S.createElement(R,ra({},L,{className:h,ref:M}),f))});Bc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bc.classNames={fullWidth:uc,zeroRight:cc};var kE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var a=kE();return a&&e.setAttribute("nonce",a),e}function CE(e,a){e.styleSheet?e.styleSheet.cssText=a:e.appendChild(document.createTextNode(a))}function EE(e){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(e)}var NE=function(){var e=0,a=null;return{add:function(r){e==0&&(a=jE())&&(CE(a,r),EE(a)),e++},remove:function(){e--,!e&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},AE=function(){var e=NE();return function(a,r){S.useEffect(function(){return e.add(a),function(){e.remove()}},[a&&r])}},s0=function(){var e=AE(),a=function(r){var l=r.styles,s=r.dynamic;return e(l,s),null};return a},TE={left:0,top:0,right:0,gap:0},If=function(e){return parseInt(e||"",10)||0},_E=function(e){var a=window.getComputedStyle(document.body),r=a[e==="padding"?"paddingLeft":"marginLeft"],l=a[e==="padding"?"paddingTop":"marginTop"],s=a[e==="padding"?"paddingRight":"marginRight"];return[If(r),If(l),If(s)]},RE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return TE;var a=_E(e),r=document.documentElement.clientWidth,l=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,l-r+a[2]-a[0])}},ME=s0(),Il="data-scroll-locked",OE=function(e,a,r,l){var s=e.left,u=e.top,d=e.right,f=e.gap;return r===void 0&&(r="margin"),`
10
+ .`.concat(mE,` {
11
+ overflow: hidden `).concat(l,`;
12
+ padding-right: `).concat(f,"px ").concat(l,`;
13
+ }
14
+ body[`).concat(Il,`] {
15
+ overflow: hidden `).concat(l,`;
16
+ overscroll-behavior: contain;
17
+ `).concat([a&&"position: relative ".concat(l,";"),r==="margin"&&`
18
+ padding-left: `.concat(s,`px;
19
+ padding-top: `).concat(u,`px;
20
+ padding-right: `).concat(d,`px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: `).concat(f,"px ").concat(l,`;
24
+ `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(l,";")].filter(Boolean).join(""),`
25
+ }
26
+
27
+ .`).concat(cc,` {
28
+ right: `).concat(f,"px ").concat(l,`;
29
+ }
30
+
31
+ .`).concat(uc,` {
32
+ margin-right: `).concat(f,"px ").concat(l,`;
33
+ }
34
+
35
+ .`).concat(cc," .").concat(cc,` {
36
+ right: 0 `).concat(l,`;
37
+ }
38
+
39
+ .`).concat(uc," .").concat(uc,` {
40
+ margin-right: 0 `).concat(l,`;
41
+ }
42
+
43
+ body[`).concat(Il,`] {
44
+ `).concat(pE,": ").concat(f,`px;
45
+ }
46
+ `)},pv=function(){var e=parseInt(document.body.getAttribute(Il)||"0",10);return isFinite(e)?e:0},DE=function(){S.useEffect(function(){return document.body.setAttribute(Il,(pv()+1).toString()),function(){var e=pv()-1;e<=0?document.body.removeAttribute(Il):document.body.setAttribute(Il,e.toString())}},[])},zE=function(e){var a=e.noRelative,r=e.noImportant,l=e.gapMode,s=l===void 0?"margin":l;DE();var u=S.useMemo(function(){return RE(s)},[s]);return S.createElement(ME,{styles:OE(u,!a,s,r?"":"!important")})},yh=!1;if(typeof window<"u")try{var Qo=Object.defineProperty({},"passive",{get:function(){return yh=!0,!0}});window.addEventListener("test",Qo,Qo),window.removeEventListener("test",Qo,Qo)}catch{yh=!1}var Ol=yh?{passive:!1}:!1,LE=function(e){return e.tagName==="TEXTAREA"},o0=function(e,a){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[a]!=="hidden"&&!(r.overflowY===r.overflowX&&!LE(e)&&r[a]==="visible")},PE=function(e){return o0(e,"overflowY")},UE=function(e){return o0(e,"overflowX")},gv=function(e,a){var r=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var s=c0(e,l);if(s){var u=u0(e,l),d=u[1],f=u[2];if(d>f)return!0}l=l.parentNode}while(l&&l!==r.body);return!1},IE=function(e){var a=e.scrollTop,r=e.scrollHeight,l=e.clientHeight;return[a,r,l]},BE=function(e){var a=e.scrollLeft,r=e.scrollWidth,l=e.clientWidth;return[a,r,l]},c0=function(e,a){return e==="v"?PE(a):UE(a)},u0=function(e,a){return e==="v"?IE(a):BE(a)},HE=function(e,a){return e==="h"&&a==="rtl"?-1:1},FE=function(e,a,r,l,s){var u=HE(e,window.getComputedStyle(a).direction),d=u*l,f=r.target,h=a.contains(f),m=!1,y=d>0,g=0,v=0;do{if(!f)break;var b=u0(e,f),k=b[0],C=b[1],E=b[2],j=C-E-u*k;(k||j)&&c0(e,f)&&(g+=j,v+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&f!==document.body||h&&(a.contains(f)||a===f));return(y&&Math.abs(g)<1||!y&&Math.abs(v)<1)&&(m=!0),m},Zo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xv=function(e){return[e.deltaX,e.deltaY]},yv=function(e){return e&&"current"in e?e.current:e},qE=function(e,a){return e[0]===a[0]&&e[1]===a[1]},GE=function(e){return`
47
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
48
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
+ `)},$E=0,Dl=[];function YE(e){var a=S.useRef([]),r=S.useRef([0,0]),l=S.useRef(),s=S.useState($E++)[0],u=S.useState(s0)[0],d=S.useRef(e);S.useEffect(function(){d.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=hE([e.lockRef.current],(e.shards||[]).map(yv),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!d.current.allowPinchZoom;var j=Zo(C),R=r.current,O="deltaX"in C?C.deltaX:R[0]-j[0],_="deltaY"in C?C.deltaY:R[1]-j[1],U,M=C.target,L=Math.abs(O)>Math.abs(_)?"h":"v";if("touches"in C&&L==="h"&&M.type==="range")return!1;var F=window.getSelection(),Y=F&&F.anchorNode,P=Y?Y===M||Y.contains(M):!1;if(P)return!1;var W=gv(L,M);if(!W)return!0;if(W?U=L:(U=L==="v"?"h":"v",W=gv(L,M)),!W)return!1;if(!l.current&&"changedTouches"in C&&(O||_)&&(l.current=U),!U)return!0;var ee=l.current||U;return FE(ee,E,C,ee==="h"?O:_)},[]),h=S.useCallback(function(C){var E=C;if(!(!Dl.length||Dl[Dl.length-1]!==u)){var j="deltaY"in E?xv(E):Zo(E),R=a.current.filter(function(U){return U.name===E.type&&(U.target===E.target||E.target===U.shadowParent)&&qE(U.delta,j)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var O=(d.current.shards||[]).map(yv).filter(Boolean).filter(function(U){return U.contains(E.target)}),_=O.length>0?f(E,O[0]):!d.current.noIsolation;_&&E.cancelable&&E.preventDefault()}}},[]),m=S.useCallback(function(C,E,j,R){var O={name:C,delta:E,target:j,should:R,shadowParent:VE(j)};a.current.push(O),setTimeout(function(){a.current=a.current.filter(function(_){return _!==O})},1)},[]),y=S.useCallback(function(C){r.current=Zo(C),l.current=void 0},[]),g=S.useCallback(function(C){m(C.type,xv(C),C.target,f(C,e.lockRef.current))},[]),v=S.useCallback(function(C){m(C.type,Zo(C),C.target,f(C,e.lockRef.current))},[]);S.useEffect(function(){return Dl.push(u),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Ol),document.addEventListener("touchmove",h,Ol),document.addEventListener("touchstart",y,Ol),function(){Dl=Dl.filter(function(C){return C!==u}),document.removeEventListener("wheel",h,Ol),document.removeEventListener("touchmove",h,Ol),document.removeEventListener("touchstart",y,Ol)}},[]);var b=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(u,{styles:GE(s)}):null,b?S.createElement(zE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function VE(e){for(var a=null;e!==null;)e instanceof ShadowRoot&&(a=e.host,e=e.host),e=e.parentNode;return a}const KE=wE(i0,YE);var Kh=S.forwardRef(function(e,a){return S.createElement(Bc,ra({},e,{ref:a,sideCar:KE}))});Kh.classNames=Bc.classNames;var XE=function(e){if(typeof document>"u")return null;var a=Array.isArray(e)?e[0]:e;return a.ownerDocument.body},zl=new WeakMap,Jo=new WeakMap,Wo={},Bf=0,d0=function(e){return e&&(e.host||d0(e.parentNode))},QE=function(e,a){return a.map(function(r){if(e.contains(r))return r;var l=d0(r);return l&&e.contains(l)?l:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},ZE=function(e,a,r,l){var s=QE(a,Array.isArray(e)?e:[e]);Wo[r]||(Wo[r]=new WeakMap);var u=Wo[r],d=[],f=new Set,h=new Set(s),m=function(g){!g||f.has(g)||(f.add(g),m(g.parentNode))};s.forEach(m);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(v){if(f.has(v))y(v);else try{var b=v.getAttribute(l),k=b!==null&&b!=="false",C=(zl.get(v)||0)+1,E=(u.get(v)||0)+1;zl.set(v,C),u.set(v,E),d.push(v),C===1&&k&&Jo.set(v,!0),E===1&&v.setAttribute(r,"true"),k||v.setAttribute(l,"true")}catch(j){console.error("aria-hidden: cannot operate on ",v,j)}})};return y(a),f.clear(),Bf++,function(){d.forEach(function(g){var v=zl.get(g)-1,b=u.get(g)-1;zl.set(g,v),u.set(g,b),v||(Jo.has(g)||g.removeAttribute(l),Jo.delete(g)),b||g.removeAttribute(r)}),Bf--,Bf||(zl=new WeakMap,zl=new WeakMap,Jo=new WeakMap,Wo={})}},f0=function(e,a,r){r===void 0&&(r="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),s=XE(e);return s?(l.push.apply(l,Array.from(s.querySelectorAll("[aria-live], script"))),ZE(l,s,r,"aria-hidden")):function(){return null}},Hc="Dialog",[h0]=oa(Hc),[JE,Jn]=h0(Hc),m0=e=>{const{__scopeDialog:a,children:r,open:l,defaultOpen:s,onOpenChange:u,modal:d=!0}=e,f=S.useRef(null),h=S.useRef(null),[m,y]=gs({prop:l,defaultProp:s??!1,onChange:u,caller:Hc});return c.jsx(JE,{scope:a,triggerRef:f,contentRef:h,contentId:hr(),titleId:hr(),descriptionId:hr(),open:m,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(g=>!g),[y]),modal:d,children:r})};m0.displayName=Hc;var p0="DialogTrigger",WE=S.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,s=Jn(p0,r),u=yt(a,s.triggerRef);return c.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Zh(s.open),...l,ref:u,onClick:Ae(e.onClick,s.onOpenToggle)})});WE.displayName=p0;var Xh="DialogPortal",[eN,g0]=h0(Xh,{forceMount:void 0}),x0=e=>{const{__scopeDialog:a,forceMount:r,children:l,container:s}=e,u=Jn(Xh,a);return c.jsx(eN,{scope:a,forceMount:r,children:S.Children.map(l,d=>c.jsx(rn,{present:r||u.open,children:c.jsx(Ic,{asChild:!0,container:s,children:d})}))})};x0.displayName=Xh;var mc="DialogOverlay",y0=S.forwardRef((e,a)=>{const r=g0(mc,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,u=Jn(mc,e.__scopeDialog);return u.modal?c.jsx(rn,{present:l||u.open,children:c.jsx(nN,{...s,ref:a})}):null});y0.displayName=mc;var tN=ql("DialogOverlay.RemoveScroll"),nN=S.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,s=Jn(mc,r);return c.jsx(Kh,{as:tN,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(Xe.div,{"data-state":Zh(s.open),...l,ref:a,style:{pointerEvents:"auto",...l.style}})})}),Fr="DialogContent",v0=S.forwardRef((e,a)=>{const r=g0(Fr,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,u=Jn(Fr,e.__scopeDialog);return c.jsx(rn,{present:l||u.open,children:u.modal?c.jsx(aN,{...s,ref:a}):c.jsx(rN,{...s,ref:a})})});v0.displayName=Fr;var aN=S.forwardRef((e,a)=>{const r=Jn(Fr,e.__scopeDialog),l=S.useRef(null),s=yt(a,r.contentRef,l);return S.useEffect(()=>{const u=l.current;if(u)return f0(u)},[]),c.jsx(b0,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,u=>u.preventDefault())})}),rN=S.forwardRef((e,a)=>{const r=Jn(Fr,e.__scopeDialog),l=S.useRef(!1),s=S.useRef(!1);return c.jsx(b0,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(l.current||r.triggerRef.current?.focus(),u.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(l.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})}),b0=S.forwardRef((e,a)=>{const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:u,...d}=e,f=Jn(Fr,r),h=S.useRef(null),m=yt(a,h);return a0(),c.jsxs(c.Fragment,{children:[c.jsx(Vh,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:u,children:c.jsx(Uc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Zh(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(lN,{titleId:f.titleId}),c.jsx(sN,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Qh="DialogTitle",S0=S.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,s=Jn(Qh,r);return c.jsx(Xe.h2,{id:s.titleId,...l,ref:a})});S0.displayName=Qh;var w0="DialogDescription",k0=S.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,s=Jn(w0,r);return c.jsx(Xe.p,{id:s.descriptionId,...l,ref:a})});k0.displayName=w0;var j0="DialogClose",C0=S.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,s=Jn(j0,r);return c.jsx(Xe.button,{type:"button",...l,ref:a,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});C0.displayName=j0;function Zh(e){return e?"open":"closed"}var E0="DialogTitleWarning",[gU,N0]=B2(E0,{contentName:Fr,titleName:Qh,docsSlug:"dialog"}),lN=({titleId:e})=>{const a=N0(E0),r=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
50
+
51
+ If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
52
+
53
+ For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},iN="DialogDescriptionWarning",sN=({contentRef:e,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${N0(iN).contentName}}.`;return S.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");a&&s&&(document.getElementById(a)||console.warn(l))},[l,e,a]),null},A0=m0,T0=x0,_0=y0,R0=v0,M0=S0,O0=k0,D0=C0,Hf={exports:{}},Ff={};var vv;function oN(){if(vv)return Ff;vv=1;var e=Oc();function a(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:a,l=e.useState,s=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(g,v){var b=v(),k=l({inst:{value:b,getSnapshot:v}}),C=k[0].inst,E=k[1];return u(function(){C.value=b,C.getSnapshot=v,h(C)&&E({inst:C})},[g,b,v]),s(function(){return h(C)&&E({inst:C}),g(function(){h(C)&&E({inst:C})})},[g]),d(b),b}function h(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!r(g,b)}catch{return!0}}function m(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Ff.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Ff}var bv;function cN(){return bv||(bv=1,Hf.exports=oN()),Hf.exports}var uN=cN();function dN(){return uN.useSyncExternalStore(fN,()=>!0,()=>!1)}function fN(){return()=>{}}var Jh="Avatar",[hN]=oa(Jh),[mN,z0]=hN(Jh),L0=S.forwardRef((e,a)=>{const{__scopeAvatar:r,...l}=e,[s,u]=S.useState("idle");return c.jsx(mN,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:u,children:c.jsx(Xe.span,{...l,ref:a})})});L0.displayName=Jh;var P0="AvatarImage",pN=S.forwardRef((e,a)=>{const{__scopeAvatar:r,src:l,onLoadingStatusChange:s=()=>{},...u}=e,d=z0(P0,r),f=gN(l,u),h=Kt(m=>{s(m),d.onImageLoadingStatusChange(m)});return qn(()=>{f!=="idle"&&h(f)},[f,h]),f==="loaded"?c.jsx(Xe.img,{...u,ref:a,src:l}):null});pN.displayName=P0;var U0="AvatarFallback",I0=S.forwardRef((e,a)=>{const{__scopeAvatar:r,delayMs:l,...s}=e,u=z0(U0,r),[d,f]=S.useState(l===void 0);return S.useEffect(()=>{if(l!==void 0){const h=window.setTimeout(()=>f(!0),l);return()=>window.clearTimeout(h)}},[l]),d&&u.imageLoadingStatus!=="loaded"?c.jsx(Xe.span,{...s,ref:a}):null});I0.displayName=U0;function Sv(e,a){return e?a?(e.src!==a&&(e.src=a),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function gN(e,{referrerPolicy:a,crossOrigin:r}){const l=dN(),s=S.useRef(null),u=l?(s.current||(s.current=new window.Image),s.current):null,[d,f]=S.useState(()=>Sv(u,e));return qn(()=>{f(Sv(u,e))},[u,e]),qn(()=>{const h=g=>()=>{f(g)};if(!u)return;const m=h("loaded"),y=h("error");return u.addEventListener("load",m),u.addEventListener("error",y),a&&(u.referrerPolicy=a),typeof r=="string"&&(u.crossOrigin=r),()=>{u.removeEventListener("load",m),u.removeEventListener("error",y)}},[u,r,a]),d}var xN=L0,yN=I0;function vN(e){const[a,r]=S.useState(void 0);return qn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const l=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const u=s[0];let d,f;if("borderBoxSize"in u){const h=u.borderBoxSize,m=Array.isArray(h)?h[0]:h;d=m.inlineSize,f=m.blockSize}else d=e.offsetWidth,f=e.offsetHeight;r({width:d,height:f})});return l.observe(e,{box:"border-box"}),()=>l.unobserve(e)}else r(void 0)},[e]),a}const bN=["top","right","bottom","left"],pr=Math.min,An=Math.max,pc=Math.round,ec=Math.floor,ia=e=>({x:e,y:e}),SN={left:"right",right:"left",bottom:"top",top:"bottom"},wN={start:"end",end:"start"};function vh(e,a,r){return An(e,pr(a,r))}function Ma(e,a){return typeof e=="function"?e(a):e}function Oa(e){return e.split("-")[0]}function Ql(e){return e.split("-")[1]}function Wh(e){return e==="x"?"y":"x"}function em(e){return e==="y"?"height":"width"}const kN=new Set(["top","bottom"]);function la(e){return kN.has(Oa(e))?"y":"x"}function tm(e){return Wh(la(e))}function jN(e,a,r){r===void 0&&(r=!1);const l=Ql(e),s=tm(e),u=em(s);let d=s==="x"?l===(r?"end":"start")?"right":"left":l==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(d=gc(d)),[d,gc(d)]}function CN(e){const a=gc(e);return[bh(e),a,bh(a)]}function bh(e){return e.replace(/start|end/g,a=>wN[a])}const wv=["left","right"],kv=["right","left"],EN=["top","bottom"],NN=["bottom","top"];function AN(e,a,r){switch(e){case"top":case"bottom":return r?a?kv:wv:a?wv:kv;case"left":case"right":return a?EN:NN;default:return[]}}function TN(e,a,r,l){const s=Ql(e);let u=AN(Oa(e),r==="start",l);return s&&(u=u.map(d=>d+"-"+s),a&&(u=u.concat(u.map(bh)))),u}function gc(e){return e.replace(/left|right|bottom|top/g,a=>SN[a])}function _N(e){return{top:0,right:0,bottom:0,left:0,...e}}function B0(e){return typeof e!="number"?_N(e):{top:e,right:e,bottom:e,left:e}}function xc(e){const{x:a,y:r,width:l,height:s}=e;return{width:l,height:s,top:r,left:a,right:a+l,bottom:r+s,x:a,y:r}}function jv(e,a,r){let{reference:l,floating:s}=e;const u=la(a),d=tm(a),f=em(d),h=Oa(a),m=u==="y",y=l.x+l.width/2-s.width/2,g=l.y+l.height/2-s.height/2,v=l[f]/2-s[f]/2;let b;switch(h){case"top":b={x:y,y:l.y-s.height};break;case"bottom":b={x:y,y:l.y+l.height};break;case"right":b={x:l.x+l.width,y:g};break;case"left":b={x:l.x-s.width,y:g};break;default:b={x:l.x,y:l.y}}switch(Ql(a)){case"start":b[d]-=v*(r&&m?-1:1);break;case"end":b[d]+=v*(r&&m?-1:1);break}return b}async function RN(e,a){var r;a===void 0&&(a={});const{x:l,y:s,platform:u,rects:d,elements:f,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Ma(a,e),k=B0(b),E=f[v?g==="floating"?"reference":"floating":g],j=xc(await u.getClippingRect({element:(r=await(u.isElement==null?void 0:u.isElement(E)))==null||r?E:E.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:m,rootBoundary:y,strategy:h})),R=g==="floating"?{x:l,y:s,width:d.floating.width,height:d.floating.height}:d.reference,O=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),_=await(u.isElement==null?void 0:u.isElement(O))?await(u.getScale==null?void 0:u.getScale(O))||{x:1,y:1}:{x:1,y:1},U=xc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:R,offsetParent:O,strategy:h}):R);return{top:(j.top-U.top+k.top)/_.y,bottom:(U.bottom-j.bottom+k.bottom)/_.y,left:(j.left-U.left+k.left)/_.x,right:(U.right-j.right+k.right)/_.x}}const MN=async(e,a,r)=>{const{placement:l="bottom",strategy:s="absolute",middleware:u=[],platform:d}=r,f=u.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(a));let m=await d.getElementRects({reference:e,floating:a,strategy:s}),{x:y,y:g}=jv(m,l,h),v=l,b={},k=0;for(let E=0;E<f.length;E++){var C;const{name:j,fn:R}=f[E],{x:O,y:_,data:U,reset:M}=await R({x:y,y:g,initialPlacement:l,placement:v,strategy:s,middlewareData:b,rects:m,platform:{...d,detectOverflow:(C=d.detectOverflow)!=null?C:RN},elements:{reference:e,floating:a}});y=O??y,g=_??g,b={...b,[j]:{...b[j],...U}},M&&k<=50&&(k++,typeof M=="object"&&(M.placement&&(v=M.placement),M.rects&&(m=M.rects===!0?await d.getElementRects({reference:e,floating:a,strategy:s}):M.rects),{x:y,y:g}=jv(m,v,h)),E=-1)}return{x:y,y:g,placement:v,strategy:s,middlewareData:b}},ON=e=>({name:"arrow",options:e,async fn(a){const{x:r,y:l,placement:s,rects:u,platform:d,elements:f,middlewareData:h}=a,{element:m,padding:y=0}=Ma(e,a)||{};if(m==null)return{};const g=B0(y),v={x:r,y:l},b=tm(s),k=em(b),C=await d.getDimensions(m),E=b==="y",j=E?"top":"left",R=E?"bottom":"right",O=E?"clientHeight":"clientWidth",_=u.reference[k]+u.reference[b]-v[b]-u.floating[k],U=v[b]-u.reference[b],M=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m));let L=M?M[O]:0;(!L||!await(d.isElement==null?void 0:d.isElement(M)))&&(L=f.floating[O]||u.floating[k]);const F=_/2-U/2,Y=L/2-C[k]/2-1,P=pr(g[j],Y),W=pr(g[R],Y),ee=P,fe=L-C[k]-W,ne=L/2-C[k]/2+F,H=vh(ee,ne,fe),z=!h.arrow&&Ql(s)!=null&&ne!==H&&u.reference[k]/2-(ne<ee?P:W)-C[k]/2<0,$=z?ne<ee?ne-ee:ne-fe:0;return{[b]:v[b]+$,data:{[b]:H,centerOffset:ne-H-$,...z&&{alignmentOffset:$}},reset:z}}}),DN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(a){var r,l;const{placement:s,middlewareData:u,rects:d,initialPlacement:f,platform:h,elements:m}=a,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:C=!0,...E}=Ma(e,a);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const j=Oa(s),R=la(f),O=Oa(f)===f,_=await(h.isRTL==null?void 0:h.isRTL(m.floating)),U=v||(O||!C?[gc(f)]:CN(f)),M=k!=="none";!v&&M&&U.push(...TN(f,C,k,_));const L=[f,...U],F=await h.detectOverflow(a,E),Y=[];let P=((l=u.flip)==null?void 0:l.overflows)||[];if(y&&Y.push(F[j]),g){const ne=jN(s,d,_);Y.push(F[ne[0]],F[ne[1]])}if(P=[...P,{placement:s,overflows:Y}],!Y.every(ne=>ne<=0)){var W,ee;const ne=(((W=u.flip)==null?void 0:W.index)||0)+1,H=L[ne];if(H&&(!(g==="alignment"?R!==la(H):!1)||P.every(X=>la(X.placement)===R?X.overflows[0]>0:!0)))return{data:{index:ne,overflows:P},reset:{placement:H}};let z=(ee=P.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:ee.placement;if(!z)switch(b){case"bestFit":{var fe;const $=(fe=P.filter(X=>{if(M){const G=la(X.placement);return G===R||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:fe[0];$&&(z=$);break}case"initialPlacement":z=f;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function Cv(e,a){return{top:e.top-a.height,right:e.right-a.width,bottom:e.bottom-a.height,left:e.left-a.width}}function Ev(e){return bN.some(a=>e[a]>=0)}const zN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(a){const{rects:r,platform:l}=a,{strategy:s="referenceHidden",...u}=Ma(e,a);switch(s){case"referenceHidden":{const d=await l.detectOverflow(a,{...u,elementContext:"reference"}),f=Cv(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Ev(f)}}}case"escaped":{const d=await l.detectOverflow(a,{...u,altBoundary:!0}),f=Cv(d,r.floating);return{data:{escapedOffsets:f,escaped:Ev(f)}}}default:return{}}}}},H0=new Set(["left","top"]);async function LN(e,a){const{placement:r,platform:l,elements:s}=e,u=await(l.isRTL==null?void 0:l.isRTL(s.floating)),d=Oa(r),f=Ql(r),h=la(r)==="y",m=H0.has(d)?-1:1,y=u&&h?-1:1,g=Ma(a,e);let{mainAxis:v,crossAxis:b,alignmentAxis:k}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof k=="number"&&(b=f==="end"?k*-1:k),h?{x:b*y,y:v*m}:{x:v*m,y:b*y}}const PN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(a){var r,l;const{x:s,y:u,placement:d,middlewareData:f}=a,h=await LN(a,e);return d===((r=f.offset)==null?void 0:r.placement)&&(l=f.arrow)!=null&&l.alignmentOffset?{}:{x:s+h.x,y:u+h.y,data:{...h,placement:d}}}}},UN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(a){const{x:r,y:l,placement:s,platform:u}=a,{mainAxis:d=!0,crossAxis:f=!1,limiter:h={fn:j=>{let{x:R,y:O}=j;return{x:R,y:O}}},...m}=Ma(e,a),y={x:r,y:l},g=await u.detectOverflow(a,m),v=la(Oa(s)),b=Wh(v);let k=y[b],C=y[v];if(d){const j=b==="y"?"top":"left",R=b==="y"?"bottom":"right",O=k+g[j],_=k-g[R];k=vh(O,k,_)}if(f){const j=v==="y"?"top":"left",R=v==="y"?"bottom":"right",O=C+g[j],_=C-g[R];C=vh(O,C,_)}const E=h.fn({...a,[b]:k,[v]:C});return{...E,data:{x:E.x-r,y:E.y-l,enabled:{[b]:d,[v]:f}}}}}},IN=function(e){return e===void 0&&(e={}),{options:e,fn(a){const{x:r,y:l,placement:s,rects:u,middlewareData:d}=a,{offset:f=0,mainAxis:h=!0,crossAxis:m=!0}=Ma(e,a),y={x:r,y:l},g=la(s),v=Wh(g);let b=y[v],k=y[g];const C=Ma(f,a),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const O=v==="y"?"height":"width",_=u.reference[v]-u.floating[O]+E.mainAxis,U=u.reference[v]+u.reference[O]-E.mainAxis;b<_?b=_:b>U&&(b=U)}if(m){var j,R;const O=v==="y"?"width":"height",_=H0.has(Oa(s)),U=u.reference[g]-u.floating[O]+(_&&((j=d.offset)==null?void 0:j[g])||0)+(_?0:E.crossAxis),M=u.reference[g]+u.reference[O]+(_?0:((R=d.offset)==null?void 0:R[g])||0)-(_?E.crossAxis:0);k<U?k=U:k>M&&(k=M)}return{[v]:b,[g]:k}}}},BN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(a){var r,l;const{placement:s,rects:u,platform:d,elements:f}=a,{apply:h=()=>{},...m}=Ma(e,a),y=await d.detectOverflow(a,m),g=Oa(s),v=Ql(s),b=la(s)==="y",{width:k,height:C}=u.floating;let E,j;g==="top"||g==="bottom"?(E=g,j=v===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(j=g,E=v==="end"?"top":"bottom");const R=C-y.top-y.bottom,O=k-y.left-y.right,_=pr(C-y[E],R),U=pr(k-y[j],O),M=!a.middlewareData.shift;let L=_,F=U;if((r=a.middlewareData.shift)!=null&&r.enabled.x&&(F=O),(l=a.middlewareData.shift)!=null&&l.enabled.y&&(L=R),M&&!v){const P=An(y.left,0),W=An(y.right,0),ee=An(y.top,0),fe=An(y.bottom,0);b?F=k-2*(P!==0||W!==0?P+W:An(y.left,y.right)):L=C-2*(ee!==0||fe!==0?ee+fe:An(y.top,y.bottom))}await h({...a,availableWidth:F,availableHeight:L});const Y=await d.getDimensions(f.floating);return k!==Y.width||C!==Y.height?{reset:{rects:!0}}:{}}}};function Fc(){return typeof window<"u"}function Zl(e){return F0(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var a;return(e==null||(a=e.ownerDocument)==null?void 0:a.defaultView)||window}function ca(e){var a;return(a=(F0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:a.documentElement}function F0(e){return Fc()?e instanceof Node||e instanceof Tn(e).Node:!1}function Qn(e){return Fc()?e instanceof Element||e instanceof Tn(e).Element:!1}function sa(e){return Fc()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function Nv(e){return!Fc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}const HN=new Set(["inline","contents"]);function xs(e){const{overflow:a,overflowX:r,overflowY:l,display:s}=Zn(e);return/auto|scroll|overlay|hidden|clip/.test(a+l+r)&&!HN.has(s)}const FN=new Set(["table","td","th"]);function qN(e){return FN.has(Zl(e))}const GN=[":popover-open",":modal"];function qc(e){return GN.some(a=>{try{return e.matches(a)}catch{return!1}})}const $N=["transform","translate","scale","rotate","perspective"],YN=["transform","translate","scale","rotate","perspective","filter"],VN=["paint","layout","strict","content"];function nm(e){const a=am(),r=Qn(e)?Zn(e):e;return $N.some(l=>r[l]?r[l]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!a&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!a&&(r.filter?r.filter!=="none":!1)||YN.some(l=>(r.willChange||"").includes(l))||VN.some(l=>(r.contain||"").includes(l))}function KN(e){let a=gr(e);for(;sa(a)&&!Gl(a);){if(nm(a))return a;if(qc(a))return null;a=gr(a)}return null}function am(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const XN=new Set(["html","body","#document"]);function Gl(e){return XN.has(Zl(e))}function Zn(e){return Tn(e).getComputedStyle(e)}function Gc(e){return Qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gr(e){if(Zl(e)==="html")return e;const a=e.assignedSlot||e.parentNode||Nv(e)&&e.host||ca(e);return Nv(a)?a.host:a}function q0(e){const a=gr(e);return Gl(a)?e.ownerDocument?e.ownerDocument.body:e.body:sa(a)&&xs(a)?a:q0(a)}function cs(e,a,r){var l;a===void 0&&(a=[]),r===void 0&&(r=!0);const s=q0(e),u=s===((l=e.ownerDocument)==null?void 0:l.body),d=Tn(s);if(u){const f=Sh(d);return a.concat(d,d.visualViewport||[],xs(s)?s:[],f&&r?cs(f):[])}return a.concat(s,cs(s,[],r))}function Sh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function G0(e){const a=Zn(e);let r=parseFloat(a.width)||0,l=parseFloat(a.height)||0;const s=sa(e),u=s?e.offsetWidth:r,d=s?e.offsetHeight:l,f=pc(r)!==u||pc(l)!==d;return f&&(r=u,l=d),{width:r,height:l,$:f}}function rm(e){return Qn(e)?e:e.contextElement}function Bl(e){const a=rm(e);if(!sa(a))return ia(1);const r=a.getBoundingClientRect(),{width:l,height:s,$:u}=G0(a);let d=(u?pc(r.width):r.width)/l,f=(u?pc(r.height):r.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const QN=ia(0);function $0(e){const a=Tn(e);return!am()||!a.visualViewport?QN:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function ZN(e,a,r){return a===void 0&&(a=!1),!r||a&&r!==Tn(e)?!1:a}function qr(e,a,r,l){a===void 0&&(a=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),u=rm(e);let d=ia(1);a&&(l?Qn(l)&&(d=Bl(l)):d=Bl(e));const f=ZN(u,r,l)?$0(u):ia(0);let h=(s.left+f.x)/d.x,m=(s.top+f.y)/d.y,y=s.width/d.x,g=s.height/d.y;if(u){const v=Tn(u),b=l&&Qn(l)?Tn(l):l;let k=v,C=Sh(k);for(;C&&l&&b!==k;){const E=Bl(C),j=C.getBoundingClientRect(),R=Zn(C),O=j.left+(C.clientLeft+parseFloat(R.paddingLeft))*E.x,_=j.top+(C.clientTop+parseFloat(R.paddingTop))*E.y;h*=E.x,m*=E.y,y*=E.x,g*=E.y,h+=O,m+=_,k=Tn(C),C=Sh(k)}}return xc({width:y,height:g,x:h,y:m})}function $c(e,a){const r=Gc(e).scrollLeft;return a?a.left+r:qr(ca(e)).left+r}function Y0(e,a){const r=e.getBoundingClientRect(),l=r.left+a.scrollLeft-$c(e,r),s=r.top+a.scrollTop;return{x:l,y:s}}function JN(e){let{elements:a,rect:r,offsetParent:l,strategy:s}=e;const u=s==="fixed",d=ca(l),f=a?qc(a.floating):!1;if(l===d||f&&u)return r;let h={scrollLeft:0,scrollTop:0},m=ia(1);const y=ia(0),g=sa(l);if((g||!g&&!u)&&((Zl(l)!=="body"||xs(d))&&(h=Gc(l)),sa(l))){const b=qr(l);m=Bl(l),y.x=b.x+l.clientLeft,y.y=b.y+l.clientTop}const v=d&&!g&&!u?Y0(d,h):ia(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-h.scrollLeft*m.x+y.x+v.x,y:r.y*m.y-h.scrollTop*m.y+y.y+v.y}}function WN(e){return Array.from(e.getClientRects())}function eA(e){const a=ca(e),r=Gc(e),l=e.ownerDocument.body,s=An(a.scrollWidth,a.clientWidth,l.scrollWidth,l.clientWidth),u=An(a.scrollHeight,a.clientHeight,l.scrollHeight,l.clientHeight);let d=-r.scrollLeft+$c(e);const f=-r.scrollTop;return Zn(l).direction==="rtl"&&(d+=An(a.clientWidth,l.clientWidth)-s),{width:s,height:u,x:d,y:f}}const Av=25;function tA(e,a){const r=Tn(e),l=ca(e),s=r.visualViewport;let u=l.clientWidth,d=l.clientHeight,f=0,h=0;if(s){u=s.width,d=s.height;const y=am();(!y||y&&a==="fixed")&&(f=s.offsetLeft,h=s.offsetTop)}const m=$c(l);if(m<=0){const y=l.ownerDocument,g=y.body,v=getComputedStyle(g),b=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(l.clientWidth-g.clientWidth-b);k<=Av&&(u-=k)}else m<=Av&&(u+=m);return{width:u,height:d,x:f,y:h}}const nA=new Set(["absolute","fixed"]);function aA(e,a){const r=qr(e,!0,a==="fixed"),l=r.top+e.clientTop,s=r.left+e.clientLeft,u=sa(e)?Bl(e):ia(1),d=e.clientWidth*u.x,f=e.clientHeight*u.y,h=s*u.x,m=l*u.y;return{width:d,height:f,x:h,y:m}}function Tv(e,a,r){let l;if(a==="viewport")l=tA(e,r);else if(a==="document")l=eA(ca(e));else if(Qn(a))l=aA(a,r);else{const s=$0(e);l={x:a.x-s.x,y:a.y-s.y,width:a.width,height:a.height}}return xc(l)}function V0(e,a){const r=gr(e);return r===a||!Qn(r)||Gl(r)?!1:Zn(r).position==="fixed"||V0(r,a)}function rA(e,a){const r=a.get(e);if(r)return r;let l=cs(e,[],!1).filter(f=>Qn(f)&&Zl(f)!=="body"),s=null;const u=Zn(e).position==="fixed";let d=u?gr(e):e;for(;Qn(d)&&!Gl(d);){const f=Zn(d),h=nm(d);!h&&f.position==="fixed"&&(s=null),(u?!h&&!s:!h&&f.position==="static"&&!!s&&nA.has(s.position)||xs(d)&&!h&&V0(e,d))?l=l.filter(y=>y!==d):s=f,d=gr(d)}return a.set(e,l),l}function lA(e){let{element:a,boundary:r,rootBoundary:l,strategy:s}=e;const d=[...r==="clippingAncestors"?qc(a)?[]:rA(a,this._c):[].concat(r),l],f=d[0],h=d.reduce((m,y)=>{const g=Tv(a,y,s);return m.top=An(g.top,m.top),m.right=pr(g.right,m.right),m.bottom=pr(g.bottom,m.bottom),m.left=An(g.left,m.left),m},Tv(a,f,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function iA(e){const{width:a,height:r}=G0(e);return{width:a,height:r}}function sA(e,a,r){const l=sa(a),s=ca(a),u=r==="fixed",d=qr(e,!0,u,a);let f={scrollLeft:0,scrollTop:0};const h=ia(0);function m(){h.x=$c(s)}if(l||!l&&!u)if((Zl(a)!=="body"||xs(s))&&(f=Gc(a)),l){const b=qr(a,!0,u,a);h.x=b.x+a.clientLeft,h.y=b.y+a.clientTop}else s&&m();u&&!l&&s&&m();const y=s&&!l&&!u?Y0(s,f):ia(0),g=d.left+f.scrollLeft-h.x-y.x,v=d.top+f.scrollTop-h.y-y.y;return{x:g,y:v,width:d.width,height:d.height}}function qf(e){return Zn(e).position==="static"}function _v(e,a){if(!sa(e)||Zn(e).position==="fixed")return null;if(a)return a(e);let r=e.offsetParent;return ca(e)===r&&(r=r.ownerDocument.body),r}function K0(e,a){const r=Tn(e);if(qc(e))return r;if(!sa(e)){let s=gr(e);for(;s&&!Gl(s);){if(Qn(s)&&!qf(s))return s;s=gr(s)}return r}let l=_v(e,a);for(;l&&qN(l)&&qf(l);)l=_v(l,a);return l&&Gl(l)&&qf(l)&&!nm(l)?r:l||KN(e)||r}const oA=async function(e){const a=this.getOffsetParent||K0,r=this.getDimensions,l=await r(e.floating);return{reference:sA(e.reference,await a(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function cA(e){return Zn(e).direction==="rtl"}const uA={convertOffsetParentRelativeRectToViewportRelativeRect:JN,getDocumentElement:ca,getClippingRect:lA,getOffsetParent:K0,getElementRects:oA,getClientRects:WN,getDimensions:iA,getScale:Bl,isElement:Qn,isRTL:cA};function X0(e,a){return e.x===a.x&&e.y===a.y&&e.width===a.width&&e.height===a.height}function dA(e,a){let r=null,l;const s=ca(e);function u(){var f;clearTimeout(l),(f=r)==null||f.disconnect(),r=null}function d(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),u();const m=e.getBoundingClientRect(),{left:y,top:g,width:v,height:b}=m;if(f||a(),!v||!b)return;const k=ec(g),C=ec(s.clientWidth-(y+v)),E=ec(s.clientHeight-(g+b)),j=ec(y),O={rootMargin:-k+"px "+-C+"px "+-E+"px "+-j+"px",threshold:An(0,pr(1,h))||1};let _=!0;function U(M){const L=M[0].intersectionRatio;if(L!==h){if(!_)return d();L?d(!1,L):l=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!X0(m,e.getBoundingClientRect())&&d(),_=!1}try{r=new IntersectionObserver(U,{...O,root:s.ownerDocument})}catch{r=new IntersectionObserver(U,O)}r.observe(e)}return d(!0),u}function fA(e,a,r,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,m=rm(e),y=s||u?[...m?cs(m):[],...cs(a)]:[];y.forEach(j=>{s&&j.addEventListener("scroll",r,{passive:!0}),u&&j.addEventListener("resize",r)});const g=m&&f?dA(m,r):null;let v=-1,b=null;d&&(b=new ResizeObserver(j=>{let[R]=j;R&&R.target===m&&b&&(b.unobserve(a),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=b)==null||O.observe(a)})),r()}),m&&!h&&b.observe(m),b.observe(a));let k,C=h?qr(e):null;h&&E();function E(){const j=qr(e);C&&!X0(C,j)&&r(),C=j,k=requestAnimationFrame(E)}return r(),()=>{var j;y.forEach(R=>{s&&R.removeEventListener("scroll",r),u&&R.removeEventListener("resize",r)}),g?.(),(j=b)==null||j.disconnect(),b=null,h&&cancelAnimationFrame(k)}}const hA=PN,mA=UN,pA=DN,gA=BN,xA=zN,Rv=ON,yA=IN,vA=(e,a,r)=>{const l=new Map,s={platform:uA,...r},u={...s.platform,_c:l};return MN(e,a,{...s,platform:u})};var bA=typeof document<"u",SA=function(){},dc=bA?S.useLayoutEffect:SA;function yc(e,a){if(e===a)return!0;if(typeof e!=typeof a)return!1;if(typeof e=="function"&&e.toString()===a.toString())return!0;let r,l,s;if(e&&a&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==a.length)return!1;for(l=r;l--!==0;)if(!yc(e[l],a[l]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(a).length)return!1;for(l=r;l--!==0;)if(!{}.hasOwnProperty.call(a,s[l]))return!1;for(l=r;l--!==0;){const u=s[l];if(!(u==="_owner"&&e.$$typeof)&&!yc(e[u],a[u]))return!1}return!0}return e!==e&&a!==a}function Q0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mv(e,a){const r=Q0(e);return Math.round(a*r)/r}function Gf(e){const a=S.useRef(e);return dc(()=>{a.current=e}),a}function wA(e){e===void 0&&(e={});const{placement:a="bottom",strategy:r="absolute",middleware:l=[],platform:s,elements:{reference:u,floating:d}={},transform:f=!0,whileElementsMounted:h,open:m}=e,[y,g]=S.useState({x:0,y:0,strategy:r,placement:a,middlewareData:{},isPositioned:!1}),[v,b]=S.useState(l);yc(v,l)||b(l);const[k,C]=S.useState(null),[E,j]=S.useState(null),R=S.useCallback(X=>{X!==M.current&&(M.current=X,C(X))},[]),O=S.useCallback(X=>{X!==L.current&&(L.current=X,j(X))},[]),_=u||k,U=d||E,M=S.useRef(null),L=S.useRef(null),F=S.useRef(y),Y=h!=null,P=Gf(h),W=Gf(s),ee=Gf(m),fe=S.useCallback(()=>{if(!M.current||!L.current)return;const X={placement:a,strategy:r,middleware:v};W.current&&(X.platform=W.current),vA(M.current,L.current,X).then(G=>{const A={...G,isPositioned:ee.current!==!1};ne.current&&!yc(F.current,A)&&(F.current=A,Yh.flushSync(()=>{g(A)}))})},[v,a,r,W,ee]);dc(()=>{m===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,g(X=>({...X,isPositioned:!1})))},[m]);const ne=S.useRef(!1);dc(()=>(ne.current=!0,()=>{ne.current=!1}),[]),dc(()=>{if(_&&(M.current=_),U&&(L.current=U),_&&U){if(P.current)return P.current(_,U,fe);fe()}},[_,U,fe,P,Y]);const H=S.useMemo(()=>({reference:M,floating:L,setReference:R,setFloating:O}),[R,O]),z=S.useMemo(()=>({reference:_,floating:U}),[_,U]),$=S.useMemo(()=>{const X={position:r,left:0,top:0};if(!z.floating)return X;const G=Mv(z.floating,y.x),A=Mv(z.floating,y.y);return f?{...X,transform:"translate("+G+"px, "+A+"px)",...Q0(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:A}},[r,f,z.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:fe,refs:H,elements:z,floatingStyles:$}),[y,fe,H,z,$])}const kA=e=>{function a(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:l,padding:s}=typeof e=="function"?e(r):e;return l&&a(l)?l.current!=null?Rv({element:l.current,padding:s}).fn(r):{}:l?Rv({element:l,padding:s}).fn(r):{}}}},jA=(e,a)=>({...hA(e),options:[e,a]}),CA=(e,a)=>({...mA(e),options:[e,a]}),EA=(e,a)=>({...yA(e),options:[e,a]}),NA=(e,a)=>({...pA(e),options:[e,a]}),AA=(e,a)=>({...gA(e),options:[e,a]}),TA=(e,a)=>({...xA(e),options:[e,a]}),_A=(e,a)=>({...kA(e),options:[e,a]});var RA="Arrow",Z0=S.forwardRef((e,a)=>{const{children:r,width:l=10,height:s=5,...u}=e;return c.jsx(Xe.svg,{...u,ref:a,width:l,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Z0.displayName=RA;var MA=Z0,lm="Popper",[J0,Yc]=oa(lm),[OA,W0]=J0(lm),e1=e=>{const{__scopePopper:a,children:r}=e,[l,s]=S.useState(null);return c.jsx(OA,{scope:a,anchor:l,onAnchorChange:s,children:r})};e1.displayName=lm;var t1="PopperAnchor",n1=S.forwardRef((e,a)=>{const{__scopePopper:r,virtualRef:l,...s}=e,u=W0(t1,r),d=S.useRef(null),f=yt(a,d),h=S.useRef(null);return S.useEffect(()=>{const m=h.current;h.current=l?.current||d.current,m!==h.current&&u.onAnchorChange(h.current)}),l?null:c.jsx(Xe.div,{...s,ref:f})});n1.displayName=t1;var im="PopperContent",[DA,zA]=J0(im),a1=S.forwardRef((e,a)=>{const{__scopePopper:r,side:l="bottom",sideOffset:s=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:k,...C}=e,E=W0(im,r),[j,R]=S.useState(null),O=yt(a,ge=>R(ge)),[_,U]=S.useState(null),M=vN(_),L=M?.width??0,F=M?.height??0,Y=l+(u!=="center"?"-"+u:""),P=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},W=Array.isArray(m)?m:[m],ee=W.length>0,fe={padding:P,boundary:W.filter(PA),altBoundary:ee},{refs:ne,floatingStyles:H,placement:z,isPositioned:$,middlewareData:X}=wA({strategy:"fixed",placement:Y,whileElementsMounted:(...ge)=>fA(...ge,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[jA({mainAxis:s+F,alignmentAxis:d}),h&&CA({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?EA():void 0,...fe}),h&&NA({...fe}),AA({...fe,apply:({elements:ge,rects:Le,availableWidth:Ee,availableHeight:vt})=>{const{width:rt,height:ie}=Le.reference,jt=ge.floating.style;jt.setProperty("--radix-popper-available-width",`${Ee}px`),jt.setProperty("--radix-popper-available-height",`${vt}px`),jt.setProperty("--radix-popper-anchor-width",`${rt}px`),jt.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),_&&_A({element:_,padding:f}),UA({arrowWidth:L,arrowHeight:F}),v&&TA({strategy:"referenceHidden",...fe})]}),[G,A]=i1(z),D=Kt(k);qn(()=>{$&&D?.()},[$,D]);const Z=X.arrow?.x,T=X.arrow?.y,oe=X.arrow?.centerOffset!==0,[ce,ue]=S.useState();return qn(()=>{j&&ue(window.getComputedStyle(j).zIndex)},[j]),c.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:$?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[X.transformOrigin?.x,X.transformOrigin?.y].join(" "),...X.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(DA,{scope:r,placedSide:G,onArrowChange:U,arrowX:Z,arrowY:T,shouldHideArrow:oe,children:c.jsx(Xe.div,{"data-side":G,"data-align":A,...C,ref:O,style:{...C.style,animation:$?void 0:"none"}})})})});a1.displayName=im;var r1="PopperArrow",LA={top:"bottom",right:"left",bottom:"top",left:"right"},l1=S.forwardRef(function(a,r){const{__scopePopper:l,...s}=a,u=zA(r1,l),d=LA[u.placedSide];return c.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:c.jsx(MA,{...s,ref:r,style:{...s.style,display:"block"}})})});l1.displayName=r1;function PA(e){return e!==null}var UA=e=>({name:"transformOrigin",options:e,fn(a){const{placement:r,rects:l,middlewareData:s}=a,d=s.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[m,y]=i1(r),g={start:"0%",center:"50%",end:"100%"}[y],v=(s.arrow?.x??0)+f/2,b=(s.arrow?.y??0)+h/2;let k="",C="";return m==="bottom"?(k=d?g:`${v}px`,C=`${-h}px`):m==="top"?(k=d?g:`${v}px`,C=`${l.floating.height+h}px`):m==="right"?(k=`${-h}px`,C=d?g:`${b}px`):m==="left"&&(k=`${l.floating.width+h}px`,C=d?g:`${b}px`),{data:{x:k,y:C}}}});function i1(e){const[a,r="center"]=e.split("-");return[a,r]}var s1=e1,o1=n1,c1=a1,u1=l1,$f="rovingFocusGroup.onEntryFocus",IA={bubbles:!1,cancelable:!0},ys="RovingFocusGroup",[wh,d1,BA]=Wb(ys),[HA,Vc]=oa(ys,[BA]),[FA,qA]=HA(ys),f1=S.forwardRef((e,a)=>c.jsx(wh.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wh.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(GA,{...e,ref:a})})}));f1.displayName=ys;var GA=S.forwardRef((e,a)=>{const{__scopeRovingFocusGroup:r,orientation:l,loop:s=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,v=S.useRef(null),b=yt(a,v),k=Pc(u),[C,E]=gs({prop:d,defaultProp:f??null,onChange:h,caller:ys}),[j,R]=S.useState(!1),O=Kt(m),_=d1(r),U=S.useRef(!1),[M,L]=S.useState(0);return S.useEffect(()=>{const F=v.current;if(F)return F.addEventListener($f,O),()=>F.removeEventListener($f,O)},[O]),c.jsx(FA,{scope:r,orientation:l,dir:k,loop:s,currentTabStopId:C,onItemFocus:S.useCallback(F=>E(F),[E]),onItemShiftTab:S.useCallback(()=>R(!0),[]),onFocusableItemAdd:S.useCallback(()=>L(F=>F+1),[]),onFocusableItemRemove:S.useCallback(()=>L(F=>F-1),[]),children:c.jsx(Xe.div,{tabIndex:j||M===0?-1:0,"data-orientation":l,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{U.current=!0}),onFocus:Ae(e.onFocus,F=>{const Y=!U.current;if(F.target===F.currentTarget&&Y&&!j){const P=new CustomEvent($f,IA);if(F.currentTarget.dispatchEvent(P),!P.defaultPrevented){const W=_().filter(z=>z.focusable),ee=W.find(z=>z.active),fe=W.find(z=>z.id===C),H=[ee,fe,...W].filter(Boolean).map(z=>z.ref.current);p1(H,y)}}U.current=!1}),onBlur:Ae(e.onBlur,()=>R(!1))})})}),h1="RovingFocusGroupItem",m1=S.forwardRef((e,a)=>{const{__scopeRovingFocusGroup:r,focusable:l=!0,active:s=!1,tabStopId:u,children:d,...f}=e,h=hr(),m=u||h,y=qA(h1,r),g=y.currentTabStopId===m,v=d1(r),{onFocusableItemAdd:b,onFocusableItemRemove:k,currentTabStopId:C}=y;return S.useEffect(()=>{if(l)return b(),()=>k()},[l,b,k]),c.jsx(wh.ItemSlot,{scope:r,id:m,focusable:l,active:s,children:c.jsx(Xe.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...f,ref:a,onMouseDown:Ae(e.onMouseDown,E=>{l?y.onItemFocus(m):E.preventDefault()}),onFocus:Ae(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Ae(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){y.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const j=VA(E,y.orientation,y.dir);if(j!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let O=v().filter(_=>_.focusable).map(_=>_.ref.current);if(j==="last")O.reverse();else if(j==="prev"||j==="next"){j==="prev"&&O.reverse();const _=O.indexOf(E.currentTarget);O=y.loop?KA(O,_+1):O.slice(_+1)}setTimeout(()=>p1(O))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:C!=null}):d})})});m1.displayName=h1;var $A={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function YA(e,a){return a!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VA(e,a,r){const l=YA(e.key,r);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return $A[l]}function p1(e,a=!1){const r=document.activeElement;for(const l of e)if(l===r||(l.focus({preventScroll:a}),document.activeElement!==r))return}function KA(e,a){return e.map((r,l)=>e[(a+l)%e.length])}var g1=f1,x1=m1,kh=["Enter"," "],XA=["ArrowDown","PageUp","Home"],y1=["ArrowUp","PageDown","End"],QA=[...XA,...y1],ZA={ltr:[...kh,"ArrowRight"],rtl:[...kh,"ArrowLeft"]},JA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vs="Menu",[us,WA,eT]=Wb(vs),[$r,v1]=oa(vs,[eT,Yc,Vc]),Kc=Yc(),b1=Vc(),[tT,Yr]=$r(vs),[nT,bs]=$r(vs),S1=e=>{const{__scopeMenu:a,open:r=!1,children:l,dir:s,onOpenChange:u,modal:d=!0}=e,f=Kc(a),[h,m]=S.useState(null),y=S.useRef(!1),g=Kt(u),v=Pc(s);return S.useEffect(()=>{const b=()=>{y.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>y.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),c.jsx(s1,{...f,children:c.jsx(tT,{scope:a,open:r,onOpenChange:g,content:h,onContentChange:m,children:c.jsx(nT,{scope:a,onClose:S.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:v,modal:d,children:l})})})};S1.displayName=vs;var aT="MenuAnchor",sm=S.forwardRef((e,a)=>{const{__scopeMenu:r,...l}=e,s=Kc(r);return c.jsx(o1,{...s,...l,ref:a})});sm.displayName=aT;var om="MenuPortal",[rT,w1]=$r(om,{forceMount:void 0}),k1=e=>{const{__scopeMenu:a,forceMount:r,children:l,container:s}=e,u=Yr(om,a);return c.jsx(rT,{scope:a,forceMount:r,children:c.jsx(rn,{present:r||u.open,children:c.jsx(Ic,{asChild:!0,container:s,children:l})})})};k1.displayName=om;var Fn="MenuContent",[lT,cm]=$r(Fn),j1=S.forwardRef((e,a)=>{const r=w1(Fn,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,u=Yr(Fn,e.__scopeMenu),d=bs(Fn,e.__scopeMenu);return c.jsx(us.Provider,{scope:e.__scopeMenu,children:c.jsx(rn,{present:l||u.open,children:c.jsx(us.Slot,{scope:e.__scopeMenu,children:d.modal?c.jsx(iT,{...s,ref:a}):c.jsx(sT,{...s,ref:a})})})})}),iT=S.forwardRef((e,a)=>{const r=Yr(Fn,e.__scopeMenu),l=S.useRef(null),s=yt(a,l);return S.useEffect(()=>{const u=l.current;if(u)return f0(u)},[]),c.jsx(um,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),sT=S.forwardRef((e,a)=>{const r=Yr(Fn,e.__scopeMenu);return c.jsx(um,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),oT=ql("MenuContent.ScrollLock"),um=S.forwardRef((e,a)=>{const{__scopeMenu:r,loop:l=!1,trapFocus:s,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,disableOutsideScroll:k,...C}=e,E=Yr(Fn,r),j=bs(Fn,r),R=Kc(r),O=b1(r),_=WA(r),[U,M]=S.useState(null),L=S.useRef(null),F=yt(a,L,E.onContentChange),Y=S.useRef(0),P=S.useRef(""),W=S.useRef(0),ee=S.useRef(null),fe=S.useRef("right"),ne=S.useRef(0),H=k?Kh:S.Fragment,z=k?{as:oT,allowPinchZoom:!0}:void 0,$=G=>{const A=P.current+G,D=_().filter(ge=>!ge.disabled),Z=document.activeElement,T=D.find(ge=>ge.ref.current===Z)?.textValue,oe=D.map(ge=>ge.textValue),ce=bT(oe,A,T),ue=D.find(ge=>ge.textValue===ce)?.ref.current;(function ge(Le){P.current=Le,window.clearTimeout(Y.current),Le!==""&&(Y.current=window.setTimeout(()=>ge(""),1e3))})(A),ue&&setTimeout(()=>ue.focus())};S.useEffect(()=>()=>window.clearTimeout(Y.current),[]),a0();const X=S.useCallback(G=>fe.current===ee.current?.side&&wT(G,ee.current?.area),[]);return c.jsx(lT,{scope:r,searchRef:P,onItemEnter:S.useCallback(G=>{X(G)&&G.preventDefault()},[X]),onItemLeave:S.useCallback(G=>{X(G)||(L.current?.focus(),M(null))},[X]),onTriggerLeave:S.useCallback(G=>{X(G)&&G.preventDefault()},[X]),pointerGraceTimerRef:W,onPointerGraceIntentChange:S.useCallback(G=>{ee.current=G},[]),children:c.jsx(H,{...z,children:c.jsx(Vh,{asChild:!0,trapped:s,onMountAutoFocus:Ae(u,G=>{G.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:c.jsx(Uc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:c.jsx(g1,{asChild:!0,...O,dir:j.dir,orientation:"vertical",loop:l,currentTabStopId:U,onCurrentTabStopIdChange:M,onEntryFocus:Ae(h,G=>{j.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(c1,{role:"menu","aria-orientation":"vertical","data-state":B1(E.open),"data-radix-menu-content":"",dir:j.dir,...R,...C,ref:F,style:{outline:"none",...C.style},onKeyDown:Ae(C.onKeyDown,G=>{const D=G.target.closest("[data-radix-menu-content]")===G.currentTarget,Z=G.ctrlKey||G.altKey||G.metaKey,T=G.key.length===1;D&&(G.key==="Tab"&&G.preventDefault(),!Z&&T&&$(G.key));const oe=L.current;if(G.target!==oe||!QA.includes(G.key))return;G.preventDefault();const ue=_().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);y1.includes(G.key)&&ue.reverse(),yT(ue)}),onBlur:Ae(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(Y.current),P.current="")}),onPointerMove:Ae(e.onPointerMove,ds(G=>{const A=G.target,D=ne.current!==G.clientX;if(G.currentTarget.contains(A)&&D){const Z=G.clientX>ne.current?"right":"left";fe.current=Z,ne.current=G.clientX}}))})})})})})})});j1.displayName=Fn;var cT="MenuGroup",dm=S.forwardRef((e,a)=>{const{__scopeMenu:r,...l}=e;return c.jsx(Xe.div,{role:"group",...l,ref:a})});dm.displayName=cT;var uT="MenuLabel",C1=S.forwardRef((e,a)=>{const{__scopeMenu:r,...l}=e;return c.jsx(Xe.div,{...l,ref:a})});C1.displayName=uT;var vc="MenuItem",Ov="menu.itemSelect",Xc=S.forwardRef((e,a)=>{const{disabled:r=!1,onSelect:l,...s}=e,u=S.useRef(null),d=bs(vc,e.__scopeMenu),f=cm(vc,e.__scopeMenu),h=yt(a,u),m=S.useRef(!1),y=()=>{const g=u.current;if(!r&&g){const v=new CustomEvent(Ov,{bubbles:!0,cancelable:!0});g.addEventListener(Ov,b=>l?.(b),{once:!0}),Zb(g,v),v.defaultPrevented?m.current=!1:d.onClose()}};return c.jsx(E1,{...s,ref:h,disabled:r,onClick:Ae(e.onClick,y),onPointerDown:g=>{e.onPointerDown?.(g),m.current=!0},onPointerUp:Ae(e.onPointerUp,g=>{m.current||g.currentTarget?.click()}),onKeyDown:Ae(e.onKeyDown,g=>{const v=f.searchRef.current!=="";r||v&&g.key===" "||kh.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});Xc.displayName=vc;var E1=S.forwardRef((e,a)=>{const{__scopeMenu:r,disabled:l=!1,textValue:s,...u}=e,d=cm(vc,r),f=b1(r),h=S.useRef(null),m=yt(a,h),[y,g]=S.useState(!1),[v,b]=S.useState("");return S.useEffect(()=>{const k=h.current;k&&b((k.textContent??"").trim())},[u.children]),c.jsx(us.ItemSlot,{scope:r,disabled:l,textValue:s??v,children:c.jsx(x1,{asChild:!0,...f,focusable:!l,children:c.jsx(Xe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...u,ref:m,onPointerMove:Ae(e.onPointerMove,ds(k=>{l?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,ds(k=>d.onItemLeave(k))),onFocus:Ae(e.onFocus,()=>g(!0)),onBlur:Ae(e.onBlur,()=>g(!1))})})})}),dT="MenuCheckboxItem",N1=S.forwardRef((e,a)=>{const{checked:r=!1,onCheckedChange:l,...s}=e;return c.jsx(M1,{scope:e.__scopeMenu,checked:r,children:c.jsx(Xc,{role:"menuitemcheckbox","aria-checked":bc(r)?"mixed":r,...s,ref:a,"data-state":hm(r),onSelect:Ae(s.onSelect,()=>l?.(bc(r)?!0:!r),{checkForDefaultPrevented:!1})})})});N1.displayName=dT;var A1="MenuRadioGroup",[fT,hT]=$r(A1,{value:void 0,onValueChange:()=>{}}),T1=S.forwardRef((e,a)=>{const{value:r,onValueChange:l,...s}=e,u=Kt(l);return c.jsx(fT,{scope:e.__scopeMenu,value:r,onValueChange:u,children:c.jsx(dm,{...s,ref:a})})});T1.displayName=A1;var _1="MenuRadioItem",R1=S.forwardRef((e,a)=>{const{value:r,...l}=e,s=hT(_1,e.__scopeMenu),u=r===s.value;return c.jsx(M1,{scope:e.__scopeMenu,checked:u,children:c.jsx(Xc,{role:"menuitemradio","aria-checked":u,...l,ref:a,"data-state":hm(u),onSelect:Ae(l.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});R1.displayName=_1;var fm="MenuItemIndicator",[M1,mT]=$r(fm,{checked:!1}),O1=S.forwardRef((e,a)=>{const{__scopeMenu:r,forceMount:l,...s}=e,u=mT(fm,r);return c.jsx(rn,{present:l||bc(u.checked)||u.checked===!0,children:c.jsx(Xe.span,{...s,ref:a,"data-state":hm(u.checked)})})});O1.displayName=fm;var pT="MenuSeparator",D1=S.forwardRef((e,a)=>{const{__scopeMenu:r,...l}=e;return c.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...l,ref:a})});D1.displayName=pT;var gT="MenuArrow",z1=S.forwardRef((e,a)=>{const{__scopeMenu:r,...l}=e,s=Kc(r);return c.jsx(u1,{...s,...l,ref:a})});z1.displayName=gT;var xT="MenuSub",[xU,L1]=$r(xT),ts="MenuSubTrigger",P1=S.forwardRef((e,a)=>{const r=Yr(ts,e.__scopeMenu),l=bs(ts,e.__scopeMenu),s=L1(ts,e.__scopeMenu),u=cm(ts,e.__scopeMenu),d=S.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=u,m={__scopeMenu:e.__scopeMenu},y=S.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return S.useEffect(()=>y,[y]),S.useEffect(()=>{const g=f.current;return()=>{window.clearTimeout(g),h(null)}},[f,h]),c.jsx(sm,{asChild:!0,...m,children:c.jsx(E1,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":B1(r.open),...e,ref:zc(a,s.onTriggerChange),onClick:g=>{e.onClick?.(g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,ds(g=>{u.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!r.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:Ae(e.onPointerLeave,ds(g=>{y();const v=r.content?.getBoundingClientRect();if(v){const b=r.content?.dataset.side,k=b==="right",C=k?-5:5,E=v[k?"left":"right"],j=v[k?"right":"left"];u.onPointerGraceIntentChange({area:[{x:g.clientX+C,y:g.clientY},{x:E,y:v.top},{x:j,y:v.top},{x:j,y:v.bottom},{x:E,y:v.bottom}],side:b}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(g),g.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,g=>{const v=u.searchRef.current!=="";e.disabled||v&&g.key===" "||ZA[l.dir].includes(g.key)&&(r.onOpenChange(!0),r.content?.focus(),g.preventDefault())})})})});P1.displayName=ts;var U1="MenuSubContent",I1=S.forwardRef((e,a)=>{const r=w1(Fn,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,u=Yr(Fn,e.__scopeMenu),d=bs(Fn,e.__scopeMenu),f=L1(U1,e.__scopeMenu),h=S.useRef(null),m=yt(a,h);return c.jsx(us.Provider,{scope:e.__scopeMenu,children:c.jsx(rn,{present:l||u.open,children:c.jsx(us.Slot,{scope:e.__scopeMenu,children:c.jsx(um,{id:f.contentId,"aria-labelledby":f.triggerId,...s,ref:m,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{d.isUsingKeyboardRef.current&&h.current?.focus(),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,y=>{y.target!==f.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,y=>{d.onClose(),y.preventDefault()}),onKeyDown:Ae(e.onKeyDown,y=>{const g=y.currentTarget.contains(y.target),v=JA[d.dir].includes(y.key);g&&v&&(u.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});I1.displayName=U1;function B1(e){return e?"open":"closed"}function bc(e){return e==="indeterminate"}function hm(e){return bc(e)?"indeterminate":e?"checked":"unchecked"}function yT(e){const a=document.activeElement;for(const r of e)if(r===a||(r.focus(),document.activeElement!==a))return}function vT(e,a){return e.map((r,l)=>e[(a+l)%e.length])}function bT(e,a,r){const s=a.length>1&&Array.from(a).every(m=>m===a[0])?a[0]:a,u=r?e.indexOf(r):-1;let d=vT(e,Math.max(u,0));s.length===1&&(d=d.filter(m=>m!==r));const h=d.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==r?h:void 0}function ST(e,a){const{x:r,y:l}=e;let s=!1;for(let u=0,d=a.length-1;u<a.length;d=u++){const f=a[u],h=a[d],m=f.x,y=f.y,g=h.x,v=h.y;y>l!=v>l&&r<(g-m)*(l-y)/(v-y)+m&&(s=!s)}return s}function wT(e,a){if(!a)return!1;const r={x:e.clientX,y:e.clientY};return ST(r,a)}function ds(e){return a=>a.pointerType==="mouse"?e(a):void 0}var kT=S1,jT=sm,CT=k1,ET=j1,NT=dm,AT=C1,TT=Xc,_T=N1,RT=T1,MT=R1,OT=O1,DT=D1,zT=z1,LT=P1,PT=I1,Qc="DropdownMenu",[UT]=oa(Qc,[v1]),ln=v1(),[IT,H1]=UT(Qc),F1=e=>{const{__scopeDropdownMenu:a,children:r,dir:l,open:s,defaultOpen:u,onOpenChange:d,modal:f=!0}=e,h=ln(a),m=S.useRef(null),[y,g]=gs({prop:s,defaultProp:u??!1,onChange:d,caller:Qc});return c.jsx(IT,{scope:a,triggerId:hr(),triggerRef:m,contentId:hr(),open:y,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(v=>!v),[g]),modal:f,children:c.jsx(kT,{...h,open:y,onOpenChange:g,dir:l,modal:f,children:r})})};F1.displayName=Qc;var q1="DropdownMenuTrigger",G1=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,disabled:l=!1,...s}=e,u=H1(q1,r),d=ln(r);return c.jsx(jT,{asChild:!0,...d,children:c.jsx(Xe.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...s,ref:zc(a,u.triggerRef),onPointerDown:Ae(e.onPointerDown,f=>{!l&&f.button===0&&f.ctrlKey===!1&&(u.onOpenToggle(),u.open||f.preventDefault())}),onKeyDown:Ae(e.onKeyDown,f=>{l||(["Enter"," "].includes(f.key)&&u.onOpenToggle(),f.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});G1.displayName=q1;var BT="DropdownMenuPortal",$1=e=>{const{__scopeDropdownMenu:a,...r}=e,l=ln(a);return c.jsx(CT,{...l,...r})};$1.displayName=BT;var Y1="DropdownMenuContent",V1=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=H1(Y1,r),u=ln(r),d=S.useRef(!1);return c.jsx(ET,{id:s.contentId,"aria-labelledby":s.triggerId,...u,...l,ref:a,onCloseAutoFocus:Ae(e.onCloseAutoFocus,f=>{d.current||s.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,f=>{const h=f.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,y=h.button===2||m;(!s.modal||y)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V1.displayName=Y1;var HT="DropdownMenuGroup",FT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(NT,{...s,...l,ref:a})});FT.displayName=HT;var qT="DropdownMenuLabel",GT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(AT,{...s,...l,ref:a})});GT.displayName=qT;var $T="DropdownMenuItem",K1=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(TT,{...s,...l,ref:a})});K1.displayName=$T;var YT="DropdownMenuCheckboxItem",VT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(_T,{...s,...l,ref:a})});VT.displayName=YT;var KT="DropdownMenuRadioGroup",XT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(RT,{...s,...l,ref:a})});XT.displayName=KT;var QT="DropdownMenuRadioItem",ZT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(MT,{...s,...l,ref:a})});ZT.displayName=QT;var JT="DropdownMenuItemIndicator",WT=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(OT,{...s,...l,ref:a})});WT.displayName=JT;var e_="DropdownMenuSeparator",t_=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(DT,{...s,...l,ref:a})});t_.displayName=e_;var n_="DropdownMenuArrow",a_=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(zT,{...s,...l,ref:a})});a_.displayName=n_;var r_="DropdownMenuSubTrigger",l_=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(LT,{...s,...l,ref:a})});l_.displayName=r_;var i_="DropdownMenuSubContent",s_=S.forwardRef((e,a)=>{const{__scopeDropdownMenu:r,...l}=e,s=ln(r);return c.jsx(PT,{...s,...l,ref:a,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});s_.displayName=i_;var o_=F1,c_=G1,u_=$1,d_=V1,f_=K1;function h_(e,[a,r]){return Math.min(r,Math.max(a,e))}function m_(e,a){return S.useReducer((r,l)=>a[r][l]??r,e)}var mm="ScrollArea",[X1]=oa(mm),[p_,Gn]=X1(mm),Q1=S.forwardRef((e,a)=>{const{__scopeScrollArea:r,type:l="hover",dir:s,scrollHideDelay:u=600,...d}=e,[f,h]=S.useState(null),[m,y]=S.useState(null),[g,v]=S.useState(null),[b,k]=S.useState(null),[C,E]=S.useState(null),[j,R]=S.useState(0),[O,_]=S.useState(0),[U,M]=S.useState(!1),[L,F]=S.useState(!1),Y=yt(a,W=>h(W)),P=Pc(s);return c.jsx(p_,{scope:r,type:l,dir:P,scrollHideDelay:u,scrollArea:f,viewport:m,onViewportChange:y,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:k,scrollbarXEnabled:U,onScrollbarXEnabledChange:M,scrollbarY:C,onScrollbarYChange:E,scrollbarYEnabled:L,onScrollbarYEnabledChange:F,onCornerWidthChange:R,onCornerHeightChange:_,children:c.jsx(Xe.div,{dir:P,...d,ref:Y,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":O+"px",...e.style}})})});Q1.displayName=mm;var Z1="ScrollAreaViewport",J1=S.forwardRef((e,a)=>{const{__scopeScrollArea:r,children:l,nonce:s,...u}=e,d=Gn(Z1,r),f=S.useRef(null),h=yt(a,f,d.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(Xe.div,{"data-radix-scroll-area-viewport":"",...u,ref:h,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});J1.displayName=Z1;var ua="ScrollAreaScrollbar",W1=S.forwardRef((e,a)=>{const{forceMount:r,...l}=e,s=Gn(ua,e.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=s,f=e.orientation==="horizontal";return S.useEffect(()=>(f?u(!0):d(!0),()=>{f?u(!1):d(!1)}),[f,u,d]),s.type==="hover"?c.jsx(g_,{...l,ref:a,forceMount:r}):s.type==="scroll"?c.jsx(x_,{...l,ref:a,forceMount:r}):s.type==="auto"?c.jsx(eS,{...l,ref:a,forceMount:r}):s.type==="always"?c.jsx(pm,{...l,ref:a}):null});W1.displayName=ua;var g_=S.forwardRef((e,a)=>{const{forceMount:r,...l}=e,s=Gn(ua,e.__scopeScrollArea),[u,d]=S.useState(!1);return S.useEffect(()=>{const f=s.scrollArea;let h=0;if(f){const m=()=>{window.clearTimeout(h),d(!0)},y=()=>{h=window.setTimeout(()=>d(!1),s.scrollHideDelay)};return f.addEventListener("pointerenter",m),f.addEventListener("pointerleave",y),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",m),f.removeEventListener("pointerleave",y)}}},[s.scrollArea,s.scrollHideDelay]),c.jsx(rn,{present:r||u,children:c.jsx(eS,{"data-state":u?"visible":"hidden",...l,ref:a})})}),x_=S.forwardRef((e,a)=>{const{forceMount:r,...l}=e,s=Gn(ua,e.__scopeScrollArea),u=e.orientation==="horizontal",d=Jc(()=>h("SCROLL_END"),100),[f,h]=m_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(f==="idle"){const m=window.setTimeout(()=>h("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(m)}},[f,s.scrollHideDelay,h]),S.useEffect(()=>{const m=s.viewport,y=u?"scrollLeft":"scrollTop";if(m){let g=m[y];const v=()=>{const b=m[y];g!==b&&(h("SCROLL"),d()),g=b};return m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,u,h,d]),c.jsx(rn,{present:r||f!=="hidden",children:c.jsx(pm,{"data-state":f==="hidden"?"hidden":"visible",...l,ref:a,onPointerEnter:Ae(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),eS=S.forwardRef((e,a)=>{const r=Gn(ua,e.__scopeScrollArea),{forceMount:l,...s}=e,[u,d]=S.useState(!1),f=e.orientation==="horizontal",h=Jc(()=>{if(r.viewport){const m=r.viewport.offsetWidth<r.viewport.scrollWidth,y=r.viewport.offsetHeight<r.viewport.scrollHeight;d(f?m:y)}},10);return $l(r.viewport,h),$l(r.content,h),c.jsx(rn,{present:l||u,children:c.jsx(pm,{"data-state":u?"visible":"hidden",...s,ref:a})})}),pm=S.forwardRef((e,a)=>{const{orientation:r="vertical",...l}=e,s=Gn(ua,e.__scopeScrollArea),u=S.useRef(null),d=S.useRef(0),[f,h]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=lS(f.viewport,f.content),y={...l,sizes:f,onSizesChange:h,hasThumb:m>0&&m<1,onThumbChange:v=>u.current=v,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:v=>d.current=v};function g(v,b){return k_(v,d.current,f,b)}return r==="horizontal"?c.jsx(y_,{...y,ref:a,onThumbPositionChange:()=>{if(s.viewport&&u.current){const v=s.viewport.scrollLeft,b=Dv(v,f,s.dir);u.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollLeft=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollLeft=g(v,s.dir))}}):r==="vertical"?c.jsx(v_,{...y,ref:a,onThumbPositionChange:()=>{if(s.viewport&&u.current){const v=s.viewport.scrollTop,b=Dv(v,f);u.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollTop=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollTop=g(v))}}):null}),y_=S.forwardRef((e,a)=>{const{sizes:r,onSizesChange:l,...s}=e,u=Gn(ua,e.__scopeScrollArea),[d,f]=S.useState(),h=S.useRef(null),m=yt(a,h,u.onScrollbarXChange);return S.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),c.jsx(nS,{"data-orientation":"horizontal",...s,ref:m,sizes:r,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Zc(r)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.x),onDragScroll:y=>e.onDragScroll(y.x),onWheelScroll:(y,g)=>{if(u.viewport){const v=u.viewport.scrollLeft+y.deltaX;e.onWheelScroll(v),sS(v,g)&&y.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:wc(d.paddingLeft),paddingEnd:wc(d.paddingRight)}})}})}),v_=S.forwardRef((e,a)=>{const{sizes:r,onSizesChange:l,...s}=e,u=Gn(ua,e.__scopeScrollArea),[d,f]=S.useState(),h=S.useRef(null),m=yt(a,h,u.onScrollbarYChange);return S.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),c.jsx(nS,{"data-orientation":"vertical",...s,ref:m,sizes:r,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Zc(r)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.y),onDragScroll:y=>e.onDragScroll(y.y),onWheelScroll:(y,g)=>{if(u.viewport){const v=u.viewport.scrollTop+y.deltaY;e.onWheelScroll(v),sS(v,g)&&y.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:wc(d.paddingTop),paddingEnd:wc(d.paddingBottom)}})}})}),[b_,tS]=X1(ua),nS=S.forwardRef((e,a)=>{const{__scopeScrollArea:r,sizes:l,hasThumb:s,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:m,onWheelScroll:y,onResize:g,...v}=e,b=Gn(ua,r),[k,C]=S.useState(null),E=yt(a,Y=>C(Y)),j=S.useRef(null),R=S.useRef(""),O=b.viewport,_=l.content-l.viewport,U=Kt(y),M=Kt(h),L=Jc(g,10);function F(Y){if(j.current){const P=Y.clientX-j.current.left,W=Y.clientY-j.current.top;m({x:P,y:W})}}return S.useEffect(()=>{const Y=P=>{const W=P.target;k?.contains(W)&&U(P,_)};return document.addEventListener("wheel",Y,{passive:!1}),()=>document.removeEventListener("wheel",Y,{passive:!1})},[O,k,_,U]),S.useEffect(M,[l,M]),$l(k,L),$l(b.content,L),c.jsx(b_,{scope:r,scrollbar:k,hasThumb:s,onThumbChange:Kt(u),onThumbPointerUp:Kt(d),onThumbPositionChange:M,onThumbPointerDown:Kt(f),children:c.jsx(Xe.div,{...v,ref:E,style:{position:"absolute",...v.style},onPointerDown:Ae(e.onPointerDown,Y=>{Y.button===0&&(Y.target.setPointerCapture(Y.pointerId),j.current=k.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),F(Y))}),onPointerMove:Ae(e.onPointerMove,F),onPointerUp:Ae(e.onPointerUp,Y=>{const P=Y.target;P.hasPointerCapture(Y.pointerId)&&P.releasePointerCapture(Y.pointerId),document.body.style.webkitUserSelect=R.current,b.viewport&&(b.viewport.style.scrollBehavior=""),j.current=null})})})}),Sc="ScrollAreaThumb",aS=S.forwardRef((e,a)=>{const{forceMount:r,...l}=e,s=tS(Sc,e.__scopeScrollArea);return c.jsx(rn,{present:r||s.hasThumb,children:c.jsx(S_,{ref:a,...l})})}),S_=S.forwardRef((e,a)=>{const{__scopeScrollArea:r,style:l,...s}=e,u=Gn(Sc,r),d=tS(Sc,r),{onThumbPositionChange:f}=d,h=yt(a,g=>d.onThumbChange(g)),m=S.useRef(void 0),y=Jc(()=>{m.current&&(m.current(),m.current=void 0)},100);return S.useEffect(()=>{const g=u.viewport;if(g){const v=()=>{if(y(),!m.current){const b=j_(g,f);m.current=b,f()}};return f(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[u.viewport,y,f]),c.jsx(Xe.div,{"data-state":d.hasThumb?"visible":"hidden",...s,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:Ae(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),k=g.clientX-b.left,C=g.clientY-b.top;d.onThumbPointerDown({x:k,y:C})}),onPointerUp:Ae(e.onPointerUp,d.onThumbPointerUp)})});aS.displayName=Sc;var gm="ScrollAreaCorner",rS=S.forwardRef((e,a)=>{const r=Gn(gm,e.__scopeScrollArea),l=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&l?c.jsx(w_,{...e,ref:a}):null});rS.displayName=gm;var w_=S.forwardRef((e,a)=>{const{__scopeScrollArea:r,...l}=e,s=Gn(gm,r),[u,d]=S.useState(0),[f,h]=S.useState(0),m=!!(u&&f);return $l(s.scrollbarX,()=>{const y=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(y),h(y)}),$l(s.scrollbarY,()=>{const y=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(y),d(y)}),m?c.jsx(Xe.div,{...l,ref:a,style:{width:u,height:f,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function wc(e){return e?parseInt(e,10):0}function lS(e,a){const r=e/a;return isNaN(r)?0:r}function Zc(e){const a=lS(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=(e.scrollbar.size-r)*a;return Math.max(l,18)}function k_(e,a,r,l="ltr"){const s=Zc(r),u=s/2,d=a||u,f=s-d,h=r.scrollbar.paddingStart+d,m=r.scrollbar.size-r.scrollbar.paddingEnd-f,y=r.content-r.viewport,g=l==="ltr"?[0,y]:[y*-1,0];return iS([h,m],g)(e)}function Dv(e,a,r="ltr"){const l=Zc(a),s=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,u=a.scrollbar.size-s,d=a.content-a.viewport,f=u-l,h=r==="ltr"?[0,d]:[d*-1,0],m=h_(e,h);return iS([0,d],[0,f])(m)}function iS(e,a){return r=>{if(e[0]===e[1]||a[0]===a[1])return a[0];const l=(a[1]-a[0])/(e[1]-e[0]);return a[0]+l*(r-e[0])}}function sS(e,a){return e>0&&e<a}var j_=(e,a=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},l=0;return(function s(){const u={left:e.scrollLeft,top:e.scrollTop},d=r.left!==u.left,f=r.top!==u.top;(d||f)&&a(),r=u,l=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(l)};function Jc(e,a){const r=Kt(e),l=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(l.current),[]),S.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(r,a)},[r,a])}function $l(e,a){const r=Kt(a);qn(()=>{let l=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(l),s.unobserve(e)}}},[e,r])}var C_=Q1,E_=J1,N_=rS,Wc="Tabs",[A_]=oa(Wc,[Vc]),oS=Vc(),[T_,xm]=A_(Wc),cS=S.forwardRef((e,a)=>{const{__scopeTabs:r,value:l,onValueChange:s,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:h="automatic",...m}=e,y=Pc(f),[g,v]=gs({prop:l,onChange:s,defaultProp:u??"",caller:Wc});return c.jsx(T_,{scope:r,baseId:hr(),value:g,onValueChange:v,orientation:d,dir:y,activationMode:h,children:c.jsx(Xe.div,{dir:y,"data-orientation":d,...m,ref:a})})});cS.displayName=Wc;var uS="TabsList",dS=S.forwardRef((e,a)=>{const{__scopeTabs:r,loop:l=!0,...s}=e,u=xm(uS,r),d=oS(r);return c.jsx(g1,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:c.jsx(Xe.div,{role:"tablist","aria-orientation":u.orientation,...s,ref:a})})});dS.displayName=uS;var fS="TabsTrigger",hS=S.forwardRef((e,a)=>{const{__scopeTabs:r,value:l,disabled:s=!1,...u}=e,d=xm(fS,r),f=oS(r),h=gS(d.baseId,l),m=xS(d.baseId,l),y=l===d.value;return c.jsx(x1,{asChild:!0,...f,focusable:!s,active:y,children:c.jsx(Xe.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":m,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:h,...u,ref:a,onMouseDown:Ae(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:Ae(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:Ae(e.onFocus,()=>{const g=d.activationMode!=="manual";!y&&!s&&g&&d.onValueChange(l)})})})});hS.displayName=fS;var mS="TabsContent",pS=S.forwardRef((e,a)=>{const{__scopeTabs:r,value:l,forceMount:s,children:u,...d}=e,f=xm(mS,r),h=gS(f.baseId,l),m=xS(f.baseId,l),y=l===f.value,g=S.useRef(y);return S.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),c.jsx(rn,{present:s||y,children:({present:v})=>c.jsx(Xe.div,{"data-state":y?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!v,id:m,tabIndex:0,...d,ref:a,style:{...e.style,animationDuration:g.current?"0s":void 0},children:v&&u})})});pS.displayName=mS;function gS(e,a){return`${e}-trigger-${a}`}function xS(e,a){return`${e}-content-${a}`}var __=cS,R_=dS,M_=hS,O_=pS,[eu]=oa("Tooltip",[Yc]),tu=Yc(),yS="TooltipProvider",D_=700,jh="tooltip.open",[z_,ym]=eu(yS),vS=e=>{const{__scopeTooltip:a,delayDuration:r=D_,skipDelayDuration:l=300,disableHoverableContent:s=!1,children:u}=e,d=S.useRef(!0),f=S.useRef(!1),h=S.useRef(0);return S.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),c.jsx(z_,{scope:a,isOpenDelayedRef:d,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(h.current),d.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>d.current=!0,l)},[l]),isPointerInTransitRef:f,onPointerInTransitChange:S.useCallback(m=>{f.current=m},[]),disableHoverableContent:s,children:u})};vS.displayName=yS;var fs="Tooltip",[L_,Ss]=eu(fs),bS=e=>{const{__scopeTooltip:a,children:r,open:l,defaultOpen:s,onOpenChange:u,disableHoverableContent:d,delayDuration:f}=e,h=ym(fs,e.__scopeTooltip),m=tu(a),[y,g]=S.useState(null),v=hr(),b=S.useRef(0),k=d??h.disableHoverableContent,C=f??h.delayDuration,E=S.useRef(!1),[j,R]=gs({prop:l,defaultProp:s??!1,onChange:L=>{L?(h.onOpen(),document.dispatchEvent(new CustomEvent(jh))):h.onClose(),u?.(L)},caller:fs}),O=S.useMemo(()=>j?E.current?"delayed-open":"instant-open":"closed",[j]),_=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,R(!0)},[R]),U=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,R(!1)},[R]),M=S.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,R(!0),b.current=0},C)},[C,R]);return S.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),c.jsx(s1,{...m,children:c.jsx(L_,{scope:a,contentId:v,open:j,stateAttribute:O,trigger:y,onTriggerChange:g,onTriggerEnter:S.useCallback(()=>{h.isOpenDelayedRef.current?M():_()},[h.isOpenDelayedRef,M,_]),onTriggerLeave:S.useCallback(()=>{k?U():(window.clearTimeout(b.current),b.current=0)},[U,k]),onOpen:_,onClose:U,disableHoverableContent:k,children:r})})};bS.displayName=fs;var Ch="TooltipTrigger",SS=S.forwardRef((e,a)=>{const{__scopeTooltip:r,...l}=e,s=Ss(Ch,r),u=ym(Ch,r),d=tu(r),f=S.useRef(null),h=yt(a,f,s.onTriggerChange),m=S.useRef(!1),y=S.useRef(!1),g=S.useCallback(()=>m.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),c.jsx(o1,{asChild:!0,...d,children:c.jsx(Xe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...l,ref:h,onPointerMove:Ae(e.onPointerMove,v=>{v.pointerType!=="touch"&&!y.current&&!u.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ae(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});SS.displayName=Ch;var vm="TooltipPortal",[P_,U_]=eu(vm,{forceMount:void 0}),wS=e=>{const{__scopeTooltip:a,forceMount:r,children:l,container:s}=e,u=Ss(vm,a);return c.jsx(P_,{scope:a,forceMount:r,children:c.jsx(rn,{present:r||u.open,children:c.jsx(Ic,{asChild:!0,container:s,children:l})})})};wS.displayName=vm;var Yl="TooltipContent",kS=S.forwardRef((e,a)=>{const r=U_(Yl,e.__scopeTooltip),{forceMount:l=r.forceMount,side:s="top",...u}=e,d=Ss(Yl,e.__scopeTooltip);return c.jsx(rn,{present:l||d.open,children:d.disableHoverableContent?c.jsx(jS,{side:s,...u,ref:a}):c.jsx(I_,{side:s,...u,ref:a})})}),I_=S.forwardRef((e,a)=>{const r=Ss(Yl,e.__scopeTooltip),l=ym(Yl,e.__scopeTooltip),s=S.useRef(null),u=yt(a,s),[d,f]=S.useState(null),{trigger:h,onClose:m}=r,y=s.current,{onPointerInTransitChange:g}=l,v=S.useCallback(()=>{f(null),g(!1)},[g]),b=S.useCallback((k,C)=>{const E=k.currentTarget,j={x:k.clientX,y:k.clientY},R=q_(j,E.getBoundingClientRect()),O=G_(j,R),_=$_(C.getBoundingClientRect()),U=V_([...O,..._]);f(U),g(!0)},[g]);return S.useEffect(()=>()=>v(),[v]),S.useEffect(()=>{if(h&&y){const k=E=>b(E,y),C=E=>b(E,h);return h.addEventListener("pointerleave",k),y.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",k),y.removeEventListener("pointerleave",C)}}},[h,y,b,v]),S.useEffect(()=>{if(d){const k=C=>{const E=C.target,j={x:C.clientX,y:C.clientY},R=h?.contains(E)||y?.contains(E),O=!Y_(j,d);R?v():O&&(v(),m())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[h,y,d,m,v]),c.jsx(jS,{...e,ref:u})}),[B_,H_]=eu(fs,{isInside:!1}),F_=M2("TooltipContent"),jS=S.forwardRef((e,a)=>{const{__scopeTooltip:r,children:l,"aria-label":s,onEscapeKeyDown:u,onPointerDownOutside:d,...f}=e,h=Ss(Yl,r),m=tu(r),{onClose:y}=h;return S.useEffect(()=>(document.addEventListener(jh,y),()=>document.removeEventListener(jh,y)),[y]),S.useEffect(()=>{if(h.trigger){const g=v=>{v.target?.contains(h.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,y]),c.jsx(Uc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:c.jsxs(c1,{"data-state":h.stateAttribute,...m,...f,ref:a,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(F_,{children:l}),c.jsx(B_,{scope:r,isInside:!0,children:c.jsx(I2,{id:h.contentId,role:"tooltip",children:s||l})})]})})});kS.displayName=Yl;var CS="TooltipArrow",ES=S.forwardRef((e,a)=>{const{__scopeTooltip:r,...l}=e,s=tu(r);return H_(CS,r).isInside?null:c.jsx(u1,{...s,...l,ref:a})});ES.displayName=CS;function q_(e,a){const r=Math.abs(a.top-e.y),l=Math.abs(a.bottom-e.y),s=Math.abs(a.right-e.x),u=Math.abs(a.left-e.x);switch(Math.min(r,l,s,u)){case u:return"left";case s:return"right";case r:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function G_(e,a,r=5){const l=[];switch(a){case"top":l.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":l.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":l.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":l.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return l}function $_(e){const{top:a,right:r,bottom:l,left:s}=e;return[{x:s,y:a},{x:r,y:a},{x:r,y:l},{x:s,y:l}]}function Y_(e,a){const{x:r,y:l}=e;let s=!1;for(let u=0,d=a.length-1;u<a.length;d=u++){const f=a[u],h=a[d],m=f.x,y=f.y,g=h.x,v=h.y;y>l!=v>l&&r<(g-m)*(l-y)/(v-y)+m&&(s=!s)}return s}function V_(e){const a=e.slice();return a.sort((r,l)=>r.x<l.x?-1:r.x>l.x?1:r.y<l.y?-1:r.y>l.y?1:0),K_(a)}function K_(e){if(e.length<=1)return e.slice();const a=[];for(let l=0;l<e.length;l++){const s=e[l];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(s.y-d.y)>=(u.y-d.y)*(s.x-d.x))a.pop();else break}a.push(s)}a.pop();const r=[];for(let l=e.length-1;l>=0;l--){const s=e[l];for(;r.length>=2;){const u=r[r.length-1],d=r[r.length-2];if((u.x-d.x)*(s.y-d.y)>=(u.y-d.y)*(s.x-d.x))r.pop();else break}r.push(s)}return r.pop(),a.length===1&&r.length===1&&a[0].x===r[0].x&&a[0].y===r[0].y?a:a.concat(r)}var X_=vS,Q_=bS,Z_=SS,J_=wS,W_=kS,eR=ES;const tR=(e,a)=>{const r=new Array(e.length+a.length);for(let l=0;l<e.length;l++)r[l]=e[l];for(let l=0;l<a.length;l++)r[e.length+l]=a[l];return r},nR=(e,a)=>({classGroupId:e,validator:a}),NS=(e=new Map,a=null,r)=>({nextPart:e,validators:a,classGroupId:r}),kc="-",zv=[],aR="arbitrary..",rR=e=>{const a=iR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return lR(d);const f=d.split(kc),h=f[0]===""&&f.length>1?1:0;return AS(f,h,a)},getConflictingClassGroupIds:(d,f)=>{if(f){const h=l[d],m=r[d];return h?m?tR(m,h):h:m||zv}return r[d]||zv}}},AS=(e,a,r)=>{if(e.length-a===0)return r.classGroupId;const s=e[a],u=r.nextPart.get(s);if(u){const m=AS(e,a+1,u);if(m)return m}const d=r.validators;if(d===null)return;const f=a===0?e.join(kc):e.slice(a).join(kc),h=d.length;for(let m=0;m<h;m++){const y=d[m];if(y.validator(f))return y.classGroupId}},lR=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=e.slice(1,-1),r=a.indexOf(":"),l=a.slice(0,r);return l?aR+l:void 0})(),iR=e=>{const{theme:a,classGroups:r}=e;return sR(r,a)},sR=(e,a)=>{const r=NS();for(const l in e){const s=e[l];bm(s,r,l,a)}return r},bm=(e,a,r,l)=>{const s=e.length;for(let u=0;u<s;u++){const d=e[u];oR(d,a,r,l)}},oR=(e,a,r,l)=>{if(typeof e=="string"){cR(e,a,r);return}if(typeof e=="function"){uR(e,a,r,l);return}dR(e,a,r,l)},cR=(e,a,r)=>{const l=e===""?a:TS(a,e);l.classGroupId=r},uR=(e,a,r,l)=>{if(fR(e)){bm(e(l),a,r,l);return}a.validators===null&&(a.validators=[]),a.validators.push(nR(r,e))},dR=(e,a,r,l)=>{const s=Object.entries(e),u=s.length;for(let d=0;d<u;d++){const[f,h]=s[d];bm(h,TS(a,f),r,l)}},TS=(e,a)=>{let r=e;const l=a.split(kc),s=l.length;for(let u=0;u<s;u++){const d=l[u];let f=r.nextPart.get(d);f||(f=NS(),r.nextPart.set(d,f)),r=f}return r},fR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let a=0,r=Object.create(null),l=Object.create(null);const s=(u,d)=>{r[u]=d,a++,a>e&&(a=0,l=r,r=Object.create(null))};return{get(u){let d=r[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return s(u,d),d},set(u,d){u in r?r[u]=d:s(u,d)}}},Eh="!",Lv=":",mR=[],Pv=(e,a,r,l,s)=>({modifiers:e,hasImportantModifier:a,baseClassName:r,maybePostfixModifierPosition:l,isExternal:s}),pR=e=>{const{prefix:a,experimentalParseClassName:r}=e;let l=s=>{const u=[];let d=0,f=0,h=0,m;const y=s.length;for(let C=0;C<y;C++){const E=s[C];if(d===0&&f===0){if(E===Lv){u.push(s.slice(h,C)),h=C+1;continue}if(E==="/"){m=C;continue}}E==="["?d++:E==="]"?d--:E==="("?f++:E===")"&&f--}const g=u.length===0?s:s.slice(h);let v=g,b=!1;g.endsWith(Eh)?(v=g.slice(0,-1),b=!0):g.startsWith(Eh)&&(v=g.slice(1),b=!0);const k=m&&m>h?m-h:void 0;return Pv(u,b,v,k)};if(a){const s=a+Lv,u=l;l=d=>d.startsWith(s)?u(d.slice(s.length)):Pv(mR,!1,d,void 0,!0)}if(r){const s=l;l=u=>r({className:u,parseClassName:s})}return l},gR=e=>{const a=new Map;return e.orderSensitiveModifiers.forEach((r,l)=>{a.set(r,1e6+l)}),r=>{const l=[];let s=[];for(let u=0;u<r.length;u++){const d=r[u],f=d[0]==="[",h=a.has(d);f||h?(s.length>0&&(s.sort(),l.push(...s),s=[]),l.push(d)):s.push(d)}return s.length>0&&(s.sort(),l.push(...s)),l}},xR=e=>({cache:hR(e.cacheSize),parseClassName:pR(e),sortModifiers:gR(e),...rR(e)}),yR=/\s+/,vR=(e,a)=>{const{parseClassName:r,getClassGroupId:l,getConflictingClassGroupIds:s,sortModifiers:u}=a,d=[],f=e.trim().split(yR);let h="";for(let m=f.length-1;m>=0;m-=1){const y=f[m],{isExternal:g,modifiers:v,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:C}=r(y);if(g){h=y+(h.length>0?" "+h:h);continue}let E=!!C,j=l(E?k.substring(0,C):k);if(!j){if(!E){h=y+(h.length>0?" "+h:h);continue}if(j=l(k),!j){h=y+(h.length>0?" "+h:h);continue}E=!1}const R=v.length===0?"":v.length===1?v[0]:u(v).join(":"),O=b?R+Eh:R,_=O+j;if(d.indexOf(_)>-1)continue;d.push(_);const U=s(j,E);for(let M=0;M<U.length;++M){const L=U[M];d.push(O+L)}h=y+(h.length>0?" "+h:h)}return h},bR=(...e)=>{let a=0,r,l,s="";for(;a<e.length;)(r=e[a++])&&(l=_S(r))&&(s&&(s+=" "),s+=l);return s},_S=e=>{if(typeof e=="string")return e;let a,r="";for(let l=0;l<e.length;l++)e[l]&&(a=_S(e[l]))&&(r&&(r+=" "),r+=a);return r},SR=(e,...a)=>{let r,l,s,u;const d=h=>{const m=a.reduce((y,g)=>g(y),e());return r=xR(m),l=r.cache.get,s=r.cache.set,u=f,f(h)},f=h=>{const m=l(h);if(m)return m;const y=vR(h,r);return s(h,y),y};return u=d,(...h)=>u(bR(...h))},wR=[],Pt=e=>{const a=r=>r[e]||wR;return a.isThemeGetter=!0,a},RS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,MS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CR=/\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$/,ER=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sr=e=>kR.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),or=e=>!!e&&Number.isInteger(Number(e)),Yf=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Ra=e=>jR.test(e),OS=()=>!0,TR=e=>CR.test(e)&&!ER.test(e),Sm=()=>!1,_R=e=>NR.test(e),RR=e=>AR.test(e),MR=e=>!ye(e)&&!ve(e),OR=e=>yr(e,LS,Sm),ye=e=>RS.test(e),Ir=e=>yr(e,PS,TR),Uv=e=>yr(e,HR,Be),DR=e=>yr(e,IS,OS),zR=e=>yr(e,US,Sm),Iv=e=>yr(e,DS,Sm),LR=e=>yr(e,zS,RR),tc=e=>yr(e,BS,_R),ve=e=>MS.test(e),Qi=e=>Vr(e,PS),PR=e=>Vr(e,US),Bv=e=>Vr(e,DS),UR=e=>Vr(e,LS),IR=e=>Vr(e,zS),nc=e=>Vr(e,BS,!0),BR=e=>Vr(e,IS,!0),yr=(e,a,r)=>{const l=RS.exec(e);return l?l[1]?a(l[1]):r(l[2]):!1},Vr=(e,a,r=!1)=>{const l=MS.exec(e);return l?l[1]?a(l[1]):r:!1},DS=e=>e==="position"||e==="percentage",zS=e=>e==="image"||e==="url",LS=e=>e==="length"||e==="size"||e==="bg-size",PS=e=>e==="length",HR=e=>e==="number",US=e=>e==="family-name",IS=e=>e==="number"||e==="weight",BS=e=>e==="shadow",FR=()=>{const e=Pt("color"),a=Pt("font"),r=Pt("text"),l=Pt("font-weight"),s=Pt("tracking"),u=Pt("leading"),d=Pt("breakpoint"),f=Pt("container"),h=Pt("spacing"),m=Pt("radius"),y=Pt("shadow"),g=Pt("inset-shadow"),v=Pt("text-shadow"),b=Pt("drop-shadow"),k=Pt("blur"),C=Pt("perspective"),E=Pt("aspect"),j=Pt("ease"),R=Pt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[..._(),ve,ye],M=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],F=()=>[ve,ye,h],Y=()=>[sr,"full","auto",...F()],P=()=>[or,"none","subgrid",ve,ye],W=()=>["auto",{span:["full",or,ve,ye]},or,ve,ye],ee=()=>[or,"auto",ve,ye],fe=()=>["auto","min","max","fr",ve,ye],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...F()],$=()=>[sr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],X=()=>[sr,"screen","full","dvw","lvw","svw","min","max","fit",...F()],G=()=>[sr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],A=()=>[e,ve,ye],D=()=>[..._(),Bv,Iv,{position:[ve,ye]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",UR,OR,{size:[ve,ye]}],oe=()=>[Yf,Qi,Ir],ce=()=>["","none","full",m,ve,ye],ue=()=>["",Be,Qi,Ir],ge=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[Be,Yf,Bv,Iv],vt=()=>["","none",k,ve,ye],rt=()=>["none",Be,ve,ye],ie=()=>["none",Be,ve,ye],jt=()=>[Be,ve,ye],je=()=>[sr,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ra],breakpoint:[Ra],color:[OS],container:[Ra],"drop-shadow":[Ra],ease:["in","out","in-out"],font:[MR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ra],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ra],shadow:[Ra],spacing:["px",Be],text:[Ra],"text-shadow":[Ra],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sr,ye,ve,E]}],container:["container"],columns:[{columns:[Be,ye,ve,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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"],sr:["sr-only","not-sr-only"],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:U()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[or,"auto",ve,ye]}],basis:[{basis:[sr,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,sr,"auto","initial","none",ye]}],grow:[{grow:["",Be,ve,ye]}],shrink:[{shrink:["",Be,ve,ye]}],order:[{order:[or,"first","last","none",ve,ye]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,Qi,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,BR,DR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yf,ye]}],"font-family":[{font:[PR,zR,a]}],"font-features":[{"font-features":[ye]}],"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:[s,ve,ye]}],"line-clamp":[{"line-clamp":[Be,"none",ve,Uv]}],leading:[{leading:[u,...F()]}],"list-image":[{"list-image":["none",ve,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",ve,Ir]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Be,"auto",ve,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},or,ve,ye],radial:["",ve,ye],conic:[or,ve,ye]},IR,LR]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,ve,ye]}],"outline-w":[{outline:["",Be,Qi,Ir]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,nc,tc]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,nc,tc]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Be,Ir]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",v,nc,tc]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Be,ve,ye]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[ve,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,ye]}],filter:[{filter:["","none",ve,ye]}],blur:[{blur:vt()}],brightness:[{brightness:[Be,ve,ye]}],contrast:[{contrast:[Be,ve,ye]}],"drop-shadow":[{"drop-shadow":["","none",b,nc,tc]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Be,ve,ye]}],"hue-rotate":[{"hue-rotate":[Be,ve,ye]}],invert:[{invert:["",Be,ve,ye]}],saturate:[{saturate:[Be,ve,ye]}],sepia:[{sepia:["",Be,ve,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,ye]}],"backdrop-blur":[{"backdrop-blur":vt()}],"backdrop-brightness":[{"backdrop-brightness":[Be,ve,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Be,ve,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,ve,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,ve,ye]}],"backdrop-invert":[{"backdrop-invert":["",Be,ve,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Be,ve,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Be,ve,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,ve,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",ve,ye]}],ease:[{ease:["linear","initial",j,ve,ye]}],delay:[{delay:[Be,ve,ye]}],animate:[{animate:["none",R,ve,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ve,ye]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:rt()}],"rotate-x":[{"rotate-x":rt()}],"rotate-y":[{"rotate-y":rt()}],"rotate-z":[{"rotate-z":rt()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:jt()}],"skew-x":[{"skew-x":jt()}],"skew-y":[{"skew-y":jt()}],transform:[{transform:[ve,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",ve,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",ve,ye]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Be,Qi,Ir,Uv]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qR=SR(FR);function be(...e){return qR(Xb(e))}const GR=Dc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:e,variant:a="default",size:r="default",asChild:l=!1,...s}){const u=l?Lc:"button";return c.jsx(u,{"data-slot":"button","data-variant":a,"data-size":r,className:be(GR({variant:a,size:r,className:e})),...s})}const HS=(...e)=>e.filter((a,r,l)=>!!a&&a.trim()!==""&&l.indexOf(a)===r).join(" ").trim();const $R=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const YR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,l)=>l?l.toUpperCase():r.toLowerCase());const Hv=e=>{const a=YR(e);return a.charAt(0).toUpperCase()+a.slice(1)};var VR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const KR=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};const XR=S.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:s="",children:u,iconNode:d,...f},h)=>S.createElement("svg",{ref:h,...VR,width:a,height:a,stroke:e,strokeWidth:l?Number(r)*24/Number(a):r,className:HS("lucide",s),...!u&&!KR(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,y])=>S.createElement(m,y)),...Array.isArray(u)?u:[u]]));const Ce=(e,a)=>{const r=S.forwardRef(({className:l,...s},u)=>S.createElement(XR,{ref:u,iconNode:a,className:HS(`lucide-${$R(Hv(e))}`,`lucide-${e}`,l),...s}));return r.displayName=Hv(e),r};const QR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],ZR=Ce("activity",QR);const JR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],WR=Ce("arrow-left",JR);const eM=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],FS=Ce("book-open",eM);const tM=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],qS=Ce("brain",tM);const nM=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],aM=Ce("calendar-clock",nM);const rM=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],lM=Ce("calendar",rM);const iM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],GS=Ce("check",iM);const sM=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],wm=Ce("chevron-left",sM);const oM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xr=Ce("chevron-right",oM);const cM=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],uM=Ce("cloud",cM);const dM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Fv=Ce("copy",dM);const fM=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],$S=Ce("cpu",fM);const hM=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],mM=Ce("credit-card",hM);const pM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],gM=Ce("download",pM);const xM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],yM=Ce("ellipsis-vertical",xM);const vM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],bM=Ce("ellipsis",vM);const SM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],YS=Ce("external-link",SM);const wM=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],kM=Ce("eye-off",wM);const jM=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],CM=Ce("eye",jM);const EM=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],NM=Ce("facebook",EM);const AM=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],km=Ce("file-text",AM);const TM=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],_M=Ce("folder-kanban",TM);const RM=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],MM=Ce("folder-open",RM);const OM=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],DM=Ce("github",OM);const zM=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],VS=Ce("hard-drive",zM);const LM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],PM=Ce("history",LM);const UM=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],IM=Ce("image-plus",UM);const BM=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],HM=Ce("layout-dashboard",BM);const FM=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],qM=Ce("layout-grid",FM);const GM=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],$M=Ce("layout-template",GM);const YM=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],VM=Ce("lightbulb",YM);const KM=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],XM=Ce("link-2",KM);const QM=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],ZM=Ce("list-todo",QM);const JM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],jc=Ce("loader-circle",JM);const WM=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],eO=Ce("lock",WM);const tO=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],nO=Ce("mail",tO);const aO=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Nh=Ce("message-circle",aO);const rO=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],lO=Ce("message-square",rO);const iO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],sO=Ce("panel-left",iO);const oO=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],cO=Ce("pen-tool",oO);const uO=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],dO=Ce("play",uO);const fO=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],hO=Ce("plug",fO);const mO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pO=Ce("plus",mO);const gO=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],xO=Ce("power",gO);const yO=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],vO=Ce("presentation",yO);const bO=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],KS=Ce("puzzle",bO);const SO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],qv=Ce("search",SO);const wO=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],kO=Ce("send",wO);const jO=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],XS=Ce("settings-2",jO);const CO=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],EO=Ce("share-2",CO);const NO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]],AO=Ce("sheet",NO);const TO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Gv=Ce("shield-alert",TO);const _O=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],RO=Ce("square-check-big",_O);const MO=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],QS=Ce("trash-2",MO);const OO=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],DO=Ce("user",OO);const zO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],LO=Ce("users",zO);const PO=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],UO=Ce("video",PO);const IO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cc=Ce("x",IO);const BO=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],HO=Ce("zap",BO),Vf=768;function FO(){const[e,a]=S.useState(void 0);return S.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Vf-1}px)`),l=()=>{a(window.innerWidth<Vf)};return r.addEventListener("change",l),a(window.innerWidth<Vf),()=>r.removeEventListener("change",l)},[]),!!e}function Xt({className:e,type:a,...r}){return c.jsx("input",{type:a,"data-slot":"input",className:be("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}function nu({...e}){return c.jsx(A0,{"data-slot":"sheet",...e})}function qO({...e}){return c.jsx(T0,{"data-slot":"sheet-portal",...e})}function GO({className:e,...a}){return c.jsx(_0,{"data-slot":"sheet-overlay",className:be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function au({className:e,children:a,side:r="right",showCloseButton:l=!0,...s}){return c.jsxs(qO,{children:[c.jsx(GO,{}),c.jsxs(R0,{"data-slot":"sheet-content",className:be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...s,children:[a,l&&c.jsxs(D0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[c.jsx(Cc,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ru({className:e,...a}){return c.jsx("div",{"data-slot":"sheet-header",className:be("flex flex-col gap-1.5 p-4",e),...a})}function lu({className:e,...a}){return c.jsx(M0,{"data-slot":"sheet-title",className:be("text-foreground font-semibold",e),...a})}function iu({className:e,...a}){return c.jsx(O0,{"data-slot":"sheet-description",className:be("text-muted-foreground text-sm",e),...a})}function $O({delayDuration:e=0,...a}){return c.jsx(X_,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function YO({...e}){return c.jsx(Q_,{"data-slot":"tooltip",...e})}function VO({...e}){return c.jsx(Z_,{"data-slot":"tooltip-trigger",...e})}function KO({className:e,sideOffset:a=0,children:r,...l}){return c.jsx(J_,{children:c.jsxs(W_,{"data-slot":"tooltip-content",sideOffset:a,className:be("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...l,children:[r,c.jsx(eR,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const XO="sidebar_state",QO=3600*24*7,ZO="16rem",JO="18rem",WO="3rem",e4="b",ZS=S.createContext(null);function su(){const e=S.useContext(ZS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function t4({defaultOpen:e=!0,open:a,onOpenChange:r,className:l,style:s,children:u,...d}){const f=FO(),[h,m]=S.useState(!1),[y,g]=S.useState(e),v=a??y,b=S.useCallback(j=>{const R=typeof j=="function"?j(v):j;r?r(R):g(R),document.cookie=`${XO}=${R}; path=/; max-age=${QO}`},[r,v]),k=S.useCallback(()=>f?m(j=>!j):b(j=>!j),[f,b,m]);S.useEffect(()=>{const j=R=>{R.key===e4&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),k())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[k]);const C=v?"expanded":"collapsed",E=S.useMemo(()=>({state:C,open:v,setOpen:b,isMobile:f,openMobile:h,setOpenMobile:m,toggleSidebar:k}),[C,v,b,f,h,m,k]);return c.jsx(ZS.Provider,{value:E,children:c.jsx($O,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ZO,"--sidebar-width-icon":WO,...s},className:be("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",l),...d,children:u})})})}function n4({side:e="left",variant:a="sidebar",collapsible:r="offcanvas",className:l,children:s,...u}){const{isMobile:d,state:f,openMobile:h,setOpenMobile:m}=su();return r==="none"?c.jsx("div",{"data-slot":"sidebar",className:be("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),...u,children:s}):d?c.jsx(nu,{open:h,onOpenChange:m,...u,children:c.jsxs(au,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":JO},side:e,children:[c.jsxs(ru,{className:"sr-only",children:[c.jsx(lu,{children:"Sidebar"}),c.jsx(iu,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?r:"","data-variant":a,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:be("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:be("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...u,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function a4({className:e,onClick:a,...r}){const{toggleSidebar:l}=su();return c.jsxs(pe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:be("size-7",e),onClick:s=>{a?.(s),l()},...r,children:[c.jsx(sO,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function r4({className:e,...a}){const{toggleSidebar:r}=su();return c.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:be("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...a})}function l4({className:e,...a}){return c.jsx("main",{"data-slot":"sidebar-inset",className:be("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...a})}function i4({className:e,...a}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:be("flex flex-col gap-2 p-2",e),...a})}function s4({className:e,...a}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:be("flex flex-col gap-2 p-2",e),...a})}function o4({className:e,...a}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:be("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...a})}function c4({className:e,...a}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:be("relative flex w-full min-w-0 flex-col p-2",e),...a})}function u4({className:e,asChild:a=!1,...r}){const l=a?Lc:"div";return c.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:be("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function Kf({className:e,...a}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:be("flex w-full min-w-0 flex-col gap-1",e),...a})}function Xf({className:e,...a}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:be("group/menu-item relative",e),...a})}const d4=Dc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Qf({asChild:e=!1,isActive:a=!1,variant:r="default",size:l="default",tooltip:s,className:u,...d}){const f=e?Lc:"button",{isMobile:h,state:m}=su(),y=c.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":a,className:be(d4({variant:r,size:l}),u),...d});return s?(typeof s=="string"&&(s={children:s}),c.jsxs(YO,{children:[c.jsx(VO,{asChild:!0,children:y}),c.jsx(KO,{side:"right",align:"center",hidden:m!=="collapsed"||h,...s})]})):y}const f4=[{page:"chat",label:"AI Chat",icon:lO},{page:"skills",label:"Skills",icon:FS},{page:"integrations",label:"Integrations",icon:hO},{page:"jobs",label:"Jobs",icon:aM},{page:"settings",label:"Settings",icon:XS}];function h4({activePage:e,onNavigate:a,...r}){return c.jsxs(n4,{collapsible:"icon",...r,children:[c.jsx(i4,{children:c.jsx(Kf,{children:c.jsx(Xf,{children:c.jsxs(Qf,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[c.jsxs("div",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center overflow-hidden rounded-lg p-1",children:[c.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain dark:hidden","aria-hidden":!0}),c.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain hidden dark:block","aria-hidden":!0})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:"Sulala Agent"}),c.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Local AI orchestration"})]})]})})})}),c.jsx(o4,{children:c.jsxs(c4,{children:[c.jsx(u4,{children:"Main"}),c.jsx(Kf,{children:f4.map(l=>c.jsx(Xf,{children:c.jsxs(Qf,{tooltip:l.label,isActive:e===l.page,onClick:()=>a(l.page),children:[c.jsx(l.icon,{className:"size-4"}),c.jsx("span",{children:l.label})]})},l.page))})]})}),c.jsx(s4,{children:c.jsx(Kf,{children:c.jsx(Xf,{children:c.jsx(Qf,{size:"lg",className:"text-muted-foreground cursor-default",children:c.jsx("span",{className:"truncate text-xs",children:"127.0.0.1"})})})})}),c.jsx(r4,{})]})}const JS="sulala-theme";function m4(){if(typeof window>"u")return"light";const e=localStorage.getItem(JS);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function p4(e){if(typeof document>"u")return;const a=document.documentElement;e==="dark"?a.classList.add("dark"):a.classList.remove("dark")}function g4(){const[e,a]=S.useState(m4);return S.useEffect(()=>{p4(e),localStorage.setItem(JS,e)},[e]),{theme:e,setTheme:s=>{a(u=>typeof s=="function"?s(u):s)},toggle:()=>a(s=>s==="dark"?"light":"dark")}}function x4({activePage:e,onNavigate:a,error:r,children:l}){const{theme:s,toggle:u}=g4();return c.jsxs(t4,{children:[c.jsx(h4,{activePage:e,onNavigate:a}),c.jsxs(l4,{children:[c.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b px-4",children:[c.jsx(a4,{className:"-ml-1"}),c.jsx("div",{className:"flex-1"}),c.jsx(pe,{variant:"outline",size:"sm",onClick:u,"aria-label":"Toggle theme",children:s==="dark"?"Light":"Dark"})]}),c.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4 md:p-6",children:[r&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-2 text-sm text-destructive",children:r}),l]})]})]})}const Se="http://127.0.0.1:2026",$v="https://hub.sulala.ai".trim?.()||null,y4="http://localhost:1717";function ke(e={}){return{"Content-Type":"application/json",...e}}async function WS(){const e=await fetch(`${Se}/api/schedules`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch schedules: ${e.status}`);return e.json()}async function ew(e){const a=await fetch(`${Se}/api/schedules`,{method:"POST",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Create schedule failed: ${a.status}`)}return a.json()}async function tw(e,a){const r=await fetch(`${Se}/api/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:ke(),body:JSON.stringify(a)});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Update schedule failed: ${r.status}`)}return r.json()}async function nw(e){const a=await fetch(`${Se}/api/schedules/${encodeURIComponent(e)}`,{method:"DELETE",headers:ke()});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Delete schedule failed: ${a.status}`)}}async function aw(e){const a=await fetch(`${Se}/api/schedules/${encodeURIComponent(e)}/run`,{method:"POST",headers:ke()});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Run job failed: ${a.status}`)}return a.json()}async function rw(){const e=await fetch(`${Se}/api/channels/telegram`,{headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Fetch Telegram channel failed: ${e.status}`)}return e.json()}async function lw(e){const a=await fetch(`${Se}/api/channels/telegram`,{method:"PUT",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Update Telegram channel failed: ${a.status}`)}return a.json()}async function iw(){const e=await fetch(`${Se}/api/channels/discord`,{headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Fetch Discord channel failed: ${e.status}`)}return e.json()}async function sw(e){const a=await fetch(`${Se}/api/channels/discord`,{method:"PUT",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Update Discord channel failed: ${a.status}`)}return a.json()}async function ow(){const e=await fetch(`${Se}/api/channels/stripe`,{headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Fetch Stripe channel failed: ${e.status}`)}return e.json()}async function cw(e){const a=await fetch(`${Se}/api/channels/stripe`,{method:"PUT",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Update Stripe channel failed: ${a.status}`)}return a.json()}async function uw(e,a=30){const r=await fetch(`${Se}/api/schedules/${encodeURIComponent(e)}/runs?limit=${a}`,{headers:ke()});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Fetch runs failed: ${r.status}`)}return r.json()}async function jm(){const e=await fetch(`${Se}/api/onboard/status`,{headers:ke()});return e.ok?e.json():{complete:!1}}async function dw(){const e=await fetch(`${Se}/api/onboard/complete`,{method:"PUT",headers:ke()});if(!e.ok)throw new Error(`Failed to complete onboarding: ${e.status}`);return e.json()}async function Da(){const e=await fetch(`${Se}/api/onboard/env`,{headers:ke()});return e.ok?e.json():{keys:{}}}async function Jl(e){const a=await fetch(`${Se}/api/onboard/env`,{method:"PUT",headers:ke(),body:JSON.stringify(e)});if(!a.ok)throw new Error(`Failed to save API keys: ${a.status}`);return a.json()}async function fw(){const e=await fetch(`${Se}/api/onboard/recommended-models`,{headers:ke()});return e.ok?e.json():{models:[]}}async function hw(e){const a=await fetch(`${Se}/api/ollama/pull`,{method:"POST",headers:ke(),body:JSON.stringify({model:e})});if(!a.ok)throw new Error(`Failed to pull model: ${a.status}`);return a.json()}async function mw(){const e=await fetch(`${Se}/health`,{headers:ke()});if(!e.ok)throw new Error(`Gateway health check failed: ${e.status}`);return e.json()}async function pw(e=50){const a=await fetch(`${Se}/api/tasks?limit=${e}`,{headers:ke()});if(!a.ok)throw new Error(`Failed to fetch tasks: ${a.status}`);return a.json()}async function gw(e=100){const a=await fetch(`${Se}/api/logs?limit=${e}`,{headers:ke()});if(!a.ok)throw new Error(`Failed to fetch logs: ${a.status}`);return a.json()}async function xw(e=200){const a=await fetch(`${Se}/api/file-states?limit=${e}`,{headers:ke()});if(!a.ok)throw new Error(`Failed to fetch file states: ${a.status}`);return a.json()}async function yw(e){const a=await fetch(`${Se}/api/tasks`,{method:"POST",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Failed to enqueue task: ${a.status}`)}return a.json()}function vw(){const e=new URL(Se);return e.protocol=e.protocol==="https:"?"wss:":"ws:",`${e.origin}/ws`}async function ws(e){const a=await fetch(`${Se}/api/agent/models?provider=${encodeURIComponent(e)}`,{headers:ke()});if(!a.ok)throw new Error(`Failed to fetch models: ${a.status}`);return a.json()}async function bw(e){const a=e?`?session_id=${encodeURIComponent(e)}`:"",r=await fetch(`${Se}/api/agent/pending-actions${a}`,{headers:ke()});if(!r.ok)throw new Error(`Failed to fetch pending actions: ${r.status}`);return r.json()}async function Sw(e){const a=await fetch(`${Se}/api/agent/pending-actions/${encodeURIComponent(e)}/approve`,{method:"POST",headers:ke()});if(!a.ok)throw new Error(`Failed to approve: ${a.status}`);return a.json()}async function ww(e){const a=await fetch(`${Se}/api/agent/pending-actions/${encodeURIComponent(e)}/reject`,{method:"POST",headers:ke()});if(!a.ok)throw new Error(`Failed to reject: ${a.status}`);return a.json()}function Cm(e){return(e?.trim()||y4).replace(/\/$/,"")}async function Ah(e){const a=Cm(e),r=await fetch(`${a}/integrations`,{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch integrations: ${r.status}`);return{integrations:((await r.json()).integrations??[]).map(d=>{if(typeof d!="object"||d===null||!("id"in d)||typeof d.id!="string")return{id:"unknown",name:"Unknown",iconUrl:"",description:"",connections:[]};const f=d,h=Array.isArray(f.connections)?f.connections.map(m=>{const y=m;return{id:String(y?.id??""),provider:String(y?.provider??""),scopes:Array.isArray(y?.scopes)?y.scopes:[],createdAt:Number(y?.createdAt??0),updatedAt:y?.updatedAt!=null?Number(y.updatedAt):void 0}}):[];return{id:f.id,name:typeof f.name=="string"?f.name:f.id,iconUrl:typeof f.iconUrl=="string"?f.iconUrl:"",description:typeof f.description=="string"?f.description:"",connections:h}})}}async function kw(e,a,r){const l=Cm(r),s=await fetch(`${l}/connect/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirect_success:a})});if(!s.ok){const u=await s.json().catch(()=>({}));throw new Error(u.error||`Connect failed: ${s.status}`)}return s.json()}async function jw(e,a){const r=Cm(a),l=await fetch(`${r}/connections/${encodeURIComponent(e)}`,{method:"DELETE"});if(!l.ok)throw new Error(`Failed to disconnect: ${l.status}`);return l.json()}async function vr(){const e=await fetch(`${Se}/api/config`,{headers:ke(),cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch config: ${e.status}`);return e.json()}async function ou(e){const a=e?.trim()?`?return_to=${encodeURIComponent(e.trim())}`:"",r=await fetch(`${Se}/api/oauth/connect-url${a}`,{headers:ke(),cache:"no-store"});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Failed to get Connect URL: ${r.status}`)}return r.json()}async function Cw(){const e=await fetch(`${Se}/api/integrations/connections`,{headers:ke(),cache:"no-store"});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch Portal connections: ${e.status}`)}return{connections:(await e.json()).connections??[]}}async function Ew(e,a){const r=await fetch(`${Se}/api/integrations/connect`,{method:"POST",headers:ke(),body:JSON.stringify({provider:e,redirect_success:a})});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error||`Connect failed: ${r.status}`)}const l=await r.json();if(!l.authUrl)throw new Error("No authUrl from agent");return{authUrl:l.authUrl,connectionId:l.connectionId??null}}async function Nw(e){const a=await fetch(`${Se}/api/integrations/connections/${encodeURIComponent(e)}`,{method:"DELETE",headers:ke()});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Disconnect failed: ${a.status}`)}return a.json()}async function Aw(){const e=await fetch(`${Se}/api/settings/job-default`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch job default: ${e.status}`);return e.json()}async function Tw(e){const a=await fetch(`${Se}/api/settings/job-default`,{method:"PUT",headers:ke(),body:JSON.stringify(e)});if(!a.ok)throw new Error(`Failed to update job default: ${a.status}`);return a.json()}async function Vl(){const e=await fetch(`${Se}/api/ollama/status`,{headers:ke()});return e.ok?e.json():{running:!1}}async function _w(){const e=await fetch(`${Se}/api/system/capabilities`,{headers:ke()});return e.ok?e.json():{storageFreeBytes:null,isCloudOrContainer:!1,cloudReason:"",ollamaSuitable:!0,ollamaSuitableReason:"Check unavailable"}}async function Rw(){const e=await fetch(`${Se}/api/ollama/install`,{method:"POST",headers:ke()});if(!e.ok)throw new Error(`Install failed: ${e.status}`);return e.json()}async function Mw(){const e=await fetch(`${Se}/api/ollama/pull-status`,{headers:ke()});return e.ok?e.json():{inProgress:!1,model:"",lastLine:"",percent:0}}async function Ow(e){const a=await fetch(`${Se}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:ke(),body:JSON.stringify({action:"cancel"})});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Cancel failed: ${a.status}`)}return a.json()}async function Dw(e){const a=await fetch(`${Se}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:ke(),body:JSON.stringify({action:"retry"})});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Retry failed: ${a.status}`)}return a.json()}async function ns(){const e=await fetch(`${Se}/api/agent/skills/config`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch skills config: ${e.status}`);return e.json()}async function fc(e){const a=await fetch(`${Se}/api/agent/skills/config`,{method:"PUT",headers:ke(),body:JSON.stringify({skills:e})});if(!a.ok)throw new Error(`Failed to save skills config: ${a.status}`);return a.json()}async function zw(){const e=await fetch(`${Se}/api/agent/skills/updates`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch updates: ${e.status}`);return e.json()}function Wl(){return $v?$v.replace(/\/$/,""):null}function Hl(){const e=Wl();return e?`${e}/api/sulalahub/registry`:null}function Em(){const e=Wl();return e?`${e}/api/sulalahub/system/registry`:null}function as(e){const a=Wl();return a?`${a}/api/sulalahub/skills/${e}`:null}async function Ec(){const e=Hl(),a=e?`${Se}/api/agent/skills/registry?url=${encodeURIComponent(e)}`:`${Se}/api/agent/skills/registry`,r=await fetch(a,{headers:ke()});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Failed to fetch registry: ${r.status}`)}return r.json()}async function Th(){const e=Em();if(!e)return{skills:[]};const a=await fetch(e);if(!a.ok)throw new Error(`Failed to fetch system registry: ${a.status}`);return a.json()}async function Lw(){const e=await fetch(`${Se}/api/agent/skills/templates`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch templates: ${e.status}`);return e.json()}async function Pw(){const e=await fetch(`${Se}/api/agent/skills/update`,{method:"POST",headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Update failed: ${e.status}`)}return e.json()}async function Uw(e,a){const r=await fetch(`${Se}/api/agent/skills/uninstall`,{method:"POST",headers:ke(),body:JSON.stringify({slug:e,target:a})});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Uninstall failed: ${r.status}`)}return r.json()}async function Nc(e,a,r){const l={slug:e,target:a},s=r?.registryUrl??(r?.system?Em():null)??Hl()??void 0;s&&(l.registryUrl=s);const u=await fetch(`${Se}/api/agent/skills/install`,{method:"POST",headers:ke(),body:JSON.stringify(l)});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Install failed: ${u.status}`)}return u.json()}async function Iw(){const e=await fetch(`${Se}/api/agent/skills`,{headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Failed to fetch skills: ${e.status}`)}return e.json()}async function _h(){const a=await(await fetch(`${Se}/api/agent/skills/publish-status`,{headers:ke()})).json().catch(()=>({}));return{submissions:Array.isArray(a.submissions)?a.submissions:[]}}async function Bw(e,a){const r=await fetch(`${Se}/api/agent/skills/publish`,{method:"POST",headers:ke(),body:JSON.stringify({slug:e,priceIntent:a?.priceIntent??"free",intendedPriceCents:a?.intendedPriceCents})}),l=await r.json().catch(()=>({}));if(!r.ok)throw new Error(l.error||`Publish failed: ${r.status}`);return l}async function Hw(){const e=await fetch(`${Se}/api/agent/skills/wizard-apps`,{headers:ke()});if(!e.ok)throw new Error(`Failed to fetch wizard options: ${e.status}`);return e.json()}async function Rh(e){const a=await fetch(`${Se}/api/agent/skills/generate`,{method:"POST",headers:ke(),body:JSON.stringify(e)});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Generate failed: ${a.status}`)}return a.json()}async function Mh(e=50){const a=await fetch(`${Se}/api/agent/sessions?limit=${encodeURIComponent(String(e))}`,{headers:ke()});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Failed to list sessions: ${a.status}`)}return a.json()}async function Fw(e){const a=await fetch(`${Se}/api/agent/sessions`,{method:"POST",headers:ke(),body:JSON.stringify(e??{})});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Failed to create session: ${a.status}`)}return a.json()}async function qw(){const e=await fetch(`${Se}/api/agent/memory/scope-keys`,{headers:ke()});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Failed to fetch memory scope keys: ${e.status}`)}return e.json()}async function Gw(e){const a=new URLSearchParams;a.set("scope",e.scope),a.set("scope_key",e.scope_key),a.set("limit",String(e.limit));const r=await fetch(`${Se}/api/agent/memory?${a.toString()}`,{headers:ke()});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Failed to fetch memory: ${r.status}`)}return r.json()}async function Hr(e){const a=await fetch(`${Se}/api/agent/sessions/${encodeURIComponent(e)}`,{headers:ke()});if(!a.ok){const r=await a.json().catch(()=>({}));throw new Error(r.error||`Failed to load session: ${a.status}`)}return a.json()}async function $w(e){const a=await new Promise((l,s)=>{const u=new FileReader;u.onload=()=>{const d=u.result,f=d.includes(",")?d.slice(d.indexOf(",")+1):d;l(f)},u.onerror=()=>s(new Error("Failed to read file")),u.readAsDataURL(e)}),r=await fetch(`${Se}/api/upload`,{method:"POST",headers:ke(),body:JSON.stringify({filename:e.name,content_type:e.type,data:a})});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`Upload failed: ${r.status}`)}return r.json()}async function Yw(e,a){const r=`${Se}/api/agent/sessions/${encodeURIComponent(e)}/messages`;try{const l=await fetch(r,{method:"POST",headers:ke(),body:JSON.stringify(a)});if(!l.ok){const s=await l.json().catch(()=>({}));if(l.status===422&&s.type==="missing_integrations"&&Array.isArray(s.missing)){const d=new Error(s.error||"Missing required integrations");throw d.missing=s.missing,d}const u=s.error||`Agent request failed: ${l.status}`;throw console.error("[chat] fetchAgentSendMessage failed:",l.status,r,u),new Error(u)}return l.json()}catch(l){throw console.error("[chat] fetchAgentSendMessage fetch error:",r,l),l}}async function Oh(e,a,r){const l=`${Se}/api/agent/sessions/${encodeURIComponent(e)}/messages/stream`;let s;try{s=await fetch(l,{method:"POST",headers:ke(),body:JSON.stringify(a)})}catch(m){console.error("[chat] fetchAgentSendMessageStream fetch error:",l,m),r.onError(m instanceof Error?m.message:"Fetch failed");return}if(!s.ok){const m=await s.json().catch(()=>({}));s.status===422&&m.type==="missing_integrations"&&Array.isArray(m.missing)&&r.onMissingIntegrations?.(m.missing);const y=m.error||`Stream failed: ${s.status}`;console.error("[chat] fetchAgentSendMessageStream failed:",s.status,l,y),r.onError(y);return}const u=s.body?.getReader();if(!u){r.onError("No response body");return}const d=new TextDecoder;let f="",h="";try{for(;;){const{done:m,value:y}=await u.read();if(m)break;f+=d.decode(y,{stream:!0});const g=f.split(`
54
+ `);f=g.pop()??"";for(const v of g)if(v.startsWith("event:"))h=v.slice(6).trim();else if(v.startsWith("data:")&&h){try{const b=JSON.parse(v.slice(5).trim());h==="assistant"&&b.delta?r.onDelta(b.delta):h==="thinking"&&b.delta?r.onThinking?.(b.delta):h==="done"&&b.finalContent!=null?r.onDone(b.finalContent):h==="pending_approval"&&b.pendingActionId?r.onPendingApproval?.(b.pendingActionId):h==="error"&&b.message&&r.onError(b.message)}catch{}h=""}}if(f.trim()&&h&&f.startsWith("data:"))try{const m=JSON.parse(f.slice(5).trim());h==="done"&&m.finalContent!=null&&r.onDone(m.finalContent)}catch{}}finally{u.releaseLock()}}const v4=Object.freeze(Object.defineProperty({__proto__:null,approvePendingAction:Sw,createSchedule:ew,deleteIntegrationsConnection:jw,deletePortalConnection:Nw,deleteSchedule:nw,enqueueTask:yw,fetchAgentMemory:Gw,fetchAgentMemoryScopeKeys:qw,fetchAgentModels:ws,fetchAgentSendMessage:Yw,fetchAgentSendMessageStream:Oh,fetchAgentSession:Hr,fetchAgentSessionCreate:Fw,fetchAgentSessions:Mh,fetchAgentSkillGenerate:Rh,fetchAgentSkillInstall:Nc,fetchAgentSkillPublish:Bw,fetchAgentSkillUninstall:Uw,fetchAgentSkillWizardApps:Hw,fetchAgentSkills:Iw,fetchAgentSkillsConfig:ns,fetchAgentSkillsConfigSave:fc,fetchAgentSkillsPublishStatus:_h,fetchAgentSkillsRegistry:Ec,fetchAgentSkillsSystemRegistry:Th,fetchAgentSkillsTemplates:Lw,fetchAgentSkillsUpdate:Pw,fetchAgentSkillsUpdates:zw,fetchChannelsDiscord:iw,fetchChannelsStripe:ow,fetchChannelsTelegram:rw,fetchConfig:vr,fetchFileStates:xw,fetchHealth:mw,fetchIntegrations:Ah,fetchJobDefault:Aw,fetchLogs:gw,fetchOAuthConnectUrl:ou,fetchOllamaPullStatus:Mw,fetchOllamaStatus:Vl,fetchOnboardEnv:Da,fetchOnboardStatus:jm,fetchPendingActions:bw,fetchPortalConnections:Cw,fetchRecommendedModels:fw,fetchScheduleRuns:uw,fetchSchedules:WS,fetchSystemCapabilities:_w,fetchTasks:pw,fetchUploadFile:$w,getHubBaseUrl:Wl,getHubRegistryUrl:Hl,getHubSkillContentUrl:as,getHubSystemRegistryUrl:Em,postOllamaInstall:Rw,postOllamaPull:hw,putOnboardComplete:dw,putOnboardEnv:Jl,rejectPendingAction:ww,runScheduleJob:aw,startIntegrationsConnect:kw,startPortalConnect:Ew,taskCancel:Ow,taskRetry:Dw,updateChannelsDiscord:sw,updateChannelsStripe:cw,updateChannelsTelegram:lw,updateJobDefault:Tw,updateSchedule:tw,wsUrl:vw},Symbol.toStringTag,{value:"Module"}));function b4(e){const[a,r]=S.useState(null),[l,s]=S.useState([]),[u,d]=S.useState([]),[f,h]=S.useState([]),[m,y]=S.useState([]),[g,v]=S.useState(!0),[b,k]=S.useState("heartbeat"),[C,E]=S.useState("{}"),[j,R]=S.useState(!1),[O,_]=S.useState(null),U=async()=>{v(!0);try{const[H,z,$,X,G]=await Promise.all([mw(),pw(),gw(),xw(),WS()]);r(H),s(z.tasks),d($.logs),h(X.fileStates),y(G.schedules)}catch(H){e(H instanceof Error?H.message:"Failed to load"),r(null),s([]),d([]),h([]),y([])}finally{v(!1)}},M=S.useRef(U);return M.current=U,S.useEffect(()=>{M.current()},[]),S.useEffect(()=>{const H=setInterval(()=>M.current(),3e4);return()=>clearInterval(H)},[]),{health:a,tasks:l,logs:u,fileStates:f,schedules:m,loading:g,load:U,enqueueType:b,setEnqueueType:k,enqueuePayload:C,setEnqueuePayload:E,enqueueing:j,actionTaskId:O,handleTaskCancel:async H=>{_(H);try{await Ow(H),await U()}catch(z){e(z instanceof Error?z.message:"Cancel failed")}finally{_(null)}},handleTaskRetry:async H=>{_(H);try{await Dw(H),await U()}catch(z){e(z instanceof Error?z.message:"Retry failed")}finally{_(null)}},handleEnqueue:async()=>{R(!0);try{let H=null;try{H=C.trim()?JSON.parse(C):null}catch{e("Payload must be valid JSON");return}await yw({type:b,payload:H}),await U()}catch(H){e(H instanceof Error?H.message:"Enqueue failed")}finally{R(!1)}},handleCreateSchedule:async H=>{try{await ew(H),await U()}catch(z){e(z instanceof Error?z.message:"Create schedule failed")}},handleUpdateSchedule:async(H,z)=>{try{await tw(H,z),await U()}catch($){e($ instanceof Error?$.message:"Update schedule failed")}},handleDeleteSchedule:async H=>{try{await nw(H),await U()}catch(z){e(z instanceof Error?z.message:"Delete schedule failed")}},handleRunSchedule:async H=>aw(H),handleFetchScheduleRuns:async H=>uw(H)}}const S4=Dc("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function xt({className:e,variant:a="default",asChild:r=!1,...l}){const s=r?Lc:"span";return c.jsx(s,{"data-slot":"badge","data-variant":a,className:be(S4({variant:a}),e),...l})}function ut({className:e,...a}){return c.jsx("div",{"data-slot":"card",className:be("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function St({className:e,...a}){return c.jsx("div",{"data-slot":"card-header",className:be("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function wt({className:e,...a}){return c.jsx("div",{"data-slot":"card-title",className:be("leading-none font-semibold",e),...a})}function kt({className:e,...a}){return c.jsx("div",{"data-slot":"card-description",className:be("text-muted-foreground text-sm",e),...a})}function dt({className:e,...a}){return c.jsx("div",{"data-slot":"card-content",className:be("px-6",e),...a})}function ei({className:e,children:a,...r}){return c.jsxs(C_,{"data-slot":"scroll-area",className:be("relative",e),...r,children:[c.jsx(E_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),c.jsx(w4,{}),c.jsx(N_,{})]})}function w4({className:e,orientation:a="vertical",...r}){return c.jsx(W1,{"data-slot":"scroll-area-scrollbar",orientation:a,className:be("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:c.jsx(aS,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function ks(e){return new Date(e).toLocaleTimeString()}function Vw(e){const a=new Date(e),r=new Date;return a.getDate()===r.getDate()&&a.getMonth()===r.getMonth()&&a.getFullYear()===r.getFullYear()?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function k4({event:e}){return e.type==="connected"||e.type==="pong"?c.jsxs("div",{className:"text-muted-foreground text-sm",children:[e.type," @ ",ks(e.ts)]}):e.type==="file_event"?c.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1 text-sm",children:[c.jsx("span",{className:"font-medium",children:e.payload.event})," ",c.jsx("span",{className:"text-muted-foreground break-all",children:e.payload.path})]}):e.type==="task_done"?c.jsxs("div",{className:"text-sm",children:["Task done: ",c.jsx("span",{className:"font-mono text-xs",children:e.taskId})]}):null}function j4({health:e,loading:a,connected:r,events:l}){return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Gateway"}),c.jsx(kt,{children:"API server status"})]}),c.jsx(dt,{className:"flex items-center gap-2",children:a?c.jsx("span",{className:"text-muted-foreground text-sm",children:"Checking…"}):e?c.jsx(xt,{variant:"default",children:e.status}):c.jsx(xt,{variant:"destructive",children:"Unreachable"})})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"WebSocket"}),c.jsx(kt,{children:"Live event stream"})]}),c.jsx(dt,{className:"flex items-center gap-2",children:c.jsx(xt,{variant:r?"default":"secondary",children:r?"Connected":"Disconnected"})})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Live events"}),c.jsx(kt,{children:"File and task events from the gateway"})]}),c.jsx(dt,{children:c.jsx(ei,{className:"h-[280px] rounded-md border p-3",children:c.jsx("div",{className:"space-y-2",children:l.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:"No events yet. Change a file in a watched folder or run a task."}):l.map((s,u)=>c.jsx(k4,{event:s},u))})})})]})]})}function C4(e){const[a,r]=S.useState([]),[l,s]=S.useState(!1),[u,d]=S.useState(""),[f,h]=S.useState([]),[m,y]=S.useState(!1),[g,v]=S.useState([]),[b,k]=S.useState(!1),[C,E]=S.useState(null),[j,R]=S.useState(null),[O,_]=S.useState(null),[U,M]=S.useState(!1),[L,F]=S.useState(null),[Y,P]=S.useState("~/.sulala/config.json"),[W,ee]=S.useState(new Set),[fe,ne]=S.useState("installed"),[H,z]=S.useState([]),[$,X]=S.useState(!1),[G,A]=S.useState({}),[D,Z]=S.useState({}),T=()=>{s(!0),Iw().then(he=>r(he.skills||[])).catch(()=>r([])).finally(()=>s(!1))},oe=()=>{T(),y(!0),k(!0),ns().then(he=>{F(he.skills??null),he.configPath&&P(he.configPath)}).catch(()=>F(null)),zw().then(he=>ee(new Set(he.updates.map(ze=>ze.slug)))).catch(()=>ee(new Set)),Promise.all([Ec().then(he=>h(he.skills||[])).catch(()=>h([])),Th().then(he=>v(he.skills||[])).catch(()=>v([]))]).finally(()=>{y(!1),k(!1)}),X(!0),Lw().then(he=>z(he.templates||[])).catch(()=>z([])).finally(()=>X(!1)),_h().then(he=>{const ze={};for(const se of he.submissions)ze[se.slug]=se.status;Z(ze)}).catch(()=>Z({}))},ce=(he,ze,se)=>{const Te={};for(const Me of ze){const Tt=he[Me]??se?.[Me];typeof Tt=="string"&&Tt.trim()||(Te[Me]=`Required (${Me})`)}return{valid:Object.keys(Te).length===0,errors:Te}};return{skills:a,skillsLoading:l,skillsSearch:u,setSkillsSearch:d,registrySkills:f,registryLoading:m,systemRegistrySkills:g,systemRegistryLoading:b,installingSlug:C,publishingSlug:j,selectedHubSkill:O,setSelectedHubSkill:_,skillsUpdating:U,skillsConfig:L,skillsConfigPath:Y,skillsUpdates:W,skillsTab:fe,setSkillsTab:ne,templates:H,templatesLoading:$,visibleSecretKeys:G,setVisibleSecretKeys:A,loadSkills:T,loadSkillsData:oe,handleSkillConfigToggle:async(he,ze)=>{const se=L?.entries?.[he]??{},Te={...L,entries:{...L?.entries,[he]:{...se,enabled:ze}}};F(Te);try{const Me=await fc(Te);Me.configPath&&P(Me.configPath),T()}catch(Me){e(Me instanceof Error?Me.message:"Failed to save config")}},handleSkillEntryUpdate:(he,ze)=>{const se=L?.entries?.[he]??{};F({...L,entries:{...L?.entries,[he]:{...se,...ze}}})},handleSkillEntrySave:async(he,ze,se)=>{if(L){if(he&&ze?.length){const Te=L?.entries?.[he]??{},{valid:Me,errors:Tt}=ce(Te,ze,se);if(!Me){e(`Set required values: ${Object.keys(Tt).join(", ")}`);return}}try{await fc(L),e(null)}catch(Te){e(Te instanceof Error?Te.message:"Failed to save config")}}},handleInstallSkill:async(he,ze)=>{E(he);try{await Nc(he,ze,{system:he.startsWith("system-")}),T();const se=await ns();F(se.skills??null),se.configPath&&P(se.configPath)}catch(se){e(se instanceof Error?se.message:"Install failed")}finally{E(null)}},handleUninstallSkill:async(he,ze)=>{const se=ze==="user"?"user":"managed";try{await Uw(he,se),T();const Te=await ns();F(Te.skills??null),Te.configPath&&P(Te.configPath)}catch(Te){e(Te instanceof Error?Te.message:"Uninstall failed")}},handlePublishSkill:async(he,ze)=>{R(he);try{await Bw(he,ze),e(""),_h().then(se=>{const Te={};for(const Me of se.submissions)Te[Me.slug]=Me.status;Z(Te)}).catch(()=>{})}catch(se){throw e(se instanceof Error?se.message:"Publish failed"),se}finally{R(null)}},handleUseTemplate:async(he,ze)=>{E(he);try{await Nc(he,"workspace");const Te=(await ns()).skills??{entries:{}},Me={...Te.entries,[he]:{enabled:!0,...ze}};await fc({...Te,entries:Me}),F({...Te,entries:Me}),T()}catch(se){e(se instanceof Error?se.message:"Template setup failed")}finally{E(null)}},handleUpdateSkills:async()=>{M(!0);try{const he=await Pw();T(),he.failed.length>0&&e(`Update failed: ${he.failed.map(ze=>ze.slug).join(", ")}`)}catch(he){e(he instanceof Error?he.message:"Update failed")}finally{M(!1)}},refreshRegistry:()=>{y(!0),k(!0),Promise.all([Ec().then(he=>h(he.skills||[])).catch(()=>h([])),Th().then(he=>v(he.skills||[])).catch(()=>v([]))]).finally(()=>{y(!1),k(!1)})},validateSkillEnvConfig:ce,publishStatusMap:D}}function Kw({className:e,orientation:a="horizontal",...r}){return c.jsx(__,{"data-slot":"tabs","data-orientation":a,orientation:a,className:be("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...r})}const E4=Dc("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Xw({className:e,variant:a="default",...r}){return c.jsx(R_,{"data-slot":"tabs-list","data-variant":a,className:be(E4({variant:a}),e),...r})}function rs({className:e,...a}){return c.jsx(M_,{"data-slot":"tabs-trigger",className:be("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...a})}function xn({className:e,...a}){return c.jsx(O_,{"data-slot":"tabs-content",className:be("flex-1 outline-none",e),...a})}function js({...e}){return c.jsx(A0,{"data-slot":"dialog",...e})}function N4({...e}){return c.jsx(T0,{"data-slot":"dialog-portal",...e})}function A4({className:e,...a}){return c.jsx(_0,{"data-slot":"dialog-overlay",className:be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function Cs({className:e,children:a,showCloseButton:r=!0,...l}){return c.jsxs(N4,{children:[c.jsx(A4,{}),c.jsxs(R0,{"data-slot":"dialog-content",className:be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg max-h-[90vh] overflow-y-auto",e),...l,children:[a,r&&c.jsxs(D0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[c.jsx(Cc,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Es({className:e,...a}){return c.jsx("div",{"data-slot":"dialog-header",className:be("flex flex-col gap-1.5 text-left",e),...a})}function hs({className:e,...a}){return c.jsx("div",{"data-slot":"dialog-footer",className:be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function Ns({className:e,...a}){return c.jsx(M0,{"data-slot":"dialog-title",className:be("text-foreground font-semibold text-lg",e),...a})}function As({className:e,...a}){return c.jsx(O0,{"data-slot":"dialog-description",className:be("text-muted-foreground text-sm",e),...a})}function Nm({...e}){return c.jsx(o_,{"data-slot":"dropdown-menu",...e})}function Am({...e}){return c.jsx(c_,{"data-slot":"dropdown-menu-trigger",...e})}function Tm({className:e,sideOffset:a=4,...r}){return c.jsx(u_,{children:c.jsx(d_,{"data-slot":"dropdown-menu-content",sideOffset:a,className:be("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function fr({className:e,inset:a,variant:r="default",...l}){return c.jsx(f_,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:be("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l})}const Qw=S.forwardRef(({className:e,orientation:a="vertical",...r},l)=>c.jsx("div",{ref:l,role:"group","data-slot":"field",className:be(a==="horizontal"?"flex flex-row items-center gap-2":"flex flex-col gap-1.5",e),...r}));Qw.displayName="Field";function T4({className:e,...a}){return c.jsx("label",{"data-slot":"field-label",className:be("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a})}function _4({className:e,...a}){return c.jsx("p",{"data-slot":"field-description",className:be("text-muted-foreground text-xs",e),...a})}function R4({className:e,...a}){return c.jsx("p",{"data-slot":"field-error",role:"alert",className:be("text-destructive text-xs",e),...a})}function Wt({className:e,...a}){return c.jsx("label",{"data-slot":"label",className:be("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a})}function _m({className:e,value:a=0,...r}){return c.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"data-slot":"progress",className:be("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...r,children:c.jsx("div",{className:"bg-primary h-full rounded-full transition-[width]",style:{width:`${Math.min(100,Math.max(0,a))}%`}})})}const ls=["What should this skill do?","Which app to connect?","When should it run?","Review & create"];function M4(e){const[a,r]=S.useState({step:0,goal:"",app:"other",trigger:"manual",apps:[],triggers:[],spec:null,loading:!1,error:null}),l=S.useCallback(async()=>{try{const{apps:g,triggers:v}=await Hw();r(b=>({...b,apps:g,triggers:v}))}catch(g){r(v=>({...v,error:g instanceof Error?g.message:"Failed to load options"}))}},[]);S.useEffect(()=>{l()},[l]);const s=S.useCallback(g=>{r(v=>({...v,step:Math.max(0,Math.min(g,ls.length-1)),error:null}))},[]),u=S.useCallback(g=>{r(v=>({...v,goal:g}))},[]),d=S.useCallback(g=>{r(v=>({...v,app:g}))},[]),f=S.useCallback(g=>{r(v=>({...v,trigger:g}))},[]),h=S.useCallback(async()=>{r(g=>({...g,loading:!0,error:null}));try{const{spec:g}=await Rh({goal:a.goal,app:a.app,trigger:a.trigger,write:!1});return r(v=>({...v,spec:g,loading:!1})),g}catch(g){return r(v=>({...v,loading:!1,error:g instanceof Error?g.message:"Failed to generate preview"})),null}},[a.goal,a.app,a.trigger]),m=S.useCallback(async()=>{r(g=>({...g,loading:!0,error:null}));try{const g=await Rh({goal:a.goal,app:a.app,trigger:a.trigger,write:!0});return r(v=>({...v,loading:!1})),e?.(),g}catch(g){return r(v=>({...v,loading:!1,error:g instanceof Error?g.message:"Failed to create skill"})),null}},[a.goal,a.app,a.trigger,e]),y=S.useCallback(()=>{r({step:0,goal:"",app:"other",trigger:"manual",apps:a.apps,triggers:a.triggers,spec:null,loading:!1,error:null})},[a.apps,a.triggers]);return{state:a,setStep:s,setGoal:u,setApp:d,setTrigger:f,generatePreview:h,createSkill:m,loadApps:l,reset:y}}const Zw=S.createContext(null);function cu(){const e=S.useContext(Zw);if(!e)throw new Error("SkillWizardFlow must wrap steps");return e}function O4(){const{state:e,setGoal:a,setStep:r}=cu();return c.jsxs("div",{className:"space-y-6",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:'Describe what you want this agent to do. For example: "Summarize my important emails daily" or "Post updates to Slack when I deploy."'}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"wizard-goal",children:"What should this skill do?"}),c.jsx("textarea",{id:"wizard-goal",placeholder:"e.g. Check Gmail and summarize important emails daily",value:e.goal,onChange:l=>a(l.target.value),rows:4,className:be("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:ring-[3px] resize-none")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs(pe,{onClick:()=>r(1),disabled:!e.goal.trim(),children:["Next",c.jsx(xr,{className:"ml-1 size-4"})]})})]})}function D4(){const{state:e,setApp:a,setStep:r}=cu(),l=e.apps.length?e.apps:[{id:"gmail",label:"Gmail",envHint:"API key or connect later"},{id:"slack",label:"Slack",envHint:"Token or connect later"},{id:"notion",label:"Notion",envHint:"API key or connect later"},{id:"github",label:"GitHub",envHint:"Token or connect later"},{id:"calendar",label:"Google Calendar",envHint:"Credentials or connect later"},{id:"webhook",label:"Webhook",envHint:"Optional"},{id:"other",label:"Other",envHint:"Depends on skill"}];return c.jsxs("div",{className:"space-y-6",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"Choose the app or service this skill will use. You can add API keys or connect the app later on the Skills page."}),c.jsx("div",{className:"grid gap-2",children:l.map(s=>c.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.app===s.id?"border-primary bg-muted/50":""}`,children:[c.jsx("input",{type:"radio",name:"wizard-app",value:s.id,checked:e.app===s.id,onChange:()=>a(s.id),className:"size-4"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("span",{className:"font-medium",children:s.label}),c.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",s.envHint,")"]})]})]},s.id))}),c.jsxs("div",{className:"flex justify-between",children:[c.jsxs(pe,{variant:"outline",onClick:()=>r(0),children:[c.jsx(wm,{className:"mr-1 size-4"}),"Back"]}),c.jsxs(pe,{onClick:()=>r(2),children:["Next",c.jsx(xr,{className:"ml-1 size-4"})]})]})]})}function z4(){const{state:e,setTrigger:a,setStep:r,generatePreview:l}=cu(),s=e.triggers.length?e.triggers:[{id:"manual",label:"When I ask (manual)"},{id:"schedule",label:"On a schedule (cron)"},{id:"webhook",label:"When a webhook is called"},{id:"message",label:"When I send a message (e.g. Telegram)"}];return c.jsxs("div",{className:"space-y-6",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"When should this skill run? You can configure schedules or webhooks later in Jobs."}),c.jsx("div",{className:"grid gap-2",children:s.map(u=>c.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.trigger===u.id?"border-primary bg-muted/50":""}`,children:[c.jsx("input",{type:"radio",name:"wizard-trigger",value:u.id,checked:e.trigger===u.id,onChange:()=>a(u.id),className:"size-4"}),c.jsx("span",{className:"font-medium",children:u.label})]},u.id))}),c.jsxs("div",{className:"flex justify-between",children:[c.jsxs(pe,{variant:"outline",onClick:()=>r(1),children:[c.jsx(wm,{className:"mr-1 size-4"}),"Back"]}),c.jsxs(pe,{onClick:async()=>{await l(),r(3)},disabled:e.loading,children:[e.loading?"Generating…":"Review",c.jsx(xr,{className:"ml-1 size-4"})]})]})]})}function L4(){const{state:e,setStep:a,createSkill:r}=cu(),l=e.spec,s=async()=>{(await r())?.written};return!l&&!e.loading?c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not loaded. Go back and click Review again."}),c.jsx(pe,{variant:"outline",onClick:()=>a(2),children:"Back"})]}):c.jsxs("div",{className:"space-y-6",children:[l&&c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-2",children:[c.jsx("div",{className:"font-medium",children:l.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:l.description}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:["Slug: ",c.jsx("code",{className:"rounded bg-muted px-1",children:l.slug}),l.requiredEnv.length>0&&c.jsxs(c.Fragment,{children:[" · Required: ",l.requiredEnv.join(", ")]})]})]}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Click Create to add this skill to your workspace. You can then enable it and add API keys (or connect the app) on the Skills page."}),e.error&&c.jsx("p",{className:"text-destructive text-sm",children:e.error}),c.jsxs("div",{className:"flex justify-between",children:[c.jsxs(pe,{variant:"outline",onClick:()=>a(2),children:[c.jsx(wm,{className:"mr-1 size-4"}),"Back"]}),c.jsx(pe,{onClick:s,disabled:e.loading,children:e.loading?"Creating…":"Create skill"})]})]})}function P4({open:e,onOpenChange:a,onSuccess:r}){const l=M4(()=>{r?.(),a(!1),l.reset()}),{state:s}=l,u=Math.max(0,Math.min(s.step,ls.length-1));return c.jsx(Zw.Provider,{value:l,children:c.jsx(js,{open:e,onOpenChange:a,children:c.jsxs(Cs,{className:"w-full max-w-lg sm:max-w-xl",showCloseButton:!0,children:[c.jsxs(Es,{className:"space-y-2 pb-4 border-b",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:c.jsx(KS,{className:"size-5"})}),c.jsxs("div",{children:[c.jsx(Ns,{children:"Create a skill"}),c.jsxs(As,{children:["Step ",u+1," of ",ls.length,": ",ls[u]]})]})]}),c.jsx(_m,{value:(u+1)/ls.length*100,className:"h-2"})]}),c.jsxs("div",{className:"pt-4",children:[s.error&&c.jsx("div",{className:"mb-4 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:s.error}),u===0&&c.jsx(O4,{}),u===1&&c.jsx(D4,{}),u===2&&c.jsx(z4,{}),u===3&&c.jsx(L4,{})]})]})})})}const Yv={apiKey:"API Key",handle:"Handle",name:"Name",timezone:"Timezone"};function U4(e){const[a,r]=S.useState(!1),[l,s]=S.useState(null),[u,d]=S.useState(null),{skills:f,skillsLoading:h,skillsSearch:m,setSkillsSearch:y,registrySkills:g,registryLoading:v,systemRegistrySkills:b,systemRegistryLoading:k,installingSlug:C,publishingSlug:E,selectedHubSkill:j,setSelectedHubSkill:R,skillsUpdating:O,skillsConfig:_,skillsConfigPath:U,skillsUpdates:M,skillsTab:L,setSkillsTab:F,visibleSecretKeys:Y,setVisibleSecretKeys:P,loadSkills:W,handleSkillConfigToggle:ee,handleSkillEntryUpdate:fe,handleSkillEntrySave:ne,handleInstallSkill:H,handleUninstallSkill:z,handlePublishSkill:$,handleUseTemplate:X,handleUpdateSkills:G,refreshRegistry:A,validateSkillEnvConfig:D,templates:Z,templatesLoading:T,publishStatusMap:oe}=e;return c.jsxs(c.Fragment,{children:[c.jsxs(ut,{children:[c.jsxs(St,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"Skills"}),c.jsxs(kt,{children:["Config: ",U]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(pe,{variant:"default",size:"sm",onClick:()=>r(!0),children:[c.jsx(pO,{className:"mr-1 size-4"}),"Create skill"]}),c.jsx("input",{className:"border-input bg-background h-9 w-48 rounded-md border px-3 text-sm placeholder:text-muted-foreground",placeholder:"Search…",value:m,onChange:ce=>y(ce.target.value)}),L==="installed"||L==="myskills"?c.jsxs(c.Fragment,{children:[c.jsx(pe,{variant:"outline",size:"sm",onClick:W,disabled:h,children:h?"…":"Refresh"}),L==="installed"&&c.jsx(pe,{variant:"secondary",size:"sm",onClick:G,disabled:O,children:O?"…":"Update all"})]}):L==="templates"?c.jsx(pe,{variant:"outline",size:"sm",onClick:W,disabled:T,children:T?"…":"Refresh"}):c.jsx(pe,{variant:"outline",size:"sm",onClick:A,disabled:v,children:v?"…":"Refresh"})]})]}),c.jsx(dt,{children:c.jsxs(Kw,{value:L,onValueChange:ce=>F(ce),children:[c.jsxs(Xw,{className:"mb-4",children:[c.jsx(rs,{value:"installed",children:"Installed"}),c.jsx(rs,{value:"myskills",children:"My skills"}),c.jsx(rs,{value:"templates",children:"Templates"}),c.jsx(rs,{value:"hub",children:"From Hub"})]}),c.jsx(xn,{value:"installed",className:"mt-0",children:c.jsx(Vv,{skills:f,skillsLoading:h,skillsSearch:m,skillsConfig:_,skillsUpdates:M,visibleSecretKeys:Y,setVisibleSecretKeys:P,handleSkillConfigToggle:ee,handleSkillEntryUpdate:fe,handleSkillEntrySave:ne,handleUninstallSkill:z,onPublishOpen:(ce,ue)=>d({slug:ce,name:ue}),validateSkillEnvConfig:D,publishStatusMap:oe})}),c.jsx(xn,{value:"myskills",className:"mt-0",children:c.jsx(Vv,{skills:f.filter(ce=>ce.source==="user"),skillsLoading:h,skillsSearch:m,skillsConfig:_,skillsUpdates:M,visibleSecretKeys:Y,setVisibleSecretKeys:P,handleSkillConfigToggle:ee,handleSkillEntryUpdate:fe,handleSkillEntrySave:ne,handleUninstallSkill:z,onPublishOpen:(ce,ue)=>d({slug:ce,name:ue}),validateSkillEnvConfig:D,publishStatusMap:oe,emptyMessage:c.jsxs(c.Fragment,{children:["Skills you or the AI created appear here. They’re stored in"," ",c.jsx("code",{className:"text-xs",children:"~/.sulala/workspace/skills/my/<name>/README.md"}),'. Create one via "Create skill" or ask the agent to create a skill for you.']})})}),c.jsx(xn,{value:"templates",className:"mt-0",children:c.jsx(I4,{skills:f,templates:Z,templatesLoading:T,installingSlug:C,onUseTemplate:s})}),c.jsx(xn,{value:"hub",className:"mt-0",children:c.jsx($4,{skills:f,registrySkills:g,registryLoading:v,systemRegistrySkills:b,systemRegistryLoading:k,skillsSearch:m,setSelectedHubSkill:R})})]})})]}),c.jsx(Y4,{skill:j,installingSlug:C,onClose:()=>R(null),onInstall:H}),c.jsx(P4,{open:a,onOpenChange:r,onSuccess:W}),c.jsx(B4,{template:l,installingSlug:C,onClose:()=>s(null),onSubmit:X}),c.jsx(H4,{slug:u?.slug,name:u?.name,onClose:()=>d(null),onPublish:$,publishingSlug:E})]})}function Vv({skills:e,skillsLoading:a,skillsSearch:r,skillsConfig:l,skillsUpdates:s,visibleSecretKeys:u,setVisibleSecretKeys:d,handleSkillConfigToggle:f,handleSkillEntryUpdate:h,handleSkillEntrySave:m,handleUninstallSkill:y,onPublishOpen:g,validateSkillEnvConfig:v,publishStatusMap:b,emptyMessage:k}){const C=e.filter(E=>!r.trim()||E.name.toLowerCase().includes(r.toLowerCase())||E.description.toLowerCase().includes(r.toLowerCase()));return a&&!e.length?c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):C.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:k??c.jsx(c.Fragment,{children:"No installed skills. Add skills to ~/.sulala/workspace/skills/<name>/README.md, or install from the From Hub tab."})}):c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:C.map(E=>{const R={slug:E.slug??E.filePath.split(/[/\\]/).pop()?.replace(/\.md$/,"")??E.name,name:E.name,description:E.description},O=l?.entries?.[R.slug]??{},_=O.enabled!==!1;return c.jsx(F4,{slug:R.slug,name:R.name,description:E.description,category:E.category,version:E.version,tags:E.tags,status:E.status,source:E.source,env:E.env,missing:E.missing,enabled:_,hasUpdate:s.has(R.slug),entry:O,visibleSecretKeys:u,setVisibleSecretKeys:d,onToggle:()=>f(R.slug,!_),onEntryUpdate:U=>h(R.slug,U),onEntrySave:(U,M)=>m(R.slug,U,M),canUninstall:E.source==="user"||E.source==="installed",onUninstall:()=>y(R.slug,E.source),canPublish:E.source==="user"&&!!g,onPublish:g?()=>g(R.slug,R.name):void 0,publishStatus:b?.[R.slug],validateSkillEnvConfig:v},R.slug)})})}function I4({skills:e,templates:a,templatesLoading:r,installingSlug:l,onUseTemplate:s}){const u=new Set(e.map(f=>f.slug??f.filePath.split(/[/\\]/).pop()?.replace(/\.md$/,"")??f.name)),d=a.filter(f=>!u.has(f.slug));return r&&!a.length?c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading templates…"}):d.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:a.length===0?"No templates available. Add template skills to the registry.":"All templates are already installed. Check Installed or From Hub."}):c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:d.map(f=>c.jsxs("article",{className:"border-border/70 bg-card/30 flex flex-col gap-3 rounded-xl border p-4",children:[c.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:c.jsx($M,{className:"size-5"})}),c.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[c.jsx(xt,{variant:"secondary",className:"text-xs w-fit",children:"Template"}),c.jsx("h3",{className:"font-semibold text-sm",children:f.name||f.slug}),c.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:f.description||""}),c.jsx(pe,{size:"sm",className:"w-fit mt-1",disabled:l!==null,onClick:()=>s(f),children:l===f.slug?"Installing…":"Use template"})]})]},f.slug))})}function B4({template:e,installingSlug:a,onClose:r,onSubmit:l}){const[s,u]=S.useState({}),[d,f]=S.useState(!1),h=!!e,m=e?.requiredFields??[],y=async v=>{if(e){v.preventDefault(),f(!0);try{await l(e.slug,s),u({}),r()}finally{f(!1)}}},g=()=>{u({}),r()};return c.jsx(js,{open:h,onOpenChange:v=>!v&&g(),children:c.jsxs(Cs,{className:"max-w-md",showCloseButton:!0,children:[c.jsxs(Es,{children:[c.jsxs(Ns,{children:["Use template: ",e?.name??e?.slug]}),c.jsxs(As,{children:[e?.description,m.length>0?" Fill in the fields below; the skill will be installed and configured.":" No configuration needed. Click Install to add this skill."]})]}),c.jsxs("form",{onSubmit:y,className:"space-y-4 pt-2",children:[m.map(v=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:`template-${v}`,children:Yv[v]??v}),c.jsx("input",{id:`template-${v}`,type:/password|secret|key|token/i.test(v)?"password":"text",className:"border-input bg-background w-full rounded-md border px-3 py-2 text-sm",value:s[v]??"",onChange:b=>u(k=>({...k,[v]:b.target.value})),placeholder:Yv[v]??v,autoComplete:"off"})]},v)),c.jsxs(hs,{className:"gap-2 pt-2",children:[c.jsx(pe,{type:"button",variant:"outline",onClick:g,children:"Cancel"}),c.jsx(pe,{type:"submit",disabled:d||a!==null,children:d||a?"Installing…":"Install"})]})]})]})})}function H4({slug:e,name:a,onClose:r,onPublish:l,publishingSlug:s}){const[u,d]=S.useState("free"),[f,h]=S.useState(""),[m,y]=S.useState(!1),[g,v]=S.useState(null),b=!!e,k=async E=>{if(E.preventDefault(),!!e){v(null);try{const j=u==="paid"&&f.trim()!==""?Math.round(parseFloat(f)*100):void 0;await l(e,{priceIntent:u,intendedPriceCents:j!==void 0&&Number.isFinite(j)?j:void 0}),y(!0)}catch(j){v(j instanceof Error?j.message:"Publish failed. Set SKILLS_REGISTRY_URL in the agent .env to your store (e.g. http://localhost:3002).")}}},C=()=>{y(!1),v(null),d("free"),h(""),r()};return c.jsx(js,{open:b,onOpenChange:E=>!E&&C(),children:c.jsxs(Cs,{className:"max-w-md",showCloseButton:!0,children:[c.jsxs(Es,{children:[c.jsx(Ns,{children:"Publish to store"}),c.jsxs(As,{children:['Submit "',a??e,'" to the skill store. Others can install it after an admin approves. Set ',c.jsx("code",{className:"text-xs",children:"SKILLS_REGISTRY_URL"})," in the agent .env to your store URL (e.g. http://localhost:3002). No API key needed unless your store requires one."]})]}),m?c.jsxs("div",{className:"space-y-4 py-2",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Submitted to the store. An admin will review it. You can track it under My skills on the store."}),c.jsx(hs,{children:c.jsx(pe,{onClick:C,children:"Close"})})]}):c.jsxs("form",{onSubmit:k,className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{children:"Price"}),c.jsxs("div",{className:"flex gap-4",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("input",{type:"radio",name:"priceIntent",checked:u==="free",onChange:()=>d("free")}),"Free"]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("input",{type:"radio",name:"priceIntent",checked:u==="paid",onChange:()=>d("paid")}),"Paid"]})]})]}),u==="paid"&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"publish-price",children:"Price (USD)"}),c.jsx(Xt,{id:"publish-price",type:"number",min:0,step:.01,placeholder:"4.99",value:f,onChange:E=>h(E.target.value)})]}),g&&c.jsx("p",{className:"text-sm text-destructive",children:g}),c.jsxs(hs,{className:"gap-2 pt-2",children:[c.jsx(pe,{type:"button",variant:"outline",onClick:C,children:"Cancel"}),c.jsx(pe,{type:"submit",disabled:!!s,children:s===e?"Submitting…":"Submit to store"})]})]})]})})}function F4({slug:e,name:a,description:r,category:l,version:s,tags:u,status:d,source:f,env:h,missing:m,enabled:y,hasUpdate:g,entry:v,visibleSecretKeys:b,setVisibleSecretKeys:k,onToggle:C,onEntryUpdate:E,onEntrySave:j,canUninstall:R,onUninstall:O,canPublish:_,onPublish:U,publishStatus:M,validateSkillEnvConfig:L}){const[F,Y]=S.useState(!1);return c.jsxs("article",{className:"border-border/70 bg-card/30 relative flex flex-col gap-3 rounded-xl border p-4",children:[c.jsx("div",{className:"absolute right-3 top-3",children:c.jsxs(Nm,{children:[c.jsx(Am,{asChild:!0,children:c.jsxs(pe,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground size-8 shrink-0",children:[c.jsx(yM,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Actions"})]})}),c.jsxs(Tm,{align:"end",children:[c.jsx(fr,{onClick:C,children:y?"Disable":"Enable"}),_&&U&&!M&&c.jsxs(fr,{onClick:U,children:[c.jsx(EO,{className:"size-4"}),"Publish to store"]}),R&&O&&c.jsx(fr,{variant:"destructive",onClick:()=>Y(!0),children:"Uninstall"})]})]})}),c.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx(xt,{variant:"secondary",className:"text-xs",children:"Free"}),l&&c.jsx(xt,{variant:"outline",className:"text-xs",children:l}),s&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",s]}),g&&c.jsx(xt,{variant:"outline",className:"text-xs text-amber-600 dark:text-amber-400",children:"Update"}),M==="approved"&&c.jsx(xt,{variant:"default",className:"text-xs",children:"Approved"}),M==="pending"&&c.jsx(xt,{variant:"secondary",className:"text-xs",children:"Pending review"}),c.jsx(xt,{variant:d==="eligible"?"default":d==="blocked"?"destructive":"secondary",children:d})]}),c.jsx("h3",{className:"font-semibold text-sm",children:a}),c.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:r}),u&&u.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:u.slice(0,4).map(P=>c.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",P]},P))}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[M==="pending"&&c.jsx("span",{className:"text-muted-foreground text-xs",children:"Already submitted"}),M==="approved"&&c.jsx("span",{className:"text-muted-foreground text-xs",children:"Published"}),f&&c.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:f})]})]}),c.jsx(js,{open:F,onOpenChange:Y,children:c.jsxs(Cs,{className:"sm:max-w-sm",children:[c.jsxs(Es,{children:[c.jsx(Ns,{children:"Remove skill?"}),c.jsxs(As,{children:['"',a,'" will be uninstalled. You can install it again from the hub later.']})]}),c.jsxs(hs,{children:[c.jsx(pe,{variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),c.jsx(pe,{variant:"destructive",onClick:()=>{O?.(),Y(!1)},children:"Remove"})]})]})}),c.jsx(q4,{entry:v,onEntryUpdate:E,onEntrySave:j}),h&&h.length>0&&c.jsx(G4,{slug:e,env:h,entry:v,visibleSecretKeys:b,setVisibleSecretKeys:k,onEntryUpdate:E,onEntrySave:j,validateSkillEnvConfig:L}),m&&m.length>0&&c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Missing bins: ",m.join(", ")]})]})}function q4({entry:e,onEntryUpdate:a,onEntrySave:r}){const l=e.readOnly===!0,s=Array.isArray(e.allowedTools)?e.allowedTools.join(", "):typeof e.allowedTools=="string"?e.allowedTools:"",u=f=>{a({...e,readOnly:f}),r(void 0,void 0)},d=f=>{const h=f.split(",").map(m=>m.trim()).filter(Boolean);a({...e,allowedTools:h.length?h:void 0})};return c.jsxs("div",{className:"mt-1 flex flex-col gap-2 border-t pt-2 text-xs",children:[c.jsxs("div",{className:"text-muted-foreground flex items-center gap-1.5 font-medium",children:[c.jsx(eO,{className:"size-3.5"}),"Permissions"]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"checkbox",checked:l,onChange:f=>u(f.target.checked),className:"size-4 rounded border-input"}),c.jsx("span",{className:"text-muted-foreground",children:"Read only"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-muted-foreground block mb-0.5",children:"Allowed tools"}),c.jsx("input",{type:"text",placeholder:"Leave empty for global allowlist",value:s,onChange:f=>d(f.target.value),onBlur:()=>r(void 0,void 0),className:"border-input bg-background w-full rounded px-2 py-1.5 text-xs","aria-label":"Allowed tools"}),c.jsx("p",{className:"text-muted-foreground mt-0.5 text-[10px]",children:"Comma-separated (e.g. read_file, run_task). Empty = use global."})]})]})}function G4({slug:e,env:a,entry:r,visibleSecretKeys:l,setVisibleSecretKeys:s,onEntryUpdate:u,onEntrySave:d,validateSkillEnvConfig:f}){const h=e==="bluesky"?{BSKY_HANDLE:r.handle,BSKY_APP_PASSWORD:r.apiKey}:void 0,m=f(r,a,h),y=g=>/PASSWORD|SECRET|KEY|TOKEN/i.test(g);return c.jsx("div",{className:"mt-1 flex flex-wrap gap-3 border-t pt-2 text-xs",children:a.map(g=>{const v=r[g]??h?.[g],b=v==="set",k=b?"":String(v??""),C=m.errors[g],E=`skill-${e}-${g}`,j=`${e}-${g}`,R=l[j];return c.jsxs(Qw,{className:"min-w-[200px]",children:[c.jsx(T4,{htmlFor:E,children:g}),c.jsxs("div",{className:"relative",children:[c.jsx(Xt,{id:E,type:y(g)?R?"text":"password":"text",placeholder:b?"(already set)":`Enter ${g}`,value:k,onChange:O=>{const _=O.target.value,U={...r,[g]:_};e==="bluesky"&&g==="BSKY_HANDLE"&&(U.handle=_),e==="bluesky"&&g==="BSKY_APP_PASSWORD"&&(U.apiKey=_),u(U)},onBlur:()=>d(a,h),className:`h-9 text-sm ${y(g)?"pr-9":""} ${C?"border-destructive":""}`,"aria-invalid":!!C,"aria-describedby":C?`${E}-err`:void 0,autoComplete:"off"}),y(g)&&c.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>s(O=>({...O,[j]:!O[j]})),"aria-label":R?"Hide":"Show",children:R?c.jsx(kM,{className:"h-4 w-4"}):c.jsx(CM,{className:"h-4 w-4"})})]}),C&&c.jsx(R4,{id:`${E}-err`,children:C}),!C&&y(g)&&c.jsx(_4,{children:"Tokens and keys are stored securely. Use the eye icon to show or hide."})]},g)})})}function $4({skills:e,registrySkills:a,registryLoading:r,systemRegistrySkills:l,systemRegistryLoading:s,skillsSearch:u,setSelectedHubSkill:d}){const f=new Set(e.filter(k=>k.source==="user"||k.source==="workspace"||k.source==="managed").map(k=>k.slug??k.name)),h=k=>k.filter(C=>!f.has(C.slug)).filter(C=>!u.trim()||(C.name||C.slug).toLowerCase().includes(u.toLowerCase())||(C.description||"").toLowerCase().includes(u.toLowerCase())),m=h(l),y=h(a),g=r||s,v=m.length>0||y.length>0;if(g&&!a.length&&!l.length)return c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});if(!v)return c.jsx("p",{className:"text-muted-foreground text-sm",children:l.length===0&&a.length===0?"Hub registry is empty or not configured. Set VITE_SKILLS_REGISTRY_URL to your store URL.":"All listed skills are already installed, or no matching search."});const b=({r:k})=>{const C=k.priceCents!=null&&k.priceCents>0?`$${(k.priceCents/100).toFixed(2)}`:"Free";return c.jsxs("article",{className:"border-border/70 bg-card/30 flex flex-col gap-3 rounded-xl border p-4",children:[c.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:c.jsx(KS,{className:"size-5"})}),c.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx(xt,{variant:"secondary",className:"text-xs",children:C}),k.category&&c.jsx(xt,{variant:"outline",className:"text-xs",children:k.category}),k.version&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",k.version]})]}),c.jsx("h3",{className:"font-semibold text-sm",children:k.name||k.slug}),c.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:k.description||""}),k.tags&&k.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:k.tags.slice(0,4).map(E=>c.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",E]},E))}),c.jsx(pe,{variant:"outline",size:"sm",className:"w-fit mt-1",onClick:()=>d(k),children:"View & install"})]})]},k.slug)};return c.jsxs("div",{className:"space-y-6",children:[m.length>0&&c.jsxs("section",{children:[c.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"System skills"}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:m.map(k=>c.jsx(b,{r:k},k.slug))})]}),y.length>0&&c.jsxs("section",{children:[c.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"Community / Hub"}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:y.map(k=>c.jsx(b,{r:k},k.slug))})]})]})}function Y4({skill:e,installingSlug:a,onClose:r,onInstall:l}){if(!e)return null;const s=(e.priceCents??0)>0,u=Wl(),d=u?`${u}/skills/${e.slug}`:null;return c.jsx(nu,{open:!!e,onOpenChange:f=>!f&&r(),children:c.jsxs(au,{side:"right",className:"w-full max-w-lg sm:max-w-xl overflow-y-auto p-6 sm:p-8",children:[c.jsxs(ru,{className:"space-y-3 p-0",children:[c.jsxs(pe,{variant:"ghost",size:"sm",className:"w-fit -ml-2",onClick:r,children:[c.jsx(WR,{className:"h-4 w-4 mr-1"}),"Back to skills"]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(xt,{variant:s?"default":"secondary",children:s?`$${(e.priceCents/100).toFixed(2)}`:"Free"}),e.category&&c.jsx(xt,{variant:"outline",children:e.category}),e.version&&c.jsxs(xt,{variant:"secondary",children:["v",e.version]}),e.tags?.map(f=>c.jsxs(xt,{variant:"secondary",className:"font-normal",children:["#",f]},f))]}),c.jsx(lu,{className:"text-left",children:e.name||e.slug}),c.jsx(iu,{className:"text-left",children:e.description}),(e.creatorName||e.creatorId)&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Creator: ",e.creatorName??e.creatorId]})]}),c.jsx("div",{className:"mt-6 space-y-6",children:s?c.jsxs(ut,{className:"p-4",children:[c.jsxs(St,{className:"px-0 pt-0 pb-3",children:[c.jsx(wt,{className:"text-sm",children:"Purchase required"}),c.jsx(kt,{className:"text-xs mt-1.5",children:"This skill is paid. Buy it on the store to get an install URL with your license."})]}),c.jsx(dt,{className:"px-0 pb-0 pt-2 space-y-3",children:d?c.jsx(pe,{asChild:!0,children:c.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Buy on store"})}):c.jsx("p",{className:"text-xs text-muted-foreground",children:"Set VITE_SKILLS_REGISTRY_URL to the hub base URL to see the store link."})})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium mb-2",children:"Install directly"}),c.jsx(pe,{disabled:a!==null,onClick:async()=>{await l(e.slug,"managed"),r()},children:a===e.slug?"Installing…":"Install"})]}),c.jsxs(ut,{children:[c.jsxs(St,{className:"py-3",children:[c.jsx(wt,{className:"text-sm",children:"Install via URL or CLI"}),c.jsx(kt,{className:"text-xs",children:"For users who want to install from the command line or use the install URL."})]}),c.jsxs(dt,{className:"space-y-3 pt-0",children:[as(e.slug)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Install URL"}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:as(e.slug)}),c.jsx(pe,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(as(e.slug)),children:c.jsx(Fv,{className:"h-4 w-4"})})]})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["CLI:"," ",c.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:['sulala skill install --from-url="',as(e.slug),'"']})]})]}),Hl()&&c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Registry URL (for env)"}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:`SKILLS_REGISTRY_URL=${Hl()}`}),c.jsx(pe,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(`SKILLS_REGISTRY_URL=${Hl()}`),children:c.jsx(Fv,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Then:"," ",c.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:["sulala skill install ",e.slug]})]})]})]})]})]})})]})})}const Kv={openai:[{id:"gpt-4o-mini",name:"GPT-4o mini"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5-mini",name:"GPT-5 mini"},{id:"gpt-5-nano",name:"GPT-5 nano"},{id:"gpt-5.2-pro",name:"GPT-5.2 Pro"},{id:"gpt-4.1",name:"GPT-4.1"}],openrouter:[],claude:[{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"},{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5"}],gemini:[{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro (preview)"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash (preview)"}],ollama:[{id:"qwen3.5:27b",name:"Qwen 3.5 27B"},{id:"qwen3.5:35b",name:"Qwen 3.5 35B"},{id:"qwen3.5:122b",name:"Qwen 3.5 122B"},{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"qwen3-vl:8b",name:"Qwen3-VL 8B"},{id:"qwen3-vl:30b",name:"Qwen3-VL 30B"},{id:"qwen3-vl:32b",name:"Qwen3-VL 32B"},{id:"qwen3-next:80b",name:"Qwen3-Next 80B"},{id:"nemotron-3-nano:30b",name:"Nemotron 3 Nano 30B"},{id:"gpt-oss-safeguard:20b",name:"GPT-OSS Safeguard 20B"},{id:"gpt-oss-safeguard:120b",name:"GPT-OSS Safeguard 120B"},{id:"qwen3:8b",name:"Qwen 3 8B"},{id:"qwen3:14b",name:"Qwen 3 14B"},{id:"qwen3:30b",name:"Qwen 3 30B"},{id:"qwen3:32b",name:"Qwen 3 32B"},{id:"qwen3:235b",name:"Qwen 3 235B"},{id:"gpt-oss:20b",name:"GPT-OSS 20B"},{id:"gpt-oss:120b",name:"GPT-OSS 120B"},{id:"magistral:24b",name:"Magistral 24B"},{id:"deepseek-v3.1:671b",name:"DeepSeek V3.1 671B"},{id:"deepseek-r1:7b",name:"DeepSeek R1 7B"},{id:"deepseek-r1:8b",name:"DeepSeek R1 8B"},{id:"deepseek-r1:14b",name:"DeepSeek R1 14B"},{id:"deepseek-r1:32b",name:"DeepSeek R1 32B"},{id:"deepseek-r1:70b",name:"DeepSeek R1 70B"},{id:"deepseek-r1:671b",name:"DeepSeek R1 671B"},{id:"llama3.2:3b",name:"Llama 3.2 3B"},{id:"llama3.1:8b",name:"Llama 3.1 8B"},{id:"llama3.1:70b",name:"Llama 3.1 70B"},{id:"hermes3:8b",name:"Hermes 3 8B"},{id:"hermes3:70b",name:"Hermes 3 70B"},{id:"mistral",name:"Mistral 7B"},{id:"gemma2:9b",name:"Gemma 2 9B"},{id:"qwen2:7b",name:"Qwen 2 7B"},{id:"qwen2:72b",name:"Qwen 2 72B"}]},ac="sulala_chat_provider",Zf="sulala_chat_model";function Jf(e){try{const a=localStorage.getItem(e);if(typeof a=="string")return a}catch{}return""}function V4(e,a,r){const[l,s]=S.useState(null),[u,d]=S.useState([]),[f,h]=S.useState(""),[m,y]=S.useState(()=>Jf(ac)),[g,v]=S.useState(()=>Jf(Zf)),[b,k]=S.useState([]),[C,E]=S.useState(!1),[j,R]=S.useState([]),[O,_]=S.useState(!1),[U,M]=S.useState(!1),[L,F]=S.useState(null),[Y,P]=S.useState(null),[W,ee]=S.useState(!1),[fe,ne]=S.useState(null),[H,z]=S.useState(null),[$,X]=S.useState(null),[G,A]=S.useState(!1),[D,Z]=S.useState(null),[T,oe]=S.useState([]),ce=()=>{ee(!0),Vl().then(je=>P(je.running)).catch(()=>P(!1)).finally(()=>ee(!1))};S.useEffect(()=>{if(e!=="chat"||m!=="ollama"){P(null),ne(null);return}ee(!0),Vl().then(je=>P(je.running)).catch(()=>P(!1)).finally(()=>ee(!1))},[e,m]),S.useEffect(()=>{if(e!=="chat"||m!=="ollama")return;const je=()=>{Mw().then(ne).catch(()=>ne(null))};je();const he=setInterval(je,1500);return()=>clearInterval(he)},[e,m]),S.useEffect(()=>{e==="chat"&&vr().then(je=>{if(s(je),je?.aiProviders?.length&&!Jf(ac)){const he=je.aiProviders[0];if(he){y(he.id),v(he.defaultModel||"");try{localStorage.setItem(ac,he.id),localStorage.setItem(Zf,he.defaultModel||"")}catch{}}}}).catch(()=>s(null))},[e]),S.useEffect(()=>{if(e!=="chat"||m!=="openrouter"&&m!=="ollama"){k([]);return}E(!0),ws(m).then(je=>k(je.models||[])).catch(()=>k([])).finally(()=>E(!1))},[e,m]),S.useEffect(()=>{e==="chat"&&(_(!0),Mh(50).then(je=>R(je.sessions||[])).catch(()=>R([])).finally(()=>_(!1)))},[e,L]),S.useEffect(()=>{if(!H||!L){H||X(null);return}A(!0),bw(L).then(je=>{const he=(je.pendingActions||[]).find(ze=>ze.id===H);X(he??null)}).catch(()=>X(null)).finally(()=>A(!1))},[H,L]);const ue=async je=>{if(!je){Le();return}z(null),X(null),M(!0);try{const he=await Hr(je);F(he.id),d(he.messages||[])}catch(he){a(he instanceof Error?he.message:"Failed to load session")}finally{M(!1)}},ge=async()=>{const je=f.trim();if(!je&&T.length===0||U)return;const he={role:"user",content:je||"(with attachments)"};d(se=>[...se,he]);const ze=[...T];h(""),oe([]),M(!0),a(null);try{let se=L;if(!se){se=(await Fw({session_key:`chat_${Date.now()}`})).id,F(se);const Ft=await Mh(50).catch(()=>({sessions:[]}));R(Ft.sessions||[])}const Te=[];for(const tt of ze){const{url:Ft}=await $w(tt);Te.push(Ft)}const Me=l?.aiProviders.find(tt=>tt.id===m),Tt=g||Me?.defaultModel||(rt.length>0?rt[0].id:""),mt={message:je||"Post the attached image(s) as requested.",provider:m,model:Tt||void 0,max_tokens:1024};if(Te.length>0&&(mt.attachment_urls=Te),D&&je===D.base_prompt.trim()&&D.required_integrations.length>0&&(mt.required_integrations=D.required_integrations),m==="openai"||m==="openrouter"||m==="ollama")d(tt=>[...tt,{role:"assistant",content:"",thinking:""}]),await Oh(se,mt,{onDelta:tt=>{d(Ft=>{const Qe=[...Ft],sn=Qe[Qe.length-1];return sn?.role==="assistant"&&(Qe[Qe.length-1]={...sn,content:(sn.content??"")+tt}),Qe})},onThinking:tt=>{d(Ft=>{const Qe=[...Ft],sn=Qe[Qe.length-1];return sn?.role==="assistant"&&(Qe[Qe.length-1]={...sn,thinking:(sn.thinking??"")+tt}),Qe})},onDone:async tt=>{if(d(Ft=>{const Qe=[...Ft],sn=Qe[Qe.length-1];return sn?.role==="assistant"&&(Qe[Qe.length-1]={...sn,content:tt}),Qe}),se&&m!=="ollama")try{const Ft=await Hr(se);d(Ft.messages||[])}catch{}},onPendingApproval:tt=>{M(!1),z(tt)},onError:a,onMissingIntegrations:r?.onMissingIntegrations});else{const tt=await Yw(se,mt);tt.pendingActionId&&z(tt.pendingActionId);const Ft=await Hr(se);d(Ft.messages||[])}}catch(se){const Te=se;Array.isArray(Te.missing)&&Te.missing.length>0&&r?.onMissingIntegrations?.(Te.missing),a(Te instanceof Error?Te.message:"Completion failed")}finally{M(!1)}},Le=()=>{F(null),d([]),z(null),X(null),a(null)},Ee=async()=>{if(!H||!L)return;const je=L;try{await Sw(H),z(null),X(null);const he=await Hr(je);d(he.messages||[]);const ze=l?.aiProviders.find(Me=>Me.id===m),se=g||ze?.defaultModel||(rt.length>0?rt[0].id:"");["openai","openrouter","ollama"].includes(m)&&(M(!0),d(Me=>[...Me,{role:"assistant",content:"",thinking:""}]),await Oh(je,{continue:!0,provider:m,model:se||void 0,max_tokens:1024},{onDelta:Me=>{d(Tt=>{const mt=[...Tt],tt=mt[mt.length-1];return tt?.role==="assistant"&&(mt[mt.length-1]={...tt,content:(tt.content??"")+Me}),mt})},onThinking:Me=>{d(Tt=>{const mt=[...Tt],tt=mt[mt.length-1];return tt?.role==="assistant"&&(mt[mt.length-1]={...tt,thinking:(tt.thinking??"")+Me}),mt})},onDone:async()=>{try{const Me=await Hr(je);d(Me.messages||[])}catch{}M(!1)},onPendingApproval:Me=>{z(Me),M(!1)},onError:Me=>{M(!1),a(Me)}}))}catch(he){a(he instanceof Error?he.message:"Failed to approve")}finally{M(!1)}},vt=async()=>{if(H)try{if(await ww(H),z(null),X(null),L){const je=await Hr(L);d(je.messages||[])}}catch(je){a(je instanceof Error?je.message:"Failed to reject")}},rt=m==="ollama"?(()=>{const je=new Set(b.map(ze=>ze.id)),he=(Kv.ollama||[]).filter(ze=>!je.has(ze.id));return[...b,...he]})():m==="openrouter"&&b.length>0?b:Kv[m]||[];return{config:l,chatMessages:u,chatInput:f,setChatInput:h,chatProvider:m,setChatProvider:je=>{y(je);try{localStorage.setItem(ac,je)}catch{}},chatModel:g,setChatModel:je=>{v(je);try{localStorage.setItem(Zf,je)}catch{}},chatModels:b,chatModelsLoading:C,chatSessions:j,chatSessionsLoading:O,chatLoading:U,chatAgentSessionId:L,models:rt,ollamaRunning:Y,ollamaStatusLoading:W,ollamaPullState:fe,checkOllama:ce,handleSelectSession:ue,handleChatSend:ge,handleNewChat:Le,pendingActionId:H,pendingActionDetails:$,pendingActionLoading:G,handleApprovePending:Ee,handleRejectPending:vt,setLastAppliedIdea:Z,chatAttachments:T,setChatAttachments:oe}}function K4({className:e,size:a="default",...r}){return c.jsx(xN,{"data-slot":"avatar","data-size":a,className:be("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",e),...r})}function X4({className:e,...a}){return c.jsx(yN,{"data-slot":"avatar-fallback",className:be("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",e),...a})}function Dh({className:e}){return c.jsxs("div",{className:be("flex items-center gap-1",e),"aria-label":"Typing",children:[c.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0ms"}}),c.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.15s"}}),c.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.3s"}})]})}function Q4({className:e}){return c.jsx("span",{className:be("inline-block h-4 w-0.5 animate-pulse bg-foreground align-middle",e),"aria-hidden":!0})}function Z4(e,a){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const J4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eD={};function Xv(e,a){return(eD.jsx?W4:J4).test(e)}const tD=/[ \t\n\f\r]/g;function nD(e){return typeof e=="object"?e.type==="text"?Qv(e.value):!1:Qv(e)}function Qv(e){return e.replace(tD,"")===""}class Ts{constructor(a,r,l){this.normal=r,this.property=a,l&&(this.space=l)}}Ts.prototype.normal={};Ts.prototype.property={};Ts.prototype.space=void 0;function Jw(e,a){const r={},l={};for(const s of e)Object.assign(r,s.property),Object.assign(l,s.normal);return new Ts(r,l,a)}function zh(e){return e.toLowerCase()}class yn{constructor(a,r){this.attribute=r,this.property=a}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let aD=0;const Ie=Kr(),Dt=Kr(),Lh=Kr(),de=Kr(),ht=Kr(),Fl=Kr(),Nn=Kr();function Kr(){return 2**++aD}const Ph=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Dt,commaOrSpaceSeparated:Nn,commaSeparated:Fl,number:de,overloadedBoolean:Lh,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),Wf=Object.keys(Ph);class Rm extends yn{constructor(a,r,l,s){let u=-1;if(super(a,r),Zv(this,"space",s),typeof l=="number")for(;++u<Wf.length;){const d=Wf[u];Zv(this,Wf[u],(l&Ph[d])===Ph[d])}}}Rm.prototype.defined=!0;function Zv(e,a,r){r&&(e[a]=r)}function ti(e){const a={},r={};for(const[l,s]of Object.entries(e.properties)){const u=new Rm(l,e.transform(e.attributes||{},l),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(u.mustUseProperty=!0),a[l]=u,r[zh(l)]=l,r[zh(u.attribute)]=l}return new Ts(a,r,e.space)}const Ww=ti({properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:ht,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:de,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:ht,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Dt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,a){return a==="role"?a:"aria-"+a.slice(4).toLowerCase()}});function ek(e,a){return a in e?e[a]:a}function tk(e,a){return ek(e,a.toLowerCase())}const rD=ti({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fl,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:ht,autoFocus:Ie,autoPlay:Ie,blocking:ht,capture:null,charSet:null,checked:Ie,cite:null,className:ht,cols:de,colSpan:null,content:null,contentEditable:Dt,controls:Ie,controlsList:ht,coords:de|Fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Lh,draggable:Dt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:ht,height:de,hidden:Lh,high:de,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:ht,itemRef:ht,itemScope:Ie,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:de,pattern:null,ping:ht,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:ht,required:Ie,reversed:Ie,rows:de,rowSpan:de,sandbox:ht,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Dt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:tk}),lD=ti({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",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:Nn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:ht,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:Fl,g2:Fl,glyphName:Fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nn,rev:Nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nn,requiredFeatures:Nn,requiredFonts:Nn,requiredFormats:Nn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ek}),nk=ti({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,a){return"xlink:"+a.slice(5).toLowerCase()}}),ak=ti({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tk}),rk=ti({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,a){return"xml:"+a.slice(3).toLowerCase()}}),iD={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"},sD=/[A-Z]/g,Jv=/-[a-z]/g,oD=/^data[-\w.:]+$/i;function cD(e,a){const r=zh(a);let l=a,s=yn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&oD.test(a)){if(a.charAt(4)==="-"){const u=a.slice(5).replace(Jv,dD);l="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=a.slice(4);if(!Jv.test(u)){let d=u.replace(sD,uD);d.charAt(0)!=="-"&&(d="-"+d),a="data"+d}}s=Rm}return new s(l,a)}function uD(e){return"-"+e.toLowerCase()}function dD(e){return e.charAt(1).toUpperCase()}const fD=Jw([Ww,rD,nk,ak,rk],"html"),Mm=Jw([Ww,lD,nk,ak,rk],"svg");function hD(e){return e.join(" ").trim()}var Ll={},eh,Wv;function mD(){if(Wv)return eh;Wv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
55
+ `,m="/",y="*",g="",v="comment",b="declaration";function k(E,j){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];j=j||{};var R=1,O=1;function _(ne){var H=ne.match(a);H&&(R+=H.length);var z=ne.lastIndexOf(h);O=~z?ne.length-z:O+ne.length}function U(){var ne={line:R,column:O};return function(H){return H.position=new M(ne),Y(),H}}function M(ne){this.start=ne,this.end={line:R,column:O},this.source=j.source}M.prototype.content=E;function L(ne){var H=new Error(j.source+":"+R+":"+O+": "+ne);if(H.reason=ne,H.filename=j.source,H.line=R,H.column=O,H.source=E,!j.silent)throw H}function F(ne){var H=ne.exec(E);if(H){var z=H[0];return _(z),E=E.slice(z.length),H}}function Y(){F(r)}function P(ne){var H;for(ne=ne||[];H=W();)H!==!1&&ne.push(H);return ne}function W(){var ne=U();if(!(m!=E.charAt(0)||y!=E.charAt(1))){for(var H=2;g!=E.charAt(H)&&(y!=E.charAt(H)||m!=E.charAt(H+1));)++H;if(H+=2,g===E.charAt(H-1))return L("End of comment missing");var z=E.slice(2,H-2);return O+=2,_(z),E=E.slice(H),O+=2,ne({type:v,comment:z})}}function ee(){var ne=U(),H=F(l);if(H){if(W(),!F(s))return L("property missing ':'");var z=F(u),$=ne({type:b,property:C(H[0].replace(e,g)),value:z?C(z[0].replace(e,g)):g});return F(d),$}}function fe(){var ne=[];P(ne);for(var H;H=ee();)H!==!1&&(ne.push(H),P(ne));return ne}return Y(),fe()}function C(E){return E?E.replace(f,g):g}return eh=k,eh}var eb;function pD(){if(eb)return Ll;eb=1;var e=Ll&&Ll.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.default=r;const a=e(mD());function r(l,s){let u=null;if(!l||typeof l!="string")return u;const d=(0,a.default)(l),f=typeof s=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:y}=h;f?s(m,y,h):y&&(u=u||{},u[m]=y)}),u}return Ll}var Zi={},tb;function gD(){if(tb)return Zi;tb=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,u=function(m){return!m||r.test(m)||e.test(m)},d=function(m,y){return y.toUpperCase()},f=function(m,y){return"".concat(y,"-")},h=function(m,y){return y===void 0&&(y={}),u(m)?m:(m=m.toLowerCase(),y.reactCompat?m=m.replace(s,f):m=m.replace(l,f),m.replace(a,d))};return Zi.camelCase=h,Zi}var Ji,nb;function xD(){if(nb)return Ji;nb=1;var e=Ji&&Ji.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=e(pD()),r=gD();function l(s,u){var d={};return!s||typeof s!="string"||(0,a.default)(s,function(f,h){f&&h&&(d[(0,r.camelCase)(f,u)]=h)}),d}return l.default=l,Ji=l,Ji}var yD=xD();const vD=Mc(yD),lk=ik("end"),Om=ik("start");function ik(e){return a;function a(r){const l=r&&r.position&&r.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function bD(e){const a=Om(e),r=lk(e);if(a&&r)return{start:a,end:r}}function is(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ab(e.position):"start"in e||"end"in e?ab(e):"line"in e||"column"in e?Uh(e):""}function Uh(e){return rb(e&&e.line)+":"+rb(e&&e.column)}function ab(e){return Uh(e&&e.start)+"-"+Uh(e&&e.end)}function rb(e){return e&&typeof e=="number"?e:1}class en extends Error{constructor(a,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let s="",u={},d=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof a=="string"?s=a:!u.cause&&a&&(d=!0,s=a.message,u.cause=a),!u.ruleId&&!u.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?u.ruleId=l:(u.source=l.slice(0,h),u.ruleId=l.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=is(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const Dm={}.hasOwnProperty,SD=new Map,wD=/[A-Z]/g,kD=new Set(["table","tbody","thead","tfoot","tr"]),jD=new Set(["td","th"]),sk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function CD(e,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=a.filePath||void 0;let l;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=OD(r,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=MD(r,a.jsx,a.jsxs)}const s={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:l,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?Mm:fD,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},u=ok(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function ok(e,a,r){if(a.type==="element")return ED(e,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return ND(e,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return TD(e,a,r);if(a.type==="mdxjsEsm")return AD(e,a);if(a.type==="root")return _D(e,a,r);if(a.type==="text")return RD(e,a)}function ED(e,a,r){const l=e.schema;let s=l;a.tagName.toLowerCase()==="svg"&&l.space==="html"&&(s=Mm,e.schema=s),e.ancestors.push(a);const u=uk(e,a.tagName,!1),d=DD(e,a);let f=Lm(e,a);return kD.has(a.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!nD(h):!0})),ck(e,d,u,a),zm(d,f),e.ancestors.pop(),e.schema=l,e.create(a,u,d,r)}function ND(e,a){if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}ms(e,a.position)}function AD(e,a){if(a.data&&a.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(a.data.estree);ms(e,a.position)}function TD(e,a,r){const l=e.schema;let s=l;a.name==="svg"&&l.space==="html"&&(s=Mm,e.schema=s),e.ancestors.push(a);const u=a.name===null?e.Fragment:uk(e,a.name,!0),d=zD(e,a),f=Lm(e,a);return ck(e,d,u,a),zm(d,f),e.ancestors.pop(),e.schema=l,e.create(a,u,d,r)}function _D(e,a,r){const l={};return zm(l,Lm(e,a)),e.create(a,e.Fragment,l,r)}function RD(e,a){return a.value}function ck(e,a,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(a.node=l)}function zm(e,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(e.children=r)}}function MD(e,a,r){return l;function l(s,u,d,f){const m=Array.isArray(d.children)?r:a;return f?m(u,d,f):m(u,d)}}function OD(e,a){return r;function r(l,s,u,d){const f=Array.isArray(u.children),h=Om(l);return a(s,u,d,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function DD(e,a){const r={};let l,s;for(s in a.properties)if(s!=="children"&&Dm.call(a.properties,s)){const u=LD(e,s,a.properties[s]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&jD.has(a.tagName)?l=f:r[d]=f}}if(l){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function zD(e,a){const r={};for(const l of a.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const u=l.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else ms(e,a.position);else{const s=l.name;let u;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else ms(e,a.position);else u=l.value===null?!0:l.value;r[s]=u}return r}function Lm(e,a){const r=[];let l=-1;const s=e.passKeys?new Map:SD;for(;++l<a.children.length;){const u=a.children[l];let d;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=s.get(h)||0;d=h+"-"+m,s.set(h,m+1)}}const f=ok(e,u,d);f!==void 0&&r.push(f)}return r}function LD(e,a,r){const l=cD(e.schema,a);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?Z4(r):hD(r)),l.property==="style"){let s=typeof r=="object"?r:PD(e,String(r));return e.stylePropertyNameCase==="css"&&(s=UD(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&l.space?iD[l.property]||l.property:l.attribute,r]}}function PD(e,a){try{return vD(a,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,s=new en("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=sk+"#cannot-parse-style-attribute",s}}function uk(e,a,r){let l;if(!r)l={type:"Literal",value:a};else if(a.includes(".")){const s=a.split(".");let u=-1,d;for(;++u<s.length;){const f=Xv(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}l=d}else l=Xv(a)&&!/^[a-z]/.test(a)?{type:"Identifier",name:a}:{type:"Literal",value:a};if(l.type==="Literal"){const s=l.value;return Dm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(l);ms(e)}function ms(e,a){const r=new en("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:a,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=sk+"#cannot-handle-mdx-estrees-without-createevaluater",r}function UD(e){const a={};let r;for(r in e)Dm.call(e,r)&&(a[ID(r)]=e[r]);return a}function ID(e){let a=e.replace(wD,BD);return a.slice(0,3)==="ms-"&&(a="-"+a),a}function BD(e){return"-"+e.toLowerCase()}const th={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"]},HD={};function Pm(e,a){const r=HD,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return dk(e,l,s)}function dk(e,a,r){if(FD(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(a&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lb(e.children,a,r)}return Array.isArray(e)?lb(e,a,r):""}function lb(e,a,r){const l=[];let s=-1;for(;++s<e.length;)l[s]=dk(e[s],a,r);return l.join("")}function FD(e){return!!(e&&typeof e=="object")}const ib=document.createElement("i");function Um(e){const a="&"+e+";";ib.innerHTML=a;const r=ib.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===a?!1:r}function _n(e,a,r,l){const s=e.length;let u=0,d;if(a<0?a=-a>s?0:s+a:a=a>s?s:a,r=r>0?r:0,l.length<1e4)d=Array.from(l),d.unshift(a,r),e.splice(...d);else for(r&&e.splice(a,r);u<l.length;)d=l.slice(u,u+1e4),d.unshift(a,0),e.splice(...d),u+=1e4,a+=1e4}function Hn(e,a){return e.length>0?(_n(e,e.length,0,a),e):a}const sb={}.hasOwnProperty;function fk(e){const a={};let r=-1;for(;++r<e.length;)qD(a,e[r]);return a}function qD(e,a){let r;for(r in a){const s=(sb.call(e,r)?e[r]:void 0)||(e[r]={}),u=a[r];let d;if(u)for(d in u){sb.call(s,d)||(s[d]=[]);const f=u[d];GD(s[d],Array.isArray(f)?f:f?[f]:[])}}}function GD(e,a){let r=-1;const l=[];for(;++r<a.length;)(a[r].add==="after"?e:l).push(a[r]);_n(e,0,0,l)}function hk(e,a){const r=Number.parseInt(e,a);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Xn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const an=br(/[A-Za-z]/),Jt=br(/[\dA-Za-z]/),$D=br(/[#-'*+\--9=?A-Z^-~]/);function Ac(e){return e!==null&&(e<32||e===127)}const Ih=br(/\d/),YD=br(/[\dA-Fa-f]/),VD=br(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const uu=br(new RegExp("\\p{P}|\\p{S}","u")),Gr=br(/\s/);function br(e){return a;function a(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ni(e){const a=[];let r=-1,l=0,s=0;for(;++r<e.length;){const u=e.charCodeAt(r);let d="";if(u===37&&Jt(e.charCodeAt(r+1))&&Jt(e.charCodeAt(r+2)))s=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(r+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),s=1):d="�"}else d=String.fromCharCode(u);d&&(a.push(e.slice(l,r),encodeURIComponent(d)),l=r+s+1,d=""),s&&(r+=s,s=0)}return a.join("")+e.slice(l)}function Ke(e,a,r,l){const s=l?l-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(h){return Ge(h)?(e.enter(r),f(h)):a(h)}function f(h){return Ge(h)&&u++<s?(e.consume(h),f):(e.exit(r),a(h))}}const KD={tokenize:XD};function XD(e){const a=e.attempt(this.parser.constructs.contentInitial,l,s);let r;return a;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ke(e,a,"linePrefix")}function s(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return _e(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const QD={tokenize:ZD},ob={tokenize:JD};function ZD(e){const a=this,r=[];let l=0,s,u,d;return f;function f(O){if(l<r.length){const _=r[l];return a.containerState=_[1],e.attempt(_[0].continuation,h,m)(O)}return m(O)}function h(O){if(l++,a.containerState._closeFlow){a.containerState._closeFlow=void 0,s&&R();const _=a.events.length;let U=_,M;for(;U--;)if(a.events[U][0]==="exit"&&a.events[U][1].type==="chunkFlow"){M=a.events[U][1].end;break}j(l);let L=_;for(;L<a.events.length;)a.events[L][1].end={...M},L++;return _n(a.events,U+1,0,a.events.slice(_)),a.events.length=L,m(O)}return f(O)}function m(O){if(l===r.length){if(!s)return v(O);if(s.currentConstruct&&s.currentConstruct.concrete)return k(O);a.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(ob,y,g)(O)}function y(O){return s&&R(),j(l),v(O)}function g(O){return a.parser.lazy[a.now().line]=l!==r.length,d=a.now().offset,k(O)}function v(O){return a.containerState={},e.attempt(ob,b,k)(O)}function b(O){return l++,r.push([a.currentConstruct,a.containerState]),v(O)}function k(O){if(O===null){s&&R(),j(0),e.consume(O);return}return s=s||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),C(O)}function C(O){if(O===null){E(e.exit("chunkFlow"),!0),j(0),e.consume(O);return}return _e(O)?(e.consume(O),E(e.exit("chunkFlow")),l=0,a.interrupt=void 0,f):(e.consume(O),C)}function E(O,_){const U=a.sliceStream(O);if(_&&U.push(null),O.previous=u,u&&(u.next=O),u=O,s.defineSkip(O.start),s.write(U),a.parser.lazy[O.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<d&&(!s.events[M][1].end||s.events[M][1].end.offset>d))return;const L=a.events.length;let F=L,Y,P;for(;F--;)if(a.events[F][0]==="exit"&&a.events[F][1].type==="chunkFlow"){if(Y){P=a.events[F][1].end;break}Y=!0}for(j(l),M=L;M<a.events.length;)a.events[M][1].end={...P},M++;_n(a.events,F+1,0,a.events.slice(L)),a.events.length=M}}function j(O){let _=r.length;for(;_-- >O;){const U=r[_];a.containerState=U[1],U[0].exit.call(a,e)}r.length=O}function R(){s.write([null]),u=void 0,s=void 0,a.containerState._closeFlow=void 0}}function JD(e,a,r){return Ke(e,e.attempt(this.parser.constructs.document,a,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kl(e){if(e===null||ft(e)||Gr(e))return 1;if(uu(e))return 2}function du(e,a,r){const l=[];let s=-1;for(;++s<e.length;){const u=e[s].resolveAll;u&&!l.includes(u)&&(a=u(a,r),l.push(u))}return a}const Bh={name:"attention",resolveAll:WD,tokenize:e3};function WD(e,a){let r=-1,l,s,u,d,f,h,m,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&a.sliceSerialize(e[l][1]).charCodeAt(0)===a.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[l][1].end},v={...e[r][1].start};cb(g,-h),cb(v,h),d={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},u={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},s={type:h>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[l][1].end={...d.start},e[r][1].start={...f.end},m=[],e[l][1].end.offset-e[l][1].start.offset&&(m=Hn(m,[["enter",e[l][1],a],["exit",e[l][1],a]])),m=Hn(m,[["enter",s,a],["enter",d,a],["exit",d,a],["enter",u,a]]),m=Hn(m,du(a.parser.constructs.insideSpan.null,e.slice(l+1,r),a)),m=Hn(m,[["exit",u,a],["enter",f,a],["exit",f,a],["exit",s,a]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,m=Hn(m,[["enter",e[r][1],a],["exit",e[r][1],a]])):y=0,_n(e,l-1,r-l+3,m),r=l+m.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function e3(e,a){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,s=Kl(l);let u;return d;function d(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),y=Kl(h),g=!y||y===2&&s||r.includes(h),v=!s||s===2&&y||r.includes(l);return m._open=!!(u===42?g:g&&(s||!v)),m._close=!!(u===42?v:v&&(y||!g)),a(h)}}function cb(e,a){e.column+=a,e.offset+=a,e._bufferIndex+=a}const t3={name:"autolink",tokenize:n3};function n3(e,a,r){let l=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return an(b)?(e.consume(b),d):b===64?r(b):m(b)}function d(b){return b===43||b===45||b===46||Jt(b)?(l=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),l=0,h):(b===43||b===45||b===46||Jt(b))&&l++<32?(e.consume(b),f):(l=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),a):b===null||b===32||b===60||Ac(b)?r(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),y):$D(b)?(e.consume(b),m):r(b)}function y(b){return Jt(b)?g(b):r(b)}function g(b){return b===46?(e.consume(b),l=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),a):v(b)}function v(b){if((b===45||Jt(b))&&l++<63){const k=b===45?v:g;return e.consume(b),k}return r(b)}}const _s={partial:!0,tokenize:a3};function a3(e,a,r){return l;function l(u){return Ge(u)?Ke(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||_e(u)?a(u):r(u)}}const mk={continuation:{tokenize:l3},exit:i3,name:"blockQuote",tokenize:r3};function r3(e,a,r){const l=this;return s;function s(d){if(d===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return r(d)}function u(d){return Ge(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),a):(e.exit("blockQuotePrefix"),a(d))}}function l3(e,a,r){const l=this;return s;function s(d){return Ge(d)?Ke(e,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(mk,a,r)(d)}}function i3(e){e.exit("blockQuote")}const pk={name:"characterEscape",tokenize:s3};function s3(e,a,r){return l;function l(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),s}function s(u){return VD(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),a):r(u)}}const gk={name:"characterReference",tokenize:o3};function o3(e,a,r){const l=this;let s=0,u,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,d=Jt,y(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=YD,y):(e.enter("characterReferenceValue"),u=7,d=Ih,y(g))}function y(g){if(g===59&&s){const v=e.exit("characterReferenceValue");return d===Jt&&!Um(l.sliceSerialize(v))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),a)}return d(g)&&s++<u?(e.consume(g),y):r(g)}}const ub={partial:!0,tokenize:u3},db={concrete:!0,name:"codeFenced",tokenize:c3};function c3(e,a,r){const l=this,s={partial:!0,tokenize:U};let u=0,d=0,f;return h;function h(M){return m(M)}function m(M){const L=l.events[l.events.length-1];return u=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(M)}function y(M){return M===f?(d++,e.consume(M),y):d<3?r(M):(e.exit("codeFencedFenceSequence"),Ge(M)?Ke(e,g,"whitespace")(M):g(M))}function g(M){return M===null||_e(M)?(e.exit("codeFencedFence"),l.interrupt?a(M):e.check(ub,C,_)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):Ge(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ke(e,b,"whitespace")(M)):M===96&&M===f?r(M):(e.consume(M),v)}function b(M){return M===null||_e(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===f?r(M):(e.consume(M),k)}function C(M){return e.attempt(s,_,E)(M)}function E(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),j}function j(M){return u>0&&Ge(M)?Ke(e,R,"linePrefix",u+1)(M):R(M)}function R(M){return M===null||_e(M)?e.check(ub,C,_)(M):(e.enter("codeFlowValue"),O(M))}function O(M){return M===null||_e(M)?(e.exit("codeFlowValue"),R(M)):(e.consume(M),O)}function _(M){return e.exit("codeFenced"),a(M)}function U(M,L,F){let Y=0;return P;function P(H){return M.enter("lineEnding"),M.consume(H),M.exit("lineEnding"),W}function W(H){return M.enter("codeFencedFence"),Ge(H)?Ke(M,ee,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):ee(H)}function ee(H){return H===f?(M.enter("codeFencedFenceSequence"),fe(H)):F(H)}function fe(H){return H===f?(Y++,M.consume(H),fe):Y>=d?(M.exit("codeFencedFenceSequence"),Ge(H)?Ke(M,ne,"whitespace")(H):ne(H)):F(H)}function ne(H){return H===null||_e(H)?(M.exit("codeFencedFence"),L(H)):F(H)}}}function u3(e,a,r){const l=this;return s;function s(d){return d===null?r(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return l.parser.lazy[l.now().line]?r(d):a(d)}}const nh={name:"codeIndented",tokenize:f3},d3={partial:!0,tokenize:h3};function f3(e,a,r){const l=this;return s;function s(m){return e.enter("codeIndented"),Ke(e,u,"linePrefix",5)(m)}function u(m){const y=l.events[l.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(m):r(m)}function d(m){return m===null?h(m):_e(m)?e.attempt(d3,d,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||_e(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),a(m)}}function h3(e,a,r){const l=this;return s;function s(d){return l.parser.lazy[l.now().line]?r(d):_e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),s):Ke(e,u,"linePrefix",5)(d)}function u(d){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):_e(d)?s(d):r(d)}}const m3={name:"codeText",previous:g3,resolve:p3,tokenize:x3};function p3(e){let a=e.length-4,r=3,l,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[a][1].type==="lineEnding"||e[a][1].type==="space")){for(l=r;++l<a;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[a][1].type="codeTextPadding",r+=2,a-=2;break}}for(l=r-1,a++;++l<=a;)s===void 0?l!==a&&e[l][1].type!=="lineEnding"&&(s=l):(l===a||e[l][1].type==="lineEnding")&&(e[s][1].type="codeTextData",l!==s+2&&(e[s][1].end=e[l-1][1].end,e.splice(s+2,l-s-2),a-=l-s-2,l=s+2),s=void 0);return e}function g3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x3(e,a,r){let l=0,s,u;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),l++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(u=e.enter("codeTextSequence"),s=0,y(g)):_e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||_e(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),m)}function y(g){return g===96?(e.consume(g),s++,y):s===l?(e.exit("codeTextSequence"),e.exit("codeText"),a(g)):(u.type="codeTextData",m(g))}}class y3{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,r){const l=r??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(a,l):a>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(a,r,l){const s=r||0;this.setCursor(Math.trunc(a));const u=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return l&&Wi(this.left,l),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),Wi(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),Wi(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a<this.left.length){const r=this.left.splice(a,Number.POSITIVE_INFINITY);Wi(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-a,Number.POSITIVE_INFINITY);Wi(this.left,r.reverse())}}}function Wi(e,a){let r=0;if(a.length<1e4)e.push(...a);else for(;r<a.length;)e.push(...a.slice(r,r+1e4)),r+=1e4}function xk(e){const a={};let r=-1,l,s,u,d,f,h,m;const y=new y3(e);for(;++r<y.length;){for(;r in a;)r=a[r];if(l=y.get(r),r&&l[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(l[0]==="enter")l[1].contentType&&(Object.assign(a,v3(y,r)),r=a[r],m=!0);else if(l[1]._container){for(u=r,s=void 0;u--;)if(d=y.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),d[1].type="lineEnding",s=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;s&&(l[1].end={...y.get(s)[1].start},f=y.slice(s,r),f.unshift(l),y.splice(s,r-s+1,f))}}return _n(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!m}function v3(e,a){const r=e.get(a)[1],l=e.get(a)[2];let s=a-1;const u=[];let d=r._tokenizer;d||(d=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,h=[],m={};let y,g,v=-1,b=r,k=0,C=0;const E=[C];for(;b;){for(;e.get(++s)[1]!==b;);u.push(s),b._tokenizer||(y=l.sliceStream(b),b.next||y.push(null),g&&d.defineSkip(b.start),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=r;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(C=v+1,E.push(C),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(d.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),v=E.length;v--;){const j=f.slice(E[v],E[v+1]),R=u.pop();h.push([R,R+j.length-1]),e.splice(R,2,j)}for(h.reverse(),v=-1;++v<h.length;)m[k+h[v][0]]=k+h[v][1],k+=h[v][1]-h[v][0]-1;return m}const b3={resolve:w3,tokenize:k3},S3={partial:!0,tokenize:j3};function w3(e){return xk(e),e}function k3(e,a){let r;return l;function l(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?u(f):_e(f)?e.check(S3,d,u)(f):(e.consume(f),s)}function u(f){return e.exit("chunkContent"),e.exit("content"),a(f)}function d(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function j3(e,a,r){const l=this;return s;function s(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ke(e,u,"linePrefix")}function u(d){if(d===null||_e(d))return r(d);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):e.interrupt(l.parser.constructs.flow,r,a)(d)}}function yk(e,a,r,l,s,u,d,f,h){const m=h||Number.POSITIVE_INFINITY;let y=0;return g;function g(j){return j===60?(e.enter(l),e.enter(s),e.enter(u),e.consume(j),e.exit(u),v):j===null||j===32||j===41||Ac(j)?r(j):(e.enter(l),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(j))}function v(j){return j===62?(e.enter(u),e.consume(j),e.exit(u),e.exit(s),e.exit(l),a):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===62?(e.exit("chunkString"),e.exit(f),v(j)):j===null||j===60||_e(j)?r(j):(e.consume(j),j===92?k:b)}function k(j){return j===60||j===62||j===92?(e.consume(j),b):b(j)}function C(j){return!y&&(j===null||j===41||ft(j))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(l),a(j)):y<m&&j===40?(e.consume(j),y++,C):j===41?(e.consume(j),y--,C):j===null||j===32||j===40||Ac(j)?r(j):(e.consume(j),j===92?E:C)}function E(j){return j===40||j===41||j===92?(e.consume(j),C):C(j)}}function vk(e,a,r,l,s,u){const d=this;let f=0,h;return m;function m(b){return e.enter(l),e.enter(s),e.consume(b),e.exit(s),e.enter(u),y}function y(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?r(b):b===93?(e.exit(u),e.enter(s),e.consume(b),e.exit(s),e.exit(l),a):_e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||_e(b)||f++>999?(e.exit("chunkString"),y(b)):(e.consume(b),h||(h=!Ge(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,g):g(b)}}function bk(e,a,r,l,s,u){let d;return f;function f(v){return v===34||v===39||v===40?(e.enter(l),e.enter(s),e.consume(v),e.exit(s),d=v===40?41:v,h):r(v)}function h(v){return v===d?(e.enter(s),e.consume(v),e.exit(s),e.exit(l),a):(e.enter(u),m(v))}function m(v){return v===d?(e.exit(u),h(d)):v===null?r(v):_e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Ke(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===d||v===null||_e(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?g:y)}function g(v){return v===d||v===92?(e.consume(v),y):y(v)}}function ss(e,a){let r;return l;function l(s){return _e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,l):Ge(s)?Ke(e,l,r?"linePrefix":"lineSuffix")(s):a(s)}}const C3={name:"definition",tokenize:N3},E3={partial:!0,tokenize:A3};function N3(e,a,r){const l=this;let s;return u;function u(b){return e.enter("definition"),d(b)}function d(b){return vk.call(l,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Xn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):r(b)}function h(b){return ft(b)?ss(e,m)(b):m(b)}function m(b){return yk(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(E3,g,g)(b)}function g(b){return Ge(b)?Ke(e,v,"whitespace")(b):v(b)}function v(b){return b===null||_e(b)?(e.exit("definition"),l.parser.defined.push(s),a(b)):r(b)}}function A3(e,a,r){return l;function l(f){return ft(f)?ss(e,s)(f):r(f)}function s(f){return bk(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Ge(f)?Ke(e,d,"whitespace")(f):d(f)}function d(f){return f===null||_e(f)?a(f):r(f)}}const T3={name:"hardBreakEscape",tokenize:_3};function _3(e,a,r){return l;function l(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return _e(u)?(e.exit("hardBreakEscape"),a(u)):r(u)}}const R3={name:"headingAtx",resolve:M3,tokenize:O3};function M3(e,a){let r=e.length-2,l=3,s,u;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(s={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},u={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},_n(e,l,r-l+1,[["enter",s,a],["enter",u,a],["exit",u,a],["exit",s,a]])),e}function O3(e,a,r){let l=0;return s;function s(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&l++<6?(e.consume(y),d):y===null||ft(y)?(e.exit("atxHeadingSequence"),f(y)):r(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||_e(y)?(e.exit("atxHeading"),a(y)):Ge(y)?Ke(e,f,"whitespace")(y):(e.enter("atxHeadingText"),m(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function m(y){return y===null||y===35||ft(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),m)}}const D3=["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"],fb=["pre","script","style","textarea"],z3={concrete:!0,name:"htmlFlow",resolveTo:U3,tokenize:I3},L3={partial:!0,tokenize:H3},P3={partial:!0,tokenize:B3};function U3(e){let a=e.length;for(;a--&&!(e[a][0]==="enter"&&e[a][1].type==="htmlFlow"););return a>1&&e[a-2][1].type==="linePrefix"&&(e[a][1].start=e[a-2][1].start,e[a+1][1].start=e[a-2][1].start,e.splice(a-2,2)),e}function I3(e,a,r){const l=this;let s,u,d,f,h;return m;function m(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),v):T===47?(e.consume(T),u=!0,C):T===63?(e.consume(T),s=3,l.interrupt?a:A):an(T)?(e.consume(T),d=String.fromCharCode(T),E):r(T)}function v(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,f=0,k):an(T)?(e.consume(T),s=4,l.interrupt?a:A):r(T)}function b(T){return T===45?(e.consume(T),l.interrupt?a:A):r(T)}function k(T){const oe="CDATA[";return T===oe.charCodeAt(f++)?(e.consume(T),f===oe.length?l.interrupt?a:ee:k):r(T)}function C(T){return an(T)?(e.consume(T),d=String.fromCharCode(T),E):r(T)}function E(T){if(T===null||T===47||T===62||ft(T)){const oe=T===47,ce=d.toLowerCase();return!oe&&!u&&fb.includes(ce)?(s=1,l.interrupt?a(T):ee(T)):D3.includes(d.toLowerCase())?(s=6,oe?(e.consume(T),j):l.interrupt?a(T):ee(T)):(s=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(T):u?R(T):O(T))}return T===45||Jt(T)?(e.consume(T),d+=String.fromCharCode(T),E):r(T)}function j(T){return T===62?(e.consume(T),l.interrupt?a:ee):r(T)}function R(T){return Ge(T)?(e.consume(T),R):P(T)}function O(T){return T===47?(e.consume(T),P):T===58||T===95||an(T)?(e.consume(T),_):Ge(T)?(e.consume(T),O):P(T)}function _(T){return T===45||T===46||T===58||T===95||Jt(T)?(e.consume(T),_):U(T)}function U(T){return T===61?(e.consume(T),M):Ge(T)?(e.consume(T),U):O(T)}function M(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),h=T,L):Ge(T)?(e.consume(T),M):F(T)}function L(T){return T===h?(e.consume(T),h=null,Y):T===null||_e(T)?r(T):(e.consume(T),L)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||ft(T)?U(T):(e.consume(T),F)}function Y(T){return T===47||T===62||Ge(T)?O(T):r(T)}function P(T){return T===62?(e.consume(T),W):r(T)}function W(T){return T===null||_e(T)?ee(T):Ge(T)?(e.consume(T),W):r(T)}function ee(T){return T===45&&s===2?(e.consume(T),z):T===60&&s===1?(e.consume(T),$):T===62&&s===4?(e.consume(T),D):T===63&&s===3?(e.consume(T),A):T===93&&s===5?(e.consume(T),G):_e(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L3,Z,fe)(T)):T===null||_e(T)?(e.exit("htmlFlowData"),fe(T)):(e.consume(T),ee)}function fe(T){return e.check(P3,ne,Z)(T)}function ne(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),H}function H(T){return T===null||_e(T)?fe(T):(e.enter("htmlFlowData"),ee(T))}function z(T){return T===45?(e.consume(T),A):ee(T)}function $(T){return T===47?(e.consume(T),d="",X):ee(T)}function X(T){if(T===62){const oe=d.toLowerCase();return fb.includes(oe)?(e.consume(T),D):ee(T)}return an(T)&&d.length<8?(e.consume(T),d+=String.fromCharCode(T),X):ee(T)}function G(T){return T===93?(e.consume(T),A):ee(T)}function A(T){return T===62?(e.consume(T),D):T===45&&s===2?(e.consume(T),A):ee(T)}function D(T){return T===null||_e(T)?(e.exit("htmlFlowData"),Z(T)):(e.consume(T),D)}function Z(T){return e.exit("htmlFlow"),a(T)}}function B3(e,a,r){const l=this;return s;function s(d){return _e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):r(d)}function u(d){return l.parser.lazy[l.now().line]?r(d):a(d)}}function H3(e,a,r){return l;function l(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(_s,a,r)}}const F3={name:"htmlText",tokenize:q3};function q3(e,a,r){const l=this;let s,u,d;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),U):A===63?(e.consume(A),O):an(A)?(e.consume(A),F):r(A)}function m(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),u=0,k):an(A)?(e.consume(A),R):r(A)}function y(A){return A===45?(e.consume(A),b):r(A)}function g(A){return A===null?r(A):A===45?(e.consume(A),v):_e(A)?(d=g,$(A)):(e.consume(A),g)}function v(A){return A===45?(e.consume(A),b):g(A)}function b(A){return A===62?z(A):A===45?v(A):g(A)}function k(A){const D="CDATA[";return A===D.charCodeAt(u++)?(e.consume(A),u===D.length?C:k):r(A)}function C(A){return A===null?r(A):A===93?(e.consume(A),E):_e(A)?(d=C,$(A)):(e.consume(A),C)}function E(A){return A===93?(e.consume(A),j):C(A)}function j(A){return A===62?z(A):A===93?(e.consume(A),j):C(A)}function R(A){return A===null||A===62?z(A):_e(A)?(d=R,$(A)):(e.consume(A),R)}function O(A){return A===null?r(A):A===63?(e.consume(A),_):_e(A)?(d=O,$(A)):(e.consume(A),O)}function _(A){return A===62?z(A):O(A)}function U(A){return an(A)?(e.consume(A),M):r(A)}function M(A){return A===45||Jt(A)?(e.consume(A),M):L(A)}function L(A){return _e(A)?(d=L,$(A)):Ge(A)?(e.consume(A),L):z(A)}function F(A){return A===45||Jt(A)?(e.consume(A),F):A===47||A===62||ft(A)?Y(A):r(A)}function Y(A){return A===47?(e.consume(A),z):A===58||A===95||an(A)?(e.consume(A),P):_e(A)?(d=Y,$(A)):Ge(A)?(e.consume(A),Y):z(A)}function P(A){return A===45||A===46||A===58||A===95||Jt(A)?(e.consume(A),P):W(A)}function W(A){return A===61?(e.consume(A),ee):_e(A)?(d=W,$(A)):Ge(A)?(e.consume(A),W):Y(A)}function ee(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),s=A,fe):_e(A)?(d=ee,$(A)):Ge(A)?(e.consume(A),ee):(e.consume(A),ne)}function fe(A){return A===s?(e.consume(A),s=void 0,H):A===null?r(A):_e(A)?(d=fe,$(A)):(e.consume(A),fe)}function ne(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||ft(A)?Y(A):(e.consume(A),ne)}function H(A){return A===47||A===62||ft(A)?Y(A):r(A)}function z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),a):r(A)}function $(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),X}function X(A){return Ge(A)?Ke(e,G,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):G(A)}function G(A){return e.enter("htmlTextData"),d(A)}}const Im={name:"labelEnd",resolveAll:V3,resolveTo:K3,tokenize:X3},G3={tokenize:Q3},$3={tokenize:Z3},Y3={tokenize:J3};function V3(e){let a=-1;const r=[];for(;++a<e.length;){const l=e[a][1];if(r.push(e[a]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const s=l.type==="labelImage"?4:2;l.type="data",a+=s}}return e.length!==r.length&&_n(e,0,e.length,r),e}function K3(e,a){let r=e.length,l=0,s,u,d,f;for(;r--;)if(s=e[r][1],u){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(u=r,s.type!=="labelLink")){l=2;break}}else s.type==="labelEnd"&&(d=r);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[u+l+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",h,a],["enter",m,a]],f=Hn(f,e.slice(u+1,u+l+3)),f=Hn(f,[["enter",y,a]]),f=Hn(f,du(a.parser.constructs.insideSpan.null,e.slice(u+l+4,d-3),a)),f=Hn(f,[["exit",y,a],e[d-2],e[d-1],["exit",m,a]]),f=Hn(f,e.slice(d+1)),f=Hn(f,[["exit",h,a]]),_n(e,u,e.length,f),e}function X3(e,a,r){const l=this;let s=l.events.length,u,d;for(;s--;)if((l.events[s][1].type==="labelImage"||l.events[s][1].type==="labelLink")&&!l.events[s][1]._balanced){u=l.events[s][1];break}return f;function f(v){return u?u._inactive?g(v):(d=l.parser.defined.includes(Xn(l.sliceSerialize({start:u.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(G3,y,d?y:g)(v):v===91?e.attempt($3,y,d?m:g)(v):d?y(v):g(v)}function m(v){return e.attempt(Y3,y,g)(v)}function y(v){return a(v)}function g(v){return u._balanced=!0,r(v)}}function Q3(e,a,r){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return ft(g)?ss(e,u)(g):u(g)}function u(g){return g===41?y(g):yk(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return ft(g)?ss(e,h)(g):y(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?bk(e,m,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function m(g){return ft(g)?ss(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),a):r(g)}}function Z3(e,a,r){const l=this;return s;function s(f){return vk.call(l,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return l.parser.defined.includes(Xn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?a(f):r(f)}function d(f){return r(f)}}function J3(e,a,r){return l;function l(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),s}function s(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),a):r(u)}}const W3={name:"labelStartImage",resolveAll:Im.resolveAll,tokenize:ez};function ez(e,a,r){const l=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):r(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(f):a(f)}}const tz={name:"labelStartLink",resolveAll:Im.resolveAll,tokenize:nz};function nz(e,a,r){const l=this;return s;function s(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):a(d)}}const ah={name:"lineEnding",tokenize:az};function az(e,a){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ke(e,a,"linePrefix")}}const hc={name:"thematicBreak",tokenize:rz};function rz(e,a,r){let l=0,s;return u;function u(m){return e.enter("thematicBreak"),d(m)}function d(m){return s=m,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):l>=3&&(m===null||_e(m))?(e.exit("thematicBreak"),a(m)):r(m)}function h(m){return m===s?(e.consume(m),l++,h):(e.exit("thematicBreakSequence"),Ge(m)?Ke(e,f,"whitespace")(m):f(m))}}const gn={continuation:{tokenize:oz},exit:uz,name:"list",tokenize:sz},lz={partial:!0,tokenize:dz},iz={partial:!0,tokenize:cz};function sz(e,a,r){const l=this,s=l.events[l.events.length-1];let u=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,d=0;return f;function f(b){const k=l.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!l.containerState.marker||b===l.containerState.marker:Ih(b)){if(l.containerState.type||(l.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(hc,r,m)(b):m(b);if(!l.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return r(b)}function h(b){return Ih(b)&&++d<10?(e.consume(b),h):(!l.interrupt||d<2)&&(l.containerState.marker?b===l.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):r(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||b,e.check(_s,l.interrupt?r:y,e.attempt(lz,v,g))}function y(b){return l.containerState.initialBlankLine=!0,u++,v(b)}function g(b){return Ge(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):r(b)}function v(b){return l.containerState.size=u+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,a(b)}}function oz(e,a,r){const l=this;return l.containerState._closeFlow=void 0,e.check(_s,s,u);function s(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ke(e,a,"listItemIndent",l.containerState.size+1)(f)}function u(f){return l.containerState.furtherBlankLines||!Ge(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,d(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(iz,a,d)(f))}function d(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ke(e,e.attempt(gn,a,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function cz(e,a,r){const l=this;return Ke(e,s,"listItemIndent",l.containerState.size+1);function s(u){const d=l.events[l.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===l.containerState.size?a(u):r(u)}}function uz(e){e.exit(this.containerState.type)}function dz(e,a,r){const l=this;return Ke(e,s,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(u){const d=l.events[l.events.length-1];return!Ge(u)&&d&&d[1].type==="listItemPrefixWhitespace"?a(u):r(u)}}const hb={name:"setextUnderline",resolveTo:fz,tokenize:hz};function fz(e,a){let r=e.length,l,s,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const d={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",u?(e.splice(s,0,["enter",d,a]),e.splice(u+1,0,["exit",e[l][1],a]),e[l][1].end={...e[u][1].end}):e[l][1]=d,e.push(["exit",d,a]),e}function hz(e,a,r){const l=this;let s;return u;function u(m){let y=l.events.length,g;for(;y--;)if(l.events[y][1].type!=="lineEnding"&&l.events[y][1].type!=="linePrefix"&&l.events[y][1].type!=="content"){g=l.events[y][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),s=m,d(m)):r(m)}function d(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),Ge(m)?Ke(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||_e(m)?(e.exit("setextHeadingLine"),a(m)):r(m)}}const mz={tokenize:pz};function pz(e){const a=this,r=e.attempt(_s,l,e.attempt(this.parser.constructs.flowInitial,s,Ke(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b3,s)),"linePrefix")));return r;function l(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),a.currentConstruct=void 0,r}function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a.currentConstruct=void 0,r}}const gz={resolveAll:wk()},xz=Sk("string"),yz=Sk("text");function Sk(e){return{resolveAll:wk(e==="text"?vz:void 0),tokenize:a};function a(r){const l=this,s=this.parser.constructs[e],u=r.attempt(s,d,f);return d;function d(y){return m(y)?u(y):f(y)}function f(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),h}function h(y){return m(y)?(r.exit("data"),u(y)):(r.consume(y),h)}function m(y){if(y===null)return!0;const g=s[y];let v=-1;if(g)for(;++v<g.length;){const b=g[v];if(!b.previous||b.previous.call(l,l.previous))return!0}return!1}}}function wk(e){return a;function a(r,l){let s=-1,u;for(;++s<=r.length;)u===void 0?r[s]&&r[s][1].type==="data"&&(u=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==u+2&&(r[u][1].end=r[s-1][1].end,r.splice(u+2,s-u-2),s=u+2),u=void 0);return e?e(r,l):r}}function vz(e,a){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],s=a.sliceStream(l);let u=s.length,d=-1,f=0,h;for(;u--;){const m=s[u];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(a._contentTypeTextTrailing&&r===e.length&&(f=0),f){const m={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:l.start._bufferIndex+d,_index:l.start._index+u,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...m.start},l.start.offset===l.end.offset?Object.assign(l,m):(e.splice(r,0,["enter",m,a],["exit",m,a]),r+=2)}r++}return e}const bz={42:gn,43:gn,45:gn,48:gn,49:gn,50:gn,51:gn,52:gn,53:gn,54:gn,55:gn,56:gn,57:gn,62:mk},Sz={91:C3},wz={[-2]:nh,[-1]:nh,32:nh},kz={35:R3,42:hc,45:[hb,hc],60:z3,61:hb,95:hc,96:db,126:db},jz={38:gk,92:pk},Cz={[-5]:ah,[-4]:ah,[-3]:ah,33:W3,38:gk,42:Bh,60:[t3,F3],91:tz,92:[T3,pk],93:Im,95:Bh,96:m3},Ez={null:[Bh,gz]},Nz={null:[42,95]},Az={null:[]},Tz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nz,contentInitial:Sz,disable:Az,document:bz,flow:kz,flowInitial:wz,insideSpan:Ez,string:jz,text:Cz},Symbol.toStringTag,{value:"Module"}));function _z(e,a,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},u=[];let d=[],f=[];const h={attempt:L(U),check:L(M),consume:R,enter:O,exit:_,interrupt:L(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:g};let y=a.tokenize.call(m,h);return a.resolveAll&&u.push(a),m;function g(W){return d=Hn(d,W),E(),d[d.length-1]!==null?[]:(F(a,0),m.events=du(u,m.events,m),m.events)}function v(W,ee){return Mz(b(W),ee)}function b(W){return Rz(d,W)}function k(){const{_bufferIndex:W,_index:ee,line:fe,column:ne,offset:H}=l;return{_bufferIndex:W,_index:ee,line:fe,column:ne,offset:H}}function C(W){s[W.line]=W.column,P()}function E(){let W;for(;l._index<d.length;){const ee=d[l._index];if(typeof ee=="string")for(W=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===W&&l._bufferIndex<ee.length;)j(ee.charCodeAt(l._bufferIndex));else j(ee)}}function j(W){y=y(W)}function R(W){_e(W)?(l.line++,l.column=1,l.offset+=W===-3?2:1,P()):W!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===d[l._index].length&&(l._bufferIndex=-1,l._index++)),m.previous=W}function O(W,ee){const fe=ee||{};return fe.type=W,fe.start=k(),m.events.push(["enter",fe,m]),f.push(fe),fe}function _(W){const ee=f.pop();return ee.end=k(),m.events.push(["exit",ee,m]),ee}function U(W,ee){F(W,ee.from)}function M(W,ee){ee.restore()}function L(W,ee){return fe;function fe(ne,H,z){let $,X,G,A;return Array.isArray(ne)?Z(ne):"tokenize"in ne?Z([ne]):D(ne);function D(ue){return ge;function ge(Le){const Ee=Le!==null&&ue[Le],vt=Le!==null&&ue.null,rt=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return Z(rt)(Le)}}function Z(ue){return $=ue,X=0,ue.length===0?z:T(ue[X])}function T(ue){return ge;function ge(Le){return A=Y(),G=ue,ue.partial||(m.currentConstruct=ue),ue.name&&m.parser.constructs.disable.null.includes(ue.name)?ce():ue.tokenize.call(ee?Object.assign(Object.create(m),ee):m,h,oe,ce)(Le)}}function oe(ue){return W(G,A),H}function ce(ue){return A.restore(),++X<$.length?T($[X]):z}}}function F(W,ee){W.resolveAll&&!u.includes(W)&&u.push(W),W.resolve&&_n(m.events,ee,m.events.length-ee,W.resolve(m.events.slice(ee),m)),W.resolveTo&&(m.events=W.resolveTo(m.events,m))}function Y(){const W=k(),ee=m.previous,fe=m.currentConstruct,ne=m.events.length,H=Array.from(f);return{from:ne,restore:z};function z(){l=W,m.previous=ee,m.currentConstruct=fe,m.events.length=ne,f=H,P()}}function P(){l.line in s&&l.column<2&&(l.column=s[l.line],l.offset+=s[l.line]-1)}}function Rz(e,a){const r=a.start._index,l=a.start._bufferIndex,s=a.end._index,u=a.end._bufferIndex;let d;if(r===s)d=[e[r].slice(l,u)];else{if(d=e.slice(r,s),l>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(l):d.shift()}u>0&&d.push(e[s].slice(0,u))}return d}function Mz(e,a){let r=-1;const l=[];let s;for(;++r<e.length;){const u=e[r];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
56
+ `;break}case-3:{d=`\r
57
+ `;break}case-2:{d=a?" ":" ";break}case-1:{if(!a&&s)continue;d=" ";break}default:d=String.fromCharCode(u)}s=u===-2,l.push(d)}return l.join("")}function Oz(e){const l={constructs:fk([Tz,...(e||{}).extensions||[]]),content:s(KD),defined:[],document:s(QD),flow:s(mz),lazy:{},string:s(xz),text:s(yz)};return l;function s(u){return d;function d(f){return _z(l,u,f)}}}function Dz(e){for(;!xk(e););return e}const mb=/[\0\t\n\r]/g;function zz(){let e=1,a="",r=!0,l;return s;function s(u,d,f){const h=[];let m,y,g,v,b;for(u=a+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),g=0,a="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){if(mb.lastIndex=g,m=mb.exec(u),v=m&&m.index!==void 0?m.index:u.length,b=u.charCodeAt(v),!m){a=u.slice(g);break}if(b===10&&g===v&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),g<v&&(h.push(u.slice(g,v)),e+=v-g),b){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}g=v+1}return f&&(l&&h.push(-5),a&&h.push(a),h.push(null)),h}}const Lz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pz(e){return e.replace(Lz,Uz)}function Uz(e,a,r){if(a)return a;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),u=s===120||s===88;return hk(r.slice(u?2:1),u?16:10)}return Um(r)||e}const kk={}.hasOwnProperty;function Iz(e,a,r){return a&&typeof a=="object"&&(r=a,a=void 0),Bz(r)(Dz(Oz(r).document().write(zz()(e,a,!0))))}function Bz(e){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Me),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:u(he),blockQuote:u(vt),characterEscape:Y,characterReference:Y,codeFenced:u(rt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(rt,d),codeText:u(ie,d),codeTextData:Y,data:Y,codeFlowValue:Y,definition:u(jt),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(je),hardBreakEscape:u(ze),hardBreakTrailing:u(ze),htmlFlow:u(se,d),htmlFlowData:Y,htmlText:u(se,d),htmlTextData:Y,image:u(Te),label:d,link:u(Me),listItem:u(mt),listItemValue:v,listOrdered:u(Tt,g),listUnordered:u(Tt),paragraph:u(tt),reference:T,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(he),strong:u(Ft),thematicBreak:u(sn)},exit:{atxHeading:h(),atxHeadingSequence:U,autolink:h(),autolinkEmail:Ee,autolinkProtocol:Le,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:ue,characterReference:ge,codeFenced:h(E),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:P,codeIndented:h(j),codeText:h(H),codeTextData:P,data:P,definition:h(),definitionDestinationString:_,definitionLabelString:R,definitionTitleString:O,emphasis:h(),hardBreakEscape:h(ee),hardBreakTrailing:h(ee),htmlFlow:h(fe),htmlFlowData:P,htmlText:h(ne),htmlTextData:P,image:h($),label:G,labelText:X,lineEnding:W,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:A,resourceTitleString:D,resource:Z,setextHeading:h(F),setextHeadingLineSequence:L,setextHeadingText:M,strong:h(),thematicBreak:h()}};jk(a,(e||{}).mdastExtensions||[]);const r={};return l;function l(ae){let me={type:"root",children:[]};const Oe={stack:[me],tokenStack:[],config:a,enter:f,exit:m,buffer:d,resume:y,data:r},He=[];let et=-1;for(;++et<ae.length;)if(ae[et][1].type==="listOrdered"||ae[et][1].type==="listUnordered")if(ae[et][0]==="enter")He.push(et);else{const vn=He.pop();et=s(ae,vn,et)}for(et=-1;++et<ae.length;){const vn=a[ae[et][0]];kk.call(vn,ae[et][1].type)&&vn[ae[et][1].type].call(Object.assign({sliceSerialize:ae[et][2].sliceSerialize},Oe),ae[et][1])}if(Oe.tokenStack.length>0){const vn=Oe.tokenStack[Oe.tokenStack.length-1];(vn[1]||pb).call(Oe,void 0,vn[0])}for(me.position={start:cr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:cr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<a.transforms.length;)me=a.transforms[et](me)||me;return me}function s(ae,me,Oe){let He=me-1,et=-1,vn=!1,fa,tn,zt,on;for(;++He<=Oe;){const ot=ae[He];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?et++:et--,on=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(fa&&!on&&!et&&!zt&&(zt=He),on=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:on=void 0}if(!et&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||et===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(fa){let La=He;for(tn=void 0;La--;){const $n=ae[La];if($n[1].type==="lineEnding"||$n[1].type==="lineEndingBlank"){if($n[0]==="exit")continue;tn&&(ae[tn][1].type="lineEndingBlank",vn=!0),$n[1].type="lineEnding",tn=La}else if(!($n[1].type==="linePrefix"||$n[1].type==="blockQuotePrefix"||$n[1].type==="blockQuotePrefixWhitespace"||$n[1].type==="blockQuoteMarker"||$n[1].type==="listItemIndent"))break}zt&&(!tn||zt<tn)&&(fa._spread=!0),fa.end=Object.assign({},tn?ae[tn][1].start:ot[1].end),ae.splice(tn||He,0,["exit",fa,ot[2]]),He++,Oe++}if(ot[1].type==="listItemPrefix"){const La={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};fa=La,ae.splice(He,0,["enter",La,ot[2]]),He++,Oe++,zt=void 0,on=!0}}}return ae[me][1]._spread=vn,Oe}function u(ae,me){return Oe;function Oe(He){f.call(this,ae(He),He),me&&me.call(this,He)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ae,me,Oe){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([me,Oe||void 0]),ae.position={start:cr(me.start),end:void 0}}function h(ae){return me;function me(Oe){ae&&ae.call(this,Oe),m.call(this,Oe)}}function m(ae,me){const Oe=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==ae.type&&(me?me.call(this,ae,He[0]):(He[1]||pb).call(this,ae,He[0]));else throw new Error("Cannot close `"+ae.type+"` ("+is({start:ae.start,end:ae.end})+"): it’s not open");Oe.position.end=cr(ae.end)}function y(){return Pm(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(ae){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.lang=ae}function k(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.meta=ae}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae.replace(/(\r?\n|\r)$/g,"")}function R(ae){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Xn(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.title=ae}function _(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.url=ae}function U(ae){const me=this.stack[this.stack.length-1];if(!me.depth){const Oe=this.sliceSerialize(ae).length;me.depth=Oe}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function L(ae){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(ae){const Oe=this.stack[this.stack.length-1].children;let He=Oe[Oe.length-1];(!He||He.type!=="text")&&(He=Qe(),He.position={start:cr(ae.start),end:void 0},Oe.push(He)),this.stack.push(He)}function P(ae){const me=this.stack.pop();me.value+=this.sliceSerialize(ae),me.position.end=cr(ae.end)}function W(ae){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=me.children[me.children.length-1];Oe.position.end=cr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&a.canContainEols.includes(me.type)&&(Y.call(this,ae),P.call(this,ae))}function ee(){this.data.atHardBreak=!0}function fe(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function ne(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function H(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.value=ae}function z(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=me,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function $(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=me,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function X(ae){const me=this.sliceSerialize(ae),Oe=this.stack[this.stack.length-2];Oe.label=Pz(me),Oe.identifier=Xn(me).toLowerCase()}function G(){const ae=this.stack[this.stack.length-1],me=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const He=ae.children;Oe.children=He}else Oe.alt=me}function A(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.url=ae}function D(){const ae=this.resume(),me=this.stack[this.stack.length-1];me.title=ae}function Z(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function oe(ae){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Xn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function ue(ae){const me=this.sliceSerialize(ae),Oe=this.data.characterReferenceType;let He;Oe?(He=hk(me,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Um(me);const et=this.stack[this.stack.length-1];et.value+=He}function ge(ae){const me=this.stack.pop();me.position.end=cr(ae.end)}function Le(ae){P.call(this,ae);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ae)}function Ee(ae){P.call(this,ae);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ae)}function vt(){return{type:"blockquote",children:[]}}function rt(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function jt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function se(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function Tt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function mt(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function tt(){return{type:"paragraph",children:[]}}function Ft(){return{type:"strong",children:[]}}function Qe(){return{type:"text",value:""}}function sn(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function jk(e,a){let r=-1;for(;++r<a.length;){const l=a[r];Array.isArray(l)?jk(e,l):Hz(e,l)}}function Hz(e,a){let r;for(r in a)if(kk.call(a,r))switch(r){case"canContainEols":{const l=a[r];l&&e[r].push(...l);break}case"transforms":{const l=a[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=a[r];l&&Object.assign(e[r],l);break}}}function pb(e,a){throw e?new Error("Cannot close `"+e.type+"` ("+is({start:e.start,end:e.end})+"): a different token (`"+a.type+"`, "+is({start:a.start,end:a.end})+") is open"):new Error("Cannot close document, a token (`"+a.type+"`, "+is({start:a.start,end:a.end})+") is still open")}function Fz(e){const a=this;a.parser=r;function r(l){return Iz(l,{...a.data("settings"),...e,extensions:a.data("micromarkExtensions")||[],mdastExtensions:a.data("fromMarkdownExtensions")||[]})}}function qz(e,a){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(a),!0)};return e.patch(a,r),e.applyData(a,r)}function Gz(e,a){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(a,r),[e.applyData(a,r),{type:"text",value:`
58
+ `}]}function $z(e,a){const r=a.value?a.value+`
59
+ `:"",l={},s=a.lang?a.lang.split(/\s+/):[];s.length>0&&(l.className=["language-"+s[0]]);let u={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return a.meta&&(u.data={meta:a.meta}),e.patch(a,u),u=e.applyData(a,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(a,u),u}function Yz(e,a){const r={type:"element",tagName:"del",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function Vz(e,a){const r={type:"element",tagName:"em",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function Kz(e,a){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(a.identifier).toUpperCase(),s=ni(l.toLowerCase()),u=e.footnoteOrder.indexOf(l);let d,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(a,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(a,m),e.applyData(a,m)}function Xz(e,a){const r={type:"element",tagName:"h"+a.depth,properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function Qz(e,a){if(e.options.allowDangerousHtml){const r={type:"raw",value:a.value};return e.patch(a,r),e.applyData(a,r)}}function Ck(e,a){const r=a.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(a.label||a.identifier)+"]"),a.type==="imageReference")return[{type:"text",value:"!["+a.alt+l}];const s=e.all(a),u=s[0];u&&u.type==="text"?u.value="["+u.value:s.unshift({type:"text",value:"["});const d=s[s.length-1];return d&&d.type==="text"?d.value+=l:s.push({type:"text",value:l}),s}function Zz(e,a){const r=String(a.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Ck(e,a);const s={src:ni(l.url||""),alt:a.alt};l.title!==null&&l.title!==void 0&&(s.title=l.title);const u={type:"element",tagName:"img",properties:s,children:[]};return e.patch(a,u),e.applyData(a,u)}function Jz(e,a){const r={src:ni(a.url)};a.alt!==null&&a.alt!==void 0&&(r.alt=a.alt),a.title!==null&&a.title!==void 0&&(r.title=a.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(a,l),e.applyData(a,l)}function Wz(e,a){const r={type:"text",value:a.value.replace(/\r?\n|\r/g," ")};e.patch(a,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(a,l),e.applyData(a,l)}function e5(e,a){const r=String(a.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Ck(e,a);const s={href:ni(l.url||"")};l.title!==null&&l.title!==void 0&&(s.title=l.title);const u={type:"element",tagName:"a",properties:s,children:e.all(a)};return e.patch(a,u),e.applyData(a,u)}function t5(e,a){const r={href:ni(a.url)};a.title!==null&&a.title!==void 0&&(r.title=a.title);const l={type:"element",tagName:"a",properties:r,children:e.all(a)};return e.patch(a,l),e.applyData(a,l)}function n5(e,a,r){const l=e.all(a),s=r?a5(r):Ek(a),u={},d=[];if(typeof a.checked=="boolean"){const y=l[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:a.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const y=l[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
60
+ `}),y.type==="element"&&y.tagName==="p"&&!s?d.push(...y.children):d.push(y)}const h=l[l.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
61
+ `});const m={type:"element",tagName:"li",properties:u,children:d};return e.patch(a,m),e.applyData(a,m)}function a5(e){let a=!1;if(e.type==="list"){a=e.spread||!1;const r=e.children;let l=-1;for(;!a&&++l<r.length;)a=Ek(r[l])}return a}function Ek(e){const a=e.spread;return a??e.children.length>1}function r5(e,a){const r={},l=e.all(a);let s=-1;for(typeof a.start=="number"&&a.start!==1&&(r.start=a.start);++s<l.length;){const d=l[s];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:a.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(a,u),e.applyData(a,u)}function l5(e,a){const r={type:"element",tagName:"p",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function i5(e,a){const r={type:"root",children:e.wrap(e.all(a))};return e.patch(a,r),e.applyData(a,r)}function s5(e,a){const r={type:"element",tagName:"strong",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function o5(e,a){const r=e.all(a),l=r.shift(),s=[];if(l){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(a.children[0],d),s.push(d)}if(r.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Om(a.children[1]),h=lk(a.children[a.children.length-1]);f&&h&&(d.position={start:f,end:h}),s.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(a,u),e.applyData(a,u)}function c5(e,a,r){const l=r?r.children:void 0,u=(l?l.indexOf(a):1)===0?"th":"td",d=r&&r.type==="table"?r.align:void 0,f=d?d.length:a.children.length;let h=-1;const m=[];for(;++h<f;){const g=a.children[h],v={},b=d?d[h]:void 0;b&&(v.align=b);let k={type:"element",tagName:u,properties:v,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),m.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(a,y),e.applyData(a,y)}function u5(e,a){const r={type:"element",tagName:"td",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}const gb=9,xb=32;function d5(e){const a=String(e),r=/\r?\n|\r/g;let l=r.exec(a),s=0;const u=[];for(;l;)u.push(yb(a.slice(s,l.index),s>0,!0),l[0]),s=l.index+l[0].length,l=r.exec(a);return u.push(yb(a.slice(s),s>0,!1)),u.join("")}function yb(e,a,r){let l=0,s=e.length;if(a){let u=e.codePointAt(l);for(;u===gb||u===xb;)l++,u=e.codePointAt(l)}if(r){let u=e.codePointAt(s-1);for(;u===gb||u===xb;)s--,u=e.codePointAt(s-1)}return s>l?e.slice(l,s):""}function f5(e,a){const r={type:"text",value:d5(String(a.value))};return e.patch(a,r),e.applyData(a,r)}function h5(e,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(a,r),e.applyData(a,r)}const m5={blockquote:qz,break:Gz,code:$z,delete:Yz,emphasis:Vz,footnoteReference:Kz,heading:Xz,html:Qz,imageReference:Zz,image:Jz,inlineCode:Wz,linkReference:e5,link:t5,listItem:n5,list:r5,paragraph:l5,root:i5,strong:s5,table:o5,tableCell:u5,tableRow:c5,text:f5,thematicBreak:h5,toml:rc,yaml:rc,definition:rc,footnoteDefinition:rc};function rc(){}const Nk=-1,fu=0,os=1,Tc=2,Bm=3,Hm=4,Fm=5,qm=6,Ak=7,Tk=8,vb=typeof self=="object"?self:globalThis,p5=(e,a)=>{const r=(s,u)=>(e.set(u,s),s),l=s=>{if(e.has(s))return e.get(s);const[u,d]=a[s];switch(u){case fu:case Nk:return r(d,s);case os:{const f=r([],s);for(const h of d)f.push(l(h));return f}case Tc:{const f=r({},s);for(const[h,m]of d)f[l(h)]=l(m);return f}case Bm:return r(new Date(d),s);case Hm:{const{source:f,flags:h}=d;return r(new RegExp(f,h),s)}case Fm:{const f=r(new Map,s);for(const[h,m]of d)f.set(l(h),l(m));return f}case qm:{const f=r(new Set,s);for(const h of d)f.add(l(h));return f}case Ak:{const{name:f,message:h}=d;return r(new vb[f](h),s)}case Tk:return r(BigInt(d),s);case"BigInt":return r(Object(BigInt(d)),s);case"ArrayBuffer":return r(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return r(new DataView(f),d)}}return r(new vb[u](d),s)};return l},bb=e=>p5(new Map,e)(0),Pl="",{toString:g5}={},{keys:x5}=Object,es=e=>{const a=typeof e;if(a!=="object"||!e)return[fu,a];const r=g5.call(e).slice(8,-1);switch(r){case"Array":return[os,Pl];case"Object":return[Tc,Pl];case"Date":return[Bm,Pl];case"RegExp":return[Hm,Pl];case"Map":return[Fm,Pl];case"Set":return[qm,Pl];case"DataView":return[os,r]}return r.includes("Array")?[os,r]:r.includes("Error")?[Ak,r]:[Tc,r]},lc=([e,a])=>e===fu&&(a==="function"||a==="symbol"),y5=(e,a,r,l)=>{const s=(d,f)=>{const h=l.push(d)-1;return r.set(f,h),h},u=d=>{if(r.has(d))return r.get(d);let[f,h]=es(d);switch(f){case fu:{let y=d;switch(h){case"bigint":f=Tk,y=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return s([Nk],d)}return s([f,y],d)}case os:{if(h){let v=d;return h==="DataView"?v=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(d)),s([h,[...v]],d)}const y=[],g=s([f,y],d);for(const v of d)y.push(u(v));return g}case Tc:{if(h)switch(h){case"BigInt":return s([h,d.toString()],d);case"Boolean":case"Number":case"String":return s([h,d.valueOf()],d)}if(a&&"toJSON"in d)return u(d.toJSON());const y=[],g=s([f,y],d);for(const v of x5(d))(e||!lc(es(d[v])))&&y.push([u(v),u(d[v])]);return g}case Bm:return s([f,d.toISOString()],d);case Hm:{const{source:y,flags:g}=d;return s([f,{source:y,flags:g}],d)}case Fm:{const y=[],g=s([f,y],d);for(const[v,b]of d)(e||!(lc(es(v))||lc(es(b))))&&y.push([u(v),u(b)]);return g}case qm:{const y=[],g=s([f,y],d);for(const v of d)(e||!lc(es(v)))&&y.push(u(v));return g}}const{message:m}=d;return s([f,{name:h,message:m}],d)};return u},Sb=(e,{json:a,lossy:r}={})=>{const l=[];return y5(!(a||r),!!a,new Map,l)(e),l},_c=typeof structuredClone=="function"?(e,a)=>a&&("json"in a||"lossy"in a)?bb(Sb(e,a)):structuredClone(e):(e,a)=>bb(Sb(e,a));function v5(e,a){const r=[{type:"text",value:"↩"}];return a>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(a)}]}),r}function b5(e,a){return"Back to reference "+(e+1)+(a>1?"-"+a:"")}function S5(e){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||v5,l=e.options.footnoteBackLabel||b5,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const y=e.all(m),g=String(m.identifier).toUpperCase(),v=ni(g.toLowerCase());let b=0;const k=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++b<=C;){k.length>0&&k.push({type:"text",value:" "});let R=typeof r=="string"?r:r(h,b);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const j={type:"element",tagName:"li",properties:{id:a+"fn-"+v},children:e.wrap(y,!0)};e.patch(m,j),f.push(j)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{..._c(d),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
62
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
63
+ `}]}}const hu=(function(e){if(e==null)return C5;if(typeof e=="function")return mu(e);if(typeof e=="object")return Array.isArray(e)?w5(e):k5(e);if(typeof e=="string")return j5(e);throw new Error("Expected function, string, or object as test")});function w5(e){const a=[];let r=-1;for(;++r<e.length;)a[r]=hu(e[r]);return mu(l);function l(...s){let u=-1;for(;++u<a.length;)if(a[u].apply(this,s))return!0;return!1}}function k5(e){const a=e;return mu(r);function r(l){const s=l;let u;for(u in e)if(s[u]!==a[u])return!1;return!0}}function j5(e){return mu(a);function a(r){return r&&r.type===e}}function mu(e){return a;function a(r,l,s){return!!(E5(r)&&e.call(this,r,typeof l=="number"?l:void 0,s||void 0))}}function C5(){return!0}function E5(e){return e!==null&&typeof e=="object"&&"type"in e}const _k=[],N5=!0,Hh=!1,A5="skip";function Rk(e,a,r,l){let s;typeof a=="function"&&typeof r!="function"?(l=r,r=a):s=a;const u=hu(s),d=l?-1:1;f(e,void 0,[])();function f(h,m,y){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=_k,k,C,E;if((!a||u(h,m,y[y.length-1]||void 0))&&(b=T5(r(h,y)),b[0]===Hh))return b;if("children"in h&&h.children){const j=h;if(j.children&&b[0]!==A5)for(C=(l?j.children.length:-1)+d,E=y.concat(j);C>-1&&C<j.children.length;){const R=j.children[C];if(k=f(R,C,E)(),k[0]===Hh)return k;C=typeof k[1]=="number"?k[1]:C+d}}return b}}}function T5(e){return Array.isArray(e)?e:typeof e=="number"?[N5,e]:e==null?_k:[e]}function Gm(e,a,r,l){let s,u,d;typeof a=="function"&&typeof r!="function"?(u=void 0,d=a,s=r):(u=a,d=r,s=l),Rk(e,u,f,s);function f(h,m){const y=m[m.length-1],g=y?y.children.indexOf(h):void 0;return d(h,g,y)}}const Fh={}.hasOwnProperty,_5={};function R5(e,a){const r=a||_5,l=new Map,s=new Map,u=new Map,d={...m5,...r.handlers},f={all:m,applyData:O5,definitionById:l,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:d,one:h,options:r,patch:M5,wrap:z5};return Gm(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?l:s,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),f;function h(y,g){const v=y.type,b=f.handlers[v];if(Fh.call(f.handlers,v)&&b)return b(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in y){const{children:C,...E}=y,j=_c(E);return j.children=f.all(y),j}return _c(y)}return(f.options.unknownHandler||D5)(f,y,g)}function m(y){const g=[];if("children"in y){const v=y.children;let b=-1;for(;++b<v.length;){const k=f.one(v[b],y);if(k){if(b&&v[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=wb(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=wb(C.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function M5(e,a){e.position&&(a.position=bD(e))}function O5(e,a){let r=a;if(e&&e.data){const l=e.data.hName,s=e.data.hChildren,u=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const d="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:d}}r.type==="element"&&u&&Object.assign(r.properties,_c(u)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function D5(e,a){const r=a.data||{},l="value"in a&&!(Fh.call(r,"hProperties")||Fh.call(r,"hChildren"))?{type:"text",value:a.value}:{type:"element",tagName:"div",properties:{},children:e.all(a)};return e.patch(a,l),e.applyData(a,l)}function z5(e,a){const r=[];let l=-1;for(a&&r.push({type:"text",value:`
64
+ `});++l<e.length;)l&&r.push({type:"text",value:`
65
+ `}),r.push(e[l]);return a&&e.length>0&&r.push({type:"text",value:`
66
+ `}),r}function wb(e){let a=0,r=e.charCodeAt(a);for(;r===9||r===32;)a++,r=e.charCodeAt(a);return e.slice(a)}function kb(e,a){const r=R5(e,a),l=r.one(e,void 0),s=S5(r),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&u.children.push({type:"text",value:`
67
+ `},s),u}function L5(e,a){return e&&"run"in e?async function(r,l){const s=kb(r,{file:l,...a});await e.run(s,l)}:function(r,l){return kb(r,{file:l,...e||a})}}function jb(e){if(e)throw e}var rh,Cb;function P5(){if(Cb)return rh;Cb=1;var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):a.call(m)==="[object Array]"},u=function(m){if(!m||a.call(m)!=="[object Object]")return!1;var y=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!y&&!g)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},d=function(m,y){r&&y.name==="__proto__"?r(m,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):m[y.name]=y.newValue},f=function(m,y){if(y==="__proto__")if(e.call(m,y)){if(l)return l(m,y).value}else return;return m[y]};return rh=function h(){var m,y,g,v,b,k,C=arguments[0],E=1,j=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},E=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});E<j;++E)if(m=arguments[E],m!=null)for(y in m)g=f(C,y),v=f(m,y),C!==v&&(R&&v&&(u(v)||(b=s(v)))?(b?(b=!1,k=g&&s(g)?g:[]):k=g&&u(g)?g:{},d(C,{name:y,newValue:h(R,k,v)})):typeof v<"u"&&d(C,{name:y,newValue:v}));return C},rh}var U5=P5();const lh=Mc(U5);function qh(e){if(typeof e!="object"||e===null)return!1;const a=Object.getPrototypeOf(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function I5(){const e=[],a={run:r,use:l};return a;function r(...s){let u=-1;const d=s.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...s);function f(h,...m){const y=e[++u];let g=-1;if(h){d(h);return}for(;++g<s.length;)(m[g]===null||m[g]===void 0)&&(m[g]=s[g]);s=m,y?B5(y,f)(...m):d(null,...m)}}function l(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),a}}function B5(e,a){let r;return l;function l(...d){const f=e.length>d.length;let h;f&&d.push(s);try{h=e.apply(this,d)}catch(m){const y=m;if(f&&r)throw y;return s(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,s):h instanceof Error?s(h):u(h))}function s(d,...f){r||(r=!0,a(d,...f))}function u(d){s(null,d)}}const aa={basename:H5,dirname:F5,extname:q5,join:G5,sep:"/"};function H5(e,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');Rs(e);let r=0,l=-1,s=e.length,u;if(a===void 0||a.length===0||a.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(u){r=s+1;break}}else l<0&&(u=!0,l=s+1);return l<0?"":e.slice(r,l)}if(a===e)return"";let d=-1,f=a.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){r=s+1;break}}else d<0&&(u=!0,d=s+1),f>-1&&(e.codePointAt(s)===a.codePointAt(f--)?f<0&&(l=s):(f=-1,l=d));return r===l?l=d:l<0&&(l=e.length),e.slice(r,l)}function F5(e){if(Rs(e),e.length===0)return".";let a=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){a=r;break}}else l||(l=!0);return a<0?e.codePointAt(0)===47?"/":".":a===1&&e.codePointAt(0)===47?"//":e.slice(0,a)}function q5(e){Rs(e);let a=e.length,r=-1,l=0,s=-1,u=0,d;for(;a--;){const f=e.codePointAt(a);if(f===47){if(d){l=a+1;break}continue}r<0&&(d=!0,r=a+1),f===46?s<0?s=a:u!==1&&(u=1):s>-1&&(u=-1)}return s<0||r<0||u===0||u===1&&s===r-1&&s===l+1?"":e.slice(s,r)}function G5(...e){let a=-1,r;for(;++a<e.length;)Rs(e[a]),e[a]&&(r=r===void 0?e[a]:r+"/"+e[a]);return r===void 0?".":$5(r)}function $5(e){Rs(e);const a=e.codePointAt(0)===47;let r=Y5(e,!a);return r.length===0&&!a&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),a?"/"+r:r}function Y5(e,a){let r="",l=0,s=-1,u=0,d=-1,f,h;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(s===d-1||u===1))if(s!==d-1&&u===2){if(r.length<2||l!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",l=0):(r=r.slice(0,h),l=r.length-1-r.lastIndexOf("/")),s=d,u=0;continue}}else if(r.length>0){r="",l=0,s=d,u=0;continue}}a&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(s+1,d):r=e.slice(s+1,d),l=d-s-1;s=d,u=0}else f===46&&u>-1?u++:u=-1}return r}function Rs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const V5={cwd:K5};function K5(){return"/"}function Gh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function X5(e){if(typeof e=="string")e=new URL(e);else if(!Gh(e)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(e.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return Q5(e)}function Q5(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const a=e.pathname;let r=-1;for(;++r<a.length;)if(a.codePointAt(r)===37&&a.codePointAt(r+1)===50){const l=a.codePointAt(r+2);if(l===70||l===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(a)}const ih=["history","path","basename","stem","extname","dirname"];class Mk{constructor(a){let r;a?Gh(a)?r={path:a}:typeof a=="string"||Z5(a)?r={value:a}:r=a:r={},this.cwd="cwd"in r?"":V5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<ih.length;){const u=ih[l];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let s;for(s in r)ih.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?aa.basename(this.path):void 0}set basename(a){oh(a,"basename"),sh(a,"basename"),this.path=aa.join(this.dirname||"",a)}get dirname(){return typeof this.path=="string"?aa.dirname(this.path):void 0}set dirname(a){Eb(this.basename,"dirname"),this.path=aa.join(a||"",this.basename)}get extname(){return typeof this.path=="string"?aa.extname(this.path):void 0}set extname(a){if(sh(a,"extname"),Eb(this.dirname,"extname"),a){if(a.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(a.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=aa.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){Gh(a)&&(a=X5(a)),oh(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return typeof this.path=="string"?aa.basename(this.path,this.extname):void 0}set stem(a){oh(a,"stem"),sh(a,"stem"),this.path=aa.join(this.dirname||"",a+(this.extname||""))}fail(a,r,l){const s=this.message(a,r,l);throw s.fatal=!0,s}info(a,r,l){const s=this.message(a,r,l);return s.fatal=void 0,s}message(a,r,l){const s=new en(a,r,l);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(a){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(a||void 0).decode(this.value)}}function sh(e,a){if(e&&e.includes(aa.sep))throw new Error("`"+a+"` cannot be a path: did not expect `"+aa.sep+"`")}function oh(e,a){if(!e)throw new Error("`"+a+"` cannot be empty")}function Eb(e,a){if(!e)throw new Error("Setting `"+a+"` requires `path` to be set too")}function Z5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J5=(function(e){const l=this.constructor.prototype,s=l[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,l),u}),W5={}.hasOwnProperty;class $m extends J5{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=I5()}copy(){const a=new $m;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];a.use(...l)}return a.data(lh(!0,{},this.namespace)),a}data(a,r){return typeof a=="string"?arguments.length===2?(dh("data",this.frozen),this.namespace[a]=r,this):W5.call(this.namespace,a)&&this.namespace[a]||void 0:a?(dh("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;const a=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const s=r.call(a,...l);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(a){this.freeze();const r=ic(a),l=this.parser||this.Parser;return ch("parse",l),l(String(r),r)}process(a,r){const l=this;return this.freeze(),ch("process",this.parser||this.Parser),uh("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(u,d){const f=ic(a),h=l.parse(f);l.run(h,f,function(y,g,v){if(y||!g||!v)return m(y);const b=g,k=l.stringify(b,v);nL(k)?v.value=k:v.result=k,m(y,v)});function m(y,g){y||!g?d(y):u?u(g):r(void 0,g)}}}processSync(a){let r=!1,l;return this.freeze(),ch("processSync",this.parser||this.Parser),uh("processSync",this.compiler||this.Compiler),this.process(a,s),Ab("processSync","process",r),l;function s(u,d){r=!0,jb(u),l=d}}run(a,r,l){Nb(a),this.freeze();const s=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?u(void 0,l):new Promise(u);function u(d,f){const h=ic(r);s.run(a,h,m);function m(y,g,v){const b=g||a;y?f(y):d?d(b):l(void 0,b,v)}}}runSync(a,r){let l=!1,s;return this.run(a,r,u),Ab("runSync","run",l),s;function u(d,f){jb(d),s=f,l=!0}}stringify(a,r){this.freeze();const l=ic(r),s=this.compiler||this.Compiler;return uh("stringify",s),Nb(a),s(a,l)}use(a,...r){const l=this.attachers,s=this.namespace;if(dh("use",this.frozen),a!=null)if(typeof a=="function")h(a,r);else if(typeof a=="object")Array.isArray(a)?f(a):d(a);else throw new TypeError("Expected usable value, not `"+a+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[y,...g]=m;h(y,g)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))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");f(m.plugins),m.settings&&(s.settings=lh(!0,s.settings,m.settings))}function f(m){let y=-1;if(m!=null)if(Array.isArray(m))for(;++y<m.length;){const g=m[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,y){let g=-1,v=-1;for(;++g<l.length;)if(l[g][0]===m){v=g;break}if(v===-1)l.push([m,...y]);else if(y.length>0){let[b,...k]=y;const C=l[v][1];qh(C)&&qh(b)&&(b=lh(!0,C,b)),l[v]=[m,b,...k]}}}}const eL=new $m().freeze();function ch(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uh(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dh(e,a){if(a)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nb(e){if(!qh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ab(e,a,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+a+"` instead")}function ic(e){return tL(e)?e:new Mk(e)}function tL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nL(e){return typeof e=="string"||aL(e)}function aL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tb=[],_b={allowDangerousHtml:!0},lL=/^(https?|ircs?|mailto|xmpp)$/i,iL=[{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 Rb(e){const a=sL(e),r=oL(e);return cL(a.runSync(a.parse(r),r),e)}function sL(e){const a=e.rehypePlugins||Tb,r=e.remarkPlugins||Tb,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._b}:_b;return eL().use(Fz).use(r).use(L5,l).use(a)}function oL(e){const a=e.children||"",r=new Mk;return typeof a=="string"&&(r.value=a),r}function cL(e,a){const r=a.allowedElements,l=a.allowElement,s=a.components,u=a.disallowedElements,d=a.skipHtml,f=a.unwrapDisallowed,h=a.urlTransform||uL;for(const y of iL)Object.hasOwn(a,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+rL+y.id,void 0);return Gm(e,m),CD(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function m(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return d?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let b;for(b in th)if(Object.hasOwn(th,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],C=th[b];(C===null||C.includes(y.tagName))&&(y.properties[b]=h(String(k||""),b,y))}}if(y.type==="element"){let b=r?!r.includes(y.tagName):u?u.includes(y.tagName):!1;if(!b&&l&&typeof g=="number"&&(b=!l(y,g,v)),b&&v&&typeof g=="number")return f&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function uL(e){const a=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),s=e.indexOf("/");return a===-1||s!==-1&&a>s||r!==-1&&a>r||l!==-1&&a>l||lL.test(e.slice(0,a))?e:""}function Mb(e,a){const r=String(e);if(typeof a!="string")throw new TypeError("Expected character");let l=0,s=r.indexOf(a);for(;s!==-1;)l++,s=r.indexOf(a,s+a.length);return l}function dL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function fL(e,a,r){const s=hu((r||{}).ignore||[]),u=hL(a);let d=-1;for(;++d<u.length;)Rk(e,"text",f);function f(m,y){let g=-1,v;for(;++g<y.length;){const b=y[g],k=v?v.children:void 0;if(s(b,k?k.indexOf(b):void 0,v))return;v=b}if(v)return h(m,y)}function h(m,y){const g=y[y.length-1],v=u[d][0],b=u[d][1];let k=0;const E=g.children.indexOf(m);let j=!1,R=[];v.lastIndex=0;let O=v.exec(m.value);for(;O;){const _=O.index,U={index:O.index,input:O.input,stack:[...y,m]};let M=b(...O,U);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?v.lastIndex=_+1:(k!==_&&R.push({type:"text",value:m.value.slice(k,_)}),Array.isArray(M)?R.push(...M):M&&R.push(M),k=_+O[0].length,j=!0),!v.global)break;O=v.exec(m.value)}return j?(k<m.value.length&&R.push({type:"text",value:m.value.slice(k)}),g.children.splice(E,1,...R)):R=[m],E+R.length}}function hL(e){const a=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<r.length;){const s=r[l];a.push([mL(s[0]),pL(s[1])])}return a}function mL(e){return typeof e=="string"?new RegExp(dL(e),"g"):e}function pL(e){return typeof e=="function"?e:function(){return e}}const fh="phrasing",hh=["autolink","link","image","label"];function gL(){return{transforms:[kL],enter:{literalAutolink:yL,literalAutolinkEmail:mh,literalAutolinkHttp:mh,literalAutolinkWww:mh},exit:{literalAutolink:wL,literalAutolinkEmail:SL,literalAutolinkHttp:vL,literalAutolinkWww:bL}}}function xL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:hh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:hh},{character:":",before:"[ps]",after:"\\/",inConstruct:fh,notInConstruct:hh}]}}function yL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mh(e){this.config.enter.autolinkProtocol.call(this,e)}function vL(e){this.config.exit.autolinkProtocol.call(this,e)}function bL(e){this.config.exit.data.call(this,e);const a=this.stack[this.stack.length-1];a.type,a.url="http://"+this.sliceSerialize(e)}function SL(e){this.config.exit.autolinkEmail.call(this,e)}function wL(e){this.exit(e)}function kL(e){fL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),CL]],{ignore:["link","linkReference"]})}function jL(e,a,r,l,s){let u="";if(!Ok(s)||(/^w/i.test(a)&&(r=a+r,a="",u="http://"),!EL(r)))return!1;const d=NL(r+l);if(!d[0])return!1;const f={type:"link",title:null,url:u+a+d[0],children:[{type:"text",value:a+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function CL(e,a,r,l){return!Ok(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+a+"@"+r,children:[{type:"text",value:a+"@"+r}]}}function EL(e){const a=e.split(".");return!(a.length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))}function NL(e){const a=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!a)return[e,void 0];e=e.slice(0,a.index);let r=a[0],l=r.indexOf(")");const s=Mb(e,"(");let u=Mb(e,")");for(;l!==-1&&s>u;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),u++;return[e,r]}function Ok(e,a){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Gr(r)||uu(r))&&(!a||r!==47)}Dk.peek=LL;function AL(){this.buffer()}function TL(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _L(){this.buffer()}function RL(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ML(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Xn(this.sliceSerialize(e)).toLowerCase(),r.label=a}function OL(e){this.exit(e)}function DL(e){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Xn(this.sliceSerialize(e)).toLowerCase(),r.label=a}function zL(e){this.exit(e)}function LL(){return"["}function Dk(e,a,r,l){const s=r.createTracker(l);let u=s.move("[^");const d=r.enter("footnoteReference"),f=r.enter("reference");return u+=s.move(r.safe(r.associationId(e),{after:"]",before:u})),f(),d(),u+=s.move("]"),u}function PL(){return{enter:{gfmFootnoteCallString:AL,gfmFootnoteCall:TL,gfmFootnoteDefinitionLabelString:_L,gfmFootnoteDefinition:RL},exit:{gfmFootnoteCallString:ML,gfmFootnoteCall:OL,gfmFootnoteDefinitionLabelString:DL,gfmFootnoteDefinition:zL}}}function UL(e){let a=!1;return e&&e.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:Dk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,s,u,d){const f=u.createTracker(d);let h=f.move("[^");const m=u.enter("footnoteDefinition"),y=u.enter("label");return h+=f.move(u.safe(u.associationId(l),{before:h,after:"]"})),y(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((a?`
68
+ `:" ")+u.indentLines(u.containerFlow(l,f.current()),a?zk:IL))),m(),h}}function IL(e,a,r){return a===0?e:zk(e,a,r)}function zk(e,a,r){return(r?"":" ")+e}const BL=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Lk.peek=$L;function HL(){return{canContainEols:["delete"],enter:{strikethrough:qL},exit:{strikethrough:GL}}}function FL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:BL}],handlers:{delete:Lk}}}function qL(e){this.enter({type:"delete",children:[]},e)}function GL(e){this.exit(e)}function Lk(e,a,r,l){const s=r.createTracker(l),u=r.enter("strikethrough");let d=s.move("~~");return d+=r.containerPhrasing(e,{...s.current(),before:d,after:"~"}),d+=s.move("~~"),u(),d}function $L(){return"~"}function YL(e){return e.length}function VL(e,a){const r=a||{},l=(r.align||[]).concat(),s=r.stringLength||YL,u=[],d=[],f=[],h=[];let m=0,y=-1;for(;++y<e.length;){const C=[],E=[];let j=-1;for(e[y].length>m&&(m=e[y].length);++j<e[y].length;){const R=KL(e[y][j]);if(r.alignDelimiters!==!1){const O=s(R);E[j]=O,(h[j]===void 0||O>h[j])&&(h[j]=O)}C.push(R)}d[y]=C,f[y]=E}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<m;)u[g]=Ob(l[g]);else{const C=Ob(l);for(;++g<m;)u[g]=C}g=-1;const v=[],b=[];for(;++g<m;){const C=u[g];let E="",j="";C===99?(E=":",j=":"):C===108?E=":":C===114&&(j=":");let R=r.alignDelimiters===!1?1:Math.max(1,h[g]-E.length-j.length);const O=E+"-".repeat(R)+j;r.alignDelimiters!==!1&&(R=E.length+R+j.length,R>h[g]&&(h[g]=R),b[g]=R),v[g]=O}d.splice(1,0,v),f.splice(1,0,b),y=-1;const k=[];for(;++y<d.length;){const C=d[y],E=f[y];g=-1;const j=[];for(;++g<m;){const R=C[g]||"";let O="",_="";if(r.alignDelimiters!==!1){const U=h[g]-(E[g]||0),M=u[g];M===114?O=" ".repeat(U):M===99?U%2?(O=" ".repeat(U/2+.5),_=" ".repeat(U/2-.5)):(O=" ".repeat(U/2),_=O):_=" ".repeat(U)}r.delimiterStart!==!1&&!g&&j.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&R==="")&&(r.delimiterStart!==!1||g)&&j.push(" "),r.alignDelimiters!==!1&&j.push(O),j.push(R),r.alignDelimiters!==!1&&j.push(_),r.padding!==!1&&j.push(" "),(r.delimiterEnd!==!1||g!==m-1)&&j.push("|")}k.push(r.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return k.join(`
69
+ `)}function KL(e){return e==null?"":String(e)}function Ob(e){const a=typeof e=="string"?e.codePointAt(0):0;return a===67||a===99?99:a===76||a===108?108:a===82||a===114?114:0}function XL(e,a,r,l){const s=r.enter("blockquote"),u=r.createTracker(l);u.move("> "),u.shift(2);const d=r.indentLines(r.containerFlow(e,u.current()),QL);return s(),d}function QL(e,a,r){return">"+(r?"":" ")+e}function ZL(e,a){return Db(e,a.inConstruct,!0)&&!Db(e,a.notInConstruct,!1)}function Db(e,a,r){if(typeof a=="string"&&(a=[a]),!a||a.length===0)return r;let l=-1;for(;++l<a.length;)if(e.includes(a[l]))return!0;return!1}function zb(e,a,r,l){let s=-1;for(;++s<r.unsafe.length;)if(r.unsafe[s].character===`
70
+ `&&ZL(r.stack,r.unsafe[s]))return/[ \t]/.test(l.before)?"":" ";return`\\
71
+ `}function JL(e,a){const r=String(e);let l=r.indexOf(a),s=l,u=0,d=0;if(typeof a!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===s?++u>d&&(d=u):u=1,s=l+a.length,l=r.indexOf(a,s);return d}function WL(e,a){return!!(a.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function e6(e){const a=e.options.fence||"`";if(a!=="`"&&a!=="~")throw new Error("Cannot serialize code with `"+a+"` for `options.fence`, expected `` ` `` or `~`");return a}function t6(e,a,r,l){const s=e6(r),u=e.value||"",d=s==="`"?"GraveAccent":"Tilde";if(WL(e,r)){const g=r.enter("codeIndented"),v=r.indentLines(u,n6);return g(),v}const f=r.createTracker(l),h=s.repeat(Math.max(JL(u,s)+1,3)),m=r.enter("codeFenced");let y=f.move(h);if(e.lang){const g=r.enter(`codeFencedLang${d}`);y+=f.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(r.safe(e.meta,{before:y,after:`
72
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
73
+ `),u&&(y+=f.move(u+`
74
+ `)),y+=f.move(h),m(),y}function n6(e,a,r){return(r?"":" ")+e}function Ym(e){const a=e.options.quote||'"';if(a!=='"'&&a!=="'")throw new Error("Cannot serialize title with `"+a+"` for `options.quote`, expected `\"`, or `'`");return a}function a6(e,a,r,l){const s=Ym(r),u=s==='"'?"Quote":"Apostrophe",d=r.enter("definition");let f=r.enter("label");const h=r.createTracker(l);let m=h.move("[");return m+=h.move(r.safe(r.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":`
75
+ `,...h.current()}))),f(),e.title&&(f=r.enter(`title${u}`),m+=h.move(" "+s),m+=h.move(r.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),f()),d(),m}function r6(e){const a=e.options.emphasis||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize emphasis with `"+a+"` for `options.emphasis`, expected `*`, or `_`");return a}function ps(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rc(e,a,r){const l=Kl(e),s=Kl(a);return l===void 0?s===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Pk.peek=l6;function Pk(e,a,r,l){const s=r6(r),u=r.enter("emphasis"),d=r.createTracker(l),f=d.move(s);let h=d.move(r.containerPhrasing(e,{after:s,before:f,...d.current()}));const m=h.charCodeAt(0),y=Rc(l.before.charCodeAt(l.before.length-1),m,s);y.inside&&(h=ps(m)+h.slice(1));const g=h.charCodeAt(h.length-1),v=Rc(l.after.charCodeAt(0),g,s);v.inside&&(h=h.slice(0,-1)+ps(g));const b=d.move(s);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+h+b}function l6(e,a,r){return r.options.emphasis||"*"}function i6(e,a){let r=!1;return Gm(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,Hh}),!!((!e.depth||e.depth<3)&&Pm(e)&&(a.options.setext||r))}function s6(e,a,r,l){const s=Math.max(Math.min(6,e.depth||1),1),u=r.createTracker(l);if(i6(e,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),v=r.containerPhrasing(e,{...u.current(),before:`
76
+ `,after:`
77
+ `});return g(),y(),v+`
78
+ `+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
79
+ `))+1))}const d="#".repeat(s),f=r.enter("headingAtx"),h=r.enter("phrasing");u.move(d+" ");let m=r.containerPhrasing(e,{before:"# ",after:`
80
+ `,...u.current()});return/^[\t ]/.test(m)&&(m=ps(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,r.options.closeAtx&&(m+=" "+d),h(),f(),m}Uk.peek=o6;function Uk(e){return e.value||""}function o6(){return"<"}Ik.peek=c6;function Ik(e,a,r,l){const s=Ym(r),u=s==='"'?"Quote":"Apostrophe",d=r.enter("image");let f=r.enter("label");const h=r.createTracker(l);let m=h.move("![");return m+=h.move(r.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=r.enter(`title${u}`),m+=h.move(" "+s),m+=h.move(r.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),f()),m+=h.move(")"),d(),m}function c6(){return"!"}Bk.peek=u6;function Bk(e,a,r,l){const s=e.referenceType,u=r.enter("imageReference");let d=r.enter("label");const f=r.createTracker(l);let h=f.move("![");const m=r.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),d();const y=r.stack;r.stack=[],d=r.enter("reference");const g=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return d(),r.stack=y,u(),s==="full"||!m||m!==g?h+=f.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function u6(){return"!"}Hk.peek=d6;function Hk(e,a,r){let l=e.value||"",s="`",u=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(l);)s+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++u<r.unsafe.length;){const d=r.unsafe[u],f=r.compilePattern(d);let h;if(d.atBreak)for(;h=f.exec(l);){let m=h.index;l.charCodeAt(m)===10&&l.charCodeAt(m-1)===13&&m--,l=l.slice(0,m)+" "+l.slice(h.index+1)}}return s+l+s}function d6(){return"`"}function Fk(e,a){const r=Pm(e);return!!(!a.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}qk.peek=f6;function qk(e,a,r,l){const s=Ym(r),u=s==='"'?"Quote":"Apostrophe",d=r.createTracker(l);let f,h;if(Fk(e,r)){const y=r.stack;r.stack=[],f=r.enter("autolink");let g=d.move("<");return g+=d.move(r.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),r.stack=y,g}f=r.enter("link"),h=r.enter("label");let m=d.move("[");return m+=d.move(r.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(r.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(h=r.enter("destinationRaw"),m+=d.move(r.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=r.enter(`title${u}`),m+=d.move(" "+s),m+=d.move(r.safe(e.title,{before:m,after:s,...d.current()})),m+=d.move(s),h()),m+=d.move(")"),f(),m}function f6(e,a,r){return Fk(e,r)?"<":"["}Gk.peek=h6;function Gk(e,a,r,l){const s=e.referenceType,u=r.enter("linkReference");let d=r.enter("label");const f=r.createTracker(l);let h=f.move("[");const m=r.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),d();const y=r.stack;r.stack=[],d=r.enter("reference");const g=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return d(),r.stack=y,u(),s==="full"||!m||m!==g?h+=f.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function h6(){return"["}function Vm(e){const a=e.options.bullet||"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bullet`, expected `*`, `+`, or `-`");return a}function m6(e){const a=Vm(e),r=e.options.bulletOther;if(!r)return a==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===a)throw new Error("Expected `bullet` (`"+a+"`) and `bulletOther` (`"+r+"`) to be different");return r}function p6(e){const a=e.options.bulletOrdered||".";if(a!=="."&&a!==")")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOrdered`, expected `.` or `)`");return a}function $k(e){const a=e.options.rule||"*";if(a!=="*"&&a!=="-"&&a!=="_")throw new Error("Cannot serialize rules with `"+a+"` for `options.rule`, expected `*`, `-`, or `_`");return a}function g6(e,a,r,l){const s=r.enter("list"),u=r.bulletCurrent;let d=e.ordered?p6(r):Vm(r);const f=e.ordered?d==="."?")":".":m6(r);let h=a&&r.bulletLastUsed?d===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),$k(r)===d&&y){let g=-1;for(;++g<e.children.length;){const v=e.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(d=f),r.bulletCurrent=d;const m=r.containerFlow(e,l);return r.bulletLastUsed=d,r.bulletCurrent=u,s(),m}function x6(e){const a=e.options.listItemIndent||"one";if(a!=="tab"&&a!=="one"&&a!=="mixed")throw new Error("Cannot serialize items with `"+a+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return a}function y6(e,a,r,l){const s=x6(r);let u=r.bulletCurrent||Vm(r);a&&a.type==="list"&&a.ordered&&(u=(typeof a.start=="number"&&a.start>-1?a.start:1)+(r.options.incrementListMarker===!1?0:a.children.indexOf(e))+u);let d=u.length+1;(s==="tab"||s==="mixed"&&(a&&a.type==="list"&&a.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=r.createTracker(l);f.move(u+" ".repeat(d-u.length)),f.shift(d);const h=r.enter("listItem"),m=r.indentLines(r.containerFlow(e,f.current()),y);return h(),m;function y(g,v,b){return v?(b?"":" ".repeat(d))+g:(b?u:u+" ".repeat(d-u.length))+g}}function v6(e,a,r,l){const s=r.enter("paragraph"),u=r.enter("phrasing"),d=r.containerPhrasing(e,l);return u(),s(),d}const b6=hu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function S6(e,a,r,l){return(e.children.some(function(d){return b6(d)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function w6(e){const a=e.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}Yk.peek=k6;function Yk(e,a,r,l){const s=w6(r),u=r.enter("strong"),d=r.createTracker(l),f=d.move(s+s);let h=d.move(r.containerPhrasing(e,{after:s,before:f,...d.current()}));const m=h.charCodeAt(0),y=Rc(l.before.charCodeAt(l.before.length-1),m,s);y.inside&&(h=ps(m)+h.slice(1));const g=h.charCodeAt(h.length-1),v=Rc(l.after.charCodeAt(0),g,s);v.inside&&(h=h.slice(0,-1)+ps(g));const b=d.move(s+s);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+h+b}function k6(e,a,r){return r.options.strong||"*"}function j6(e,a,r,l){return r.safe(e.value,l)}function C6(e){const a=e.options.ruleRepetition||3;if(a<3)throw new Error("Cannot serialize rules with repetition `"+a+"` for `options.ruleRepetition`, expected `3` or more");return a}function E6(e,a,r){const l=($k(r)+(r.options.ruleSpaces?" ":"")).repeat(C6(r));return r.options.ruleSpaces?l.slice(0,-1):l}const Vk={blockquote:XL,break:zb,code:t6,definition:a6,emphasis:Pk,hardBreak:zb,heading:s6,html:Uk,image:Ik,imageReference:Bk,inlineCode:Hk,link:qk,linkReference:Gk,list:g6,listItem:y6,paragraph:v6,root:S6,strong:Yk,text:j6,thematicBreak:E6};function N6(){return{enter:{table:A6,tableData:Lb,tableHeader:Lb,tableRow:_6},exit:{codeText:R6,table:T6,tableData:ph,tableHeader:ph,tableRow:ph}}}function A6(e){const a=e._align;this.enter({type:"table",align:a.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function T6(e){this.exit(e),this.data.inTable=void 0}function _6(e){this.enter({type:"tableRow",children:[]},e)}function ph(e){this.exit(e)}function Lb(e){this.enter({type:"tableCell",children:[]},e)}function R6(e){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,M6));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(e)}function M6(e,a){return a==="|"?a:e}function O6(e){const a=e||{},r=a.tableCellPadding,l=a.tablePipeAlign,s=a.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
81
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:h,tableRow:f}};function d(b,k,C,E){return m(y(b,C,E),b.align)}function f(b,k,C,E){const j=g(b,C,E),R=m([j]);return R.slice(0,R.indexOf(`
82
+ `))}function h(b,k,C,E){const j=C.enter("tableCell"),R=C.enter("phrasing"),O=C.containerPhrasing(b,{...E,before:u,after:u});return R(),j(),O}function m(b,k){return VL(b,{align:k,alignDelimiters:l,padding:r,stringLength:s})}function y(b,k,C){const E=b.children;let j=-1;const R=[],O=k.enter("table");for(;++j<E.length;)R[j]=g(E[j],k,C);return O(),R}function g(b,k,C){const E=b.children;let j=-1;const R=[],O=k.enter("tableRow");for(;++j<E.length;)R[j]=h(E[j],b,k,C);return O(),R}function v(b,k,C){let E=Vk.inlineCode(b,k,C);return C.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function D6(){return{exit:{taskListCheckValueChecked:Pb,taskListCheckValueUnchecked:Pb,paragraph:L6}}}function z6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:P6}}}function Pb(e){const a=this.stack[this.stack.length-2];a.type,a.checked=e.type==="taskListCheckValueChecked"}function L6(e){const a=this.stack[this.stack.length-2];if(a&&a.type==="listItem"&&typeof a.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const s=a.children;let u=-1,d;for(;++u<s.length;){const f=s[u];if(f.type==="paragraph"){d=f;break}}d===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function P6(e,a,r,l){const s=e.children[0],u=typeof e.checked=="boolean"&&s&&s.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=r.createTracker(l);u&&f.move(d);let h=Vk.listItem(e,a,r,{...l,...f.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(y){return y+d}}function U6(){return[gL(),PL(),HL(),N6(),D6()]}function I6(e){return{extensions:[xL(),UL(e),FL(),O6(e),z6()]}}const B6={tokenize:Y6,partial:!0},Kk={tokenize:V6,partial:!0},Xk={tokenize:K6,partial:!0},Qk={tokenize:X6,partial:!0},H6={tokenize:Q6,partial:!0},Zk={name:"wwwAutolink",tokenize:G6,previous:Wk},Jk={name:"protocolAutolink",tokenize:$6,previous:ej},za={name:"emailAutolink",tokenize:q6,previous:tj},da={};function F6(){return{text:da}}let Br=48;for(;Br<123;)da[Br]=za,Br++,Br===58?Br=65:Br===91&&(Br=97);da[43]=za;da[45]=za;da[46]=za;da[95]=za;da[72]=[za,Jk];da[104]=[za,Jk];da[87]=[za,Zk];da[119]=[za,Zk];function q6(e,a,r){const l=this;let s,u;return d;function d(g){return!$h(g)||!tj.call(l,l.previous)||Km(l.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return $h(g)?(e.consume(g),f):g===64?(e.consume(g),h):r(g)}function h(g){return g===46?e.check(H6,y,m)(g):g===45||g===95||Jt(g)?(u=!0,e.consume(g),h):y(g)}function m(g){return e.consume(g),s=!0,h}function y(g){return u&&s&&an(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),a(g)):r(g)}}function G6(e,a,r){const l=this;return s;function s(d){return d!==87&&d!==119||!Wk.call(l,l.previous)||Km(l.events)?r(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(B6,e.attempt(Kk,e.attempt(Xk,u),r),r)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),a(d)}}function $6(e,a,r){const l=this;let s="",u=!1;return d;function d(g){return(g===72||g===104)&&ej.call(l,l.previous)&&!Km(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),f):r(g)}function f(g){if(an(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const v=s.toLowerCase();if(v==="http"||v==="https")return e.consume(g),h}return r(g)}function h(g){return g===47?(e.consume(g),u?m:(u=!0,h)):r(g)}function m(g){return g===null||Ac(g)||ft(g)||Gr(g)||uu(g)?r(g):e.attempt(Kk,e.attempt(Xk,y),r)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),a(g)}}function Y6(e,a,r){let l=0;return s;function s(d){return(d===87||d===119)&&l<3?(l++,e.consume(d),s):d===46&&l===3?(e.consume(d),u):r(d)}function u(d){return d===null?r(d):a(d)}}function V6(e,a,r){let l,s,u;return d;function d(m){return m===46||m===95?e.check(Qk,h,f)(m):m===null||ft(m)||Gr(m)||m!==45&&uu(m)?h(m):(u=!0,e.consume(m),d)}function f(m){return m===95?l=!0:(s=l,l=void 0),e.consume(m),d}function h(m){return s||l||!u?r(m):a(m)}}function K6(e,a){let r=0,l=0;return s;function s(d){return d===40?(r++,e.consume(d),s):d===41&&l<r?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(Qk,a,u)(d):d===null||ft(d)||Gr(d)?a(d):(e.consume(d),s)}function u(d){return d===41&&l++,e.consume(d),s}}function X6(e,a,r){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),u):f===93?(e.consume(f),s):f===60||f===null||ft(f)||Gr(f)?a(f):r(f)}function s(f){return f===null||f===40||f===91||ft(f)||Gr(f)?a(f):l(f)}function u(f){return an(f)?d(f):r(f)}function d(f){return f===59?(e.consume(f),l):an(f)?(e.consume(f),d):r(f)}}function Q6(e,a,r){return l;function l(u){return e.consume(u),s}function s(u){return Jt(u)?r(u):a(u)}}function Wk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function ej(e){return!an(e)}function tj(e){return!(e===47||$h(e))}function $h(e){return e===43||e===45||e===46||e===95||Jt(e)}function Km(e){let a=e.length,r=!1;for(;a--;){const l=e[a][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const Z6={tokenize:lP,partial:!0};function J6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nP,continuation:{tokenize:aP},exit:rP}},text:{91:{name:"gfmFootnoteCall",tokenize:tP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:W6,resolveTo:eP}}}}function W6(e,a,r){const l=this;let s=l.events.length;const u=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let d;for(;s--;){const h=l.events[s][1];if(h.type==="labelImage"){d=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!d||!d._balanced)return r(h);const m=Xn(l.sliceSerialize({start:d.end,end:l.now()}));return m.codePointAt(0)!==94||!u.includes(m.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),a(h))}}function eP(e,a){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[r+1],e[r+2],["enter",l,a],e[r+3],e[r+4],["enter",s,a],["exit",s,a],["enter",u,a],["enter",d,a],["exit",d,a],["exit",u,a],e[e.length-2],e[e.length-1],["exit",l,a]];return e.splice(r,e.length-r+1,...f),e}function tP(e,a,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(u>999||g===93&&!d||g===null||g===91||ft(g))return r(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return s.includes(Xn(l.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),a):r(g)}return ft(g)||(d=!0),u++,e.consume(g),g===92?y:m}function y(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function nP(e,a,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u,d=0,f;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(k)}function y(k){if(d>999||k===93&&!f||k===null||k===91||ft(k))return r(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return u=Xn(l.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return ft(k)||(f=!0),d++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),d++,y):y(k)}function v(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(u)||s.push(u),Ke(e,b,"gfmFootnoteDefinitionWhitespace")):r(k)}function b(k){return a(k)}}function aP(e,a,r){return e.check(_s,a,e.attempt(Z6,a,r))}function rP(e){e.exit("gfmFootnoteDefinition")}function lP(e,a,r){const l=this;return Ke(e,s,"gfmFootnoteDefinitionIndent",5);function s(u){const d=l.events[l.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?a(u):r(u)}}function iP(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:u,resolveAll:s};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function s(d,f){let h=-1;for(;++h<d.length;)if(d[h][0]==="enter"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._close){let m=h;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[h][1].end.offset-d[h][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[h][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[h][1].end)},g={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[h][1].start)},v=[["enter",y,f],["enter",d[m][1],f],["exit",d[m][1],f],["enter",g,f]],b=f.parser.constructs.insideSpan.null;b&&_n(v,v.length,0,du(b,d.slice(m+1,h),f)),_n(v,v.length,0,[["exit",g,f],["enter",d[h][1],f],["exit",d[h][1],f],["exit",y,f]]),_n(d,m-1,h-m+3,v),h=m+v.length-2;break}}for(h=-1;++h<d.length;)d[h][1].type==="strikethroughSequenceTemporary"&&(d[h][1].type="data");return d}function u(d,f,h){const m=this.previous,y=this.events;let g=0;return v;function v(k){return m===126&&y[y.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const C=Kl(m);if(k===126)return g>1?h(k):(d.consume(k),g++,b);if(g<2&&!r)return h(k);const E=d.exit("strikethroughSequenceTemporary"),j=Kl(k);return E._open=!j||j===2&&!!C,E._close=!C||C===2&&!!j,f(k)}}}class sP{constructor(){this.map=[]}add(a,r,l){oP(this,a,r,l)}consume(a){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(a.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),a.length=this.map[r][0];l.push(a.slice()),a.length=0;let s=l.pop();for(;s;){for(const u of s)a.push(u);s=l.pop()}this.map.length=0}}function oP(e,a,r,l){let s=0;if(!(r===0&&l.length===0)){for(;s<e.map.length;){if(e.map[s][0]===a){e.map[s][1]+=r,e.map[s][2].push(...l);return}s+=1}e.map.push([a,r,l])}}function cP(e,a){let r=!1;const l=[];for(;a<e.length;){const s=e[a];if(r){if(s[0]==="enter")s[1].type==="tableContent"&&l.push(e[a+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[a-1][1].type==="tableDelimiterMarker"){const u=l.length-1;l[u]=l[u]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(r=!0);a+=1}return l}function uP(){return{flow:{null:{name:"table",tokenize:dP,resolveAll:fP}}}}function dP(e,a,r){const l=this;let s=0,u=0,d;return f;function f(P){let W=l.events.length-1;for(;W>-1;){const ne=l.events[W][1].type;if(ne==="lineEnding"||ne==="linePrefix")W--;else break}const ee=W>-1?l.events[W][1].type:null,fe=ee==="tableHead"||ee==="tableRow"?M:h;return fe===M&&l.parser.lazy[l.now().line]?r(P):fe(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),m(P)}function m(P){return P===124||(d=!0,u+=1),y(P)}function y(P){return P===null?r(P):_e(P)?u>1?(u=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):r(P):Ge(P)?Ke(e,y,"whitespace")(P):(u+=1,d&&(d=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),g(P)))}function g(P){return P===null||P===124||ft(P)?(e.exit("data"),y(P)):(e.consume(P),P===92?v:g)}function v(P){return P===92||P===124?(e.consume(P),g):g(P)}function b(P){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(P):(e.enter("tableDelimiterRow"),d=!1,Ge(P)?Ke(e,k,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):k(P))}function k(P){return P===45||P===58?E(P):P===124?(d=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),C):U(P)}function C(P){return Ge(P)?Ke(e,E,"whitespace")(P):E(P)}function E(P){return P===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),j):P===45?(u+=1,j(P)):P===null||_e(P)?_(P):U(P)}function j(P){return P===45?(e.enter("tableDelimiterFiller"),R(P)):U(P)}function R(P){return P===45?(e.consume(P),R):P===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(P))}function O(P){return Ge(P)?Ke(e,_,"whitespace")(P):_(P)}function _(P){return P===124?k(P):P===null||_e(P)?!d||s!==u?U(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),a(P)):U(P)}function U(P){return r(P)}function M(P){return e.enter("tableRow"),L(P)}function L(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),L):P===null||_e(P)?(e.exit("tableRow"),a(P)):Ge(P)?Ke(e,L,"whitespace")(P):(e.enter("data"),F(P))}function F(P){return P===null||P===124||ft(P)?(e.exit("data"),L(P)):(e.consume(P),P===92?Y:F)}function Y(P){return P===92||P===124?(e.consume(P),F):F(P)}}function fP(e,a){let r=-1,l=!0,s=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,h=0,m,y,g;const v=new sP;for(;++r<e.length;){const b=e[r],k=b[1];b[0]==="enter"?k.type==="tableHead"?(f=!1,h!==0&&(Ub(v,a,h,m,y),y=void 0,h=0),m={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(r,0,[["enter",m,a]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(l=!0,g=void 0,u=[0,0,0,0],d=[0,r+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(r,0,[["enter",y,a]])),s=k.type==="tableDelimiterRow"?2:y?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(l=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],g=sc(v,a,u,s,void 0,g),u=[0,0,0,0]),d[2]=r)):k.type==="tableCellDivider"&&(l?l=!1:(u[1]!==0&&(d[0]=d[1],g=sc(v,a,u,s,void 0,g)),u=d,d=[u[1],r,0,0])):k.type==="tableHead"?(f=!0,h=r):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=r,u[1]!==0?(d[0]=d[1],g=sc(v,a,u,s,r,g)):d[1]!==0&&(g=sc(v,a,d,s,r,g)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=r)}for(h!==0&&Ub(v,a,h,m,y),v.consume(a.events),r=-1;++r<a.events.length;){const b=a.events[r];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=cP(a.events,r))}return e}function sc(e,a,r,l,s,u){const d=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(u.end=Object.assign({},Ul(a.events,r[0])),e.add(r[0],0,[["exit",u,a]]));const h=Ul(a.events,r[1]);if(u={type:d,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",u,a]]),r[2]!==0){const m=Ul(a.events,r[2]),y=Ul(a.events,r[3]),g={type:f,start:Object.assign({},m),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",g,a]]),l!==2){const v=a.events[r[2]],b=a.events[r[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const k=r[2]+1,C=r[3]-r[2]-1;e.add(k,C,[])}}e.add(r[3]+1,0,[["exit",g,a]])}return s!==void 0&&(u.end=Object.assign({},Ul(a.events,s)),e.add(s,0,[["exit",u,a]]),u=void 0),u}function Ub(e,a,r,l,s){const u=[],d=Ul(a.events,r);s&&(s.end=Object.assign({},d),u.push(["exit",s,a])),l.end=Object.assign({},d),u.push(["exit",l,a]),e.add(r+1,0,u)}function Ul(e,a){const r=e[a],l=r[0]==="enter"?"start":"end";return r[1][l]}const hP={name:"tasklistCheck",tokenize:pP};function mP(){return{text:{91:hP}}}function pP(e,a,r){const l=this;return s;function s(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),u)}function u(h){return ft(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),d):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),d):r(h)}function d(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(h)}function f(h){return _e(h)?a(h):Ge(h)?e.check({tokenize:gP},a,r)(h):r(h)}}function gP(e,a,r){return Ke(e,l,"whitespace");function l(s){return s===null?r(s):a(s)}}function xP(e){return fk([F6(),J6(),iP(e),uP(),mP()])}const yP={};function Ib(e){const a=this,r=e||yP,l=a.data(),s=l.micromarkExtensions||(l.micromarkExtensions=[]),u=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),d=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);s.push(xP(r)),u.push(U6()),d.push(I6(r))}function vP(e){return e.filter(a=>a.connections.length>0).map(a=>a.id)}const nj=[{id:"summarize_inbox",title:"Summarize my inbox",description:"Get a brief summary of unread emails",base_prompt:"Summarize my unread emails and list the most important ones with senders and subjects.",required_integrations:["gmail"],optional_integrations:[]},{id:"create_linear_issue",title:"Create a Linear issue",description:"Turn a short description into a Linear issue",base_prompt:"Create a Linear issue from this: [describe the issue]. Use the default team and set a sensible title and description.",required_integrations:["linear"],optional_integrations:["slack"]},{id:"schedule_zoom",title:"Schedule a Zoom meeting",description:"Create a Zoom meeting and optionally invite via Slack",base_prompt:"Schedule a Zoom meeting for [time/topic]. Create the meeting and share the link.",required_integrations:["zoom"],optional_integrations:["slack","calendar"]},{id:"stripe_overview",title:"Stripe overview",description:"See recent customers and revenue",base_prompt:"Give me a short overview of my Stripe account: recent customers, revenue this month, and any failed payments.",required_integrations:["stripe"],optional_integrations:[]}];function bP({connectedIds:e,onSelectIdea:a,onMissingIntegrations:r}){const l=s=>{s.required_integrations.filter(d=>!e.includes(d)).length===0?a(s):r(s)};return c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Automation ideas"}),c.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1 scrollbar-thin",children:nj.map(s=>c.jsxs("button",{type:"button",onClick:()=>l(s),className:"border-input bg-muted/30 hover:bg-muted/50 flex shrink-0 flex-col items-start gap-0.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors min-w-[180px] max-w-[220px]",children:[c.jsx("span",{className:"font-medium",children:s.title}),c.jsx("span",{className:"text-muted-foreground line-clamp-2 text-xs",children:s.description})]},s.id))})]})}const Ut="https://cdn.simpleicons.org",aj=[{id:"github",name:"GitHub",description:"Repos, issues, and code",category:"featured",icon:DM,logoUrl:`${Ut}/github`},{id:"gmail",name:"Gmail",description:"Send and read email",category:"featured",icon:nO,logoUrl:`${Ut}/gmail`},{id:"notion",name:"Notion",description:"Pages, databases, and docs",category:"featured",icon:FS,logoUrl:`${Ut}/notion`},{id:"slack",name:"Slack",description:"Channels and messages",category:"featured",icon:Nh,logoUrl:`${Ut}/slack`},{id:"calendar",name:"Google Calendar",description:"Events and scheduling",category:"featured",icon:lM,logoUrl:`${Ut}/googlecalendar`},{id:"drive",name:"Google Drive",description:"Files and folders",category:"featured",icon:VS,logoUrl:`${Ut}/googledrive`},{id:"docs",name:"Google Docs",description:"Create and edit documents",category:"featured",icon:km,logoUrl:`${Ut}/googledocs`},{id:"sheets",name:"Google Sheets",description:"Spreadsheets and data",category:"featured",icon:AO,logoUrl:`${Ut}/googlesheets`},{id:"asana",name:"Asana",description:"Tasks and projects",category:"featured",icon:RO,logoUrl:`${Ut}/asana`},{id:"contacts",name:"Google Contacts",description:"Contacts and people",category:"featured",icon:LO,logoUrl:`${Ut}/google`},{id:"facebook",name:"Facebook",description:"Pages and posts",category:"featured",icon:NM,logoUrl:`${Ut}/facebook`},{id:"bluesky",name:"Bluesky",description:"Posts and timeline (atproto)",category:"featured",icon:Nh,logoUrl:`${Ut}/bluesky`},{id:"airtable",name:"Airtable",description:"Bases, tables, and records",category:"featured",icon:qM,logoUrl:`${Ut}/airtable`},{id:"linear",name:"Linear",description:"Issues and workflows",category:"featured",icon:ZR,logoUrl:`${Ut}/linear`},{id:"zoom",name:"Zoom",description:"Meetings and video",category:"featured",icon:UO,logoUrl:`${Ut}/zoom`},{id:"dropbox",name:"Dropbox",description:"Files and folders",category:"featured",icon:uM,logoUrl:`${Ut}/dropbox`},{id:"jira",name:"Jira",description:"Issues and projects",category:"featured",icon:_M,logoUrl:`${Ut}/jirasoftware`},{id:"slides",name:"Google Slides",description:"Presentations and slides",category:"featured",icon:vO,logoUrl:`${Ut}/googleslides`},{id:"figma",name:"Figma",description:"Design files and prototypes",category:"featured",icon:cO,logoUrl:`${Ut}/figma`}],SP=new Map(aj.map(e=>[e.id,e]));function wP(e){return SP.get(e.toLowerCase())??null}function Bb(){return aj}function kP({open:e,onOpenChange:a,requiredIntegrations:r,connectedIds:l,ideaTitle:s,onConnect:u}){const d=r.filter(f=>l.includes(f));return c.jsx(js,{open:e,onOpenChange:a,children:c.jsxs(Cs,{className:"max-w-md",showCloseButton:!0,children:[c.jsxs(Es,{children:[c.jsx(Ns,{children:s?`Missing integrations: ${s}`:"Missing integrations"}),c.jsx(As,{children:"Connect the required apps below, then try again. Do not execute the workflow until all required integrations are connected."})]}),c.jsx("ul",{className:"space-y-2 text-sm",children:r.map(f=>{const m=wP(f)?.name??f,y=d.includes(f);return c.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border bg-muted/30 px-3 py-2",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[y?c.jsx("span",{className:"text-green-600 dark:text-green-400","aria-hidden":!0,children:"✓"}):c.jsx("span",{className:"text-muted-foreground","aria-hidden":!0,children:"✗"}),m]}),!y&&c.jsx(pe,{size:"sm",variant:"outline",onClick:()=>u(f),children:"Connect"})]},f)})}),c.jsx(hs,{className:"gap-2 pt-2",children:c.jsx(pe,{variant:"outline",onClick:()=>a(!1),children:"Close"})})]})})}const Hb={p:({children:e})=>c.jsx("p",{className:"mb-2 last:mb-0",children:e}),h1:({children:e})=>c.jsx("h1",{className:"mb-2 mt-3 text-lg font-bold first:mt-0",children:e}),h2:({children:e})=>c.jsx("h2",{className:"mb-2 mt-3 text-base font-bold first:mt-0",children:e}),h3:({children:e})=>c.jsx("h3",{className:"mb-1 mt-2 text-sm font-bold first:mt-0",children:e}),ul:({children:e})=>c.jsx("ul",{className:"mb-2 list-inside list-disc space-y-0.5",children:e}),ol:({children:e})=>c.jsx("ol",{className:"mb-2 list-inside list-decimal space-y-0.5",children:e}),code:({className:e,children:a,...r})=>e?.includes("language-")?c.jsx("pre",{className:"mb-2 overflow-x-auto rounded bg-muted p-2 text-xs",children:c.jsx("code",{className:e,...r,children:a})}):c.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",...r,children:a}),a:({href:e,children:a})=>c.jsx("a",{href:e,className:"text-primary underline hover:no-underline",target:"_blank",rel:"noopener noreferrer",children:a}),blockquote:({children:e})=>c.jsx("blockquote",{className:"my-2 border-l-2 border-muted-foreground/30 pl-3 italic",children:e}),img:({src:e,alt:a})=>e?c.jsx("img",{src:e,alt:a??"attachment",className:"my-1 max-h-48 max-w-full rounded object-contain"}):null};function jP(e){return e?e.replace(/\[Attached media \(use these URLs when posting images[^\]]*\):\s*([^\]]+)\]/,(a,r)=>r.split(",").map(l=>l.trim()).filter(Boolean).map(l=>`![attached](${l})`).join(`
83
+ `)):""}function CP({message:e,isLast:a,isStreaming:r}){const l=e,s=l.created_at?Vw(l.created_at):null,u=l.usage,d=u&&((u.prompt_tokens??0)>0||(u.completion_tokens??0)>0);if(l.role==="user"){const f=jP(l.content);return c.jsxs("div",{className:"flex items-start gap-2 justify-end",children:[c.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-col gap-0.5 rounded-lg rounded-tr-sm px-3 py-2 text-sm",children:[c.jsx("div",{className:"chat-markdown text-foreground break-words [&>*:last-child]:mb-0",children:c.jsx(Rb,{remarkPlugins:[Ib],components:Hb,children:f})}),s&&c.jsx("div",{className:"text-muted-foreground text-right text-xs",children:s})]}),c.jsx(K4,{className:"size-8 shrink-0",children:c.jsx(X4,{className:"rounded-full",children:c.jsx(DO,{className:"size-4"})})})]})}if(l.role==="assistant")return c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[c.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),c.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),c.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-1 flex-col gap-0.5 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:[(l.thinking??"")&&c.jsxs("details",{className:"text-muted-foreground border-border mb-2 rounded border border-dashed py-1.5 pl-2 pr-2 text-xs",open:r,children:[c.jsxs("summary",{className:"cursor-pointer font-medium flex items-center gap-2",children:["Thinking",r&&c.jsx(Dh,{className:"ml-1"})]}),c.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap break-words font-sans",children:l.thinking})]}),l.content??""?c.jsxs("div",{className:"flex items-end gap-x-1",children:[c.jsx("div",{className:"chat-markdown text-foreground min-w-0 flex-1 [&>*:last-child]:mb-0",children:c.jsx(Rb,{remarkPlugins:[Ib],components:Hb,children:String(l.content)})}),r&&c.jsx(Q4,{className:"shrink-0"})]}):r&&a?c.jsx(Dh,{}):null,l.tool_calls?.length?c.jsxs("details",{className:"text-muted-foreground mt-1 text-xs group/details",children:[c.jsxs("summary",{className:"cursor-pointer list-none flex items-center gap-1 opacity-80 hover:opacity-100 [&::-webkit-details-marker]:hidden",children:[c.jsx(xr,{className:"size-3.5 shrink-0 transition-transform group-open/details:rotate-90"}),c.jsx("span",{children:"Show details"}),c.jsxs("span",{className:"opacity-75",children:["(",l.tool_calls.length," tool call",l.tool_calls.length!==1?"s":"",")"]})]}),c.jsx("div",{className:"mt-1.5 border-l border-border/50 pl-4",children:c.jsxs("div",{className:"opacity-80",children:["Tool calls:"," ",l.tool_calls.map(f=>`${f.name}(${f.arguments?.slice(0,40)??""}${(f.arguments?.length??0)>40?"…":""})`).join(", ")]})})]}):null,s||d||l.cost_usd!=null&&l.cost_usd>0?c.jsxs("div",{className:"text-muted-foreground mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs opacity-80",children:[s&&c.jsx("span",{children:s}),d&&c.jsxs("span",{children:[u.prompt_tokens??0," in / ",u.completion_tokens??0," out",u.total_tokens!=null&&` (${u.total_tokens} total)`]}),l.cost_usd!=null&&l.cost_usd>0&&c.jsxs("span",{title:"Estimated cost for this response",children:["$",l.cost_usd.toFixed(6)]})]}):null]})]});if(l.role==="tool"||l.name){const f=l.name??"tool",h=String(l.content??"");return c.jsxs("details",{className:"text-muted-foreground group/tool flex gap-2 pl-10 text-xs",children:[c.jsxs("summary",{className:"cursor-pointer list-none flex flex-1 items-start gap-2 [&::-webkit-details-marker]:hidden",children:[c.jsx(xr,{className:"size-3.5 shrink-0 mt-0.5 transition-transform group-open/tool:rotate-90"}),c.jsxs("div",{className:"flex-1 min-w-0 rounded bg-muted/20 px-2 py-1",children:[c.jsxs("span",{className:"font-medium",children:["Tool result (",f,")"]}),s&&c.jsxs("span",{className:"ml-1 opacity-75",children:["· ",s]})]})]}),c.jsx("div",{className:"pl-10 pr-2 pb-1",children:c.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-words rounded bg-muted/20 p-2 text-xs font-sans",children:h||"(empty)"})})]})}return null}function EP(e){const{config:a,chatMessages:r,chatInput:l,setChatInput:s,chatProvider:u,setChatProvider:d,chatModel:f,setChatModel:h,chatModelsLoading:m,chatSessions:y,chatSessionsLoading:g,chatLoading:v,chatAgentSessionId:b,models:k,ollamaRunning:C,ollamaStatusLoading:E,ollamaPullState:j,checkOllama:R,handleSelectSession:O,handleChatSend:_,handleNewChat:U,pendingActionId:M,pendingActionDetails:L,pendingActionLoading:F,handleApprovePending:Y,handleRejectPending:P,setLastAppliedIdea:W,chatAttachments:ee=[],setChatAttachments:fe,integrations:ne=[],onNavigateToIntegrations:H,missingIntegrationsFromServer:z=null,onClearMissingIntegrationsFromServer:$}=e,[X,G]=S.useState(!1),[A,D]=S.useState([]),[Z,T]=S.useState(""),[oe,ce]=S.useState(!1),ue=vP(ne),ge=r.length===0&&l.length===0,Le=se=>{s(se.base_prompt),W?.(se)},Ee=se=>{D(se.required_integrations),T(se.title),G(!0)},vt=se=>{G(!1),H?.()},rt=se=>{O(se),ce(!1)},ie=b&&y.length>0?y.find(se=>se.id===b)?.session_key??"Current chat":"Chat history",jt=se=>{se.required_integrations.filter(Me=>!ue.includes(Me)).length===0?Le(se):Ee(se)},je=u==="ollama"&&C===!1&&!E,he=u==="ollama"&&j?.inProgress,ze=u==="ollama";return c.jsxs(ut,{className:"flex flex-1 flex-col",children:[c.jsxs(St,{className:"flex flex-row items-center justify-between space-y-0",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"AI Chat"}),c.jsx(kt,{children:"Agent with sessions and tools (e.g. run_task). OpenAI supports tool calls."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Nm,{children:[c.jsx(Am,{asChild:!0,children:c.jsxs(pe,{variant:"outline",size:"sm",className:"gap-1.5",children:[c.jsx(VM,{className:"size-3.5"}),"Try an idea"]})}),c.jsx(Tm,{align:"end",className:"min-w-[220px]",children:nj.map(se=>c.jsxs(fr,{onClick:()=>jt(se),className:"flex flex-col items-start gap-0.5 py-2",children:[c.jsx("span",{className:"font-medium",children:se.title}),c.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:se.description})]},se.id))})]}),c.jsx(pe,{variant:"outline",size:"sm",onClick:U,children:"New chat"})]})]}),c.jsxs(dt,{className:"flex flex-1 flex-col gap-4",children:[je&&c.jsxs("div",{className:"bg-muted border-border flex flex-wrap items-center justify-between gap-2 rounded-lg border p-3 text-sm",children:[c.jsx("span",{children:"Ollama is not running. Set it up to use the default AI."}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(pe,{variant:"outline",size:"sm",asChild:!0,children:c.jsx("a",{href:"/onboard",target:"_blank",rel:"noopener noreferrer",children:"Set up Ollama"})}),c.jsx(pe,{variant:"secondary",size:"sm",onClick:R,disabled:E,children:"Check again"})]})]}),he&&j&&c.jsxs("div",{className:"bg-primary/10 border-primary/20 flex flex-col gap-2 rounded-lg border p-3 text-sm",children:[c.jsxs("div",{className:"font-medium",children:["Pulling model ",j.model,"…"]}),j.percent>=0&&j.percent<=100&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"bg-muted h-2 flex-1 overflow-hidden rounded-full",children:c.jsx("div",{className:"bg-primary h-full transition-[width] duration-300",style:{width:`${j.percent}%`}})}),c.jsxs("span",{className:"text-muted-foreground shrink-0 text-xs",children:[j.percent,"%"]})]}),j.lastLine&&c.jsx("div",{className:"text-muted-foreground truncate font-mono text-xs",title:j.lastLine,children:j.lastLine})]}),ze&&c.jsxs("div",{className:"bg-amber-500/10 border-amber-500/50 flex items-center gap-2 rounded-lg border p-3 text-sm",children:[c.jsx(Gv,{className:"size-4 shrink-0 text-amber-600 dark:text-amber-400","aria-hidden":!0}),c.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:"Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support, switch to a cloud provider."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs(nu,{open:oe,onOpenChange:ce,children:[c.jsxs(pe,{variant:"outline",size:"sm",className:"gap-1.5 min-w-[140px] justify-between",onClick:()=>ce(!0),disabled:g,children:[c.jsx(PM,{className:"size-3.5 shrink-0"}),c.jsx("span",{className:"truncate",children:ie})]}),c.jsxs(au,{side:"right",className:"flex flex-col w-full sm:max-w-md",children:[c.jsxs(ru,{children:[c.jsx(lu,{children:"Chat history"}),c.jsx(iu,{children:"Switch to a previous chat or start a new one."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[c.jsx(pe,{variant:"outline",size:"sm",className:"w-full justify-start mb-2",onClick:()=>rt(""),children:"New chat"}),y.length===0&&!g&&c.jsx("p",{className:"text-muted-foreground text-sm py-2",children:"No chats yet."}),g&&c.jsxs("p",{className:"text-muted-foreground text-sm py-2 flex items-center gap-2",children:[c.jsx(jc,{className:"size-4 animate-spin"}),"Loading…"]}),c.jsx("ul",{className:"space-y-1",children:y.map(se=>c.jsx("li",{children:c.jsx("button",{type:"button",onClick:()=>rt(se.id),className:be("w-full text-left rounded-md px-3 py-2 text-sm transition-colors",se.id===b?"bg-primary/10 text-primary font-medium":"hover:bg-muted"),children:c.jsx("span",{className:"truncate block",children:se.session_key})})},se.id))})]})]})]}),c.jsxs("select",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:u,onChange:se=>{const Te=se.target.value;d(Te);const Me=a?.aiProviders.find(Tt=>Tt.id===Te);h(Me?.defaultModel||"")},children:[(!u||!a?.aiProviders?.some(se=>se.id===u))&&c.jsx("option",{value:"",children:"Select provider"}),(a?.aiProviders??[]).map(se=>c.jsx("option",{value:se.id,children:se.label},se.id))]}),c.jsxs("select",{className:"border-input bg-background min-w-[200px] rounded-md border px-3 py-2 text-sm",value:f,onChange:se=>h(se.target.value),disabled:(u==="openrouter"||u==="ollama")&&m,children:[(u==="openrouter"||u==="ollama")&&m?c.jsx("option",{value:f,children:"Loading models…"}):k.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id)),(u==="openrouter"||u==="ollama")&&!m&&k.length===0&&f&&c.jsx("option",{value:f,children:f})]})]}),c.jsx(ei,{className:"min-h-[240px] flex-1 rounded-md border p-3",children:c.jsxs("div",{className:"space-y-3",children:[r.length===0&&c.jsx("p",{className:"text-muted-foreground text-sm",children:"Send a message to start. Provider and model can be changed above."}),r.map((se,Te)=>c.jsx(CP,{message:se,isLast:Te===r.length-1,isStreaming:v&&Te===r.length-1},Te)),M&&c.jsxs(ut,{className:"border-amber-500/50 bg-amber-500/5",children:[c.jsxs(St,{className:"pb-2",children:[c.jsxs(wt,{className:"flex items-center gap-2 text-base",children:[c.jsx(Gv,{className:"size-4 text-amber-600"}),"Approve this action"]}),c.jsx(kt,{children:"The agent wants to run a tool that can change files or run commands. Approve to continue or reject to cancel."})]}),c.jsx(dt,{className:"space-y-3",children:F&&!L?c.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 py-2",children:[c.jsx(jc,{className:"size-4 animate-spin"}),"Loading…"]}):c.jsxs(c.Fragment,{children:[L&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"font-mono text-sm font-medium",children:L.toolName}),Object.keys(L.args).length>0&&c.jsx("pre",{className:"bg-muted max-h-32 overflow-auto rounded p-2 text-xs",children:JSON.stringify(L.args,null,2)})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(pe,{size:"sm",onClick:Y,children:[c.jsx(GS,{className:"size-4"}),"Approve"]}),c.jsxs(pe,{size:"sm",variant:"destructive",onClick:P,children:[c.jsx(Cc,{className:"size-4"}),"Reject"]})]})]})})]}),v&&r.length>0&&r[r.length-1]?.role==="user"&&c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[c.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),c.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),c.jsx("div",{className:"border-border bg-muted/30 flex items-center gap-2 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:c.jsx(Dh,{})})]})]})}),ge&&c.jsx(bP,{connectedIds:ue,onSelectIdea:Le,onMissingIntegrations:Ee}),ee.length>0&&c.jsx("div",{className:"border-border flex flex-wrap gap-2 rounded-md border p-2",children:ee.map((se,Te)=>c.jsxs("div",{className:"relative",children:[se.type.startsWith("image/")?c.jsx("img",{src:URL.createObjectURL(se),alt:se.name,className:"h-14 w-14 rounded object-cover"}):c.jsx("div",{className:"border-input flex h-14 w-14 items-center justify-center rounded border text-xs",children:se.name.slice(0,8)}),c.jsx("button",{type:"button",className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground text-muted hover:bg-foreground hover:text-background",onClick:()=>fe(Me=>Me.filter((Tt,mt)=>mt!==Te)),"aria-label":"Remove attachment",children:c.jsx(Cc,{className:"h-3 w-3"})})]},`${se.name}-${Te}`))}),c.jsxs("div",{className:"flex gap-2 items-end",children:[c.jsxs("label",{className:"cursor-pointer shrink-0 rounded-md border border-input px-2 py-2 text-muted-foreground hover:bg-muted/50",children:[c.jsx("input",{type:"file",accept:"image/*",className:"sr-only",multiple:!0,onChange:se=>{const Te=se.target.files?Array.from(se.target.files):[];fe(Me=>[...Me,...Te]),se.target.value=""}}),c.jsx(IM,{className:"h-5 w-5","aria-hidden":!0})]}),c.jsx("textarea",{className:"border-input bg-background field-sizing-content min-h-10 max-h-48 w-full min-w-0 flex-1 resize-none rounded-md border px-3 py-2 text-sm leading-relaxed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",placeholder:"Type a message…",value:l,onChange:se=>s(se.target.value),onKeyDown:se=>{se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),_())},rows:1}),c.jsx(pe,{onClick:_,disabled:v||!l.trim()&&ee.length===0,children:v?"Sending…":"Send"})]}),c.jsx(kP,{open:X||z!=null&&z.length>0,onOpenChange:se=>{se||(G(!1),$?.())},requiredIntegrations:X?A:z??[],connectedIds:ue,ideaTitle:X?Z:"",onConnect:vt})]})]})}function NP(e,a){const[r,l]=S.useState([]),[s,u]=S.useState(!1),[d,f]=S.useState(null),[h,m]=S.useState(!1),[y,g]=S.useState(null),[v,b]=S.useState(void 0),[k,C]=S.useState(!1),[E,j]=S.useState(!1),R=15e3,O=S.useCallback(async()=>{u(!0),m(!1),g(null),b(void 0),C(!1),j(!1);const F=new Promise((Y,P)=>{setTimeout(()=>P(new Error("Request timed out. Check that the agent and integrations service are running.")),R)});try{const Y=await Promise.race([vr(),F]),P=!!(Y.portalGatewayUrl?.trim()&&Y.integrationsMode!=="portal");if(C(P),j(Y.portalOAuthConnectAvailable===!0),Y.integrationsMode==="portal"){m(!0),g(Y.portalGatewayUrl??null);const fe=Y.integrationsUrl?.trim()||void 0;try{let ne;try{const{integrations:$}=await Promise.race([Ah(fe),F]);ne=$.map(X=>({...X,connections:[]}))}catch{ne=Bb().map(X=>({id:X.id,name:X.name,iconUrl:X.logoUrl??"",description:X.description,connections:[]}))}const H=new Map(ne.map($=>[$.id,$])),{connections:z}=await Promise.race([Cw(),F]);for(const $ of z){const X=$.provider||"other";let G=H.get(X);if(!G){const A=X.charAt(0).toUpperCase()+X.slice(1);G={id:X,name:A,iconUrl:"",description:"Connected via Portal",connections:[]},H.set(X,G),ne.push(G)}G.connections.push($)}l(ne)}catch{l(Bb().map(ne=>({id:ne.id,name:ne.name,iconUrl:ne.logoUrl??"",description:ne.description,connections:[],tokenOnly:ne.tokenOnly})))}u(!1);return}const W=Y.integrationsUrl??void 0;b(W);const{integrations:ee}=await Promise.race([Ah(W),F]);l(ee)}catch(Y){a(Y.message),l([])}finally{u(!1)}},[a]),_=S.useRef(O);_.current=O,S.useEffect(()=>{(e==="integrations"||e==="chat")&&_.current()},[e]);const U=S.useCallback(async F=>{f(F);try{const Y=typeof window<"u"?`${window.location.origin}${window.location.pathname}?page=integrations`:"";if(h){const{authUrl:P}=await Ew(F,Y);window.location.href=P}else{const{authUrl:P}=await kw(F,Y,v);window.location.href=P}}catch(Y){a(Y.message),f(null)}},[h,v,a]),M=S.useCallback(async F=>{try{h?await Nw(F):await jw(F,v),await O()}catch(Y){a(Y.message)}},[h,v,O,a]),L=S.useCallback(async F=>{try{const{url:Y}=await ou(F);window.open(Y,"_blank","noopener,noreferrer")}catch(Y){a(Y.message)}},[a]);return{integrations:r,loading:s,connectingProvider:d,integrationsManagedByPortal:h,portalGatewayUrl:y,portalUrlSetButKeyMissing:k,portalOAuthConnectAvailable:E,load:O,handleConnect:U,handleDisconnect:M,startOAuthConnect:L}}function AP({integrations:e,loading:a,connectingProvider:r,integrationsManagedByPortal:l,portalUrlSetButKeyMissing:s=!1,load:u,handleConnect:d,handleDisconnect:f,onError:h}){const[m,y]=S.useState("");S.useEffect(()=>{const v=new URLSearchParams(window.location.search),b=v.get("connectionId"),k=v.get("error"),C=v.get("oauth"),E=v.get("message");if(b||k){if(k&&h)try{h(decodeURIComponent(k))}catch{h("OAuth failed")}u();const j=new URL(window.location.href);j.searchParams.delete("connectionId"),j.searchParams.delete("error"),window.history.replaceState({},"",j.toString())}else if(C==="success"||C==="error"){C==="error"&&E&&h&&h(E==="exchange_failed"?"Token exchange failed. Check PORTAL_OAUTH_CLIENT_SECRET and redirect_uri.":E==="no_token"?"No access token in response.":E),u();const j=new URL(window.location.href);j.searchParams.delete("oauth"),j.searchParams.delete("message"),window.history.replaceState({},"",j.toString())}},[u,h]);const g=S.useMemo(()=>{const v=m.trim().toLowerCase();return v?e.filter(b=>b.name.toLowerCase().includes(v)||b.description.toLowerCase().includes(v)||b.id.toLowerCase().includes(v)):e},[e,m]);return a&&e.length===0?c.jsxs("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 py-12",children:[c.jsx(jc,{className:"size-5 animate-spin"}),c.jsx("span",{children:"Loading…"})]}):l?c.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Apps"}),c.jsx(xt,{variant:"secondary",className:"rounded-full text-[10px] font-medium uppercase",children:"Beta"})]}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connect and disconnect apps here. Your agent uses ",c.jsx("code",{className:"rounded bg-muted px-1",children:"PORTAL_API_KEY"})," or OAuth to access them."]})]}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Configure Portal gateway and connect in ",c.jsx("strong",{children:"Settings → Portal"}),"."]}),e.length>0&&c.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:c.jsxs("div",{className:"relative w-full sm:w-64",children:[c.jsx(qv,{className:"text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2"}),c.jsx(Xt,{type:"search",placeholder:"Search apps",value:m,onChange:v=>y(v.target.value),className:"pl-9"})]})}),g.length>0?c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(v=>c.jsx(Fb,{app:v,connecting:r===v.id,onConnect:()=>d(v.id),onDisconnect:f},v.id))}):m.trim()?c.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No apps match your search."}):c.jsx("p",{className:"text-muted-foreground py-4 text-center text-sm",children:"No connections yet. Click an app to connect."})]}):e.length===0&&!a?s?c.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4",children:[c.jsxs("div",{className:"border-amber-500/50 bg-amber-500/10 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[c.jsx("p",{className:"font-medium",children:"Portal API key required"}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Configure Portal gateway URL and API key (or connect with OAuth) in ",c.jsx("strong",{children:"Settings → Portal"}),"."]})]}),c.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>u(),className:"self-start",children:"Retry"})]}):c.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:c.jsxs("div",{className:"border-destructive/50 bg-destructive/5 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[c.jsx("p",{className:"font-medium",children:"Could not reach the integrations service"}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Set ",c.jsx("code",{className:"rounded bg-muted px-1",children:"INTEGRATIONS_URL"})," in the agent .env (e.g. http://localhost:1717) and run the integrations service (",c.jsx("code",{className:"rounded bg-muted px-1",children:"cd integrations && npm run dev"}),"), or configure Portal in ",c.jsx("strong",{children:"Settings → Portal"}),"."]}),c.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>u(),children:"Retry"})]})}):c.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Apps"}),c.jsx(xt,{variant:"secondary",className:"rounded-full text-[10px] font-medium uppercase",children:"Beta"})]}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect your favorite apps. The agent uses these via connectionId — no secrets in skills."})]}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Portal gateway and Connect with Sulala are in ",c.jsx("strong",{children:"Settings → Portal"}),"."]}),c.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:c.jsxs("div",{className:"relative w-full sm:w-64",children:[c.jsx(qv,{className:"text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2"}),c.jsx(Xt,{type:"search",placeholder:"Search apps",value:m,onChange:v=>y(v.target.value),className:"pl-9"})]})}),c.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(v=>c.jsx(Fb,{app:v,connecting:r===v.id,onConnect:()=>d(v.id),onDisconnect:f},v.id))}),g.length===0&&c.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No apps match your search."})]})}const TP="https://discord.com/developers/applications",_P="https://dashboard.stripe.com/apikeys";function Fb({app:e,connecting:a,onConnect:r,onDisconnect:l,portalMode:s=!1}){const u=e.connections.length>0,d=e.tokenOnly===!0,f=e.id==="discord",h=e.id==="stripe",m=()=>{if(!u){if(d&&f){window.open(TP,"_blank","noopener,noreferrer");return}if(d&&h){window.open(_P,"_blank","noopener,noreferrer");return}r()}};return c.jsxs("div",{className:"border-border hover:bg-muted/50 flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 transition-colors",onClick:m,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),m())},role:"button",tabIndex:0,children:[c.jsx("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg p-1.5",children:e.iconUrl?c.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-contain"}):c.jsx("span",{className:"text-muted-foreground text-sm font-medium",children:e.name.charAt(0)})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium truncate",children:e.name}),u&&c.jsx(xt,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Connected"}),d&&!u&&c.jsx(xt,{variant:"outline",className:"shrink-0 text-[10px]",children:"Setup"})]}),c.jsx("p",{className:"text-muted-foreground truncate text-sm",children:e.description}),f&&d&&c.jsxs("p",{className:"text-muted-foreground mt-0.5 text-xs",children:["Set ",c.jsx("code",{className:"rounded bg-muted px-1",children:"DISCORD_BOT_TOKEN"})," in agent .env or Settings → Channels. Click to open Discord Developer Portal."]}),h&&d&&c.jsxs("p",{className:"text-muted-foreground mt-0.5 text-xs",children:["Set Secret Key in Settings → Payment or ",c.jsx("code",{className:"rounded bg-muted px-1",children:"STRIPE_SECRET_KEY"})," in agent .env. Click to open Stripe API keys."]})]}),c.jsx("div",{className:"flex shrink-0 items-center gap-1",children:u&&!s?e.connections.map(y=>c.jsx(pe,{variant:"ghost",size:"icon",className:"size-8",onClick:g=>{g.stopPropagation(),l(y.id)},title:"Disconnect",children:c.jsx(QS,{className:"size-3.5 text-muted-foreground"})},y.id)):u&&s?c.jsx("span",{title:"Manage in Portal",children:c.jsx(xr,{className:"text-muted-foreground size-5"})}):a?c.jsx(jc,{className:"text-muted-foreground size-5 animate-spin"}):c.jsx(xr,{className:"text-muted-foreground size-5"})})]})}function Xm({className:e,...a}){return c.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:c.jsx("table",{"data-slot":"table",className:be("w-full caption-bottom text-sm",e),...a})})}function Qm({className:e,...a}){return c.jsx("thead",{"data-slot":"table-header",className:be("[&_tr]:border-b",e),...a})}function Zm({className:e,...a}){return c.jsx("tbody",{"data-slot":"table-body",className:be("[&_tr:last-child]:border-0",e),...a})}function mr({className:e,...a}){return c.jsx("tr",{"data-slot":"table-row",className:be("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...a})}function Zt({className:e,...a}){return c.jsx("th",{"data-slot":"table-head",className:be("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function Ht({className:e,...a}){return c.jsx("td",{"data-slot":"table-cell",className:be("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}const rj=[{label:"Every day at 9:00 AM",value:"0 9 * * *"},{label:"Every day at 8:00 AM",value:"0 8 * * *"},{label:"Every day at 12:00 PM (noon)",value:"0 12 * * *"},{label:"Every day at 6:00 PM",value:"0 18 * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Every 30 minutes",value:"*/30 * * * *"},{label:"Every 15 minutes",value:"*/15 * * * *"},{label:"Every Monday at 9:00 AM",value:"0 9 * * 1"},{label:"Every weekday at 9:00 AM",value:"0 9 * * 1-5"},{label:"Custom (advanced)",value:"__custom__"}];function RP(e){return rj.find(r=>r.value===e&&r.value!=="__custom__")?.label??(e?`Custom: ${e}`:"—")}function MP(e){const{schedules:a,load:r,onCreateSchedule:l,onUpdateSchedule:s,onDeleteSchedule:u,onRunSchedule:d,onFetchScheduleRuns:f}=e,[h,m]=S.useState("Morning post"),[y,g]=S.useState(""),[v,b]=S.useState("Fetch daily news and post one to Bluesky."),[k,C]=S.useState("0 9 * * *"),[E,j]=S.useState(""),[R,O]=S.useState(!0),[_,U]=S.useState(""),[M,L]=S.useState(""),[F,Y]=S.useState([]),[P,W]=S.useState([]),[ee,fe]=S.useState(!1),[ne,H]=S.useState(!1),[z,$]=S.useState(null),[X,G]=S.useState(null),[A,D]=S.useState([]),[Z,T]=S.useState(!1),[oe,ce]=S.useState(null),ue=k==="__custom__"?E.trim():k;S.useEffect(()=>{vr().then(ie=>Y(ie?.aiProviders??[])).catch(()=>Y([]))},[]),S.useEffect(()=>{if(!_||_!=="ollama"&&_!=="openrouter"){W([]),L("");return}fe(!0),ws(_).then(ie=>W(ie.models??[])).catch(()=>W([])).finally(()=>fe(!1))},[_]);const ge=async()=>{if(v.trim()){H(!0);try{const ie=R?[{channel:"telegram",target:"default"}]:[];await l({name:h.trim()||"Scheduled job",description:y.trim()||void 0,cron_expression:ue.trim(),prompt:v.trim(),delivery:ie.length?ie:void 0,provider:_.trim()||null,model:M.trim()||null}),m("Morning post"),g(""),b("Fetch daily news and post one to Bluesky."),C("0 9 * * *"),j(""),O(!0),U(""),L("")}finally{H(!1)}}},Le=async ie=>{$(ie.id);try{await s(ie.id,{enabled:!ie.enabled})}finally{$(null)}},Ee=async ie=>{$(ie);try{await u(ie)}finally{$(null)}},vt=async ie=>{$(ie.id),ce(null);try{const jt=await d(ie.id);ce({jobId:ie.id,message:`Job enqueued (task ${jt.id.slice(0,12)}…)`}),r()}catch(jt){ce({jobId:ie.id,message:jt instanceof Error?jt.message:"Run failed"})}finally{$(null)}},rt=ie=>{G(ie)};return S.useEffect(()=>{if(!X){D([]);return}T(!0),f(X.id).then(({runs:ie})=>D(ie)).catch(()=>D([])).finally(()=>T(!1))},[X?.id,f]),c.jsxs("div",{className:"space-y-4",children:[c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"New job"}),c.jsx(kt,{children:"Describe what you want in plain language. The agent will use your skills (e.g. news, Bluesky) and run on schedule. Job results are sent to Telegram: the first chat that messages the bot becomes the notification target, or set it in Settings → Channels."})]}),c.jsxs(dt,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Name"}),c.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:h,onChange:ie=>m(ie.target.value),placeholder:"Morning post"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Schedule"}),c.jsx("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:k,onChange:ie=>C(ie.target.value),children:rj.map(ie=>c.jsx("option",{value:ie.value,children:ie.label},ie.value))}),k==="__custom__"&&c.jsxs("div",{className:"mt-2 space-y-1",children:[c.jsx("label",{className:"text-muted-foreground block text-xs",children:"Cron expression: minute hour day month weekday (e.g. 0 9 * * * = 9:00 daily)"}),c.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 font-mono text-sm",value:E,onChange:ie=>j(ie.target.value),placeholder:"0 9 * * *"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Description (optional)"}),c.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:y,onChange:ie=>g(ie.target.value),placeholder:"Short context for this job"})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"AI Provider (optional)"}),c.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:_,onChange:ie=>U(ie.target.value),children:[c.jsx("option",{value:"",children:"Use default (OpenRouter/OpenAI if configured)"}),F.map(ie=>c.jsx("option",{value:ie.id,children:ie.label},ie.id)),F.length===0&&c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"",children:"Use default"}),c.jsx("option",{value:"openrouter",children:"OpenRouter"}),c.jsx("option",{value:"openai",children:"OpenAI"}),c.jsx("option",{value:"claude",children:"Claude"}),c.jsx("option",{value:"gemini",children:"Gemini"}),c.jsx("option",{value:"ollama",children:"Ollama"})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Leave empty to use app default (prefers OpenRouter or OpenAI when configured). Do not use Ollama for jobs unless it is always running."}),_==="ollama"&&c.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200",children:[c.jsx("strong",{children:"Warning:"})," Using Ollama for scheduled jobs is not recommended. The job will not run if Ollama is not running when the job triggers. Use OpenRouter or OpenAI for reliable scheduled runs."]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Model (optional)"}),_&&(_==="ollama"||_==="openrouter")?c.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:M,onChange:ie=>L(ie.target.value),disabled:ee,children:[c.jsx("option",{value:"",children:"Use provider default"}),P.map(ie=>c.jsx("option",{value:ie.id,children:ie.name},ie.id))]}):c.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:M,onChange:ie=>L(ie.target.value),placeholder:_?F.find(ie=>ie.id===_)?.defaultModel??"e.g. gpt-4o-mini":"Select provider first",disabled:!_})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Prompt *"}),c.jsx("textarea",{className:"border-input bg-background min-h-[80px] w-full rounded-md border px-3 py-2 text-sm",value:v,onChange:ie=>b(ie.target.value),placeholder:"e.g. Fetch daily news and post one to Bluesky.",rows:3})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("input",{type:"checkbox",checked:R,onChange:ie=>O(ie.target.checked)}),"Notify via Telegram when job completes or fails"]}),c.jsx(pe,{onClick:ge,disabled:ne||!v.trim()||!ue,children:ne?"Adding…":"Add job"})]})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"Scheduled jobs"}),c.jsx(kt,{children:"Agent jobs (prompt + schedule). You get a Telegram notification on success or failure if delivery is set."})]}),c.jsx(pe,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),c.jsx(dt,{children:c.jsx(ei,{className:"h-[320px]",children:c.jsxs(Xm,{children:[c.jsx(Qm,{children:c.jsxs(mr,{children:[c.jsx(Zt,{children:"Name"}),c.jsx(Zt,{children:"Prompt"}),c.jsx(Zt,{children:"Model"}),c.jsx(Zt,{children:"Cron"}),c.jsx(Zt,{children:"Delivery"}),c.jsx(Zt,{children:"Enabled"}),c.jsx(Zt,{children:"Created"}),c.jsx(Zt,{className:"w-[70px]",children:"Actions"})]})}),c.jsx(Zm,{children:a.length===0?c.jsx(mr,{children:c.jsx(Ht,{colSpan:8,className:"text-muted-foreground text-center text-sm",children:"No scheduled jobs. Add one above."})}):a.map(ie=>c.jsxs(mr,{children:[c.jsx(Ht,{className:"font-medium",children:ie.name||ie.id}),c.jsx(Ht,{className:"max-w-[200px] truncate text-sm",children:ie.prompt||ie.task_type||"—"}),c.jsx(Ht,{className:"text-muted-foreground max-w-[120px] truncate text-xs",children:ie.provider?`${ie.provider}${ie.model?` / ${ie.model}`:""}`:"—"}),c.jsx(Ht,{className:"text-xs",children:RP(ie.cron_expression)}),c.jsx(Ht,{children:ie.delivery?c.jsx(xt,{variant:"outline",children:"Telegram"}):c.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),c.jsx(Ht,{children:c.jsx(xt,{variant:ie.enabled?"default":"secondary",children:ie.enabled?"On":"Off"})}),c.jsx(Ht,{className:"text-muted-foreground text-xs",children:ks(ie.created_at)}),c.jsx(Ht,{children:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs(Nm,{children:[c.jsx(Am,{asChild:!0,children:c.jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:z===ie.id,title:"Actions",children:c.jsx(bM,{className:"size-4"})})}),c.jsxs(Tm,{align:"end",children:[c.jsxs(fr,{onClick:()=>vt(ie),children:[c.jsx(dO,{className:"size-4"}),"Test"]}),c.jsxs(fr,{onClick:()=>rt(ie),children:[c.jsx(km,{className:"size-4"}),"Logs"]}),c.jsxs(fr,{onClick:()=>Le(ie),children:[c.jsx(xO,{className:"size-4"}),ie.enabled?"Disable":"Enable"]}),c.jsxs(fr,{variant:"destructive",onClick:()=>Ee(ie.id),children:[c.jsx(QS,{className:"size-4"}),"Delete"]})]})]}),oe?.jobId===ie.id&&c.jsx("span",{className:"text-muted-foreground text-xs",children:oe.message})]})})]},ie.id))})]})})})]}),c.jsx(nu,{open:!!X,onOpenChange:ie=>!ie&&G(null),children:c.jsxs(au,{side:"right",className:"w-full max-w-lg overflow-y-auto",children:[c.jsxs(ru,{children:[c.jsxs(lu,{children:[X?.name||X?.id," — Run logs"]}),c.jsx(iu,{children:"Recent runs for this job. Status: pending, running, done, or failed."})]}),c.jsx("div",{className:"mt-4 space-y-3",children:Z?c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):A.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:"No runs yet. Use Test to run now."}):A.map(ie=>c.jsxs("div",{className:"border-input rounded-md border p-3 text-sm",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx(xt,{variant:ie.status==="done"?"default":ie.status==="failed"?"destructive":ie.status==="running"?"secondary":"outline",children:ie.status}),c.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[ie.id.slice(0,16),"…"]})]}),c.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:[Vw(ie.created_at),ie.finished_at!=null&&ie.started_at!=null&&c.jsxs(c.Fragment,{children:[" · ",Math.round((ie.finished_at-ie.started_at)/1e3),"s"]})]}),ie.error&&c.jsx("p",{className:"mt-2 text-destructive text-xs",children:ie.error})]},ie.id))})]})})]})}function OP({config:e}){return c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Watched folders"}),c.jsx(kt,{children:"Paths monitored by the file watcher (from env and config/watched.json). Read-only."})]}),c.jsx(dt,{children:e?.watchFolders&&e.watchFolders.length>0?c.jsx("ul",{className:"space-y-2 font-mono text-sm",children:e.watchFolders.map(a=>c.jsx("li",{className:"rounded border bg-muted/30 px-3 py-2",children:a},a))}):c.jsx("p",{className:"text-muted-foreground text-sm",children:"No watched folders configured. Set WATCH_FOLDERS in .env or add paths to config/watched.json."})})]})}function DP(e){const[a,r]=S.useState(null);return S.useEffect(()=>{(e==="config"||e==="settings")&&vr().then(r).catch(()=>r(null))},[e]),a}const qb={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic (Claude) API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key",OLLAMA_BASE_URL:"Ollama Base URL",GATEWAY_API_KEY:"Gateway API Key"};function zP(){const[e,a]=S.useState({}),[r,l]=S.useState({}),[s,u]=S.useState(!0),[d,f]=S.useState(!1),[h,m]=S.useState(null),[y,g]=S.useState(!1),[v,b]=S.useState(null),[k,C]=S.useState(null),[E,j]=S.useState(""),[R,O]=S.useState(""),[_,U]=S.useState([]),[M,L]=S.useState(!1),[F,Y]=S.useState(!1),[P,W]=S.useState(null);S.useEffect(()=>{Promise.all([Da(),Vl(),vr(),Aw()]).then(([H,z,$,X])=>{a(H.keys||{}),m(z.running),C($??null),j(X.defaultProvider??""),O(X.defaultModel??"")}).catch(()=>b({type:"error",text:"Failed to load"})).finally(()=>u(!1))},[]),S.useEffect(()=>{if(!E||E!=="ollama"&&E!=="openrouter"){U([]);return}L(!0),ws(E).then(H=>U(H.models??[])).catch(()=>U([])).finally(()=>L(!1))},[E]);const ee=async()=>{g(!0);try{const{running:H}=await Vl();m(H)}finally{g(!1)}},fe=async()=>{f(!0),b(null);try{const H={};for(const[$,X]of Object.entries(r))typeof X=="string"&&X.trim()&&(H[$]=X.trim());await Jl(H);const{keys:z}=await Da();a(z),l({}),b({type:"success",text:"API keys saved. Restart the agent for changes to take effect."})}catch(H){b({type:"error",text:H instanceof Error?H.message:"Failed to save"})}finally{f(!1)}},ne=Object.keys(qb);return s?c.jsx(ut,{children:c.jsx(dt,{className:"pt-6",children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"})})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{children:"AI Providers"}),c.jsxs(kt,{children:["Add or update API keys. Saved to ",c.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),". Restart the agent for changes."]})]}),c.jsxs(dt,{className:"space-y-4",children:[ne.map(H=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:H,children:qb[H]??H}),c.jsx(Xt,{id:H,type:"password",placeholder:e[H]==="set"?"(already set)":"",value:r[H]??"",onChange:z=>l($=>({...$,[H]:z.target.value})),autoComplete:"off"})]},H)),v&&c.jsx("p",{className:v.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:v.text}),c.jsx(pe,{onClick:fe,disabled:d||Object.keys(r).length===0,children:d?"Saving…":"Save"})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{children:"Default for scheduled jobs"}),c.jsx(kt,{children:'When a job uses "Use default", this provider and model are used. Set this to OpenRouter or OpenAI (not Ollama) so jobs run reliably even when Ollama is not running.'})]}),c.jsxs(dt,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"job-default-provider",children:"Provider"}),c.jsxs("select",{id:"job-default-provider",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:E,onChange:H=>{j(H.target.value),O("")},children:[c.jsx("option",{value:"",children:"Use env default"}),(k?.aiProviders??[]).filter(H=>H.id!=="ollama").map(H=>c.jsx("option",{value:H.id,children:H.label},H.id)),c.jsx("option",{value:"ollama",children:"Ollama (not recommended for jobs)"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"job-default-model",children:"Model"}),E&&(E==="ollama"||E==="openrouter")?c.jsxs("select",{id:"job-default-model",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:R,onChange:H=>O(H.target.value),disabled:M,children:[c.jsx("option",{value:"",children:"Use provider default"}),_.map(H=>c.jsx("option",{value:H.id,children:H.name},H.id))]}):c.jsx(Xt,{id:"job-default-model",className:"h-9 text-sm",value:R,onChange:H=>O(H.target.value),placeholder:E?"e.g. gpt-4o-mini":"Set provider first",disabled:!E})]})]}),E==="ollama"&&c.jsx("p",{className:"text-amber-600 dark:text-amber-400 text-sm",children:"Ollama is not recommended for scheduled jobs. If Ollama is not running when the job runs, the job will fail."}),P&&c.jsx("p",{className:P.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:P.text}),c.jsx(pe,{onClick:async()=>{Y(!0),W(null);try{await Tw({defaultProvider:E.trim()||null,defaultModel:R.trim()||null}),W({type:"success",text:"Job default saved. New jobs using “Use default” will use this."})}catch(H){W({type:"error",text:H instanceof Error?H.message:"Failed to save"})}finally{Y(!1)}},disabled:F,children:F?"Saving…":"Save job default"})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{children:"Ollama"}),c.jsx(kt,{children:"Local AI. No API key required. Install from ollama.com"})]}),c.jsxs(dt,{children:[h?c.jsx("p",{className:"text-green-600 dark:text-green-400 text-sm",children:"Ollama is running."}):c.jsx("p",{className:"text-muted-foreground text-sm",children:"Ollama is not running."}),c.jsx(pe,{variant:"outline",size:"sm",onClick:ee,disabled:y,className:"mt-2",children:y?"Checking…":"Check again"}),c.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Install from ",c.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," or run ",c.jsx("code",{children:"ollama serve"})," in terminal."]})]})]})]})}function LP(e){const{tasks:a,load:r,enqueueType:l,setEnqueueType:s,enqueuePayload:u,setEnqueuePayload:d,enqueueing:f,actionTaskId:h,handleTaskCancel:m,handleTaskRetry:y,handleEnqueue:g}=e;return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Enqueue task"}),c.jsx(kt,{children:"Add a task to the queue"})]}),c.jsxs(dt,{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Type"}),c.jsx("input",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:l,onChange:v=>s(v.target.value),placeholder:"e.g. heartbeat"})]}),c.jsxs("div",{className:"min-w-[200px] space-y-2",children:[c.jsx("label",{className:"text-muted-foreground block text-sm",children:"Payload (JSON)"}),c.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:u,onChange:v=>d(v.target.value),placeholder:'{"key": "value"}'})]}),c.jsx(pe,{onClick:g,disabled:f,children:f?"Enqueueing…":"Enqueue"})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"Tasks"}),c.jsx(kt,{children:"Recent tasks (from gateway)"})]}),c.jsx(pe,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),c.jsx(dt,{children:c.jsx(ei,{className:"h-[400px]",children:c.jsxs(Xm,{children:[c.jsx(Qm,{children:c.jsxs(mr,{children:[c.jsx(Zt,{children:"ID"}),c.jsx(Zt,{children:"Type"}),c.jsx(Zt,{children:"Status"}),c.jsx(Zt,{children:"Created"}),c.jsx(Zt,{className:"w-[120px]",children:"Actions"})]})}),c.jsx(Zm,{children:a.map(v=>c.jsxs(mr,{children:[c.jsxs(Ht,{className:"font-mono text-xs",children:[v.id.slice(0,20),"…"]}),c.jsx(Ht,{children:v.type}),c.jsx(Ht,{children:c.jsx(xt,{variant:v.status==="done"?"default":v.status==="failed"?"destructive":v.status==="cancelled"?"outline":"secondary",children:v.status})}),c.jsx(Ht,{className:"text-muted-foreground text-xs",children:ks(v.created_at)}),c.jsxs(Ht,{children:[(v.status==="pending"||v.status==="running")&&c.jsx(pe,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",disabled:h===v.id,onClick:()=>m(v.id),children:"Cancel"}),v.status==="failed"&&c.jsx(pe,{variant:"ghost",size:"sm",className:"h-7",disabled:h===v.id,onClick:()=>y(v.id),children:"Retry"})]})]},v.id))})]})})})]})]})}function PP({logs:e,load:a}){return c.jsxs(ut,{children:[c.jsxs(St,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"Logs"}),c.jsx(kt,{children:"Recent gateway and worker logs"})]}),c.jsx(pe,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),c.jsx(dt,{children:c.jsx(ei,{className:"h-[500px] rounded-md border p-3",children:c.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.map(r=>c.jsxs("div",{className:"flex flex-wrap gap-2 border-b py-1.5 last:border-0",children:[c.jsx("span",{className:"text-muted-foreground shrink-0",children:ks(r.created_at)}),c.jsx(xt,{variant:"outline",className:"shrink-0",children:r.source}),c.jsx("span",{className:r.level==="error"?"text-destructive":r.level==="warn"?"text-amber-600 dark:text-amber-400":"",children:r.message})]},r.id))})})})]})}function UP({fileStates:e,load:a}){return c.jsxs(ut,{children:[c.jsxs(St,{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(wt,{className:"text-base",children:"File states"}),c.jsx(kt,{children:"Files seen by the watcher (last modified time, size)"})]}),c.jsx(pe,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),c.jsx(dt,{children:c.jsx(ei,{className:"h-[500px]",children:c.jsxs(Xm,{children:[c.jsx(Qm,{children:c.jsxs(mr,{children:[c.jsx(Zt,{children:"Path"}),c.jsx(Zt,{children:"Size"}),c.jsx(Zt,{children:"Last seen"})]})}),c.jsx(Zm,{children:e.length===0?c.jsx(mr,{children:c.jsx(Ht,{colSpan:3,className:"text-muted-foreground text-center",children:"No file states. Add watched folders and trigger file events."})}):e.map(r=>c.jsxs(mr,{children:[c.jsx(Ht,{className:"max-w-[400px] truncate font-mono text-xs",children:r.path}),c.jsx(Ht,{className:"text-muted-foreground text-xs",children:r.size!=null?`${r.size} B`:"—"}),c.jsx(Ht,{className:"text-muted-foreground text-xs",children:ks(r.last_seen)})]},r.path))})]})})})]})}const IP="https://discord.com/developers/applications";function BP(){const[e,a]=S.useState(null),[r,l]=S.useState(null),[s,u]=S.useState(!0),[d,f]=S.useState(!1),[h,m]=S.useState(null),[y,g]=S.useState(!1),[v,b]=S.useState(""),[k,C]=S.useState("open"),[E,j]=S.useState(""),[R,O]=S.useState(""),[_,U]=S.useState(""),[M,L]=S.useState([]),[F,Y]=S.useState(!1),[P,W]=S.useState(null),[ee,fe]=S.useState(""),[ne,H]=S.useState(!1),z=async()=>{u(!0),m(null);try{const[G,A,D]=await Promise.all([rw(),iw(),vr()]);a(G),W(A),l(D),g(G.enabled),b(""),C(G.dmPolicy||"open"),j(Array.isArray(G.allowFrom)?G.allowFrom.join(", "):""),O(G.defaultProvider??""),U(G.defaultModel??"")}catch(G){m(G instanceof Error?G.message:String(G))}finally{u(!1)}};S.useEffect(()=>{z()},[]),S.useEffect(()=>{if(!R||R!=="ollama"&&R!=="openrouter"){L([]);return}Y(!0),ws(R).then(G=>L(G.models??[])).catch(()=>L([])).finally(()=>Y(!1))},[R]);const $=async()=>{f(!0),m(null);try{const G=E.split(/[,;\s]+/).map(Z=>parseInt(Z.trim(),10)).filter(Z=>!Number.isNaN(Z)),A={enabled:y,dmPolicy:k,allowFrom:G,defaultProvider:R.trim()||null,defaultModel:_.trim()||null};v.trim()&&(A.botToken=v.trim());const D=await lw(A);a(D),b("")}catch(G){m(G instanceof Error?G.message:String(G))}finally{f(!1)}},X=async()=>{H(!0),m(null);try{const G=await sw({botToken:ee.trim()||null});W(G),fe("")}catch(G){m(G instanceof Error?G.message:String(G))}finally{H(!1)}};return s?c.jsx(ut,{children:c.jsx(dt,{className:"pt-6",children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading channels…"})})}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Telegram"}),c.jsx(kt,{children:"Connect your device to Telegram so you can chat with the agent from your phone. Create a bot with @BotFather, then paste the token below."})]}),c.jsxs(dt,{className:"space-y-4",children:[e&&c.jsxs("div",{className:"space-y-1 text-sm",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.status==="connected"&&e.botUsername?c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["Connected as @",e.botUsername]}):e.configured?c.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"Not connected"}):c.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]}),e.error&&c.jsx("p",{className:"text-destructive text-xs",children:e.error}),e.configured&&!e.botUsername&&!e.error&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Click Save or Reconnect to start the bot. Use “Anyone” under Who can DM if you want to receive messages."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"checkbox",id:"telegram-enabled",checked:y,onChange:G=>g(G.target.checked),className:"h-4 w-4 rounded border-input"}),c.jsx("label",{htmlFor:"telegram-enabled",className:"text-sm font-medium",children:"Enable Telegram channel"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"telegram-token",className:"text-sm font-medium",children:"Bot token"}),c.jsx(Xt,{id:"telegram-token",type:"password",placeholder:e?.configured?"(already set)":"123456789:ABC…",value:v,onChange:G=>b(G.target.value),autoComplete:"off",className:"font-mono text-sm"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from @BotFather in Telegram. Leave blank to keep the current token."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"telegram-dm-policy",className:"text-sm font-medium",children:"Who can DM the bot"}),c.jsxs("select",{id:"telegram-dm-policy",value:k,onChange:G=>C(G.target.value),className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[c.jsx("option",{value:"open",children:"Anyone"}),c.jsx("option",{value:"allowlist",children:"Only allowlist (set IDs below)"}),c.jsx("option",{value:"disabled",children:"Disabled"})]}),k==="disabled"&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Bot can still connect; it won’t reply to any DMs. Choose Anyone to chat from Telegram."})]}),k==="allowlist"&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"telegram-allow-from",className:"text-sm font-medium",children:"Allowed user IDs (comma-separated)"}),c.jsx(Xt,{id:"telegram-allow-from",value:E,onChange:G=>j(G.target.value),placeholder:"123456789, 987654321",className:"font-mono text-sm"})]}),c.jsxs("div",{className:"space-y-2 border-t pt-4",children:[c.jsx("label",{className:"text-sm font-medium",children:"AI for Telegram"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Provider and model used when you chat via Telegram. Leave empty to use a connected provider (OpenRouter or OpenAI if configured, otherwise app default)."}),c.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("label",{htmlFor:"telegram-provider",className:"text-xs text-muted-foreground",children:"Provider"}),c.jsxs("select",{id:"telegram-provider",value:R,onChange:G=>{O(G.target.value),U("")},className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[c.jsx("option",{value:"",children:"Use app default"}),(r?.aiProviders??[]).map(G=>c.jsx("option",{value:G.id,children:G.label},G.id))]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("label",{htmlFor:"telegram-model",className:"text-xs text-muted-foreground",children:"Model"}),R==="ollama"||R==="openrouter"?c.jsxs("select",{id:"telegram-model",value:_,onChange:G=>U(G.target.value),disabled:F,className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[c.jsx("option",{value:"",children:"Use provider default"}),M.map(G=>c.jsx("option",{value:G.id,children:G.name},G.id))]}):c.jsx(Xt,{id:"telegram-model",value:_,onChange:G=>U(G.target.value),placeholder:R?"e.g. gpt-4o-mini":"Set provider first",disabled:!R,className:"h-9 text-sm"})]})]}),R==="ollama"&&c.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:c.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support in Telegram, use a cloud provider."})})]}),h&&c.jsx("p",{className:"text-destructive text-sm",children:h}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(pe,{onClick:$,disabled:d,children:[c.jsx(kO,{className:"size-4"}),d?"Saving…":"Save"]}),e?.configured&&e.status!=="connected"&&c.jsx(pe,{variant:"outline",onClick:$,disabled:d,title:"Restart the bot with current settings",children:"Reconnect"})]})]})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Discord"}),c.jsx(kt,{children:"Let the agent post to your Discord servers. Create an app at the Discord Developer Portal, add a bot, invite it to your server with Send Messages, then paste the bot token below."})]}),c.jsxs(dt,{className:"space-y-4",children:[P&&c.jsx("div",{className:"space-y-1 text-sm",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"Status:"}),P.configured?c.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Configured"}):c.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"discord-token",className:"text-sm font-medium",children:"Bot token"}),c.jsx(Xt,{id:"discord-token",type:"password",placeholder:P?.configured?"(already set)":"Paste your bot token…",value:ee,onChange:G=>fe(G.target.value),autoComplete:"off",className:"font-mono text-sm"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from the Discord Developer Portal (Bot section). Leave blank to keep the current token."})]}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:[c.jsxs("a",{href:IP,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Discord Developer Portal",c.jsx(YS,{className:"size-3"})]})," ","→ create app, add bot, then OAuth2 → URL Generator (scope: bot, permissions: Send Messages) to invite the bot to your server."]}),h&&c.jsx("p",{className:"text-destructive text-sm",children:h}),c.jsx(pe,{onClick:X,disabled:ne,children:ne?"Saving…":"Save"})]})]})]})}const HP="https://dashboard.stripe.com/apikeys";function FP(){const[e,a]=S.useState(null),[r,l]=S.useState(""),[s,u]=S.useState(!1),[d,f]=S.useState(!0),[h,m]=S.useState(null),y=async()=>{f(!0),m(null);try{const v=await ow();a(v)}catch(v){m(v instanceof Error?v.message:String(v))}finally{f(!1)}};S.useEffect(()=>{y()},[]);const g=async()=>{u(!0),m(null);try{const v=await cw({secretKey:r.trim()||null});a(v),l("")}catch(v){m(v instanceof Error?v.message:String(v))}finally{u(!1)}};return d?c.jsx(ut,{children:c.jsx(dt,{className:"pt-6",children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading payment settings…"})})}):c.jsx("div",{className:"space-y-4",children:c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{className:"text-base",children:"Stripe"}),c.jsx(kt,{children:"Let the agent list customers and invoices, and create invoices. Paste your Stripe Secret Key (from Dashboard → API keys). Use test key (sk_test_…) for development."})]}),c.jsxs(dt,{className:"space-y-4",children:[e&&c.jsx("div",{className:"space-y-1 text-sm",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.configured?c.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Configured"}):c.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{htmlFor:"stripe-secret-key",className:"text-sm font-medium",children:"Secret key"}),c.jsx(Xt,{id:"stripe-secret-key",type:"password",placeholder:e?.configured?"(already set)":"sk_test_… or sk_live_…",value:r,onChange:v=>l(v.target.value),autoComplete:"off",className:"font-mono text-sm"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a key from Stripe Dashboard → Developers → API keys. Leave blank to keep the current key."})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:c.jsxs("a",{href:HP,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Stripe API keys",c.jsx(YS,{className:"size-3"})]})}),h&&c.jsx("p",{className:"text-destructive text-sm",children:h}),c.jsx(pe,{onClick:g,disabled:s,children:s?"Saving…":"Save"})]})]})})}function qP(){const[e,a]=S.useState(null),[r,l]=S.useState("session"),[s,u]=S.useState(""),[d,f]=S.useState([]),[h,m]=S.useState(!0),[y,g]=S.useState(!1),[v,b]=S.useState(null);S.useEffect(()=>{b(null),qw().then(j=>{a(j),j.session.length>0?(l("session"),u(j.session[0])):j.shared.length>0&&(l("shared"),u(j.shared[0]))}).catch(j=>b(j instanceof Error?j.message:String(j))).finally(()=>m(!1))},[]);const k=r==="session"?e?.session??[]:e?.shared??[];S.useEffect(()=>{if(!s||!k.includes(s)){f([]);return}g(!0),Gw({scope:r,scope_key:s,limit:200}).then(j=>f(j.entries??[])).catch(j=>b(j instanceof Error?j.message:String(j))).finally(()=>g(!1))},[r,s]);const C=()=>{const j=new Blob([JSON.stringify({scope:r,scope_key:s,exported_at:new Date().toISOString(),entries:d},null,2)],{type:"application/json"}),R=document.createElement("a");R.href=URL.createObjectURL(j),R.download=`sulala-memory-${r}-${s.replace(/[^a-z0-9-_]/gi,"_")}.json`,R.click(),URL.revokeObjectURL(R.href)},E=j=>new Date(j).toLocaleString();return h?c.jsx(ut,{children:c.jsx(dt,{className:"pt-6",children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading memory…"})})}):c.jsx("div",{className:"space-y-4",children:c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsxs(wt,{className:"flex items-center gap-2 text-base",children:[c.jsx(qS,{className:"size-4"}),"Agent memory"]}),c.jsx(kt,{children:"View stored memory (session-scoped or shared across sessions). Use the chat to add entries via the write_memory tool."})]}),c.jsxs(dt,{className:"space-y-4",children:[v&&c.jsx("p",{className:"text-destructive text-sm",role:"alert",children:v}),c.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"memory-scope",children:"Scope"}),c.jsxs("select",{id:"memory-scope",className:"flex h-9 w-[140px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:r,onChange:j=>{const R=j.target.value;l(R);const O=R==="session"?e?.session??[]:e?.shared??[];u(O[0]??"")},children:[c.jsx("option",{value:"session",children:"Session"}),c.jsx("option",{value:"shared",children:"Shared"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"memory-scope-key",children:r==="session"?"Session":"Shared key"}),c.jsx("select",{id:"memory-scope-key",className:"flex h-9 min-w-[200px] max-w-[320px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:s,onChange:j=>u(j.target.value),children:k.length===0?c.jsx("option",{value:"",children:"— No keys —"}):k.map(j=>c.jsx("option",{value:j,children:j.length>40?j.slice(0,37)+"…":j},j))})]}),d.length>0&&c.jsxs(pe,{variant:"outline",size:"sm",onClick:C,children:[c.jsx(gM,{className:"size-4 mr-1"}),"Export JSON"]})]}),y&&c.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading entries…"}),!y&&s&&k.includes(s)&&c.jsx("div",{className:"rounded-md border",children:d.length===0?c.jsxs("p",{className:"p-4 text-muted-foreground text-sm",children:["No memory entries for this ",r," key."]}):c.jsx("ul",{className:"divide-y divide-border max-h-[400px] overflow-y-auto",children:d.map(j=>c.jsxs("li",{className:"p-3 text-sm",children:[c.jsx("p",{className:"text-foreground",children:j.content}),c.jsx("p",{className:"mt-1 text-muted-foreground text-xs",children:E(j.created_at)})]},j.id))})})]})]})})}const gh="https://portal.sulala.ai/api/gateway";function GP({required:e=!1,portalGatewayUrl:a,onSaved:r,onError:l,portalOAuthConnectAvailable:s=!1,onOAuthConnect:u}){const[d,f]=S.useState({}),[h,m]=S.useState(a?.trim()||gh),[y,g]=S.useState(""),[v,b]=S.useState(!1),[k,C]=S.useState(!1),[E,j]=S.useState(!1);S.useEffect(()=>{m(a?.trim()||gh)},[a]),S.useEffect(()=>{b(!0),Da().then(({keys:L})=>{f(L??{})}).catch(()=>f({})).finally(()=>b(!1))},[]);const R=async()=>{const L=h.trim();if(!L){l?.("Enter Portal gateway URL");return}if(e&&!y.trim()){l?.("Enter Portal API key");return}C(!0);try{const F={PORTAL_GATEWAY_URL:L};y.trim()&&(F.PORTAL_API_KEY=y.trim()),await Jl(F);const{keys:Y}=await Da();f(Y??{}),y.trim()&&g(""),r?.()}catch(F){l?.(F instanceof Error?F.message:"Failed to save")}finally{C(!1)}},O=d.PORTAL_API_KEY==="set"?"(already set)":"sk_live_...",_=k||!h.trim()||e&&!y.trim(),U=s&&u,M=async()=>{j(!0),l?.("");try{await u?.()}catch(L){l?.(L.message)}finally{j(!1)}};return c.jsxs("div",{className:"border-border bg-muted/30 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[c.jsx("p",{className:"font-medium",children:e?"Portal API key required":"Portal settings"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:e?"Create an API key at your Portal and enter it below. Takes effect immediately.":"Connect GitHub, Gmail, and other apps via Portal. Saved keys take effect immediately."}),v?c.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading…"}):c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Wt,{htmlFor:"portal-gateway-url",className:"text-xs",children:"Portal gateway URL"}),c.jsx(Xt,{id:"portal-gateway-url",type:"url",placeholder:gh,value:h,onChange:L=>m(L.target.value),className:"h-8 font-mono text-xs"}),c.jsx("p",{className:"text-muted-foreground text-[10px]",children:"e.g. http://localhost:3004/api/gateway for local Portal, or https://portal.sulala.ai/api/gateway"})]}),U&&c.jsxs(c.Fragment,{children:[c.jsx(pe,{variant:"default",size:"sm",onClick:M,disabled:E,className:"w-fit",children:E?"Opening…":"Connect with Sulala (OAuth)"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Opens in a new tab. After signing in you’ll be redirected back; refresh this page if the key doesn’t appear."}),c.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"or"})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Wt,{htmlFor:"portal-api-key",className:"text-xs",children:"Portal API Key"}),c.jsx(Xt,{id:"portal-api-key",type:"password",placeholder:O,value:y,onChange:L=>g(L.target.value),autoComplete:"off",className:"h-8"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(pe,{variant:"secondary",size:"sm",onClick:R,disabled:_,children:k?"Saving…":"Save"}),c.jsx("a",{href:(()=>{const L=h.trim();if(!L)return"https://portal.sulala.ai/api/keys";try{const F=L.replace(/\/api\/gateway$/i,""),Y=/^https?:\/\//i.test(F)?F:`https://${F}`;return new URL("/api-keys",Y).toString()}catch{return"https://portal.sulala.ai/api/keys"}})(),target:"_blank",rel:"noreferrer",className:"text-primary hover:underline text-xs",children:"Create API key →"})]})]})]})}function $P({storeBaseUrl:e,onSaved:a,onError:r}){const[l,s]=S.useState({}),[u,d]=S.useState(""),[f,h]=S.useState(!1),[m,y]=S.useState(!1);S.useEffect(()=>{h(!0),Da().then(({keys:k})=>s(k??{})).catch(()=>s({})).finally(()=>h(!1))},[]);const g=async()=>{y(!0);try{const k={};u.trim()&&(k.STORE_PUBLISH_API_KEY=u.trim()),await Jl(k);const{keys:C}=await Da();s(C??{}),u.trim()&&d(""),a?.()}catch(k){r?.(k instanceof Error?k.message:"Failed to save")}finally{y(!1)}},v=l.STORE_PUBLISH_API_KEY==="set"?"(already set)":"sk_pub_...",b=e?`${e.replace(/\/$/,"")}/my-skills`:null;return c.jsxs("div",{className:"border-border bg-muted/30 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[c.jsx("p",{className:"font-medium",children:"Store publish API key"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Publish skills from the dashboard (Skills → My skills → Publish to store). Create a key on the store (My skills → Create publish API key), then paste it here."}),f?c.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading…"}):c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Wt,{htmlFor:"store-publish-api-key",className:"text-xs",children:"API key"}),c.jsx(Xt,{id:"store-publish-api-key",type:"password",placeholder:v,value:u,onChange:k=>d(k.target.value),autoComplete:"off",className:"h-8"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(pe,{variant:"secondary",size:"sm",onClick:g,disabled:m,children:m?"Saving…":"Save"}),b&&c.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline text-xs",children:"Create API key on store →"})]})]})]})}const YP=[{value:"overview",label:"Overview",icon:HM},{value:"tasks",label:"Tasks",icon:ZM},{value:"logs",label:"Logs",icon:km},{value:"files",label:"File states",icon:MM},{value:"ai-providers",label:"AI Providers",icon:$S},{value:"channels",label:"Channels",icon:Nh},{value:"payment",label:"Payment",icon:mM},{value:"memory",label:"Memory",icon:qS},{value:"portal",label:"Portal",icon:XM},{value:"config",label:"Watched folders",icon:XS}];function VP(e){return c.jsx("div",{className:"flex flex-1 flex-col min-h-0",children:c.jsx(Kw,{defaultValue:"overview",orientation:"vertical",className:"flex flex-1 flex-col min-h-0",children:c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsx(Xw,{variant:"line",className:"w-52 shrink-0 flex flex-col h-auto rounded-none p-2 gap-0.5",children:YP.map(({value:a,label:r,icon:l})=>c.jsxs(rs,{value:a,className:be("w-full justify-start gap-2 rounded-md px-3 py-2 h-auto font-normal","data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:font-medium"),children:[c.jsx(l,{className:"size-4 shrink-0"}),c.jsx("span",{className:"truncate",children:r})]},a))}),c.jsxs("div",{className:"flex-1 min-w-0 overflow-auto p-4",children:[c.jsx(xn,{value:"overview",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(j4,{health:e.health,loading:e.loading,connected:e.connected,events:e.events})}),c.jsx(xn,{value:"tasks",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(LP,{tasks:e.tasks,loading:e.loading,load:e.load,enqueueType:e.enqueueType,setEnqueueType:e.setEnqueueType,enqueuePayload:e.enqueuePayload,setEnqueuePayload:e.setEnqueuePayload,enqueueing:e.enqueueing,actionTaskId:e.actionTaskId,handleTaskCancel:e.handleTaskCancel,handleTaskRetry:e.handleTaskRetry,handleEnqueue:e.handleEnqueue})}),c.jsx(xn,{value:"logs",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(PP,{logs:e.logs,load:e.load})}),c.jsx(xn,{value:"files",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(UP,{fileStates:e.fileStates,load:e.load})}),c.jsx(xn,{value:"ai-providers",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(zP,{})}),c.jsx(xn,{value:"channels",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(BP,{})}),c.jsx(xn,{value:"payment",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(FP,{})}),c.jsx(xn,{value:"memory",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(qP,{})}),c.jsx(xn,{value:"portal",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(KP,{config:e.config,onError:e.onError})}),c.jsx(xn,{value:"config",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:c.jsx(OP,{config:e.config})})]})]})})})}function KP({config:e,onError:a}){const r=e?.portalGatewayUrl??null,l=e?.portalOAuthConnectAvailable===!0,s=async()=>{const{url:d}=await ou();window.open(d,"_blank","noopener,noreferrer")},u=Wl();return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsx(GP,{portalGatewayUrl:r,onError:a,portalOAuthConnectAvailable:l,onOAuthConnect:l?s:void 0}),c.jsx($P,{storeBaseUrl:u,onError:a})]})}const XP=100;function QP(e){const[a,r]=S.useState([]),[l,s]=S.useState(!1),u=S.useRef(null),d=S.useRef(e?.onSkillsChanged);return d.current=e?.onSkillsChanged,S.useEffect(()=>{const f=vw(),h=new WebSocket(f);return h.onopen=()=>s(!0),h.onclose=()=>s(!1),h.onmessage=m=>{try{const y=JSON.parse(m.data);r(g=>[y,...g].slice(0,XP)),y.type==="skills_changed"&&d.current&&d.current()}catch{}},h.onerror=()=>{},u.current=h,()=>{h.close(),u.current=null,s(!1)}},[]),{events:a,connected:l}}function ZP({className:e,checked:a,onCheckedChange:r,onChange:l,...s}){const u=a===!0;return c.jsx("input",{type:"checkbox",checked:u,onChange:d=>{l?.(d),r?.(d.target.checked)},"data-slot":"checkbox",className:be("border-input size-4 shrink-0 rounded border transition-colors","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2","accent-primary disabled:opacity-50",e),...s})}const JP="modulepreload",WP=function(e){return"/"+e},Gb={},eU=function(a,r,l){let s=Promise.resolve();if(r&&r.length>0){let m=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};var d=m;document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");s=m(r.map(y=>{if(y=WP(y),y in Gb)return;Gb[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${v}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":JP,g||(b.as="script"),b.crossOrigin="",b.href=y,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((k,C)=>{b.addEventListener("load",k),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${y}`)))})}))}function u(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return s.then(f=>{for(const h of f||[])h.status==="rejected"&&u(h.reason);return a().catch(u)})},tU=[{id:"openrouter",label:"OpenRouter",envKey:"OPENROUTER_API_KEY",recommended:!0},{id:"ollama",label:"Ollama (Local – No API Key Required)",envKey:null},{id:"openai",label:"OpenAI",envKey:"OPENAI_API_KEY"},{id:"anthropic",label:"Anthropic (Claude)",envKey:"ANTHROPIC_API_KEY"},{id:"google",label:"Google / Gemini",envKey:"GOOGLE_GEMINI_API_KEY"}],nU={openai:"OPENAI_API_KEY",anthropic:"ANTHROPIC_API_KEY",google:"GOOGLE_GEMINI_API_KEY",gemini:"GEMINI_API_KEY",openrouter:"OPENROUTER_API_KEY"};function aU(e){const[a,r]=S.useState({statusLoading:!0,statusComplete:null,step:0,selectedProviders:["openrouter"],envKeys:{},envKeysInput:{},recommendedModels:[],registrySkills:[],selectedSkills:[],ollamaRunning:null,ollamaStatusLoading:!1,pullState:{inProgress:!1,model:"",lastLine:"",percent:0},pullingModels:new Set,loading:!1,error:null,systemCapabilities:null}),l=S.useCallback(async()=>{r(_=>({..._,statusLoading:!0}));try{const{complete:_}=await jm();return r(U=>({...U,statusComplete:_,statusLoading:!1})),_}catch(_){return r(U=>({...U,statusComplete:!1,statusLoading:!1,error:_ instanceof Error?_.message:"Failed to load status"})),!1}},[]),s=S.useCallback(async()=>{try{const{keys:_}=await Da();return r(U=>({...U,envKeys:_})),_}catch{return{}}},[]),u=S.useCallback(async()=>{try{const{models:_}=await fw();return r(U=>({...U,recommendedModels:_})),_}catch{return[]}},[]),d=S.useCallback(async()=>{try{const{skills:_}=await Ec();return r(U=>({...U,registrySkills:_})),_}catch{return[]}},[]),f=S.useCallback(async()=>{r(_=>({..._,ollamaStatusLoading:!0}));try{const{running:_}=await Vl();return r(U=>({...U,ollamaRunning:_,ollamaStatusLoading:!1})),_}catch{return r(_=>({..._,ollamaRunning:!1,ollamaStatusLoading:!1})),!1}},[]),h=S.useCallback(async()=>{const{fetchOllamaPullStatus:_}=await eU(async()=>{const{fetchOllamaPullStatus:M}=await Promise.resolve().then(()=>v4);return{fetchOllamaPullStatus:M}},void 0),U=await _();return r(M=>({...M,pullState:U})),U},[]);S.useEffect(()=>{l()},[l]);const m=S.useCallback(async()=>{try{const _=await _w();return r(U=>({...U,systemCapabilities:_})),_}catch{return r(_=>({..._,systemCapabilities:null})),null}},[]);return S.useEffect(()=>{a.step===0&&m()},[a.step,m]),S.useEffect(()=>{(a.step===1||a.step===2)&&s()},[a.step,s]),S.useEffect(()=>{a.step===2&&a.selectedProviders.includes("ollama")&&(u(),f())},[a.step,a.selectedProviders,u,f]),S.useEffect(()=>{a.step===4&&d()},[a.step,d]),S.useEffect(()=>{if(!a.pullState.inProgress)return;const _=setInterval(h,500);return()=>clearInterval(_)},[a.pullState.inProgress,h]),{...a,loadStatus:l,loadSystemCapabilities:m,installOllama:async()=>{r(_=>({..._,error:null}));try{await Rw(),await f()}catch(_){r(U=>({...U,error:_ instanceof Error?_.message:"Failed to install Ollama"}))}},loadEnv:s,loadRecommendedModels:u,loadRegistrySkills:d,checkOllama:f,setStep:_=>r(U=>({...U,step:_})),setSelectedProviders:_=>r(U=>({...U,selectedProviders:_})),setEnvKeysInput:_=>r(U=>({...U,envKeysInput:_})),setSelectedSkills:_=>r(U=>({...U,selectedSkills:_})),setError:_=>r(U=>({...U,error:_})),saveEnv:async(_,U)=>{r(M=>({...M,loading:!0,error:null}));try{const M=a.envKeysInput,L={...U};for(const[Y,P]of Object.entries(M))typeof P=="string"&&P.trim()&&(L[Y]=P.trim());await Jl(L);const{keys:F}=await Da();r(Y=>({...Y,envKeys:F,envKeysInput:{},loading:!1,step:_??2}))}catch(M){r(L=>({...L,loading:!1,error:M instanceof Error?M.message:"Failed to save API keys"}))}},pullModel:async _=>{r(U=>({...U,pullingModels:new Set(U.pullingModels).add(_),error:null}));try{await hw(_),h()}catch(U){r(M=>({...M,pullingModels:(()=>{const L=new Set(M.pullingModels);return L.delete(_),L})(),error:U instanceof Error?U.message:"Failed to pull model"}))}},installSkill:async _=>{r(U=>({...U,loading:!0,error:null}));try{await Nc(_,"managed"),r(U=>({...U,selectedSkills:[...new Set([...U.selectedSkills,_])],loading:!1}))}catch(U){r(M=>({...M,loading:!1,error:U instanceof Error?U.message:"Failed to install skill"}))}},finishOnboarding:async()=>{r(_=>({..._,loading:!0,error:null}));try{await dw(),r(_=>({..._,statusComplete:!0,loading:!1})),e?.()}catch(_){r(U=>({...U,loading:!1,error:_ instanceof Error?_.message:"Failed to complete onboarding"}))}}}}function rU(e){if(!e)return null;const a=e.match(/~?(\d+(?:\.\d+)?)\s*(GB|MB|gb|mb)/);if(!a)return null;const r=parseFloat(a[1]),l=a[2].toUpperCase();return l==="GB"?Math.round(r*1024*1024*1024):l==="MB"?Math.round(r*1024*1024):null}const lj=S.createContext(null);function Xl(){const e=S.useContext(lj);if(!e)throw new Error("OnboardingFlow must wrap steps");return e}const lU=["Choose AI Provider","Provider Configuration","Integrations","Ollama Model Setup","Finish"],iU=["Choose AI Provider","Provider Configuration","Integrations","Finish"];function sU(){const{selectedProviders:e,setSelectedProviders:a,setStep:r,systemCapabilities:l}=Xl(),s=l&&!l.ollamaSuitable,u=f=>{if(f==="ollama"&&s)return;const h=e.includes(f)?e.filter(m=>m!==f):[...e,f];a(h)},d=e.length>=1;return c.jsxs("div",{className:"space-y-6",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"Select at least one AI provider to continue. Ollama runs locally and needs no API key."}),s&&l&&c.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:[c.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",l.ollamaSuitableReason]}),c.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Use a cloud provider (OpenAI, OpenRouter, etc.) instead."})]}),e.includes("ollama")&&c.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:c.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, add a cloud provider."})}),c.jsx("div",{className:"grid gap-3",children:tU.map(f=>c.jsxs("label",{className:`border-input flex items-center gap-3 rounded-lg border p-4 transition-colors ${f.id==="ollama"&&s?"cursor-not-allowed opacity-60":"hover:bg-muted/50 cursor-pointer"}`,children:[c.jsx(ZP,{checked:e.includes(f.id),onCheckedChange:()=>u(f.id),disabled:f.id==="ollama"&&!!s}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"font-medium",children:[f.label,"recommended"in f&&f.recommended&&c.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 ml-2 text-xs",children:"(Recommended)"}),f.id==="ollama"&&s&&c.jsx("span",{className:"text-amber-600 dark:text-amber-400 ml-2 text-xs",children:"(Not recommended)"})]}),f.envKey&&c.jsx("div",{className:"text-muted-foreground text-xs",children:"Requires API key"})]})]},f.id))}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("div",{}),c.jsxs(pe,{disabled:!d,onClick:()=>r(1),children:["Next",c.jsx(xr,{className:"ml-1 size-4"})]})]})]})}function oU(){const{selectedProviders:e,envKeys:a,envKeysInput:r,setEnvKeysInput:l,saveEnv:s,setStep:u,loading:d,error:f}=Xl(),h=e.filter(k=>k!=="ollama"),m={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key"},y=h.flatMap(k=>{const C=nU[k];return C?[C]:[]}),v=!y.some(k=>a[k]!=="set")||y.length===0,b=y.some(k=>(r[k]??"").trim().length>0);return c.jsxs("div",{className:"space-y-6",children:[h.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:"No cloud providers selected. Skipping API keys."}):c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-muted-foreground text-sm",children:["Enter API keys for selected providers. Keys are saved securely to ",c.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),"."]}),c.jsx("div",{className:"grid gap-4",children:y.map(k=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:k,children:m[k]??k}),c.jsx(Xt,{id:k,type:"password",placeholder:a[k]==="set"?"(already set)":"sk-...",value:r[k]??"",onChange:C=>l({...r,[k]:C.target.value}),autoComplete:"off"})]},k))})]}),f&&c.jsx("div",{className:"text-destructive text-sm",children:f}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(pe,{variant:"outline",onClick:()=>u(0),children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[(v||b)&&c.jsx(pe,{variant:"outline",onClick:()=>u(2),children:h.length===0?"Next":"Skip for now"}),b&&c.jsx(pe,{onClick:()=>s(2),disabled:d,children:d?"Saving…":"Save & Next"}),v&&!b&&h.length>0&&c.jsx(pe,{onClick:()=>u(2),children:"Next"})]})]})]})}const oc="https://portal.sulala.ai/api/gateway";function cU(){const{envKeys:e,envKeysInput:a,setEnvKeysInput:r,saveEnv:l,setStep:s,setError:u,loading:d,error:f,selectedProviders:h}=Xl(),m=(a.PORTAL_API_KEY??"").trim().length>0,y=e.PORTAL_API_KEY==="set"||m,v=h.includes("ollama")?4:3,[b,k]=S.useState(!1),[C,E]=S.useState(!1),[j,R]=S.useState(oc),{loadEnv:O}=Xl();S.useEffect(()=>{vr().then(L=>{const F=(L.portalGatewayUrl??"").trim()||oc;R(F)}).catch(()=>{})},[]);const _=()=>{l(v,{PORTAL_GATEWAY_URL:j})},U=async()=>{u(null),k(!0);try{await Jl({PORTAL_GATEWAY_URL:j});const{url:L}=await ou("onboarding_step_3");window.open(L,"_blank","noopener,noreferrer"),E(!0)}catch(L){u(L.message)}finally{k(!1)}},M=async()=>{u(null),await O()};return c.jsxs("div",{className:"space-y-6",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect with Sulala to use GitHub, Gmail, and other apps. Use OAuth (no API key) or enter an API key below."}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"portal-gateway-url-onboard",children:"Portal gateway URL"}),c.jsx(Xt,{id:"portal-gateway-url-onboard",type:"url",placeholder:oc,value:j,onChange:L=>R(L.target.value.trim()||oc),className:"font-mono text-xs"}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["Use ",c.jsx("code",{className:"rounded bg-muted px-1",children:"http://localhost:3004/api/gateway"})," for local Portal, or leave default for portal.sulala.ai"]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(Wt,{children:"Connect with Sulala"}),c.jsx(pe,{variant:"outline",onClick:U,disabled:b,children:b?"Opening…":"Connect with Sulala (OAuth)"})]}),c.jsx("div",{className:"text-muted-foreground text-xs",children:"Or use an API key:"}),c.jsx("a",{href:j?`${j.replace(/\/api\/gateway$/i,"").replace(/\/$/,"")}/api-keys`:"https://portal.sulala.ai/api-keys",target:"_blank",rel:"noreferrer",className:"text-primary hover:underline inline-block text-xs",children:"Create API key →"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Wt,{htmlFor:"portal-api-key",children:"Portal API Key"}),c.jsx(Xt,{id:"portal-api-key",type:"password",placeholder:e.PORTAL_API_KEY==="set"?"(already set)":"sk_live_...",value:a.PORTAL_API_KEY??"",onChange:L=>r({...a,PORTAL_API_KEY:L.target.value}),autoComplete:"off"})]})]}),f&&c.jsx("div",{className:"text-destructive text-sm",children:f}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx(pe,{variant:"outline",onClick:()=>s(1),children:"Back"}),C&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Sign-in opened in your browser. Close that tab and return here when done."}),c.jsx(pe,{variant:"secondary",size:"sm",onClick:M,children:"I've signed in — continue"})]})]}),c.jsxs("div",{className:"flex gap-2",children:[y&&!m&&c.jsx(pe,{onClick:()=>s(v),children:"Next"}),y&&m&&c.jsx(pe,{onClick:_,disabled:d,children:d?"Saving…":"Save & Next"})]})]})]})}function uU({m:e,installed:a,pulling:r,onPull:l}){return c.jsxs("div",{className:"border-input flex flex-col gap-2 rounded-lg border p-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:e.name}),c.jsx("div",{className:"text-muted-foreground text-sm",children:e.description}),c.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(VS,{className:"size-3"})," ",e.size]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(HO,{className:"size-3"})," ",e.ram," RAM"]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx($S,{className:"size-3"})," ",e.cpu]}),e.gpu!=="None"&&c.jsxs("span",{children:["GPU: ",e.gpu]})]})]}),c.jsx(pe,{variant:a?"secondary":"default",size:"sm",onClick:l,disabled:a||r,children:a?"Installed":r?"Installing…":"Install"})]})}function dU(){const{recommendedModels:e,ollamaRunning:a,ollamaStatusLoading:r,pullState:l,pullingModels:s,pullModel:u,installOllama:d,setStep:f,checkOllama:h,systemCapabilities:m,error:y}=Xl(),g=()=>{window.confirm("Ollama will be downloaded and installed (~500MB). This requires network access and sufficient disk space. Continue?")&&d()},v=C=>{const E=m?.storageFreeBytes??0,j=rU(C.size);if(j!=null&&E>0&&j>E){alert(`Insufficient storage. This model needs ~${C.size}. You have ${(E/1024/1024/1024).toFixed(1)}GB free.`);return}window.confirm(`Download and install ${C.name}? This will use ~${C.size} of disk space. Continue?`)&&u(C.id)},b=new Set;l.inProgress&&l.model&&b.add(l.model);const k=m&&!m.ollamaSuitable;return c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:c.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, use a cloud provider."})}),k&&c.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:c.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",m.ollamaSuitableReason," Ollama may not run well here."]})}),r?c.jsx("p",{className:"text-muted-foreground text-sm",children:"Checking Ollama…"}):a===!1?c.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-4",children:[c.jsxs("p",{className:"text-amber-700 dark:text-amber-400 text-sm",children:["⚠️ Ollama is not running. Click Install to download Ollama, or install from"," ",c.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," ","and run ",c.jsx("code",{children:"ollama serve"}),"."]}),c.jsxs("div",{className:"mt-2 flex gap-2",children:[c.jsx(pe,{variant:"default",size:"sm",onClick:g,disabled:r,children:"Install Ollama"}),c.jsx(pe,{variant:"outline",size:"sm",onClick:h,disabled:r,children:"Check again"})]})]}):null,l.inProgress&&c.jsxs("div",{className:"rounded-lg border border-blue-500/50 bg-blue-500/10 p-4",children:[c.jsxs("div",{className:"font-medium",children:["Pulling ",l.model,"…"]}),l.percent>=0&&l.percent<=100&&c.jsx(_m,{value:l.percent,className:"mt-2 h-2"}),l.lastLine&&c.jsx("div",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:l.lastLine})]}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Select models to install. You can skip and install later from Settings."}),c.jsx("div",{className:"grid gap-3",children:e.map(C=>c.jsx(uU,{m:C,installed:!1,pulling:s.has(C.id),onPull:()=>v(C)},C.id))}),y&&c.jsx("div",{className:"text-destructive text-sm",children:y}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(pe,{variant:"outline",onClick:()=>f(2),children:"Back"}),c.jsx(pe,{onClick:()=>f(4),children:"Skip or Next"})]})]})}function $b(){const{selectedProviders:e,finishOnboarding:a,loading:r,error:l,setStep:s}=Xl(),u=e.includes("ollama");return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold",children:"Summary"}),c.jsx("ul",{className:"text-muted-foreground mt-2 space-y-1 text-sm",children:c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(GS,{className:"size-4 text-green-600"}),"AI providers: ",e.join(", ")||"None"]})})]}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Click Finish to complete onboarding and open the dashboard. You can change providers anytime in Settings."}),l&&c.jsx("div",{className:"text-destructive text-sm",children:l}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(pe,{variant:"outline",onClick:()=>s(u?3:2),children:"Back"}),c.jsx(pe,{onClick:a,disabled:r,children:r?"Finishing…":"Finish"})]})]})}const fU="onboarding_step_3";function hU({onComplete:e}){const a=aU(e),{step:r,selectedProviders:l,setStep:s,loadEnv:u,setError:d}=a,f=l.includes("ollama"),h=f?5:4,m=f?lU:iU,y=Math.max(0,Math.min(r,h-1));S.useEffect(()=>{const v=new URLSearchParams(window.location.search),b=v.get("return_to"),k=v.get("oauth"),C=v.get("message");if(b!==fU||!k)return;s(2),u(),k==="error"&&C&&d(C==="exchange_failed"?"Token exchange failed. Check PORTAL_OAUTH_CLIENT_SECRET and redirect_uri.":C==="no_token"?"No access token in response.":C);const E=new URL(window.location.href);E.searchParams.delete("oauth"),E.searchParams.delete("return_to"),E.searchParams.delete("message"),window.history.replaceState({},"",E.toString())},[s,u,d]);const g={0:"Choose which AI providers you want to use.",1:"Enter API keys for cloud providers.",2:"Create an API key at portal.sulala.ai. Required to connect GitHub, Gmail, and other apps.",...f?{3:"Install local models with Ollama.",4:"Review and complete setup."}:{3:"Review and complete setup."}};return c.jsx(lj.Provider,{value:a,children:c.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-2xl space-y-8",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Welcome to Sulala"}),c.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Step ",y+1," of ",h,": ",m[y]]}),c.jsx(_m,{value:(y+1)/h*100,className:"mt-4 h-2"})]}),c.jsxs(ut,{children:[c.jsxs(St,{children:[c.jsx(wt,{children:m[y]}),c.jsx(kt,{children:g[y]})]}),c.jsxs(dt,{children:[y===0&&c.jsx(sU,{}),y===1&&c.jsx(oU,{}),y===2&&c.jsx(cU,{}),y===3&&(f?c.jsx(dU,{}):c.jsx($b,{})),y===4&&f&&c.jsx($b,{})]})]})]})})})}function mU(){const[e,a]=S.useState(null),[r,l]=S.useState(()=>{if(typeof window>"u")return"chat";const j=new URLSearchParams(window.location.search).get("page");return["chat","skills","integrations","jobs","settings","overview","tasks","logs","files","config"].includes(j)?j:"chat"}),[s,u]=S.useState(null);S.useEffect(()=>{console.log("fetching onboarding status"),jm().then(({complete:j})=>{console.log("onboarding status",j),a(j)}).catch(j=>{console.error("error fetching onboarding status",j);const R=j.message||String(j);a(!!(R.includes("429")||R.includes("fetch")))})},[]);const[d,f]=S.useState(null),h=b4(j=>u(j)),m=C4(j=>u(j)),y=V4(r,j=>u(j),{onMissingIntegrations:j=>f(j)}),g=NP(r,j=>u(j)),v=DP(r);S.useEffect(()=>{(r==="settings"||r==="jobs")&&h.load()},[r]);const b=S.useRef(()=>{});b.current=m.loadSkills;const{events:k,connected:C}=QP({onSkillsChanged:()=>b.current?.()});if(S.useEffect(()=>{r==="skills"&&m.loadSkillsData()},[r]),e===null)return c.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading…"})});if(!e)return c.jsx(pU,{onComplete:()=>a(!0)});const E=j=>{if(l(j),typeof window<"u"){const R=new URL(window.location.href);R.searchParams.set("page",j),window.history.replaceState({},"",R.toString())}};return c.jsxs(x4,{activePage:r,onNavigate:E,error:s,children:[r==="chat"&&c.jsx(EP,{...y,integrations:g.integrations,onNavigateToIntegrations:()=>E("integrations"),missingIntegrationsFromServer:d,onClearMissingIntegrationsFromServer:()=>f(null)}),r==="skills"&&c.jsx(U4,{...m}),r==="integrations"&&c.jsx(AP,{...g,onError:j=>u(j)}),r==="jobs"&&c.jsx(MP,{schedules:h.schedules,loading:h.loading,load:h.load,onCreateSchedule:h.handleCreateSchedule,onUpdateSchedule:h.handleUpdateSchedule,onDeleteSchedule:h.handleDeleteSchedule,onRunSchedule:h.handleRunSchedule,onFetchScheduleRuns:h.handleFetchScheduleRuns}),r==="settings"&&c.jsx(VP,{health:h.health,loading:h.loading,connected:C,events:k,tasks:h.tasks,load:h.load,enqueueType:h.enqueueType,setEnqueueType:h.setEnqueueType,enqueuePayload:h.enqueuePayload,setEnqueuePayload:h.setEnqueuePayload,enqueueing:h.enqueueing,actionTaskId:h.actionTaskId,handleTaskCancel:h.handleTaskCancel,handleTaskRetry:h.handleTaskRetry,handleEnqueue:h.handleEnqueue,logs:h.logs,fileStates:h.fileStates,config:v,onError:j=>u(j)})]})}function pU({onComplete:e}){return c.jsx(hU,{onComplete:e})}T2.createRoot(document.getElementById("root")).render(c.jsx(S.StrictMode,{children:c.jsx(mU,{})}));