@knpkv/codecommit-web 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/client/assets/index-BONVALG8.js +411 -0
  2. package/dist/client/assets/index-CKmThzme.css +1 -0
  3. package/dist/client/index.html +2 -2
  4. package/dist/server/Api.d.ts +122 -2
  5. package/dist/server/Api.d.ts.map +1 -1
  6. package/dist/server/Api.js +72 -4
  7. package/dist/server/Api.js.map +1 -1
  8. package/dist/server/Server.d.ts.map +1 -1
  9. package/dist/server/Server.js +28 -6
  10. package/dist/server/Server.js.map +1 -1
  11. package/dist/server/handlers/config-live.d.ts.map +1 -1
  12. package/dist/server/handlers/config-live.js +14 -4
  13. package/dist/server/handlers/config-live.js.map +1 -1
  14. package/dist/server/handlers/events-live.d.ts +1 -1
  15. package/dist/server/handlers/events-live.d.ts.map +1 -1
  16. package/dist/server/handlers/events-live.js +19 -10
  17. package/dist/server/handlers/events-live.js.map +1 -1
  18. package/dist/server/handlers/index.d.ts +1 -0
  19. package/dist/server/handlers/index.d.ts.map +1 -1
  20. package/dist/server/handlers/index.js +1 -0
  21. package/dist/server/handlers/index.js.map +1 -1
  22. package/dist/server/handlers/prs-live.d.ts.map +1 -1
  23. package/dist/server/handlers/prs-live.js +10 -1
  24. package/dist/server/handlers/prs-live.js.map +1 -1
  25. package/dist/server/handlers/sandbox-live.d.ts +6 -0
  26. package/dist/server/handlers/sandbox-live.d.ts.map +1 -0
  27. package/dist/server/handlers/sandbox-live.js +32 -0
  28. package/dist/server/handlers/sandbox-live.js.map +1 -0
  29. package/package.json +2 -2
  30. package/dist/client/assets/index-BYI4sUt8.js +0 -370
  31. package/dist/client/assets/index-YklnGGqZ.css +0 -1
@@ -0,0 +1,411 @@
1
+ var TY=Object.defineProperty;var sO=e=>{throw TypeError(e)};var RY=(e,t,n)=>t in e?TY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var S=(e,t,n)=>RY(e,typeof t!="symbol"?t+"":t,n),oO=(e,t,n)=>t.has(e)||sO("Cannot "+n);var Ry=(e,t,n)=>(oO(e,t,"read from private field"),n?n.call(e):t.get(e)),Nw=(e,t,n)=>t.has(e)?sO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ay=(e,t,n,r)=>(oO(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function AY(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var mv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mP={exports:{}},d0={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var NY=Symbol.for("react.transitional.element"),OY=Symbol.for("react.fragment");function pP(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:NY,type:e,key:r,ref:t!==void 0?t:null,props:n}}d0.Fragment=OY;d0.jsx=pP;d0.jsxs=pP;mP.exports=d0;var m=mP.exports,gP={exports:{}},Ke={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var iT=Symbol.for("react.transitional.element"),MY=Symbol.for("react.portal"),jY=Symbol.for("react.fragment"),DY=Symbol.for("react.strict_mode"),IY=Symbol.for("react.profiler"),zY=Symbol.for("react.consumer"),$Y=Symbol.for("react.context"),LY=Symbol.for("react.forward_ref"),PY=Symbol.for("react.suspense"),FY=Symbol.for("react.memo"),yP=Symbol.for("react.lazy"),UY=Symbol.for("react.activity"),lO=Symbol.iterator;function BY(e){return e===null||typeof e!="object"?null:(e=lO&&e[lO]||e["@@iterator"],typeof e=="function"?e:null)}var bP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vP=Object.assign,xP={};function Zd(e,t,n){this.props=e,this.context=t,this.refs=xP,this.updater=n||bP}Zd.prototype.isReactComponent={};Zd.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Zd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SP(){}SP.prototype=Zd.prototype;function aT(e,t,n){this.props=e,this.context=t,this.refs=xP,this.updater=n||bP}var sT=aT.prototype=new SP;sT.constructor=aT;vP(sT,Zd.prototype);sT.isPureReactComponent=!0;var cO=Array.isArray;function U_(){}var Kt={H:null,A:null,T:null,S:null},wP=Object.prototype.hasOwnProperty;function oT(e,t,n){var r=n.ref;return{$$typeof:iT,type:e,key:t,ref:r!==void 0?r:null,props:n}}function HY(e,t){return oT(e.type,t,e.props)}function lT(e){return typeof e=="object"&&e!==null&&e.$$typeof===iT}function qY(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var uO=/\/+/g;function Ow(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qY(""+e.key):t.toString(36)}function VY(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(U_,U_):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function df(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case iT:case MY:s=!0;break;case yP:return s=e._init,df(s(e._payload),t,n,r,i)}}if(s)return i=i(e),s=r===""?"."+Ow(e,0):r,cO(i)?(n="",s!=null&&(n=s.replace(uO,"$&/")+"/"),df(i,t,n,"",function(c){return c})):i!=null&&(lT(i)&&(i=HY(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(uO,"$&/")+"/")+s)),t.push(i)),1;s=0;var o=r===""?".":r+":";if(cO(e))for(var l=0;l<e.length;l++)r=e[l],a=o+Ow(r,l),s+=df(r,t,n,a,i);else if(l=BY(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,a=o+Ow(r,l++),s+=df(r,t,n,a,i);else if(a==="object"){if(typeof e.then=="function")return df(VY(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function Ny(e,t,n){if(e==null)return e;var r=[],i=0;return df(e,r,"","",function(a){return t.call(n,a,i++)}),r}function KY(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var fO=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},GY={map:Ny,forEach:function(e,t,n){Ny(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ny(e,function(){t++}),t},toArray:function(e){return Ny(e,function(t){return t})||[]},only:function(e){if(!lT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Activity=UY;Ke.Children=GY;Ke.Component=Zd;Ke.Fragment=jY;Ke.Profiler=IY;Ke.PureComponent=aT;Ke.StrictMode=DY;Ke.Suspense=PY;Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kt;Ke.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Kt.H.useMemoCache(e)}};Ke.cache=function(e){return function(){return e.apply(null,arguments)}};Ke.cacheSignal=function(){return null};Ke.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=vP({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=""+t.key),t)!wP.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),o=0;o<a;o++)s[o]=arguments[o+2];r.children=s}return oT(e.type,i,r)};Ke.createContext=function(e){return e={$$typeof:$Y,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:zY,_context:e},e};Ke.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=""+t.key),t)wP.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];i.children=o}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return oT(e,a,i)};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:LY,render:e}};Ke.isValidElement=lT;Ke.lazy=function(e){return{$$typeof:yP,_payload:{_status:-1,_result:e},_init:KY}};Ke.memo=function(e,t){return{$$typeof:FY,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Kt.T,n={};Kt.T=n;try{var r=e(),i=Kt.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(U_,fO)}catch(a){fO(a)}finally{t!==null&&n.types!==null&&(t.types=n.types),Kt.T=t}};Ke.unstable_useCacheRefresh=function(){return Kt.H.useCacheRefresh()};Ke.use=function(e){return Kt.H.use(e)};Ke.useActionState=function(e,t,n){return Kt.H.useActionState(e,t,n)};Ke.useCallback=function(e,t){return Kt.H.useCallback(e,t)};Ke.useContext=function(e){return Kt.H.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e,t){return Kt.H.useDeferredValue(e,t)};Ke.useEffect=function(e,t){return Kt.H.useEffect(e,t)};Ke.useEffectEvent=function(e){return Kt.H.useEffectEvent(e)};Ke.useId=function(){return Kt.H.useId()};Ke.useImperativeHandle=function(e,t,n){return Kt.H.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return Kt.H.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return Kt.H.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return Kt.H.useMemo(e,t)};Ke.useOptimistic=function(e,t){return Kt.H.useOptimistic(e,t)};Ke.useReducer=function(e,t,n){return Kt.H.useReducer(e,t,n)};Ke.useRef=function(e){return Kt.H.useRef(e)};Ke.useState=function(e){return Kt.H.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return Kt.H.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return Kt.H.useTransition()};Ke.version="19.2.4";gP.exports=Ke;var y=gP.exports;const ee=gg(y),h0=AY({__proto__:null,default:ee},[y]);var _P={exports:{}},m0={},EP={exports:{}},kP={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(I,F){var z=I.length;I.push(F);e:for(;0<z;){var V=z-1>>>1,N=I[V];if(0<i(N,F))I[V]=F,I[z]=N,z=V;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var F=I[0],z=I.pop();if(z!==F){I[0]=z;e:for(var V=0,N=I.length,ue=N>>>1;V<ue;){var q=2*(V+1)-1,T=I[q],K=q+1,G=I[K];if(0>i(T,z))K<N&&0>i(G,T)?(I[V]=G,I[K]=z,V=K):(I[V]=T,I[q]=z,V=q);else if(K<N&&0>i(G,z))I[V]=G,I[K]=z,V=K;else break e}}return F}function i(I,F){var z=I.sortIndex-F.sortIndex;return z!==0?z:I.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],c=[],f=1,u=null,d=3,h=!1,p=!1,b=!1,x=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function E(I){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=I)r(c),F.sortIndex=F.expirationTime,t(l,F);else break;F=n(c)}}function C(I){if(b=!1,E(I),!p)if(n(l)!==null)p=!0,k||(k=!0,B());else{var F=n(c);F!==null&&U(C,F.startTime-I)}}var k=!1,_=-1,A=5,D=-1;function O(){return x?!0:!(e.unstable_now()-D<A)}function L(){if(x=!1,k){var I=e.unstable_now();D=I;var F=!0;try{e:{p=!1,b&&(b=!1,v(_),_=-1),h=!0;var z=d;try{t:{for(E(I),u=n(l);u!==null&&!(u.expirationTime>I&&O());){var V=u.callback;if(typeof V=="function"){u.callback=null,d=u.priorityLevel;var N=V(u.expirationTime<=I);if(I=e.unstable_now(),typeof N=="function"){u.callback=N,E(I),F=!0;break t}u===n(l)&&r(l),E(I)}else r(l);u=n(l)}if(u!==null)F=!0;else{var ue=n(c);ue!==null&&U(C,ue.startTime-I),F=!1}}break e}finally{u=null,d=z,h=!1}F=void 0}}finally{F?B():k=!1}}}var B;if(typeof w=="function")B=function(){w(L)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,W=X.port2;X.port1.onmessage=L,B=function(){W.postMessage(null)}}else B=function(){g(L,0)};function U(I,F){_=g(function(){I(e.unstable_now())},F)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(I){switch(d){case 1:case 2:case 3:var F=3;break;default:F=d}var z=d;d=F;try{return I()}finally{d=z}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(I,F){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var z=d;d=I;try{return F()}finally{d=z}},e.unstable_scheduleCallback=function(I,F,z){var V=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?V+z:V):z=V,I){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=z+N,I={id:f++,callback:F,priorityLevel:I,startTime:z,expirationTime:N,sortIndex:-1},z>V?(I.sortIndex=z,t(c,I),n(l)===null&&I===n(c)&&(b?(v(_),_=-1):b=!0,U(C,z-V))):(I.sortIndex=N,t(l,I),p||h||(p=!0,k||(k=!0,B()))),I},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(I){var F=d;return function(){var z=d;d=F;try{return I.apply(this,arguments)}finally{d=z}}}})(kP);EP.exports=kP;var B_=EP.exports,CP={exports:{}},Kr={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var YY=y;function TP(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Lo(){}var Fr={d:{f:Lo,r:function(){throw Error(TP(522))},D:Lo,C:Lo,L:Lo,m:Lo,X:Lo,S:Lo,M:Lo},p:0,findDOMNode:null},WY=Symbol.for("react.portal");function JY(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:WY,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var zm=YY.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p0(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Fr;Kr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(TP(299));return JY(e,t,null,n)};Kr.flushSync=function(e){var t=zm.T,n=Fr.p;try{if(zm.T=null,Fr.p=2,e)return e()}finally{zm.T=t,Fr.p=n,Fr.d.f()}};Kr.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Fr.d.C(e,t))};Kr.prefetchDNS=function(e){typeof e=="string"&&Fr.d.D(e)};Kr.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=p0(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Fr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:a}):n==="script"&&Fr.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Kr.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=p0(t.as,t.crossOrigin);Fr.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Fr.d.M(e)};Kr.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=p0(n,t.crossOrigin);Fr.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Kr.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=p0(t.as,t.crossOrigin);Fr.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Fr.d.m(e)};Kr.requestFormReset=function(e){Fr.d.r(e)};Kr.unstable_batchedUpdates=function(e,t){return e(t)};Kr.useFormState=function(e,t,n){return zm.H.useFormState(e,t,n)};Kr.useFormStatus=function(){return zm.H.useHostTransitionStatus()};Kr.version="19.2.4";function RP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RP)}catch(e){console.error(e)}}RP(),CP.exports=Kr;var eh=CP.exports;const AP=gg(eh);/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Pn=B_,NP=y,XY=eh;function J(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function OP(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yg(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function MP(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jP(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function dO(e){if(yg(e)!==e)throw Error(J(188))}function QY(e){var t=e.alternate;if(!t){if(t=yg(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return dO(i),e;if(a===r)return dO(i),t;a=a.sibling}throw Error(J(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function DP(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=DP(e),t!==null)return t;e=e.sibling}return null}var Wt=Object.assign,ZY=Symbol.for("react.element"),Oy=Symbol.for("react.transitional.element"),gm=Symbol.for("react.portal"),Cf=Symbol.for("react.fragment"),IP=Symbol.for("react.strict_mode"),H_=Symbol.for("react.profiler"),zP=Symbol.for("react.consumer"),eo=Symbol.for("react.context"),cT=Symbol.for("react.forward_ref"),q_=Symbol.for("react.suspense"),V_=Symbol.for("react.suspense_list"),uT=Symbol.for("react.memo"),Vo=Symbol.for("react.lazy"),K_=Symbol.for("react.activity"),eW=Symbol.for("react.memo_cache_sentinel"),hO=Symbol.iterator;function Vh(e){return e===null||typeof e!="object"?null:(e=hO&&e[hO]||e["@@iterator"],typeof e=="function"?e:null)}var tW=Symbol.for("react.client.reference");function G_(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===tW?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cf:return"Fragment";case H_:return"Profiler";case IP:return"StrictMode";case q_:return"Suspense";case V_:return"SuspenseList";case K_:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case gm:return"Portal";case eo:return e.displayName||"Context";case zP:return(e._context.displayName||"Context")+".Consumer";case cT:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uT:return t=e.displayName||null,t!==null?t:G_(e.type)||"Memo";case Vo:t=e._payload,e=e._init;try{return G_(e(t))}catch{}}return null}var ym=Array.isArray,Pe=NP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gt=XY.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Lc={pending:!1,data:null,method:null,action:null},Y_=[],Tf=-1;function ws(e){return{current:e}}function Jn(e){0>Tf||(e.current=Y_[Tf],Y_[Tf]=null,Tf--)}function Ft(e,t){Tf++,Y_[Tf]=e.current,e.current=t}var cs=ws(null),bp=ws(null),ul=ws(null),pv=ws(null);function gv(e,t){switch(Ft(ul,t),Ft(bp,e),Ft(cs,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vM(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vM(t),e=n4(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Jn(cs),Ft(cs,e)}function pd(){Jn(cs),Jn(bp),Jn(ul)}function W_(e){e.memoizedState!==null&&Ft(pv,e);var t=cs.current,n=n4(t,e.type);t!==n&&(Ft(bp,e),Ft(cs,n))}function yv(e){bp.current===e&&(Jn(cs),Jn(bp)),pv.current===e&&(Jn(pv),Ap._currentValue=Lc)}var Mw,mO;function wc(e){if(Mw===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Mw=t&&t[1]||"",mO=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Mw+e+mO}var jw=!1;function Dw(e,t){if(!e||jw)return"";jw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(h){var d=h}Reflect.construct(e,[],u)}else{try{u.call()}catch(h){d=h}e.call(u.prototype)}}else{try{throw Error()}catch(h){d=h}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split(`
44
+ `),c=o.split(`
45
+ `);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==c[i]){var f=`
46
+ `+l[r].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=r&&0<=i);break}}}finally{jw=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?wc(n):""}function nW(e,t){switch(e.tag){case 26:case 27:case 5:return wc(e.type);case 16:return wc("Lazy");case 13:return e.child!==t&&t!==null?wc("Suspense Fallback"):wc("Suspense");case 19:return wc("SuspenseList");case 0:case 15:return Dw(e.type,!1);case 11:return Dw(e.type.render,!1);case 1:return Dw(e.type,!0);case 31:return wc("Activity");default:return""}}function pO(e){try{var t="",n=null;do t+=nW(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var J_=Object.prototype.hasOwnProperty,fT=Pn.unstable_scheduleCallback,Iw=Pn.unstable_cancelCallback,rW=Pn.unstable_shouldYield,iW=Pn.unstable_requestPaint,_i=Pn.unstable_now,aW=Pn.unstable_getCurrentPriorityLevel,$P=Pn.unstable_ImmediatePriority,LP=Pn.unstable_UserBlockingPriority,bv=Pn.unstable_NormalPriority,sW=Pn.unstable_LowPriority,PP=Pn.unstable_IdlePriority,oW=Pn.log,lW=Pn.unstable_setDisableYieldValue,bg=null,Ei=null;function tl(e){if(typeof oW=="function"&&lW(e),Ei&&typeof Ei.setStrictMode=="function")try{Ei.setStrictMode(bg,e)}catch{}}var ki=Math.clz32?Math.clz32:fW,cW=Math.log,uW=Math.LN2;function fW(e){return e>>>=0,e===0?32:31-(cW(e)/uW|0)|0}var My=256,jy=262144,Dy=4194304;function _c(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function g0(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=r&134217727;return o!==0?(r=o&~a,r!==0?i=_c(r):(s&=o,s!==0?i=_c(s):n||(n=o&~e,n!==0&&(i=_c(n))))):(o=r&~a,o!==0?i=_c(o):s!==0?i=_c(s):n||(n=r&~e,n!==0&&(i=_c(n)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function vg(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dW(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 FP(){var e=Dy;return Dy<<=1,!(Dy&62914560)&&(Dy=4194304),e}function zw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xg(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hW(e,t,n,r,i,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var f=31-ki(n),u=1<<f;o[f]=0,l[f]=-1;var d=c[f];if(d!==null)for(c[f]=null,f=0;f<d.length;f++){var h=d[f];h!==null&&(h.lane&=-536870913)}n&=~u}r!==0&&UP(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(s&~t))}function UP(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ki(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function BP(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ki(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function HP(e,t){var n=t&-t;return n=n&42?1:dT(n),n&(e.suspendedLanes|t)?0:n}function dT(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function hT(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function qP(){var e=gt.p;return e!==0?e:(e=window.event,e===void 0?32:h4(e.type))}function gO(e,t){var n=gt.p;try{return gt.p=e,t()}finally{gt.p=n}}var Jl=Math.random().toString(36).slice(2),ur="__reactFiber$"+Jl,si="__reactProps$"+Jl,th="__reactContainer$"+Jl,X_="__reactEvents$"+Jl,mW="__reactListeners$"+Jl,pW="__reactHandles$"+Jl,yO="__reactResources$"+Jl,Sg="__reactMarker$"+Jl;function mT(e){delete e[ur],delete e[si],delete e[X_],delete e[mW],delete e[pW]}function Rf(e){var t=e[ur];if(t)return t;for(var n=e.parentNode;n;){if(t=n[th]||n[ur]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=EM(e);e!==null;){if(n=e[ur])return n;e=EM(e)}return t}e=n,n=e.parentNode}return null}function nh(e){if(e=e[ur]||e[th]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bm(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(J(33))}function Kf(e){var t=e[yO];return t||(t=e[yO]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Wn(e){e[Sg]=!0}var VP=new Set,KP={};function ku(e,t){gd(e,t),gd(e+"Capture",t)}function gd(e,t){for(KP[e]=t,e=0;e<t.length;e++)VP.add(t[e])}var gW=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]*$"),bO={},vO={};function yW(e){return J_.call(vO,e)?!0:J_.call(bO,e)?!1:gW.test(e)?vO[e]=!0:(bO[e]=!0,!1)}function Sb(e,t,n){if(yW(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Iy(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ds(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Bi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function GP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bW(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Q_(e){if(!e._valueTracker){var t=GP(e)?"checked":"value";e._valueTracker=bW(e,t,""+e[t])}}function YP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=GP(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var vW=/[\n"\\]/g;function Yi(e){return e.replace(vW,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Z_(e,t,n,r,i,a,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Bi(t)):e.value!==""+Bi(t)&&(e.value=""+Bi(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?eE(e,s,Bi(t)):n!=null?eE(e,s,Bi(n)):r!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Bi(o):e.removeAttribute("name")}function WP(e,t,n,r,i,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Q_(e);return}n=n!=null?""+Bi(n):"",t=t!=null?""+Bi(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Q_(e)}function eE(e,t,n){t==="number"&&vv(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Bi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function JP(e,t,n){if(t!=null&&(t=""+Bi(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Bi(n):""}function XP(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(J(92));if(ym(r)){if(1<r.length)throw Error(J(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Bi(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Q_(e)}function yd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xW=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 xO(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||xW.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function QP(e,t,n){if(t!=null&&typeof t!="object")throw Error(J(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&xO(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&xO(e,a,t[a])}function pT(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var SW=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"]]),wW=/^[\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 wb(e){return wW.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function to(){}var tE=null;function gT(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Af=null,Yf=null;function SO(e){var t=nh(e);if(t&&(e=t.stateNode)){var n=e[si]||null;e:switch(e=t.stateNode,t.type){case"input":if(Z_(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Yi(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[si]||null;if(!i)throw Error(J(90));Z_(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&YP(r)}break e;case"textarea":JP(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gf(e,!!n.multiple,t,!1)}}}var $w=!1;function ZP(e,t,n){if($w)return e(t,n);$w=!0;try{var r=e(t);return r}finally{if($w=!1,(Af!==null||Yf!==null)&&(R0(),Af&&(t=Af,e=Yf,Yf=Af=null,SO(t),e)))for(t=0;t<e.length;t++)SO(e[t])}}function vp(e,t){var n=e.stateNode;if(n===null)return null;var r=n[si]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var yo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nE=!1;if(yo)try{var Kh={};Object.defineProperty(Kh,"passive",{get:function(){nE=!0}}),window.addEventListener("test",Kh,Kh),window.removeEventListener("test",Kh,Kh)}catch{nE=!1}var nl=null,yT=null,_b=null;function eF(){if(_b)return _b;var e,t=yT,n=t.length,r,i="value"in nl?nl.value:nl.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return _b=i.slice(e,1<r?1-r:void 0)}function Eb(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zy(){return!0}function wO(){return!1}function li(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?zy:wO,this.isPropagationStopped=wO,this}return Wt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zy)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zy)},persist:function(){},isPersistent:zy}),t}var Cu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y0=li(Cu),wg=Wt({},Cu,{view:0,detail:0}),_W=li(wg),Lw,Pw,Gh,b0=Wt({},wg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bT,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gh&&(Gh&&e.type==="mousemove"?(Lw=e.screenX-Gh.screenX,Pw=e.screenY-Gh.screenY):Pw=Lw=0,Gh=e),Lw)},movementY:function(e){return"movementY"in e?e.movementY:Pw}}),_O=li(b0),EW=Wt({},b0,{dataTransfer:0}),kW=li(EW),CW=Wt({},wg,{relatedTarget:0}),Fw=li(CW),TW=Wt({},Cu,{animationName:0,elapsedTime:0,pseudoElement:0}),RW=li(TW),AW=Wt({},Cu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NW=li(AW),OW=Wt({},Cu,{data:0}),EO=li(OW),MW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jW={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"},DW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=DW[e])?!!t[e]:!1}function bT(){return IW}var zW=Wt({},wg,{key:function(e){if(e.key){var t=MW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eb(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bT,charCode:function(e){return e.type==="keypress"?Eb(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eb(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$W=li(zW),LW=Wt({},b0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kO=li(LW),PW=Wt({},wg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bT}),FW=li(PW),UW=Wt({},Cu,{propertyName:0,elapsedTime:0,pseudoElement:0}),BW=li(UW),HW=Wt({},b0,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qW=li(HW),VW=Wt({},Cu,{newState:0,oldState:0}),KW=li(VW),GW=[9,13,27,32],vT=yo&&"CompositionEvent"in window,$m=null;yo&&"documentMode"in document&&($m=document.documentMode);var YW=yo&&"TextEvent"in window&&!$m,tF=yo&&(!vT||$m&&8<$m&&11>=$m),CO=" ",TO=!1;function nF(e,t){switch(e){case"keyup":return GW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rF(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nf=!1;function WW(e,t){switch(e){case"compositionend":return rF(t);case"keypress":return t.which!==32?null:(TO=!0,CO);case"textInput":return e=t.data,e===CO&&TO?null:e;default:return null}}function JW(e,t){if(Nf)return e==="compositionend"||!vT&&nF(e,t)?(e=eF(),_b=yT=nl=null,Nf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return tF&&t.locale!=="ko"?null:t.data;default:return null}}var XW={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 RO(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!XW[e.type]:t==="textarea"}function iF(e,t,n,r){Af?Yf?Yf.push(r):Yf=[r]:Af=r,t=$v(t,"onChange"),0<t.length&&(n=new y0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Lm=null,xp=null;function QW(e){Z3(e,0)}function v0(e){var t=bm(e);if(YP(t))return e}function AO(e,t){if(e==="change")return t}var aF=!1;if(yo){var Uw;if(yo){var Bw="oninput"in document;if(!Bw){var NO=document.createElement("div");NO.setAttribute("oninput","return;"),Bw=typeof NO.oninput=="function"}Uw=Bw}else Uw=!1;aF=Uw&&(!document.documentMode||9<document.documentMode)}function OO(){Lm&&(Lm.detachEvent("onpropertychange",sF),xp=Lm=null)}function sF(e){if(e.propertyName==="value"&&v0(xp)){var t=[];iF(t,xp,e,gT(e)),ZP(QW,t)}}function ZW(e,t,n){e==="focusin"?(OO(),Lm=t,xp=n,Lm.attachEvent("onpropertychange",sF)):e==="focusout"&&OO()}function eJ(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return v0(xp)}function tJ(e,t){if(e==="click")return v0(t)}function nJ(e,t){if(e==="input"||e==="change")return v0(t)}function rJ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oi=typeof Object.is=="function"?Object.is:rJ;function Sp(e,t){if(Oi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!J_.call(t,i)||!Oi(e[i],t[i]))return!1}return!0}function MO(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jO(e,t){var n=MO(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=MO(n)}}function oF(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?oF(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lF(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vv(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vv(e.document)}return t}function xT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iJ=yo&&"documentMode"in document&&11>=document.documentMode,Of=null,rE=null,Pm=null,iE=!1;function DO(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;iE||Of==null||Of!==vv(r)||(r=Of,"selectionStart"in r&&xT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pm&&Sp(Pm,r)||(Pm=r,r=$v(rE,"onSelect"),0<r.length&&(t=new y0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Of)))}function pc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mf={animationend:pc("Animation","AnimationEnd"),animationiteration:pc("Animation","AnimationIteration"),animationstart:pc("Animation","AnimationStart"),transitionrun:pc("Transition","TransitionRun"),transitionstart:pc("Transition","TransitionStart"),transitioncancel:pc("Transition","TransitionCancel"),transitionend:pc("Transition","TransitionEnd")},Hw={},cF={};yo&&(cF=document.createElement("div").style,"AnimationEvent"in window||(delete Mf.animationend.animation,delete Mf.animationiteration.animation,delete Mf.animationstart.animation),"TransitionEvent"in window||delete Mf.transitionend.transition);function Tu(e){if(Hw[e])return Hw[e];if(!Mf[e])return e;var t=Mf[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cF)return Hw[e]=t[n];return e}var uF=Tu("animationend"),fF=Tu("animationiteration"),dF=Tu("animationstart"),aJ=Tu("transitionrun"),sJ=Tu("transitionstart"),oJ=Tu("transitioncancel"),hF=Tu("transitionend"),mF=new Map,aE="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(" ");aE.push("scrollEnd");function Pa(e,t){mF.set(e,t),ku(t,[e])}var xv=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Fi=[],jf=0,ST=0;function x0(){for(var e=jf,t=ST=jf=0;t<e;){var n=Fi[t];Fi[t++]=null;var r=Fi[t];Fi[t++]=null;var i=Fi[t];Fi[t++]=null;var a=Fi[t];if(Fi[t++]=null,r!==null&&i!==null){var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}a!==0&&pF(n,i,a)}}function S0(e,t,n,r){Fi[jf++]=e,Fi[jf++]=t,Fi[jf++]=n,Fi[jf++]=r,ST|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function wT(e,t,n,r){return S0(e,t,n,r),Sv(e)}function Ru(e,t){return S0(e,null,null,t),Sv(e)}function pF(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ki(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Sv(e){if(50<Ym)throw Ym=0,CE=null,Error(J(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Df={};function lJ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vi(e,t,n,r){return new lJ(e,t,n,r)}function _T(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uo(e,t){var n=e.alternate;return n===null?(n=vi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function gF(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function kb(e,t,n,r,i,a){var s=0;if(r=e,typeof e=="function")_T(e)&&(s=1);else if(typeof e=="string")s=hX(e,n,cs.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K_:return e=vi(31,n,t,i),e.elementType=K_,e.lanes=a,e;case Cf:return Pc(n.children,i,a,t);case IP:s=8,i|=24;break;case H_:return e=vi(12,n,t,i|2),e.elementType=H_,e.lanes=a,e;case q_:return e=vi(13,n,t,i),e.elementType=q_,e.lanes=a,e;case V_:return e=vi(19,n,t,i),e.elementType=V_,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case eo:s=10;break e;case zP:s=9;break e;case cT:s=11;break e;case uT:s=14;break e;case Vo:s=16,r=null;break e}s=29,n=Error(J(130,e===null?"null":typeof e,"")),r=null}return t=vi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pc(e,t,n,r){return e=vi(7,e,r,t),e.lanes=n,e}function qw(e,t,n){return e=vi(6,e,null,t),e.lanes=n,e}function yF(e){var t=vi(18,null,null,0);return t.stateNode=e,t}function Vw(e,t,n){return t=vi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var IO=new WeakMap;function Wi(e,t){if(typeof e=="object"&&e!==null){var n=IO.get(e);return n!==void 0?n:(t={value:e,source:t,stack:pO(t)},IO.set(e,t),t)}return{value:e,source:t,stack:pO(t)}}var If=[],zf=0,wv=null,wp=0,Hi=[],qi=0,Ol=null,es=1,ts="";function Ws(e,t){If[zf++]=wp,If[zf++]=wv,wv=e,wp=t}function bF(e,t,n){Hi[qi++]=es,Hi[qi++]=ts,Hi[qi++]=Ol,Ol=e;var r=es;e=ts;var i=32-ki(r)-1;r&=~(1<<i),n+=1;var a=32-ki(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,es=1<<32-ki(t)+i|n<<i|r,ts=a+e}else es=1<<a|n<<i|r,ts=e}function ET(e){e.return!==null&&(Ws(e,1),bF(e,1,0))}function kT(e){for(;e===wv;)wv=If[--zf],If[zf]=null,wp=If[--zf],If[zf]=null;for(;e===Ol;)Ol=Hi[--qi],Hi[qi]=null,ts=Hi[--qi],Hi[qi]=null,es=Hi[--qi],Hi[qi]=null}function vF(e,t){Hi[qi++]=es,Hi[qi++]=ts,Hi[qi++]=Ol,es=t.id,ts=t.overflow,Ol=e}var fr=null,Ht=null,ct=!1,fl=null,Ji=!1,sE=Error(J(519));function Ml(e){var t=Error(J(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _p(Wi(t,e)),sE}function zO(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ur]=e,t[si]=r,n){case"dialog":rt("cancel",t),rt("close",t);break;case"iframe":case"object":case"embed":rt("load",t);break;case"video":case"audio":for(n=0;n<Tp.length;n++)rt(Tp[n],t);break;case"source":rt("error",t);break;case"img":case"image":case"link":rt("error",t),rt("load",t);break;case"details":rt("toggle",t);break;case"input":rt("invalid",t),WP(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":rt("invalid",t);break;case"textarea":rt("invalid",t),XP(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||t4(t.textContent,n)?(r.popover!=null&&(rt("beforetoggle",t),rt("toggle",t)),r.onScroll!=null&&rt("scroll",t),r.onScrollEnd!=null&&rt("scrollend",t),r.onClick!=null&&(t.onclick=to),t=!0):t=!1,t||Ml(e,!0)}function $O(e){for(fr=e.return;fr;)switch(fr.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:fr=fr.return}}function Qu(e){if(e!==fr)return!1;if(!ct)return $O(e),ct=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||OE(e.type,e.memoizedProps)),n=!n),n&&Ht&&Ml(e),$O(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));Ht=_M(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));Ht=_M(e)}else t===27?(t=Ht,Xl(e.type)?(e=IE,IE=null,Ht=e):Ht=t):Ht=fr?ea(e.stateNode.nextSibling):null;return!0}function Xc(){Ht=fr=null,ct=!1}function Kw(){var e=fl;return e!==null&&(ei===null?ei=e:ei.push.apply(ei,e),fl=null),e}function _p(e){fl===null?fl=[e]:fl.push(e)}var oE=ws(null),Au=null,no=null;function Wo(e,t,n){Ft(oE,t._currentValue),t._currentValue=n}function fo(e){e._currentValue=oE.current,Jn(oE)}function lE(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function cE(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;e:for(;a!==null;){var o=a;a=i;for(var l=0;l<t.length;l++)if(o.context===t[l]){a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),lE(a.return,n,e),r||(s=null);break e}a=o.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(J(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),lE(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function rh(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(J(387));if(s=s.memoizedProps,s!==null){var o=i.type;Oi(i.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(i===pv.current){if(s=i.alternate,s===null)throw Error(J(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ap):e=[Ap])}i=i.return}e!==null&&cE(t,e,n,r),t.flags|=262144}function _v(e){for(e=e.firstContext;e!==null;){if(!Oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qc(e){Au=e,no=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mr(e){return xF(Au,e)}function $y(e,t){return Au===null&&Qc(e),xF(e,t)}function xF(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},no===null){if(e===null)throw Error(J(308));no=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else no=no.next=t;return n}var cJ=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},uJ=Pn.unstable_scheduleCallback,fJ=Pn.unstable_NormalPriority,_n={$$typeof:eo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function CT(){return{controller:new cJ,data:new Map,refCount:0}}function _g(e){e.refCount--,e.refCount===0&&uJ(fJ,function(){e.controller.abort()})}var Fm=null,uE=0,bd=0,Wf=null;function dJ(e,t){if(Fm===null){var n=Fm=[];uE=0,bd=XT(),Wf={status:"pending",value:void 0,then:function(r){n.push(r)}}}return uE++,t.then(LO,LO),t}function LO(){if(--uE===0&&Fm!==null){Wf!==null&&(Wf.status="fulfilled");var e=Fm;Fm=null,bd=0,Wf=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function hJ(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var PO=Pe.S;Pe.S=function(e,t){D3=_i(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&dJ(e,t),PO!==null&&PO(e,t)};var Fc=ws(null);function TT(){var e=Fc.current;return e!==null?e:It.pooledCache}function Cb(e,t){t===null?Ft(Fc,Fc.current):Ft(Fc,t.pool)}function SF(){var e=TT();return e===null?null:{parent:_n._currentValue,pool:e}}var ih=Error(J(460)),RT=Error(J(474)),w0=Error(J(542)),Ev={then:function(){}};function FO(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wF(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(to,to),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,BO(e),e;default:if(typeof t.status=="string")t.then(to,to);else{if(e=It,e!==null&&100<e.shellSuspendCounter)throw Error(J(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,BO(e),e}throw Uc=t,ih}}function Ec(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Uc=n,ih):n}}var Uc=null;function UO(){if(Uc===null)throw Error(J(459));var e=Uc;return Uc=null,e}function BO(e){if(e===ih||e===w0)throw Error(J(483))}var Jf=null,Ep=0;function Ly(e){var t=Ep;return Ep+=1,Jf===null&&(Jf=[]),wF(Jf,e,t)}function Yh(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Py(e,t){throw t.$$typeof===ZY?Error(J(525)):(e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _F(e){function t(g,v){if(e){var w=g.deletions;w===null?(g.deletions=[v],g.flags|=16):w.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g){for(var v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function i(g,v){return g=uo(g,v),g.index=0,g.sibling=null,g}function a(g,v,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<v?(g.flags|=67108866,v):w):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,v,w,E){return v===null||v.tag!==6?(v=qw(w,g.mode,E),v.return=g,v):(v=i(v,w),v.return=g,v)}function l(g,v,w,E){var C=w.type;return C===Cf?f(g,v,w.props.children,E,w.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Vo&&Ec(C)===v.type)?(v=i(v,w.props),Yh(v,w),v.return=g,v):(v=kb(w.type,w.key,w.props,null,g.mode,E),Yh(v,w),v.return=g,v)}function c(g,v,w,E){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Vw(w,g.mode,E),v.return=g,v):(v=i(v,w.children||[]),v.return=g,v)}function f(g,v,w,E,C){return v===null||v.tag!==7?(v=Pc(w,g.mode,E,C),v.return=g,v):(v=i(v,w),v.return=g,v)}function u(g,v,w){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=qw(""+v,g.mode,w),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Oy:return w=kb(v.type,v.key,v.props,null,g.mode,w),Yh(w,v),w.return=g,w;case gm:return v=Vw(v,g.mode,w),v.return=g,v;case Vo:return v=Ec(v),u(g,v,w)}if(ym(v)||Vh(v))return v=Pc(v,g.mode,w,null),v.return=g,v;if(typeof v.then=="function")return u(g,Ly(v),w);if(v.$$typeof===eo)return u(g,$y(g,v),w);Py(g,v)}return null}function d(g,v,w,E){var C=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return C!==null?null:o(g,v,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Oy:return w.key===C?l(g,v,w,E):null;case gm:return w.key===C?c(g,v,w,E):null;case Vo:return w=Ec(w),d(g,v,w,E)}if(ym(w)||Vh(w))return C!==null?null:f(g,v,w,E,null);if(typeof w.then=="function")return d(g,v,Ly(w),E);if(w.$$typeof===eo)return d(g,v,$y(g,w),E);Py(g,w)}return null}function h(g,v,w,E,C){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return g=g.get(w)||null,o(v,g,""+E,C);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Oy:return g=g.get(E.key===null?w:E.key)||null,l(v,g,E,C);case gm:return g=g.get(E.key===null?w:E.key)||null,c(v,g,E,C);case Vo:return E=Ec(E),h(g,v,w,E,C)}if(ym(E)||Vh(E))return g=g.get(w)||null,f(v,g,E,C,null);if(typeof E.then=="function")return h(g,v,w,Ly(E),C);if(E.$$typeof===eo)return h(g,v,w,$y(v,E),C);Py(v,E)}return null}function p(g,v,w,E){for(var C=null,k=null,_=v,A=v=0,D=null;_!==null&&A<w.length;A++){_.index>A?(D=_,_=null):D=_.sibling;var O=d(g,_,w[A],E);if(O===null){_===null&&(_=D);break}e&&_&&O.alternate===null&&t(g,_),v=a(O,v,A),k===null?C=O:k.sibling=O,k=O,_=D}if(A===w.length)return n(g,_),ct&&Ws(g,A),C;if(_===null){for(;A<w.length;A++)_=u(g,w[A],E),_!==null&&(v=a(_,v,A),k===null?C=_:k.sibling=_,k=_);return ct&&Ws(g,A),C}for(_=r(_);A<w.length;A++)D=h(_,g,A,w[A],E),D!==null&&(e&&D.alternate!==null&&_.delete(D.key===null?A:D.key),v=a(D,v,A),k===null?C=D:k.sibling=D,k=D);return e&&_.forEach(function(L){return t(g,L)}),ct&&Ws(g,A),C}function b(g,v,w,E){if(w==null)throw Error(J(151));for(var C=null,k=null,_=v,A=v=0,D=null,O=w.next();_!==null&&!O.done;A++,O=w.next()){_.index>A?(D=_,_=null):D=_.sibling;var L=d(g,_,O.value,E);if(L===null){_===null&&(_=D);break}e&&_&&L.alternate===null&&t(g,_),v=a(L,v,A),k===null?C=L:k.sibling=L,k=L,_=D}if(O.done)return n(g,_),ct&&Ws(g,A),C;if(_===null){for(;!O.done;A++,O=w.next())O=u(g,O.value,E),O!==null&&(v=a(O,v,A),k===null?C=O:k.sibling=O,k=O);return ct&&Ws(g,A),C}for(_=r(_);!O.done;A++,O=w.next())O=h(_,g,A,O.value,E),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?A:O.key),v=a(O,v,A),k===null?C=O:k.sibling=O,k=O);return e&&_.forEach(function(B){return t(g,B)}),ct&&Ws(g,A),C}function x(g,v,w,E){if(typeof w=="object"&&w!==null&&w.type===Cf&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Oy:e:{for(var C=w.key;v!==null;){if(v.key===C){if(C=w.type,C===Cf){if(v.tag===7){n(g,v.sibling),E=i(v,w.props.children),E.return=g,g=E;break e}}else if(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Vo&&Ec(C)===v.type){n(g,v.sibling),E=i(v,w.props),Yh(E,w),E.return=g,g=E;break e}n(g,v);break}else t(g,v);v=v.sibling}w.type===Cf?(E=Pc(w.props.children,g.mode,E,w.key),E.return=g,g=E):(E=kb(w.type,w.key,w.props,null,g.mode,E),Yh(E,w),E.return=g,g=E)}return s(g);case gm:e:{for(C=w.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),E=i(v,w.children||[]),E.return=g,g=E;break e}else{n(g,v);break}else t(g,v);v=v.sibling}E=Vw(w,g.mode,E),E.return=g,g=E}return s(g);case Vo:return w=Ec(w),x(g,v,w,E)}if(ym(w))return p(g,v,w,E);if(Vh(w)){if(C=Vh(w),typeof C!="function")throw Error(J(150));return w=C.call(w),b(g,v,w,E)}if(typeof w.then=="function")return x(g,v,Ly(w),E);if(w.$$typeof===eo)return x(g,v,$y(g,w),E);Py(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),E=i(v,w),E.return=g,g=E):(n(g,v),E=qw(w,g.mode,E),E.return=g,g=E),s(g)):n(g,v)}return function(g,v,w,E){try{Ep=0;var C=x(g,v,w,E);return Jf=null,C}catch(_){if(_===ih||_===w0)throw _;var k=vi(29,_,null,g.mode);return k.lanes=E,k.return=g,k}finally{}}}var Zc=_F(!0),EF=_F(!1),Ko=!1;function AT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fE(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function dl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Sv(e),pF(e,null,n),t}return S0(e,r,t,n),Sv(e)}function Um(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BP(e,n)}}function Gw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var dE=!1;function Bm(){if(dE){var e=Wf;if(e!==null)throw e}}function Hm(e,t,n,r){dE=!1;var i=e.updateQueue;Ko=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==s&&(o===null?f.firstBaseUpdate=c:o.next=c,f.lastBaseUpdate=l))}if(a!==null){var u=i.baseState;s=0,f=c=l=null,o=a;do{var d=o.lane&-536870913,h=d!==o.lane;if(h?(ot&d)===d:(r&d)===d){d!==0&&d===bd&&(dE=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,b=o;d=t;var x=n;switch(b.tag){case 1:if(p=b.payload,typeof p=="function"){u=p.call(x,u,d);break e}u=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,d=typeof p=="function"?p.call(x,u,d):p,d==null)break e;u=Wt({},u,d);break e;case 2:Ko=!0}}d=o.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(c=f=h,l=u):f=f.next=h,s|=d;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);f===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=f,a===null&&(i.shared.lanes=0),Dl|=s,e.lanes=s,e.memoizedState=u}}function kF(e,t){if(typeof e!="function")throw Error(J(191,e));e.call(t)}function CF(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)kF(n[e],t)}var vd=ws(null),kv=ws(0);function HO(e,t){e=So,Ft(kv,e),Ft(vd,t),So=e|t.baseLanes}function hE(){Ft(kv,So),Ft(vd,vd.current)}function NT(){So=kv.current,Jn(vd),Jn(kv)}var Mi=ws(null),Zi=null;function Jo(e){var t=e.alternate;Ft(dn,dn.current&1),Ft(Mi,e),Zi===null&&(t===null||vd.current!==null||t.memoizedState!==null)&&(Zi=e)}function mE(e){Ft(dn,dn.current),Ft(Mi,e),Zi===null&&(Zi=e)}function TF(e){e.tag===22?(Ft(dn,dn.current),Ft(Mi,e),Zi===null&&(Zi=e)):Xo()}function Xo(){Ft(dn,dn.current),Ft(Mi,Mi.current)}function gi(e){Jn(Mi),Zi===e&&(Zi=null),Jn(dn)}var dn=ws(0);function Cv(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||jE(n)||DE(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=0,Ye=null,Ot=null,Sn=null,Tv=!1,Xf=!1,eu=!1,Rv=0,kp=0,Qf=null,mJ=0;function tn(){throw Error(J(321))}function OT(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Oi(e[n],t[n]))return!1;return!0}function MT(e,t,n,r,i,a){return bo=a,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pe.H=e===null||e.memoizedState===null?i3:HT,eu=!1,a=n(r,i),eu=!1,Xf&&(a=AF(t,n,r,i)),RF(e),a}function RF(e){Pe.H=Cp;var t=Ot!==null&&Ot.next!==null;if(bo=0,Sn=Ot=Ye=null,Tv=!1,kp=0,Qf=null,t)throw Error(J(300));e===null||Tn||(e=e.dependencies,e!==null&&_v(e)&&(Tn=!0))}function AF(e,t,n,r){Ye=e;var i=0;do{if(Xf&&(Qf=null),kp=0,Xf=!1,25<=i)throw Error(J(301));if(i+=1,Sn=Ot=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Pe.H=a3,a=t(n,r)}while(Xf);return a}function pJ(){var e=Pe.H,t=e.useState()[0];return t=typeof t.then=="function"?Eg(t):t,e=e.useState()[0],(Ot!==null?Ot.memoizedState:null)!==e&&(Ye.flags|=1024),t}function jT(){var e=Rv!==0;return Rv=0,e}function DT(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function IT(e){if(Tv){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Tv=!1}bo=0,Sn=Ot=Ye=null,Xf=!1,kp=Rv=0,Qf=null}function Dr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?Ye.memoizedState=Sn=e:Sn=Sn.next=e,Sn}function hn(){if(Ot===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var t=Sn===null?Ye.memoizedState:Sn.next;if(t!==null)Sn=t,Ot=e;else{if(e===null)throw Ye.alternate===null?Error(J(467)):Error(J(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Sn===null?Ye.memoizedState=Sn=e:Sn=Sn.next=e}return Sn}function _0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eg(e){var t=kp;return kp+=1,Qf===null&&(Qf=[]),e=wF(Qf,e,t),t=Ye,(Sn===null?t.memoizedState:Sn.next)===null&&(t=t.alternate,Pe.H=t===null||t.memoizedState===null?i3:HT),e}function E0(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Eg(e);if(e.$$typeof===eo)return mr(e)}throw Error(J(438,String(e)))}function zT(e){var t=null,n=Ye.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ye.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=_0(),Ye.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=eW;return t.index++,n}function vo(e,t){return typeof t=="function"?t(e):t}function Tb(e){var t=hn();return $T(t,Ot,e)}function $T(e,t,n){var r=e.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var o=s=null,l=null,c=t,f=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(ot&u)===u:(bo&u)===u){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===bd&&(f=!0);else if((bo&d)===d){c=c.next,d===bd&&(f=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=u,s=a):l=l.next=u,Ye.lanes|=d,Dl|=d;u=c.action,eu&&n(a,u),a=c.hasEagerState?c.eagerState:n(a,u)}else d={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=d,s=a):l=l.next=d,Ye.lanes|=u,Dl|=u;c=c.next}while(c!==null&&c!==t);if(l===null?s=a:l.next=o,!Oi(a,e.memoizedState)&&(Tn=!0,f&&(n=Wf,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Yw(e){var t=hn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Oi(a,t.memoizedState)||(Tn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function NF(e,t,n){var r=Ye,i=hn(),a=ct;if(a){if(n===void 0)throw Error(J(407));n=n()}else n=t();var s=!Oi((Ot||i).memoizedState,n);if(s&&(i.memoizedState=n,Tn=!0),i=i.queue,LT(jF.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||Sn!==null&&Sn.memoizedState.tag&1){if(r.flags|=2048,xd(9,{destroy:void 0},MF.bind(null,r,i,n,t),null),It===null)throw Error(J(349));a||bo&127||OF(r,t,n)}return n}function OF(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t=_0(),Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function MF(e,t,n,r){t.value=n,t.getSnapshot=r,DF(t)&&IF(e)}function jF(e,t,n){return n(function(){DF(t)&&IF(e)})}function DF(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Oi(e,n)}catch{return!0}}function IF(e){var t=Ru(e,2);t!==null&&ai(t,e,2)}function pE(e){var t=Dr();if(typeof e=="function"){var n=e;if(e=n(),eu){tl(!0);try{n()}finally{tl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:e},t}function zF(e,t,n,r){return e.baseState=n,$T(e,Ot,typeof r=="function"?r:vo)}function gJ(e,t,n,r,i){if(C0(e))throw Error(J(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s)}};Pe.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,$F(t,a)):(a.next=n.next,t.pending=n.next=a)}}function $F(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=Pe.T,s={};Pe.T=s;try{var o=n(i,r),l=Pe.S;l!==null&&l(s,o),qO(e,t,o)}catch(c){gE(e,t,c)}finally{a!==null&&s.types!==null&&(a.types=s.types),Pe.T=a}}else try{a=n(i,r),qO(e,t,a)}catch(c){gE(e,t,c)}}function qO(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){VO(e,t,r)},function(r){return gE(e,t,r)}):VO(e,t,n)}function VO(e,t,n){t.status="fulfilled",t.value=n,LF(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$F(e,n)))}function gE(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,LF(t),t=t.next;while(t!==r)}e.action=null}function LF(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function PF(e,t){return t}function KO(e,t){if(ct){var n=It.formState;if(n!==null){e:{var r=Ye;if(ct){if(Ht){t:{for(var i=Ht,a=Ji;i.nodeType!==8;){if(!a){i=null;break t}if(i=ea(i.nextSibling),i===null){i=null;break t}}a=i.data,i=a==="F!"||a==="F"?i:null}if(i){Ht=ea(i.nextSibling),r=i.data==="F!";break e}}Ml(r)}r=!1}r&&(t=n[0])}}return n=Dr(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:PF,lastRenderedState:t},n.queue=r,n=t3.bind(null,Ye,r),r.dispatch=n,r=pE(!1),a=BT.bind(null,Ye,!1,r.queue),r=Dr(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gJ.bind(null,Ye,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function GO(e){var t=hn();return FF(t,Ot,e)}function FF(e,t,n){if(t=$T(e,t,PF)[0],e=Tb(vo)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Eg(t)}catch(s){throw s===ih?w0:s}else r=t;t=hn();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ye.flags|=2048,xd(9,{destroy:void 0},yJ.bind(null,i,n),null)),[r,a,e]}function yJ(e,t){e.action=t}function YO(e){var t=hn(),n=Ot;if(n!==null)return FF(t,n,e);hn(),t=t.memoizedState,n=hn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function xd(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ye.updateQueue,t===null&&(t=_0(),Ye.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function UF(){return hn().memoizedState}function Rb(e,t,n,r){var i=Dr();Ye.flags|=e,i.memoizedState=xd(1|t,{destroy:void 0},n,r===void 0?null:r)}function k0(e,t,n,r){var i=hn();r=r===void 0?null:r;var a=i.memoizedState.inst;Ot!==null&&r!==null&&OT(r,Ot.memoizedState.deps)?i.memoizedState=xd(t,a,n,r):(Ye.flags|=e,i.memoizedState=xd(1|t,a,n,r))}function WO(e,t){Rb(8390656,8,e,t)}function LT(e,t){k0(2048,8,e,t)}function bJ(e){Ye.flags|=4;var t=Ye.updateQueue;if(t===null)t=_0(),Ye.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function BF(e){var t=hn().memoizedState;return bJ({ref:t,nextImpl:e}),function(){if(pt&2)throw Error(J(440));return t.impl.apply(void 0,arguments)}}function HF(e,t){return k0(4,2,e,t)}function qF(e,t){return k0(4,4,e,t)}function VF(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function KF(e,t,n){n=n!=null?n.concat([e]):null,k0(4,4,VF.bind(null,t,e),n)}function PT(){}function GF(e,t){var n=hn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&OT(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function YF(e,t){var n=hn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&OT(t,r[1]))return r[0];if(r=e(),eu){tl(!0);try{e()}finally{tl(!1)}}return n.memoizedState=[r,t],r}function FT(e,t,n){return n===void 0||bo&1073741824&&!(ot&261930)?e.memoizedState=t:(e.memoizedState=n,e=z3(),Ye.lanes|=e,Dl|=e,n)}function WF(e,t,n,r){return Oi(n,t)?n:vd.current!==null?(e=FT(e,n,r),Oi(e,t)||(Tn=!0),e):!(bo&42)||bo&1073741824&&!(ot&261930)?(Tn=!0,e.memoizedState=n):(e=z3(),Ye.lanes|=e,Dl|=e,t)}function JF(e,t,n,r,i){var a=gt.p;gt.p=a!==0&&8>a?a:8;var s=Pe.T,o={};Pe.T=o,BT(e,!1,t,n);try{var l=i(),c=Pe.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var f=hJ(l,r);qm(e,t,f,Ci(e))}else qm(e,t,r,Ci(e))}catch(u){qm(e,t,{then:function(){},status:"rejected",reason:u},Ci())}finally{gt.p=a,s!==null&&o.types!==null&&(s.types=o.types),Pe.T=s}}function vJ(){}function yE(e,t,n,r){if(e.tag!==5)throw Error(J(476));var i=XF(e).queue;JF(e,i,t,Lc,n===null?vJ:function(){return QF(e),n(r)})}function XF(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Lc,baseState:Lc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:Lc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function QF(e){var t=XF(e);t.next===null&&(t=e.alternate.memoizedState),qm(e,t.next.queue,{},Ci())}function UT(){return mr(Ap)}function ZF(){return hn().memoizedState}function e3(){return hn().memoizedState}function xJ(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ci();e=dl(n);var r=hl(t,e,n);r!==null&&(ai(r,t,n),Um(r,t,n)),t={cache:CT()},e.payload=t;return}t=t.return}}function SJ(e,t,n){var r=Ci();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},C0(e)?n3(t,n):(n=wT(e,t,n,r),n!==null&&(ai(n,e,r),r3(n,t,r)))}function t3(e,t,n){var r=Ci();qm(e,t,n,r)}function qm(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(C0(e))n3(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,Oi(o,s))return S0(e,t,i,0),It===null&&x0(),!1}catch{}finally{}if(n=wT(e,t,i,r),n!==null)return ai(n,e,r),r3(n,t,r),!0}return!1}function BT(e,t,n,r){if(r={lane:2,revertLane:XT(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},C0(e)){if(t)throw Error(J(479))}else t=wT(e,n,r,2),t!==null&&ai(t,e,2)}function C0(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function n3(e,t){Xf=Tv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function r3(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BP(e,n)}}var Cp={readContext:mr,use:E0,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};Cp.useEffectEvent=tn;var i3={readContext:mr,use:E0,useCallback:function(e,t){return Dr().memoizedState=[e,t===void 0?null:t],e},useContext:mr,useEffect:WO,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Rb(4194308,4,VF.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rb(4194308,4,e,t)},useInsertionEffect:function(e,t){Rb(4,2,e,t)},useMemo:function(e,t){var n=Dr();t=t===void 0?null:t;var r=e();if(eu){tl(!0);try{e()}finally{tl(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Dr();if(n!==void 0){var i=n(t);if(eu){tl(!0);try{n(t)}finally{tl(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=SJ.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=Dr();return e={current:e},t.memoizedState=e},useState:function(e){e=pE(e);var t=e.queue,n=t3.bind(null,Ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:PT,useDeferredValue:function(e,t){var n=Dr();return FT(n,e,t)},useTransition:function(){var e=pE(!1);return e=JF.bind(null,Ye,e.queue,!0,!1),Dr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ye,i=Dr();if(ct){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),It===null)throw Error(J(349));ot&127||OF(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,WO(jF.bind(null,r,a,e),[e]),r.flags|=2048,xd(9,{destroy:void 0},MF.bind(null,r,a,n,t),null),n},useId:function(){var e=Dr(),t=It.identifierPrefix;if(ct){var n=ts,r=es;n=(r&~(1<<32-ki(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Rv++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=mJ++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:UT,useFormState:KO,useActionState:KO,useOptimistic:function(e){var t=Dr();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=BT.bind(null,Ye,!0,n),n.dispatch=t,[e,t]},useMemoCache:zT,useCacheRefresh:function(){return Dr().memoizedState=xJ.bind(null,Ye)},useEffectEvent:function(e){var t=Dr(),n={impl:e};return t.memoizedState=n,function(){if(pt&2)throw Error(J(440));return n.impl.apply(void 0,arguments)}}},HT={readContext:mr,use:E0,useCallback:GF,useContext:mr,useEffect:LT,useImperativeHandle:KF,useInsertionEffect:HF,useLayoutEffect:qF,useMemo:YF,useReducer:Tb,useRef:UF,useState:function(){return Tb(vo)},useDebugValue:PT,useDeferredValue:function(e,t){var n=hn();return WF(n,Ot.memoizedState,e,t)},useTransition:function(){var e=Tb(vo)[0],t=hn().memoizedState;return[typeof e=="boolean"?e:Eg(e),t]},useSyncExternalStore:NF,useId:ZF,useHostTransitionStatus:UT,useFormState:GO,useActionState:GO,useOptimistic:function(e,t){var n=hn();return zF(n,Ot,e,t)},useMemoCache:zT,useCacheRefresh:e3};HT.useEffectEvent=BF;var a3={readContext:mr,use:E0,useCallback:GF,useContext:mr,useEffect:LT,useImperativeHandle:KF,useInsertionEffect:HF,useLayoutEffect:qF,useMemo:YF,useReducer:Yw,useRef:UF,useState:function(){return Yw(vo)},useDebugValue:PT,useDeferredValue:function(e,t){var n=hn();return Ot===null?FT(n,e,t):WF(n,Ot.memoizedState,e,t)},useTransition:function(){var e=Yw(vo)[0],t=hn().memoizedState;return[typeof e=="boolean"?e:Eg(e),t]},useSyncExternalStore:NF,useId:ZF,useHostTransitionStatus:UT,useFormState:YO,useActionState:YO,useOptimistic:function(e,t){var n=hn();return Ot!==null?zF(n,Ot,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:zT,useCacheRefresh:e3};a3.useEffectEvent=BF;function Ww(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Wt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bE={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ci(),i=dl(r);i.payload=t,n!=null&&(i.callback=n),t=hl(e,i,r),t!==null&&(ai(t,e,r),Um(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ci(),i=dl(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=hl(e,i,r),t!==null&&(ai(t,e,r),Um(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ci(),r=dl(n);r.tag=2,t!=null&&(r.callback=t),t=hl(e,r,n),t!==null&&(ai(t,e,n),Um(t,e,n))}};function JO(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!Sp(n,r)||!Sp(i,a):!0}function XO(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bE.enqueueReplaceState(t,t.state,null)}function tu(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=Wt({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function s3(e){xv(e)}function o3(e){console.error(e)}function l3(e){xv(e)}function Av(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function QO(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function vE(e,t,n){return n=dl(n),n.tag=3,n.payload={element:null},n.callback=function(){Av(e,t)},n}function c3(e){return e=dl(e),e.tag=3,e}function u3(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){QO(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){QO(t,n,r),typeof i!="function"&&(ml===null?ml=new Set([this]):ml.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function wJ(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&rh(t,n,i,!0),n=Mi.current,n!==null){switch(n.tag){case 31:case 13:return Zi===null?Dv():n.alternate===null&&an===0&&(an=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ev?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),s1(e,r,i)),!1;case 22:return n.flags|=65536,r===Ev?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),s1(e,r,i)),!1}throw Error(J(435,n.tag))}return s1(e,r,i),Dv(),!1}if(ct)return t=Mi.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==sE&&(e=Error(J(422),{cause:r}),_p(Wi(e,n)))):(r!==sE&&(t=Error(J(423),{cause:r}),_p(Wi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Wi(r,n),i=vE(e.stateNode,r,i),Gw(e,i),an!==4&&(an=2)),!1;var a=Error(J(520),{cause:r});if(a=Wi(a,n),Gm===null?Gm=[a]:Gm.push(a),an!==4&&(an=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=vE(n.stateNode,r,e),Gw(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(ml===null||!ml.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=c3(i),u3(i,e,n,r),Gw(n,i),!1}n=n.return}while(n!==null);return!1}var qT=Error(J(461)),Tn=!1;function ar(e,t,n,r){t.child=e===null?EF(t,null,n,r):Zc(t,e.child,n,r)}function ZO(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var s={};for(var o in r)o!=="ref"&&(s[o]=r[o])}else s=r;return Qc(t),r=MT(e,t,n,s,a,i),o=jT(),e!==null&&!Tn?(DT(e,t,i),xo(e,t,i)):(ct&&o&&ET(t),t.flags|=1,ar(e,t,r,i),t.child)}function eM(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!_T(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,f3(e,t,a,r,i)):(e=kb(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!VT(e,i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Sp,n(s,r)&&e.ref===t.ref)return xo(e,t,i)}return t.flags|=1,e=uo(a,r),e.ref=t.ref,e.return=t,t.child=e}function f3(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sp(a,r)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=r=a,VT(e,i))e.flags&131072&&(Tn=!0);else return t.lanes=e.lanes,xo(e,t,i)}return xE(e,t,n,r,i)}function d3(e,t,n,r){var i=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return tM(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cb(t,a!==null?a.cachePool:null),a!==null?HO(t,a):hE(),TF(t);else return r=t.lanes=536870912,tM(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(Cb(t,a.cachePool),HO(t,a),Xo(),t.memoizedState=null):(e!==null&&Cb(t,null),hE(),Xo());return ar(e,t,i,n),t.child}function vm(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function tM(e,t,n,r,i){var a=TT();return a=a===null?null:{parent:_n._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Cb(t,null),hE(),TF(t),e!==null&&rh(e,t,r,!0),t.childLanes=i,null}function Ab(e,t){return t=Nv({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nM(e,t,n){return Zc(t,e.child,null,n),e=Ab(t,t.pendingProps),e.flags|=2,gi(t),t.memoizedState=null,e}function _J(e,t,n){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ct){if(r.mode==="hidden")return e=Ab(t,r),t.lanes=536870912,vm(null,e);if(mE(t),(e=Ht)?(e=i4(e,Ji),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ol!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},n=yF(e),n.return=t,t.child=n,fr=t,Ht=null)):e=null,e===null)throw Ml(t);return t.lanes=536870912,null}return Ab(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(mE(t),i)if(t.flags&256)t.flags&=-257,t=nM(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(J(558));else if(Tn||rh(e,t,n,!1),i=(n&e.childLanes)!==0,Tn||i){if(r=It,r!==null&&(s=HP(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Ru(e,s),ai(r,e,s),qT;Dv(),t=nM(e,t,n)}else e=a.treeContext,Ht=ea(s.nextSibling),fr=t,ct=!0,fl=null,Ji=!1,e!==null&&vF(t,e),t=Ab(t,r),t.flags|=4096;return t}return e=uo(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Nb(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(J(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xE(e,t,n,r,i){return Qc(t),n=MT(e,t,n,r,void 0,i),r=jT(),e!==null&&!Tn?(DT(e,t,i),xo(e,t,i)):(ct&&r&&ET(t),t.flags|=1,ar(e,t,n,i),t.child)}function rM(e,t,n,r,i,a){return Qc(t),t.updateQueue=null,n=AF(t,r,n,i),RF(e),r=jT(),e!==null&&!Tn?(DT(e,t,a),xo(e,t,a)):(ct&&r&&ET(t),t.flags|=1,ar(e,t,n,a),t.child)}function iM(e,t,n,r,i){if(Qc(t),t.stateNode===null){var a=Df,s=n.contextType;typeof s=="object"&&s!==null&&(a=mr(s)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bE,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},AT(t),s=n.contextType,a.context=typeof s=="object"&&s!==null?mr(s):Df,a.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Ww(t,n,s,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&bE.enqueueReplaceState(a,a.state,null),Hm(t,r,a,i),Bm(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var o=t.memoizedProps,l=tu(n,o);a.props=l;var c=a.context,f=n.contextType;s=Df,typeof f=="object"&&f!==null&&(s=mr(f));var u=n.getDerivedStateFromProps;f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o||c!==s)&&XO(t,a,r,s),Ko=!1;var d=t.memoizedState;a.state=d,Hm(t,r,a,i),Bm(),c=t.memoizedState,o||d!==c||Ko?(typeof u=="function"&&(Ww(t,n,u,r),c=t.memoizedState),(l=Ko||JO(t,n,l,r,d,c,s))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=s,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fE(e,t),s=t.memoizedProps,f=tu(n,s),a.props=f,u=t.pendingProps,d=a.context,c=n.contextType,l=Df,typeof c=="object"&&c!==null&&(l=mr(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==u||d!==l)&&XO(t,a,r,l),Ko=!1,d=t.memoizedState,a.state=d,Hm(t,r,a,i),Bm();var h=t.memoizedState;s!==u||d!==h||Ko||e!==null&&e.dependencies!==null&&_v(e.dependencies)?(typeof o=="function"&&(Ww(t,n,o,r),h=t.memoizedState),(f=Ko||JO(t,n,f,r,d,h,l)||e!==null&&e.dependencies!==null&&_v(e.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=f):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Nb(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Zc(t,e.child,null,i),t.child=Zc(t,null,n,i)):ar(e,t,n,i),t.memoizedState=a.state,e=t.child):e=xo(e,t,i),e}function aM(e,t,n,r){return Xc(),t.flags|=256,ar(e,t,n,r),t.child}var Jw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xw(e){return{baseLanes:e,cachePool:SF()}}function Qw(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Si),e}function h3(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(dn.current&2)!==0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(ct){if(i?Jo(t):Xo(),(e=Ht)?(e=i4(e,Ji),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ol!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},n=yF(e),n.return=t,t.child=n,fr=t,Ht=null)):e=null,e===null)throw Ml(t);return DE(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,i?(Xo(),i=t.mode,o=Nv({mode:"hidden",children:o},i),r=Pc(r,i,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=Xw(n),r.childLanes=Qw(e,s,n),t.memoizedState=Jw,vm(null,r)):(Jo(t),SE(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(a)t.flags&256?(Jo(t),t.flags&=-257,t=Zw(e,t,n)):t.memoizedState!==null?(Xo(),t.child=e.child,t.flags|=128,t=null):(Xo(),o=r.fallback,i=t.mode,r=Nv({mode:"visible",children:r.children},i),o=Pc(o,i,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,Zc(t,e.child,null,n),r=t.child,r.memoizedState=Xw(n),r.childLanes=Qw(e,s,n),t.memoizedState=Jw,t=vm(null,r));else if(Jo(t),DE(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var c=s.dgst;s=c,r=Error(J(419)),r.stack="",r.digest=s,_p({value:r,source:null,stack:null}),t=Zw(e,t,n)}else if(Tn||rh(e,t,n,!1),s=(n&e.childLanes)!==0,Tn||s){if(s=It,s!==null&&(r=HP(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ru(e,r),ai(s,e,r),qT;jE(o)||Dv(),t=Zw(e,t,n)}else jE(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ht=ea(o.nextSibling),fr=t,ct=!0,fl=null,Ji=!1,e!==null&&vF(t,e),t=SE(t,r.children),t.flags|=4096);return t}return i?(Xo(),o=r.fallback,i=t.mode,l=e.child,c=l.sibling,r=uo(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?o=uo(c,o):(o=Pc(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,vm(null,r),r=t.child,o=e.child.memoizedState,o===null?o=Xw(n):(i=o.cachePool,i!==null?(l=_n._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=SF(),o={baseLanes:o.baseLanes|n,cachePool:i}),r.memoizedState=o,r.childLanes=Qw(e,s,n),t.memoizedState=Jw,vm(e.child,r)):(Jo(t),n=e.child,e=n.sibling,n=uo(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function SE(e,t){return t=Nv({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Nv(e,t){return e=vi(22,e,null,t),e.lanes=0,e}function Zw(e,t,n){return Zc(t,e.child,null,n),e=SE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),lE(e.return,t,n)}function e1(e,t,n,r,i,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i,s.treeForkCount=a)}function m3(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var s=dn.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,Ft(dn,s),ar(e,t,r,n),r=ct?wp:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sM(e,n,t);else if(e.tag===19)sM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Cv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),e1(t,!1,i,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Cv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}e1(t,!0,n,null,a,r);break;case"together":e1(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function xo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Dl|=t.lanes,!(n&t.childLanes))if(e!==null){if(rh(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=uo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=uo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function VT(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&_v(e)))}function EJ(e,t,n){switch(t.tag){case 3:gv(t,t.stateNode.containerInfo),Wo(t,_n,e.memoizedState.cache),Xc();break;case 27:case 5:W_(t);break;case 4:gv(t,t.stateNode.containerInfo);break;case 10:Wo(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mE(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Jo(t),t.flags|=128,null):n&t.child.childLanes?h3(e,t,n):(Jo(t),e=xo(e,t,n),e!==null?e.sibling:null);Jo(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(rh(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return m3(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ft(dn,dn.current),r)break;return null;case 22:return t.lanes=0,d3(e,t,n,t.pendingProps);case 24:Wo(t,_n,e.memoizedState.cache)}return xo(e,t,n)}function p3(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Tn=!0;else{if(!VT(e,n)&&!(t.flags&128))return Tn=!1,EJ(e,t,n);Tn=!!(e.flags&131072)}else Tn=!1,ct&&t.flags&1048576&&bF(t,wp,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Ec(t.elementType),t.type=e,typeof e=="function")_T(e)?(r=tu(e,r),t.tag=1,t=iM(null,t,e,r,n)):(t.tag=0,t=xE(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===cT){t.tag=11,t=ZO(null,t,e,r,n);break e}else if(i===uT){t.tag=14,t=eM(null,t,e,r,n);break e}}throw t=G_(e)||e,Error(J(306,t,""))}}return t;case 0:return xE(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=tu(r,t.pendingProps),iM(e,t,r,i,n);case 3:e:{if(gv(t,t.stateNode.containerInfo),e===null)throw Error(J(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fE(e,t),Hm(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wo(t,_n,r),r!==a.cache&&cE(t,[_n],n,!0),Bm(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=aM(e,t,r,n);break e}else if(r!==i){i=Wi(Error(J(424)),t),_p(i),t=aM(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ht=ea(e.firstChild),fr=t,ct=!0,fl=null,Ji=!0,n=EF(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Xc(),r===i){t=xo(e,t,n);break e}ar(e,t,r,n)}t=t.child}return t;case 26:return Nb(e,t),e===null?(n=CM(t.type,null,t.pendingProps,null))?t.memoizedState=n:ct||(n=t.type,e=t.pendingProps,r=Lv(ul.current).createElement(n),r[ur]=t,r[si]=e,gr(r,n,e),Wn(r),t.stateNode=r):t.memoizedState=CM(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return W_(t),e===null&&ct&&(r=t.stateNode=a4(t.type,t.pendingProps,ul.current),fr=t,Ji=!0,i=Ht,Xl(t.type)?(IE=i,Ht=ea(r.firstChild)):Ht=i),ar(e,t,t.pendingProps.children,n),Nb(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ct&&((i=r=Ht)&&(r=eX(r,t.type,t.pendingProps,Ji),r!==null?(t.stateNode=r,fr=t,Ht=ea(r.firstChild),Ji=!1,i=!0):i=!1),i||Ml(t)),W_(t),i=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,r=a.children,OE(i,a)?r=null:s!==null&&OE(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=MT(e,t,pJ,null,null,n),Ap._currentValue=i),Nb(e,t),ar(e,t,r,n),t.child;case 6:return e===null&&ct&&((e=n=Ht)&&(n=tX(n,t.pendingProps,Ji),n!==null?(t.stateNode=n,fr=t,Ht=null,e=!0):e=!1),e||Ml(t)),null;case 13:return h3(e,t,n);case 4:return gv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zc(t,null,r,n):ar(e,t,r,n),t.child;case 11:return ZO(e,t,t.type,t.pendingProps,n);case 7:return ar(e,t,t.pendingProps,n),t.child;case 8:return ar(e,t,t.pendingProps.children,n),t.child;case 12:return ar(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wo(t,t.type,r.value),ar(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Qc(t),i=mr(i),r=r(i),t.flags|=1,ar(e,t,r,n),t.child;case 14:return eM(e,t,t.type,t.pendingProps,n);case 15:return f3(e,t,t.type,t.pendingProps,n);case 19:return m3(e,t,n);case 31:return _J(e,t,n);case 22:return d3(e,t,n,t.pendingProps);case 24:return Qc(t),r=mr(_n),e===null?(i=TT(),i===null&&(i=It,a=CT(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},AT(t),Wo(t,_n,i)):(e.lanes&n&&(fE(e,t),Hm(t,null,null,n),Bm()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Wo(t,_n,r)):(r=a.cache,Wo(t,_n,r),r!==i.cache&&cE(t,[_n],n,!0))),ar(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(J(156,t.tag))}function Is(e){e.flags|=4}function t1(e,t,n,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(P3())e.flags|=8192;else throw Uc=Ev,RT}else e.flags&=-16777217}function oM(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!l4(t))if(P3())e.flags|=8192;else throw Uc=Ev,RT}function Fy(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?FP():536870912,e.lanes|=t,Sd|=t)}function Wh(e,t){if(!ct)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kJ(e,t,n){var r=t.pendingProps;switch(kT(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(t),null;case 1:return Bt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),fo(_n),pd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Qu(t)?Is(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Kw())),Bt(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Is(t),a!==null?(Bt(t),oM(t,a)):(Bt(t),t1(t,i,null,r,n))):a?a!==e.memoizedState?(Is(t),Bt(t),oM(t,a)):(Bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Is(t),Bt(t),t1(t,i,e,r,n)),null;case 27:if(yv(t),n=ul.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Is(t);else{if(!r){if(t.stateNode===null)throw Error(J(166));return Bt(t),null}e=cs.current,Qu(t)?zO(t):(e=a4(i,r,n),t.stateNode=e,Is(t))}return Bt(t),null;case 5:if(yv(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Is(t);else{if(!r){if(t.stateNode===null)throw Error(J(166));return Bt(t),null}if(a=cs.current,Qu(t))zO(t);else{var s=Lv(ul.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":a=s.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?s.createElement(i,{is:r.is}):s.createElement(i)}}a[ur]=t,a[si]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;e:switch(gr(a,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Is(t)}}return Bt(t),t1(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Is(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(e=ul.current,Qu(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=fr,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ur]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||t4(e.nodeValue,n)),e||Ml(t,!0)}else e=Lv(e).createTextNode(r),e[ur]=t,t.stateNode=e}return Bt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Qu(t),n!==null){if(e===null){if(!r)throw Error(J(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(557));e[ur]=t}else Xc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bt(t),e=!1}else n=Kw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(gi(t),t):(gi(t),null);if(t.flags&128)throw Error(J(558))}return Bt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Qu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[ur]=t}else Xc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bt(t),i=!1}else i=Kw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(gi(t),t):(gi(t),null)}return gi(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fy(t,t.updateQueue),Bt(t),null);case 4:return pd(),e===null&&QT(t.stateNode.containerInfo),Bt(t),null;case 10:return fo(t.type),Bt(t),null;case 19:if(Jn(dn),r=t.memoizedState,r===null)return Bt(t),null;if(i=(t.flags&128)!==0,a=r.rendering,a===null)if(i)Wh(r,!1);else{if(an!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Cv(e),a!==null){for(t.flags|=128,Wh(r,!1),e=a.updateQueue,t.updateQueue=e,Fy(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gF(n,e),n=n.sibling;return Ft(dn,dn.current&1|2),ct&&Ws(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&_i()>Mv&&(t.flags|=128,i=!0,Wh(r,!1),t.lanes=4194304)}else{if(!i)if(e=Cv(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Fy(t,e),Wh(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!ct)return Bt(t),null}else 2*_i()-r.renderingStartTime>Mv&&n!==536870912&&(t.flags|=128,i=!0,Wh(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=_i(),e.sibling=null,n=dn.current,Ft(dn,i?n&1|2:n&1),ct&&Ws(t,r.treeForkCount),e):(Bt(t),null);case 22:case 23:return gi(t),NT(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bt(t),t.subtreeFlags&6&&(t.flags|=8192)):Bt(t),n=t.updateQueue,n!==null&&Fy(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Jn(Fc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fo(_n),Bt(t),null;case 25:return null;case 30:return null}throw Error(J(156,t.tag))}function CJ(e,t){switch(kT(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fo(_n),pd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return yv(t),null;case 31:if(t.memoizedState!==null){if(gi(t),t.alternate===null)throw Error(J(340));Xc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(gi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Xc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jn(dn),null;case 4:return pd(),null;case 10:return fo(t.type),null;case 22:case 23:return gi(t),NT(),e!==null&&Jn(Fc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fo(_n),null;case 25:return null;default:return null}}function g3(e,t){switch(kT(t),t.tag){case 3:fo(_n),pd();break;case 26:case 27:case 5:yv(t);break;case 4:pd();break;case 31:t.memoizedState!==null&&gi(t);break;case 13:gi(t);break;case 19:Jn(dn);break;case 10:fo(t.type);break;case 22:case 23:gi(t),NT(),e!==null&&Jn(Fc);break;case 24:fo(_n)}}function kg(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,s=n.inst;r=a(),s.destroy=r}n=n.next}while(n!==i)}}catch(o){_t(t,t.return,o)}}function jl(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var s=r.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,i=t;var l=n,c=o;try{c()}catch(f){_t(i,l,f)}}}r=r.next}while(r!==a)}}catch(f){_t(t,t.return,f)}}function y3(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{CF(t,n)}catch(r){_t(e,e.return,r)}}}function b3(e,t,n){n.props=tu(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){_t(e,t,r)}}function Vm(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){_t(e,t,i)}}function ns(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){_t(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){_t(e,t,i)}else n.current=null}function v3(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){_t(e,e.return,i)}}function n1(e,t,n){try{var r=e.stateNode;YJ(r,e.type,n,t),r[si]=t}catch(i){_t(e,e.return,i)}}function x3(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xl(e.type)||e.tag===4}function r1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||x3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wE(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=to));else if(r!==4&&(r===27&&Xl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(wE(e,t,n),e=e.sibling;e!==null;)wE(e,t,n),e=e.sibling}function Ov(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Xl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ov(e,t,n),e=e.sibling;e!==null;)Ov(e,t,n),e=e.sibling}function S3(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);gr(t,r,n),t[ur]=e,t[si]=n}catch(a){_t(e,e.return,a)}}var Xs=!1,wn=!1,i1=!1,lM=typeof WeakSet=="function"?WeakSet:Set,Yn=null;function TJ(e,t){if(e=e.containerInfo,AE=Bv,e=lF(e),xT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,c=0,f=0,u=e,d=null;t:for(;;){for(var h;u!==n||i!==0&&u.nodeType!==3||(o=s+i),u!==a||r!==0&&u.nodeType!==3||(l=s+r),u.nodeType===3&&(s+=u.nodeValue.length),(h=u.firstChild)!==null;)d=u,u=h;for(;;){if(u===e)break t;if(d===n&&++c===i&&(o=s),d===a&&++f===r&&(l=s),(h=u.nextSibling)!==null)break;u=d,d=u.parentNode}u=h}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(NE={focusedElem:e,selectionRange:n},Bv=!1,Yn=t;Yn!==null;)if(t=Yn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Yn=e;else for(;Yn!==null;){switch(t=Yn,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var p=tu(n.type,i);e=r.getSnapshotBeforeUpdate(p,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(b){_t(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ME(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ME(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(J(163))}if(e=t.sibling,e!==null){e.return=t.return,Yn=e;break}Yn=t.return}}function w3(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:$s(e,n),r&4&&kg(5,n);break;case 1:if($s(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){_t(n,n.return,s)}else{var i=tu(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){_t(n,n.return,s)}}r&64&&y3(n),r&512&&Vm(n,n.return);break;case 3:if($s(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{CF(e,t)}catch(s){_t(n,n.return,s)}}break;case 27:t===null&&r&4&&S3(n);case 26:case 5:$s(e,n),t===null&&r&4&&v3(n),r&512&&Vm(n,n.return);break;case 12:$s(e,n);break;case 31:$s(e,n),r&4&&k3(e,n);break;case 13:$s(e,n),r&4&&C3(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=zJ.bind(null,n),nX(e,n))));break;case 22:if(r=n.memoizedState!==null||Xs,!r){t=t!==null&&t.memoizedState!==null||wn,i=Xs;var a=wn;Xs=r,(wn=t)&&!a?Bs(e,n,(n.subtreeFlags&8772)!==0):$s(e,n),Xs=i,wn=a}break;case 30:break;default:$s(e,n)}}function _3(e){var t=e.alternate;t!==null&&(e.alternate=null,_3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mT(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Xt=null,Zr=!1;function zs(e,t,n){for(n=n.child;n!==null;)E3(e,t,n),n=n.sibling}function E3(e,t,n){if(Ei&&typeof Ei.onCommitFiberUnmount=="function")try{Ei.onCommitFiberUnmount(bg,n)}catch{}switch(n.tag){case 26:wn||ns(n,t),zs(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:wn||ns(n,t);var r=Xt,i=Zr;Xl(n.type)&&(Xt=n.stateNode,Zr=!1),zs(e,t,n),Wm(n.stateNode),Xt=r,Zr=i;break;case 5:wn||ns(n,t);case 6:if(r=Xt,i=Zr,Xt=null,zs(e,t,n),Xt=r,Zr=i,Xt!==null)if(Zr)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(n.stateNode)}catch(a){_t(n,t,a)}else try{Xt.removeChild(n.stateNode)}catch(a){_t(n,t,a)}break;case 18:Xt!==null&&(Zr?(e=Xt,SM(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),kd(e)):SM(Xt,n.stateNode));break;case 4:r=Xt,i=Zr,Xt=n.stateNode.containerInfo,Zr=!0,zs(e,t,n),Xt=r,Zr=i;break;case 0:case 11:case 14:case 15:jl(2,n,t),wn||jl(4,n,t),zs(e,t,n);break;case 1:wn||(ns(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&b3(n,t,r)),zs(e,t,n);break;case 21:zs(e,t,n);break;case 22:wn=(r=wn)||n.memoizedState!==null,zs(e,t,n),wn=r;break;default:zs(e,t,n)}}function k3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{kd(e)}catch(n){_t(t,t.return,n)}}}function C3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{kd(e)}catch(n){_t(t,t.return,n)}}function RJ(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lM),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lM),t;default:throw Error(J(435,e.tag))}}function Uy(e,t){var n=RJ(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var i=$J.bind(null,e,r);r.then(i,i)}})}function Jr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Xl(o.type)){Xt=o.stateNode,Zr=!1;break e}break;case 5:Xt=o.stateNode,Zr=!1;break e;case 3:case 4:Xt=o.stateNode.containerInfo,Zr=!0;break e}o=o.return}if(Xt===null)throw Error(J(160));E3(a,s,i),Xt=null,Zr=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)T3(t,e),t=t.sibling}var ba=null;function T3(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jr(t,e),Xr(e),r&4&&(jl(3,e,e.return),kg(3,e),jl(5,e,e.return));break;case 1:Jr(t,e),Xr(e),r&512&&(wn||n===null||ns(n,n.return)),r&64&&Xs&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=ba;if(Jr(t,e),Xr(e),r&512&&(wn||n===null||ns(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":a=i.getElementsByTagName("title")[0],(!a||a[Sg]||a[ur]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),gr(a,r,n),a[ur]=e,Wn(a),r=a;break e;case"link":var s=RM("link","href",i).get(r+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(a=s[o],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}a=i.createElement(r),gr(a,r,n),i.head.appendChild(a);break;case"meta":if(s=RM("meta","content",i).get(r+(n.content||""))){for(o=0;o<s.length;o++)if(a=s[o],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}a=i.createElement(r),gr(a,r,n),i.head.appendChild(a);break;default:throw Error(J(468,r))}a[ur]=e,Wn(a),r=a}e.stateNode=r}else AM(i,e.type,e.stateNode);else e.stateNode=TM(i,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?AM(i,e.type,e.stateNode):TM(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&n1(e,e.memoizedProps,n.memoizedProps)}break;case 27:Jr(t,e),Xr(e),r&512&&(wn||n===null||ns(n,n.return)),n!==null&&r&4&&n1(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Jr(t,e),Xr(e),r&512&&(wn||n===null||ns(n,n.return)),e.flags&32){i=e.stateNode;try{yd(i,"")}catch(p){_t(e,e.return,p)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,n1(e,i,n!==null?n.memoizedProps:i)),r&1024&&(i1=!0);break;case 6:if(Jr(t,e),Xr(e),r&4){if(e.stateNode===null)throw Error(J(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){_t(e,e.return,p)}}break;case 3:if(jb=null,i=ba,ba=Pv(t.containerInfo),Jr(t,e),ba=i,Xr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kd(t.containerInfo)}catch(p){_t(e,e.return,p)}i1&&(i1=!1,R3(e));break;case 4:r=ba,ba=Pv(e.stateNode.containerInfo),Jr(t,e),Xr(e),ba=r;break;case 12:Jr(t,e),Xr(e);break;case 31:Jr(t,e),Xr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Uy(e,r)));break;case 13:Jr(t,e),Xr(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(T0=_i()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Uy(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Xs,f=wn;if(Xs=c||i,wn=f||l,Jr(t,e),wn=f,Xs=c,Xr(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Xs||wn||kc(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var u=l.memoizedProps.style,d=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(p){_t(l,l.return,p)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(p){_t(l,l.return,p)}}}else if(t.tag===18){if(n===null){l=t;try{var h=l.stateNode;i?wM(h,!0):wM(l.stateNode,!1)}catch(p){_t(l,l.return,p)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Uy(e,n))));break;case 19:Jr(t,e),Xr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Uy(e,r)));break;case 30:break;case 21:break;default:Jr(t,e),Xr(e)}}function Xr(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(x3(r)){n=r;break}r=r.return}if(n==null)throw Error(J(160));switch(n.tag){case 27:var i=n.stateNode,a=r1(e);Ov(e,a,i);break;case 5:var s=n.stateNode;n.flags&32&&(yd(s,""),n.flags&=-33);var o=r1(e);Ov(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,c=r1(e);wE(e,c,l);break;default:throw Error(J(161))}}catch(f){_t(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function R3(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;R3(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $s(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)w3(e,t.alternate,t),t=t.sibling}function kc(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:jl(4,t,t.return),kc(t);break;case 1:ns(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&b3(t,t.return,n),kc(t);break;case 27:Wm(t.stateNode);case 26:case 5:ns(t,t.return),kc(t);break;case 22:t.memoizedState===null&&kc(t);break;case 30:kc(t);break;default:kc(t)}e=e.sibling}}function Bs(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,s=a.flags;switch(a.tag){case 0:case 11:case 15:Bs(i,a,n),kg(4,a);break;case 1:if(Bs(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){_t(r,r.return,c)}if(r=a,i=r.updateQueue,i!==null){var o=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)kF(l[i],o)}catch(c){_t(r,r.return,c)}}n&&s&64&&y3(a),Vm(a,a.return);break;case 27:S3(a);case 26:case 5:Bs(i,a,n),n&&r===null&&s&4&&v3(a),Vm(a,a.return);break;case 12:Bs(i,a,n);break;case 31:Bs(i,a,n),n&&s&4&&k3(i,a);break;case 13:Bs(i,a,n),n&&s&4&&C3(i,a);break;case 22:a.memoizedState===null&&Bs(i,a,n),Vm(a,a.return);break;case 30:break;default:Bs(i,a,n)}t=t.sibling}}function KT(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&_g(n))}function GT(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_g(e))}function ma(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)A3(e,t,n,r),t=t.sibling}function A3(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:ma(e,t,n,r),i&2048&&kg(9,t);break;case 1:ma(e,t,n,r);break;case 3:ma(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_g(e)));break;case 12:if(i&2048){ma(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,s=a.id,o=a.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){_t(t,t.return,l)}}else ma(e,t,n,r);break;case 31:ma(e,t,n,r);break;case 13:ma(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,t.memoizedState!==null?a._visibility&2?ma(e,t,n,r):Km(e,t):a._visibility&2?ma(e,t,n,r):(a._visibility|=2,hf(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&KT(s,t);break;case 24:ma(e,t,n,r),i&2048&&GT(t.alternate,t);break;default:ma(e,t,n,r)}}function hf(e,t,n,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,s=t,o=n,l=r,c=s.flags;switch(s.tag){case 0:case 11:case 15:hf(a,s,o,l,i),kg(8,s);break;case 23:break;case 22:var f=s.stateNode;s.memoizedState!==null?f._visibility&2?hf(a,s,o,l,i):Km(a,s):(f._visibility|=2,hf(a,s,o,l,i)),i&&c&2048&&KT(s.alternate,s);break;case 24:hf(a,s,o,l,i),i&&c&2048&&GT(s.alternate,s);break;default:hf(a,s,o,l,i)}t=t.sibling}}function Km(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Km(n,r),i&2048&&KT(r.alternate,r);break;case 24:Km(n,r),i&2048&&GT(r.alternate,r);break;default:Km(n,r)}t=t.sibling}}var xm=8192;function Zu(e,t,n){if(e.subtreeFlags&xm)for(e=e.child;e!==null;)N3(e,t,n),e=e.sibling}function N3(e,t,n){switch(e.tag){case 26:Zu(e,t,n),e.flags&xm&&e.memoizedState!==null&&mX(n,ba,e.memoizedState,e.memoizedProps);break;case 5:Zu(e,t,n);break;case 3:case 4:var r=ba;ba=Pv(e.stateNode.containerInfo),Zu(e,t,n),ba=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=xm,xm=16777216,Zu(e,t,n),xm=r):Zu(e,t,n));break;default:Zu(e,t,n)}}function O3(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Jh(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yn=r,j3(r,e)}O3(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)M3(e),e=e.sibling}function M3(e){switch(e.tag){case 0:case 11:case 15:Jh(e),e.flags&2048&&jl(9,e,e.return);break;case 3:Jh(e);break;case 12:Jh(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ob(e)):Jh(e);break;default:Jh(e)}}function Ob(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yn=r,j3(r,e)}O3(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),Ob(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ob(t));break;default:Ob(t)}e=e.sibling}}function j3(e,t){for(;Yn!==null;){var n=Yn;switch(n.tag){case 0:case 11:case 15:jl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:_g(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Yn=r;else e:for(n=e;Yn!==null;){r=Yn;var i=r.sibling,a=r.return;if(_3(r),r===n){Yn=null;break e}if(i!==null){i.return=a,Yn=i;break e}Yn=a}}}var AJ={getCacheForType:function(e){var t=mr(_n),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return mr(_n).controller.signal}},NJ=typeof WeakMap=="function"?WeakMap:Map,pt=0,It=null,it=null,ot=0,St=0,mi=null,rl=!1,ah=!1,YT=!1,So=0,an=0,Dl=0,Bc=0,WT=0,Si=0,Sd=0,Gm=null,ei=null,_E=!1,T0=0,D3=0,Mv=1/0,jv=null,ml=null,$n=0,pl=null,wd=null,ho=0,EE=0,kE=null,I3=null,Ym=0,CE=null;function Ci(){return pt&2&&ot!==0?ot&-ot:Pe.T!==null?XT():qP()}function z3(){if(Si===0)if(!(ot&536870912)||ct){var e=jy;jy<<=1,!(jy&3932160)&&(jy=262144),Si=e}else Si=536870912;return e=Mi.current,e!==null&&(e.flags|=32),Si}function ai(e,t,n){(e===It&&(St===2||St===9)||e.cancelPendingCommit!==null)&&(_d(e,0),il(e,ot,Si,!1)),xg(e,n),(!(pt&2)||e!==It)&&(e===It&&(!(pt&2)&&(Bc|=n),an===4&&il(e,ot,Si,!1)),_s(e))}function $3(e,t,n){if(pt&6)throw Error(J(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||vg(e,t),i=r?jJ(e,t):a1(e,t,!0),a=r;do{if(i===0){ah&&!r&&il(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!OJ(n)){i=a1(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;i=Gm;var l=o.current.memoizedState.isDehydrated;if(l&&(_d(o,s).flags|=256),s=a1(o,s,!1),s!==2){if(YT&&!l){o.errorRecoveryDisabledLanes|=a,Bc|=a,i=4;break e}a=ei,ei=i,a!==null&&(ei===null?ei=a:ei.push.apply(ei,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){_d(e,0),il(e,t,0,!0);break}e:{switch(r=e,a=i,a){case 0:case 1:throw Error(J(345));case 4:if((t&4194048)!==t)break;case 6:il(r,t,Si,!rl);break e;case 2:ei=null;break;case 3:case 5:break;default:throw Error(J(329))}if((t&62914560)===t&&(i=T0+300-_i(),10<i)){if(il(r,t,Si,!rl),g0(r,0,!0)!==0)break e;ho=t,r.timeoutHandle=r4(cM.bind(null,r,n,ei,jv,_E,t,Si,Bc,Sd,rl,a,"Throttled",-0,0),i);break e}cM(r,n,ei,jv,_E,t,Si,Bc,Sd,rl,a,null,-0,0)}}break}while(!0);_s(e)}function cM(e,t,n,r,i,a,s,o,l,c,f,u,d,h){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:to},N3(t,a,u);var p=(a&62914560)===a?T0-_i():(a&4194048)===a?D3-_i():0;if(p=pX(u,p),p!==null){ho=a,e.cancelPendingCommit=p(fM.bind(null,e,t,a,n,r,i,s,o,l,f,u,null,d,h)),il(e,a,s,!c);return}}fM(e,t,a,n,r,i,s,o,l)}function OJ(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Oi(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function il(e,t,n,r){t&=~WT,t&=~Bc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ki(i),s=1<<a;r[a]=-1,i&=~s}n!==0&&UP(e,n,t)}function R0(){return pt&6?!0:(Cg(0),!1)}function JT(){if(it!==null){if(St===0)var e=it.return;else e=it,no=Au=null,IT(e),Jf=null,Ep=0,e=it;for(;e!==null;)g3(e.alternate,e),e=e.return;it=null}}function _d(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,XJ(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ho=0,JT(),It=e,it=n=uo(e.current,null),ot=t,St=0,mi=null,rl=!1,ah=vg(e,t),YT=!1,Sd=Si=WT=Bc=Dl=an=0,ei=Gm=null,_E=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ki(r),a=1<<i;t|=e[i],r&=~a}return So=t,x0(),n}function L3(e,t){Ye=null,Pe.H=Cp,t===ih||t===w0?(t=UO(),St=3):t===RT?(t=UO(),St=4):St=t===qT?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,mi=t,it===null&&(an=1,Av(e,Wi(t,e.current)))}function P3(){var e=Mi.current;return e===null?!0:(ot&4194048)===ot?Zi===null:(ot&62914560)===ot||ot&536870912?e===Zi:!1}function F3(){var e=Pe.H;return Pe.H=Cp,e===null?Cp:e}function U3(){var e=Pe.A;return Pe.A=AJ,e}function Dv(){an=4,rl||(ot&4194048)!==ot&&Mi.current!==null||(ah=!0),!(Dl&134217727)&&!(Bc&134217727)||It===null||il(It,ot,Si,!1)}function a1(e,t,n){var r=pt;pt|=2;var i=F3(),a=U3();(It!==e||ot!==t)&&(jv=null,_d(e,t)),t=!1;var s=an;e:do try{if(St!==0&&it!==null){var o=it,l=mi;switch(St){case 8:JT(),s=6;break e;case 3:case 2:case 9:case 6:Mi.current===null&&(t=!0);var c=St;if(St=0,mi=null,$f(e,o,l,c),n&&ah){s=0;break e}break;default:c=St,St=0,mi=null,$f(e,o,l,c)}}MJ(),s=an;break}catch(f){L3(e,f)}while(!0);return t&&e.shellSuspendCounter++,no=Au=null,pt=r,Pe.H=i,Pe.A=a,it===null&&(It=null,ot=0,x0()),s}function MJ(){for(;it!==null;)B3(it)}function jJ(e,t){var n=pt;pt|=2;var r=F3(),i=U3();It!==e||ot!==t?(jv=null,Mv=_i()+500,_d(e,t)):ah=vg(e,t);e:do try{if(St!==0&&it!==null){t=it;var a=mi;t:switch(St){case 1:St=0,mi=null,$f(e,t,a,1);break;case 2:case 9:if(FO(a)){St=0,mi=null,uM(t);break}t=function(){St!==2&&St!==9||It!==e||(St=7),_s(e)},a.then(t,t);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:FO(a)?(St=0,mi=null,uM(t)):(St=0,mi=null,$f(e,t,a,7));break;case 5:var s=null;switch(it.tag){case 26:s=it.memoizedState;case 5:case 27:var o=it;if(s?l4(s):o.stateNode.complete){St=0,mi=null;var l=o.sibling;if(l!==null)it=l;else{var c=o.return;c!==null?(it=c,A0(c)):it=null}break t}}St=0,mi=null,$f(e,t,a,5);break;case 6:St=0,mi=null,$f(e,t,a,6);break;case 8:JT(),an=6;break e;default:throw Error(J(462))}}DJ();break}catch(f){L3(e,f)}while(!0);return no=Au=null,Pe.H=r,Pe.A=i,pt=n,it!==null?0:(It=null,ot=0,x0(),an)}function DJ(){for(;it!==null&&!rW();)B3(it)}function B3(e){var t=p3(e.alternate,e,So);e.memoizedProps=e.pendingProps,t===null?A0(e):it=t}function uM(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=rM(n,t,t.pendingProps,t.type,void 0,ot);break;case 11:t=rM(n,t,t.pendingProps,t.type.render,t.ref,ot);break;case 5:IT(t);default:g3(n,t),t=it=gF(t,So),t=p3(n,t,So)}e.memoizedProps=e.pendingProps,t===null?A0(e):it=t}function $f(e,t,n,r){no=Au=null,IT(t),Jf=null,Ep=0;var i=t.return;try{if(wJ(e,i,t,n,ot)){an=1,Av(e,Wi(n,e.current)),it=null;return}}catch(a){if(i!==null)throw it=i,a;an=1,Av(e,Wi(n,e.current)),it=null;return}t.flags&32768?(ct||r===1?e=!0:ah||ot&536870912?e=!1:(rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mi.current,r!==null&&r.tag===13&&(r.flags|=16384))),H3(t,e)):A0(t)}function A0(e){var t=e;do{if(t.flags&32768){H3(t,rl);return}e=t.return;var n=kJ(t.alternate,t,So);if(n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);an===0&&(an=5)}function H3(e,t){do{var n=CJ(e.alternate,e);if(n!==null){n.flags&=32767,it=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){it=e;return}it=e=n}while(e!==null);an=6,it=null}function fM(e,t,n,r,i,a,s,o,l){e.cancelPendingCommit=null;do N0();while($n!==0);if(pt&6)throw Error(J(327));if(t!==null){if(t===e.current)throw Error(J(177));if(a=t.lanes|t.childLanes,a|=ST,hW(e,n,a,s,o,l),e===It&&(it=It=null,ot=0),wd=t,pl=e,ho=n,EE=a,kE=i,I3=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,LJ(bv,function(){return Y3(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Pe.T,Pe.T=null,i=gt.p,gt.p=2,s=pt,pt|=4;try{TJ(e,t,n)}finally{pt=s,gt.p=i,Pe.T=r}}$n=1,q3(),V3(),K3()}}function q3(){if($n===1){$n=0;var e=pl,t=wd,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Pe.T,Pe.T=null;var r=gt.p;gt.p=2;var i=pt;pt|=4;try{T3(t,e);var a=NE,s=lF(e.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&oF(o.ownerDocument.documentElement,o)){if(l!==null&&xT(o)){var c=l.start,f=l.end;if(f===void 0&&(f=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(f,o.value.length);else{var u=o.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var h=d.getSelection(),p=o.textContent.length,b=Math.min(l.start,p),x=l.end===void 0?b:Math.min(l.end,p);!h.extend&&b>x&&(s=x,x=b,b=s);var g=jO(o,b),v=jO(o,x);if(g&&v&&(h.rangeCount!==1||h.anchorNode!==g.node||h.anchorOffset!==g.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var w=u.createRange();w.setStart(g.node,g.offset),h.removeAllRanges(),b>x?(h.addRange(w),h.extend(v.node,v.offset)):(w.setEnd(v.node,v.offset),h.addRange(w))}}}}for(u=[],h=o;h=h.parentNode;)h.nodeType===1&&u.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<u.length;o++){var E=u[o];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}Bv=!!AE,NE=AE=null}finally{pt=i,gt.p=r,Pe.T=n}}e.current=t,$n=2}}function V3(){if($n===2){$n=0;var e=pl,t=wd,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Pe.T,Pe.T=null;var r=gt.p;gt.p=2;var i=pt;pt|=4;try{w3(e,t.alternate,t)}finally{pt=i,gt.p=r,Pe.T=n}}$n=3}}function K3(){if($n===4||$n===3){$n=0,iW();var e=pl,t=wd,n=ho,r=I3;t.subtreeFlags&10256||t.flags&10256?$n=5:($n=0,wd=pl=null,G3(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ml=null),hT(n),t=t.stateNode,Ei&&typeof Ei.onCommitFiberRoot=="function")try{Ei.onCommitFiberRoot(bg,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Pe.T,i=gt.p,gt.p=2,Pe.T=null;try{for(var a=e.onRecoverableError,s=0;s<r.length;s++){var o=r[s];a(o.value,{componentStack:o.stack})}}finally{Pe.T=t,gt.p=i}}ho&3&&N0(),_s(e),i=e.pendingLanes,n&261930&&i&42?e===CE?Ym++:(Ym=0,CE=e):Ym=0,Cg(0)}}function G3(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_g(t)))}function N0(){return q3(),V3(),K3(),Y3()}function Y3(){if($n!==5)return!1;var e=pl,t=EE;EE=0;var n=hT(ho),r=Pe.T,i=gt.p;try{gt.p=32>n?32:n,Pe.T=null,n=kE,kE=null;var a=pl,s=ho;if($n=0,wd=pl=null,ho=0,pt&6)throw Error(J(331));var o=pt;if(pt|=4,M3(a.current),A3(a,a.current,s,n),pt=o,Cg(0,!1),Ei&&typeof Ei.onPostCommitFiberRoot=="function")try{Ei.onPostCommitFiberRoot(bg,a)}catch{}return!0}finally{gt.p=i,Pe.T=r,G3(e,t)}}function dM(e,t,n){t=Wi(n,t),t=vE(e.stateNode,t,2),e=hl(e,t,2),e!==null&&(xg(e,2),_s(e))}function _t(e,t,n){if(e.tag===3)dM(e,e,n);else for(;t!==null;){if(t.tag===3){dM(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ml===null||!ml.has(r))){e=Wi(n,e),n=c3(2),r=hl(t,n,2),r!==null&&(u3(n,r,t,e),xg(r,2),_s(r));break}}t=t.return}}function s1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new NJ;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(YT=!0,i.add(n),e=IJ.bind(null,e,t,n),t.then(e,e))}function IJ(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,It===e&&(ot&n)===n&&(an===4||an===3&&(ot&62914560)===ot&&300>_i()-T0?!(pt&2)&&_d(e,0):WT|=n,Sd===ot&&(Sd=0)),_s(e)}function W3(e,t){t===0&&(t=FP()),e=Ru(e,t),e!==null&&(xg(e,t),_s(e))}function zJ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W3(e,n)}function $J(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(J(314))}r!==null&&r.delete(t),W3(e,n)}function LJ(e,t){return fT(e,t)}var Iv=null,mf=null,TE=!1,zv=!1,o1=!1,al=0;function _s(e){e!==mf&&e.next===null&&(mf===null?Iv=mf=e:mf=mf.next=e),zv=!0,TE||(TE=!0,FJ())}function Cg(e,t){if(!o1&&zv){o1=!0;do for(var n=!1,r=Iv;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var s=r.suspendedLanes,o=r.pingedLanes;a=(1<<31-ki(42|e)+1)-1,a&=i&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,hM(r,a))}else a=ot,a=g0(r,r===It?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||vg(r,a)||(n=!0,hM(r,a));r=r.next}while(n);o1=!1}}function PJ(){J3()}function J3(){zv=TE=!1;var e=0;al!==0&&JJ()&&(e=al);for(var t=_i(),n=null,r=Iv;r!==null;){var i=r.next,a=X3(r,t);a===0?(r.next=null,n===null?Iv=i:n.next=i,i===null&&(mf=n)):(n=r,(e!==0||a&3)&&(zv=!0)),r=i}$n!==0&&$n!==5||Cg(e),al!==0&&(al=0)}function X3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var s=31-ki(a),o=1<<s,l=i[s];l===-1?(!(o&n)||o&r)&&(i[s]=dW(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}if(t=It,n=ot,n=g0(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(St===2||St===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Iw(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||vg(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Iw(r),hT(n)){case 2:case 8:n=LP;break;case 32:n=bv;break;case 268435456:n=PP;break;default:n=bv}return r=Q3.bind(null,e),n=fT(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Iw(r),e.callbackPriority=2,e.callbackNode=null,2}function Q3(e,t){if($n!==0&&$n!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(N0()&&e.callbackNode!==n)return null;var r=ot;return r=g0(e,e===It?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:($3(e,r,t),X3(e,_i()),e.callbackNode!=null&&e.callbackNode===n?Q3.bind(null,e):null)}function hM(e,t){if(N0())return null;$3(e,t,!0)}function FJ(){QJ(function(){pt&6?fT($P,PJ):J3()})}function XT(){if(al===0){var e=bd;e===0&&(e=My,My<<=1,!(My&261888)&&(My=256)),al=e}return al}function mM(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wb(""+e)}function pM(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function UJ(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var a=mM((i[si]||null).action),s=r.submitter;s&&(t=(t=s[si]||null)?mM(t.formAction):s.getAttribute("formAction"),t!==null&&(a=t,s=null));var o=new y0("action","action",null,r,i);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(al!==0){var l=s?pM(i,s):new FormData(i);yE(n,{pending:!0,data:l,method:i.method,action:a},null,l)}}else typeof a=="function"&&(o.preventDefault(),l=s?pM(i,s):new FormData(i),yE(n,{pending:!0,data:l,method:i.method,action:a},a,l))},currentTarget:i}]})}}for(var l1=0;l1<aE.length;l1++){var c1=aE[l1],BJ=c1.toLowerCase(),HJ=c1[0].toUpperCase()+c1.slice(1);Pa(BJ,"on"+HJ)}Pa(uF,"onAnimationEnd");Pa(fF,"onAnimationIteration");Pa(dF,"onAnimationStart");Pa("dblclick","onDoubleClick");Pa("focusin","onFocus");Pa("focusout","onBlur");Pa(aJ,"onTransitionRun");Pa(sJ,"onTransitionStart");Pa(oJ,"onTransitionCancel");Pa(hF,"onTransitionEnd");gd("onMouseEnter",["mouseout","mouseover"]);gd("onMouseLeave",["mouseout","mouseover"]);gd("onPointerEnter",["pointerout","pointerover"]);gd("onPointerLeave",["pointerout","pointerover"]);ku("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ku("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ku("onBeforeInput",["compositionend","keypress","textInput","paste"]);ku("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ku("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ku("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tp="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(" "),qJ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tp));function Z3(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var o=r[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&i.isPropagationStopped())break e;a=o,i.currentTarget=c;try{a(i)}catch(f){xv(f)}i.currentTarget=null,a=l}else for(s=0;s<r.length;s++){if(o=r[s],l=o.instance,c=o.currentTarget,o=o.listener,l!==a&&i.isPropagationStopped())break e;a=o,i.currentTarget=c;try{a(i)}catch(f){xv(f)}i.currentTarget=null,a=l}}}}function rt(e,t){var n=t[X_];n===void 0&&(n=t[X_]=new Set);var r=e+"__bubble";n.has(r)||(e4(t,e,2,!1),n.add(r))}function u1(e,t,n){var r=0;t&&(r|=4),e4(n,e,r,t)}var By="_reactListening"+Math.random().toString(36).slice(2);function QT(e){if(!e[By]){e[By]=!0,VP.forEach(function(n){n!=="selectionchange"&&(qJ.has(n)||u1(n,!1,e),u1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[By]||(t[By]=!0,u1("selectionchange",!1,t))}}function e4(e,t,n,r){switch(h4(t)){case 2:var i=bX;break;case 8:i=vX;break;default:i=nR}n=i.bind(null,t,n,e),i=void 0,!nE||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function f1(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;o!==null;){if(s=Rf(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue e}o=o.parentNode}}r=r.return}ZP(function(){var c=a,f=gT(n),u=[];e:{var d=mF.get(e);if(d!==void 0){var h=y0,p=e;switch(e){case"keypress":if(Eb(n)===0)break e;case"keydown":case"keyup":h=$W;break;case"focusin":p="focus",h=Fw;break;case"focusout":p="blur",h=Fw;break;case"beforeblur":case"afterblur":h=Fw;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=_O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=kW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=FW;break;case uF:case fF:case dF:h=RW;break;case hF:h=BW;break;case"scroll":case"scrollend":h=_W;break;case"wheel":h=qW;break;case"copy":case"cut":case"paste":h=NW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=kO;break;case"toggle":case"beforetoggle":h=KW}var b=(t&4)!==0,x=!b&&(e==="scroll"||e==="scrollend"),g=b?d!==null?d+"Capture":null:d;b=[];for(var v=c,w;v!==null;){var E=v;if(w=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||w===null||g===null||(E=vp(v,g),E!=null&&b.push(Rp(v,E,w))),x)break;v=v.return}0<b.length&&(d=new h(d,p,null,n,f),u.push({event:d,listeners:b}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==tE&&(p=n.relatedTarget||n.fromElement)&&(Rf(p)||p[th]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?Rf(p):null,p!==null&&(x=yg(p),b=p.tag,p!==x||b!==5&&b!==27&&b!==6)&&(p=null)):(h=null,p=c),h!==p)){if(b=_O,E="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=kO,E="onPointerLeave",g="onPointerEnter",v="pointer"),x=h==null?d:bm(h),w=p==null?d:bm(p),d=new b(E,v+"leave",h,n,f),d.target=x,d.relatedTarget=w,E=null,Rf(f)===c&&(b=new b(g,v+"enter",p,n,f),b.target=w,b.relatedTarget=x,E=b),x=E,h&&p)t:{for(b=VJ,g=h,v=p,w=0,E=g;E;E=b(E))w++;E=0;for(var C=v;C;C=b(C))E++;for(;0<w-E;)g=b(g),w--;for(;0<E-w;)v=b(v),E--;for(;w--;){if(g===v||v!==null&&g===v.alternate){b=g;break t}g=b(g),v=b(v)}b=null}else b=null;h!==null&&gM(u,d,h,b,!1),p!==null&&x!==null&&gM(u,x,p,b,!0)}}e:{if(d=c?bm(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var k=AO;else if(RO(d))if(aF)k=nJ;else{k=eJ;var _=ZW}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&pT(c.elementType)&&(k=AO):k=tJ;if(k&&(k=k(e,c))){iF(u,k,n,f);break e}_&&_(e,d,c),e==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&eE(d,"number",d.value)}switch(_=c?bm(c):window,e){case"focusin":(RO(_)||_.contentEditable==="true")&&(Of=_,rE=c,Pm=null);break;case"focusout":Pm=rE=Of=null;break;case"mousedown":iE=!0;break;case"contextmenu":case"mouseup":case"dragend":iE=!1,DO(u,n,f);break;case"selectionchange":if(iJ)break;case"keydown":case"keyup":DO(u,n,f)}var A;if(vT)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Nf?nF(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(tF&&n.locale!=="ko"&&(Nf||D!=="onCompositionStart"?D==="onCompositionEnd"&&Nf&&(A=eF()):(nl=f,yT="value"in nl?nl.value:nl.textContent,Nf=!0)),_=$v(c,D),0<_.length&&(D=new EO(D,e,null,n,f),u.push({event:D,listeners:_}),A?D.data=A:(A=rF(n),A!==null&&(D.data=A)))),(A=YW?WW(e,n):JW(e,n))&&(D=$v(c,"onBeforeInput"),0<D.length&&(_=new EO("onBeforeInput","beforeinput",null,n,f),u.push({event:_,listeners:D}),_.data=A)),UJ(u,e,c,n,f)}Z3(u,t)})}function Rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $v(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=vp(e,n),i!=null&&r.unshift(Rp(e,i,a)),i=vp(e,t),i!=null&&r.push(Rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function VJ(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gM(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===r)break;o!==5&&o!==26&&o!==27||c===null||(l=c,i?(c=vp(n,a),c!=null&&s.unshift(Rp(n,c,l))):i||(c=vp(n,a),c!=null&&s.push(Rp(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var KJ=/\r\n?/g,GJ=/\u0000|\uFFFD/g;function yM(e){return(typeof e=="string"?e:""+e).replace(KJ,`
49
+ `).replace(GJ,"")}function t4(e,t){return t=yM(t),yM(e)===t}function At(e,t,n,r,i,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||yd(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&yd(e,""+r);break;case"className":Iy(e,"class",r);break;case"tabIndex":Iy(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Iy(e,n,r);break;case"style":QP(e,r,a);break;case"data":if(t!=="object"){Iy(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=wb(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 a=="function"&&(n==="formAction"?(t!=="input"&&At(e,t,"name",i.name,i,null),At(e,t,"formEncType",i.formEncType,i,null),At(e,t,"formMethod",i.formMethod,i,null),At(e,t,"formTarget",i.formTarget,i,null)):(At(e,t,"encType",i.encType,i,null),At(e,t,"method",i.method,i,null),At(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=wb(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=to);break;case"onScroll":r!=null&&rt("scroll",e);break;case"onScrollEnd":r!=null&&rt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(J(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(J(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=wb(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":rt("beforetoggle",e),rt("toggle",e),Sb(e,"popover",r);break;case"xlinkActuate":Ds(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ds(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ds(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ds(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ds(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ds(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Sb(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=SW.get(n)||n,Sb(e,n,r))}}function RE(e,t,n,r,i,a){switch(n){case"style":QP(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(J(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(J(60));e.innerHTML=n}}break;case"children":typeof r=="string"?yd(e,r):(typeof r=="number"||typeof r=="bigint")&&yd(e,""+r);break;case"onScroll":r!=null&&rt("scroll",e);break;case"onScrollEnd":r!=null&&rt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=to);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!KP.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),a=e[si]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,i),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Sb(e,n,r)}}}function gr(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",e),rt("load",e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(J(137,t));default:At(e,t,a,s,n,null)}}i&&At(e,t,"srcSet",n.srcSet,n,null),r&&At(e,t,"src",n.src,n,null);return;case"input":rt("invalid",e);var o=a=s=i=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"name":i=f;break;case"type":s=f;break;case"checked":l=f;break;case"defaultChecked":c=f;break;case"value":a=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(J(137,t));break;default:At(e,t,r,f,n,null)}}WP(e,a,o,l,c,s,i,!1);return;case"select":rt("invalid",e),r=s=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":r=o;default:At(e,t,i,o,n,null)}t=a,n=s,e.multiple=!!r,t!=null?Gf(e,!!r,t,!1):n!=null&&Gf(e,!!r,n,!0);return;case"textarea":rt("invalid",e),a=i=r=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":r=o;break;case"defaultValue":i=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(J(91));break;default:At(e,t,s,o,n,null)}XP(e,r,i,a);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:At(e,t,l,r,n,null)}return;case"dialog":rt("beforetoggle",e),rt("toggle",e),rt("cancel",e),rt("close",e);break;case"iframe":case"object":rt("load",e);break;case"video":case"audio":for(r=0;r<Tp.length;r++)rt(Tp[r],e);break;case"image":rt("error",e),rt("load",e);break;case"details":rt("toggle",e);break;case"embed":case"source":case"link":rt("error",e),rt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(J(137,t));default:At(e,t,c,r,n,null)}return;default:if(pT(t)){for(f in n)n.hasOwnProperty(f)&&(r=n[f],r!==void 0&&RE(e,t,f,r,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(r=n[o],r!=null&&At(e,t,o,r,n,null))}function YJ(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,s=null,o=null,l=null,c=null,f=null;for(h in n){var u=n[h];if(n.hasOwnProperty(h)&&u!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(h)||At(e,t,h,null,r,u)}}for(var d in r){var h=r[d];if(u=n[d],r.hasOwnProperty(d)&&(h!=null||u!=null))switch(d){case"type":a=h;break;case"name":i=h;break;case"checked":c=h;break;case"defaultChecked":f=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(J(137,t));break;default:h!==u&&At(e,t,d,h,r,u)}}Z_(e,s,o,l,c,f,a,i);return;case"select":h=s=o=d=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(a)||At(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case"value":d=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&At(e,t,i,a,r,l)}t=o,n=s,r=h,d!=null?Gf(e,!!n,d,!1):!!r!=!!n&&(t!=null?Gf(e,!!n,t,!0):Gf(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(o in n)if(i=n[o],n.hasOwnProperty(o)&&i!=null&&!r.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:At(e,t,o,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(J(91));break;default:i!==a&&At(e,t,s,i,r,a)}JP(e,d,h);return;case"option":for(var p in n)if(d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p))switch(p){case"selected":e.selected=!1;break;default:At(e,t,p,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:At(e,t,l,d,r,h)}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 b in n)d=n[b],n.hasOwnProperty(b)&&d!=null&&!r.hasOwnProperty(b)&&At(e,t,b,null,r,d);for(c in r)if(d=r[c],h=n[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(J(137,t));break;default:At(e,t,c,d,r,h)}return;default:if(pT(t)){for(var x in n)d=n[x],n.hasOwnProperty(x)&&d!==void 0&&!r.hasOwnProperty(x)&&RE(e,t,x,void 0,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d===void 0&&h===void 0||RE(e,t,f,d,r,h);return}}for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g)&&At(e,t,g,null,r,d);for(u in r)d=r[u],h=n[u],!r.hasOwnProperty(u)||d===h||d==null&&h==null||At(e,t,u,d,r,h)}function bM(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function WJ(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,s=i.initiatorType,o=i.duration;if(a&&o&&bM(s)){for(s=0,o=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>o)break;var f=l.transferSize,u=l.initiatorType;f&&bM(u)&&(l=l.responseEnd,s+=f*(l<o?1:(o-c)/(l-c)))}if(--r,t+=8*(a+s)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var AE=null,NE=null;function Lv(e){return e.nodeType===9?e:e.ownerDocument}function vM(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n4(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function OE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var d1=null;function JJ(){var e=window.event;return e&&e.type==="popstate"?e===d1?!1:(d1=e,!0):(d1=null,!1)}var r4=typeof setTimeout=="function"?setTimeout:void 0,XJ=typeof clearTimeout=="function"?clearTimeout:void 0,xM=typeof Promise=="function"?Promise:void 0,QJ=typeof queueMicrotask=="function"?queueMicrotask:typeof xM<"u"?function(e){return xM.resolve(null).then(e).catch(ZJ)}:r4;function ZJ(e){setTimeout(function(){throw e})}function Xl(e){return e==="head"}function SM(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(i),kd(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Wm(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Wm(n);for(var a=n.firstChild;a;){var s=a.nextSibling,o=a.nodeName;a[Sg]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=s}}else n==="body"&&Wm(e.ownerDocument.body);n=i}while(n);kd(t)}function wM(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function ME(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ME(n),mT(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function eX(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Sg])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=ea(e.nextSibling),e===null)break}return null}function tX(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ea(e.nextSibling),e===null))return null;return e}function i4(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ea(e.nextSibling),e===null))return null;return e}function jE(e){return e.data==="$?"||e.data==="$~"}function DE(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function nX(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ea(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var IE=null;function _M(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ea(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function EM(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function a4(e,t,n){switch(t=Lv(n),e){case"html":if(e=t.documentElement,!e)throw Error(J(452));return e;case"head":if(e=t.head,!e)throw Error(J(453));return e;case"body":if(e=t.body,!e)throw Error(J(454));return e;default:throw Error(J(451))}}function Wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mT(e)}var ia=new Map,kM=new Set;function Pv(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ao=gt.d;gt.d={f:rX,r:iX,D:aX,C:sX,L:oX,m:lX,X:uX,S:cX,M:fX};function rX(){var e=Ao.f(),t=R0();return e||t}function iX(e){var t=nh(e);t!==null&&t.tag===5&&t.type==="form"?QF(t):Ao.r(e)}var sh=typeof document>"u"?null:document;function s4(e,t,n){var r=sh;if(r&&typeof t=="string"&&t){var i=Yi(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),kM.has(i)||(kM.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),gr(t,"link",e),Wn(t),r.head.appendChild(t)))}}function aX(e){Ao.D(e),s4("dns-prefetch",e,null)}function sX(e,t){Ao.C(e,t),s4("preconnect",e,t)}function oX(e,t,n){Ao.L(e,t,n);var r=sh;if(r&&e&&t){var i='link[rel="preload"][as="'+Yi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Yi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Yi(n.imageSizes)+'"]')):i+='[href="'+Yi(e)+'"]';var a=i;switch(t){case"style":a=Ed(e);break;case"script":a=oh(e)}ia.has(a)||(e=Wt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ia.set(a,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Tg(a))||t==="script"&&r.querySelector(Rg(a))||(t=r.createElement("link"),gr(t,"link",e),Wn(t),r.head.appendChild(t)))}}function lX(e,t){Ao.m(e,t);var n=sh;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Yi(r)+'"][href="'+Yi(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=oh(e)}if(!ia.has(a)&&(e=Wt({rel:"modulepreload",href:e},t),ia.set(a,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Rg(a)))return}r=n.createElement("link"),gr(r,"link",e),Wn(r),n.head.appendChild(r)}}}function cX(e,t,n){Ao.S(e,t,n);var r=sh;if(r&&e){var i=Kf(r).hoistableStyles,a=Ed(e);t=t||"default";var s=i.get(a);if(!s){var o={loading:0,preload:null};if(s=r.querySelector(Tg(a)))o.loading=5;else{e=Wt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ia.get(a))&&ZT(e,n);var l=s=r.createElement("link");Wn(l),gr(l,"link",e),l._p=new Promise(function(c,f){l.onload=c,l.onerror=f}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Mb(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:o},i.set(a,s)}}}function uX(e,t){Ao.X(e,t);var n=sh;if(n&&e){var r=Kf(n).hoistableScripts,i=oh(e),a=r.get(i);a||(a=n.querySelector(Rg(i)),a||(e=Wt({src:e,async:!0},t),(t=ia.get(i))&&eR(e,t),a=n.createElement("script"),Wn(a),gr(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function fX(e,t){Ao.M(e,t);var n=sh;if(n&&e){var r=Kf(n).hoistableScripts,i=oh(e),a=r.get(i);a||(a=n.querySelector(Rg(i)),a||(e=Wt({src:e,async:!0,type:"module"},t),(t=ia.get(i))&&eR(e,t),a=n.createElement("script"),Wn(a),gr(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function CM(e,t,n,r){var i=(i=ul.current)?Pv(i):null;if(!i)throw Error(J(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ed(n.href),n=Kf(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ed(n.href);var a=Kf(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Tg(e)))&&!a._p&&(s.instance=a,s.state.loading=5),ia.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ia.set(e,n),a||dX(i,e,n,s.state))),t&&r===null)throw Error(J(528,""));return s}if(t&&r!==null)throw Error(J(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=oh(n),n=Kf(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(J(444,e))}}function Ed(e){return'href="'+Yi(e)+'"'}function Tg(e){return'link[rel="stylesheet"]['+e+"]"}function o4(e){return Wt({},e,{"data-precedence":e.precedence,precedence:null})}function dX(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),gr(t,"link",n),Wn(t),e.head.appendChild(t))}function oh(e){return'[src="'+Yi(e)+'"]'}function Rg(e){return"script[async]"+e}function TM(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Yi(n.href)+'"]');if(r)return t.instance=r,Wn(r),r;var i=Wt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Wn(r),gr(r,"style",i),Mb(r,n.precedence,e),t.instance=r;case"stylesheet":i=Ed(n.href);var a=e.querySelector(Tg(i));if(a)return t.state.loading|=4,t.instance=a,Wn(a),a;r=o4(n),(i=ia.get(i))&&ZT(r,i),a=(e.ownerDocument||e).createElement("link"),Wn(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),gr(a,"link",r),t.state.loading|=4,Mb(a,n.precedence,e),t.instance=a;case"script":return a=oh(n.src),(i=e.querySelector(Rg(a)))?(t.instance=i,Wn(i),i):(r=n,(i=ia.get(a))&&(r=Wt({},n),eR(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Wn(i),gr(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(J(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Mb(r,n.precedence,e));return t.instance}function Mb(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,s=0;s<r.length;s++){var o=r[s];if(o.dataset.precedence===t)a=o;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ZT(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function eR(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var jb=null;function RM(e,t,n){if(jb===null){var r=new Map,i=jb=new Map;i.set(n,r)}else i=jb,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Sg]||a[ur]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(t)||"";s=e+s;var o=r.get(s);o?o.push(a):r.set(s,[a])}}return r}function AM(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function hX(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function l4(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function mX(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=Ed(r.href),a=t.querySelector(Tg(i));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fv.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Wn(a);return}a=t.ownerDocument||t,r=o4(r),(i=ia.get(i))&&ZT(r,i),a=a.createElement("link"),Wn(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),gr(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Fv.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var h1=0;function pX(e,t){return e.stylesheets&&e.count===0&&Db(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Db(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&h1===0&&(h1=62500*WJ());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Db(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>h1?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Fv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Db(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Uv=null;function Db(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Uv=new Map,t.forEach(gX,e),Uv=null,Fv.call(e))}function gX(e,t){if(!(t.state.loading&4)){var n=Uv.get(e);if(n)var r=n.get(null);else{n=new Map,Uv.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var s=i[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}i=t.instance,s=i.getAttribute("data-precedence"),a=n.get(s)||r,a===r&&n.set(null,i),n.set(s,i),this.count++,r=Fv.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ap={$$typeof:eo,Provider:null,Consumer:null,_currentValue:Lc,_currentValue2:Lc,_threadCount:0};function yX(e,t,n,r,i,a,s,o,l){this.tag=1,this.containerInfo=e,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=zw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zw(0),this.hiddenUpdates=zw(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function c4(e,t,n,r,i,a,s,o,l,c,f,u){return e=new yX(e,t,n,s,l,c,f,u,o),t=1,a===!0&&(t|=24),a=vi(3,null,null,t),e.current=a,a.stateNode=e,t=CT(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},AT(a),e}function u4(e){return e?(e=Df,e):Df}function f4(e,t,n,r,i,a){i=u4(i),r.context===null?r.context=i:r.pendingContext=i,r=dl(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=hl(e,r,t),n!==null&&(ai(n,e,t),Um(n,e,t))}function NM(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tR(e,t){NM(e,t),(e=e.alternate)&&NM(e,t)}function d4(e){if(e.tag===13||e.tag===31){var t=Ru(e,67108864);t!==null&&ai(t,e,67108864),tR(e,67108864)}}function OM(e){if(e.tag===13||e.tag===31){var t=Ci();t=dT(t);var n=Ru(e,t);n!==null&&ai(n,e,t),tR(e,t)}}var Bv=!0;function bX(e,t,n,r){var i=Pe.T;Pe.T=null;var a=gt.p;try{gt.p=2,nR(e,t,n,r)}finally{gt.p=a,Pe.T=i}}function vX(e,t,n,r){var i=Pe.T;Pe.T=null;var a=gt.p;try{gt.p=8,nR(e,t,n,r)}finally{gt.p=a,Pe.T=i}}function nR(e,t,n,r){if(Bv){var i=zE(r);if(i===null)f1(e,t,r,Hv,n),MM(e,r);else if(SX(i,e,t,n,r))r.stopPropagation();else if(MM(e,r),t&4&&-1<xX.indexOf(e)){for(;i!==null;){var a=nh(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=_c(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-ki(s);o.entanglements[1]|=l,s&=~l}_s(a),!(pt&6)&&(Mv=_i()+500,Cg(0))}}break;case 31:case 13:o=Ru(a,2),o!==null&&ai(o,a,2),R0(),tR(a,2)}if(a=zE(r),a===null&&f1(e,t,r,Hv,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else f1(e,t,r,null,n)}}function zE(e){return e=gT(e),rR(e)}var Hv=null;function rR(e){if(Hv=null,e=Rf(e),e!==null){var t=yg(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=MP(t),e!==null)return e;e=null}else if(n===31){if(e=jP(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hv=e,null}function h4(e){switch(e){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(aW()){case $P:return 2;case LP:return 8;case bv:case sW:return 32;case PP:return 268435456;default:return 32}default:return 32}}var $E=!1,gl=null,yl=null,bl=null,Np=new Map,Op=new Map,Qo=[],xX="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 MM(e,t){switch(e){case"focusin":case"focusout":gl=null;break;case"dragenter":case"dragleave":yl=null;break;case"mouseover":case"mouseout":bl=null;break;case"pointerover":case"pointerout":Np.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Op.delete(t.pointerId)}}function Xh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=nh(t),t!==null&&d4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function SX(e,t,n,r,i){switch(t){case"focusin":return gl=Xh(gl,e,t,n,r,i),!0;case"dragenter":return yl=Xh(yl,e,t,n,r,i),!0;case"mouseover":return bl=Xh(bl,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Np.set(a,Xh(Np.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Op.set(a,Xh(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function m4(e){var t=Rf(e.target);if(t!==null){var n=yg(t);if(n!==null){if(t=n.tag,t===13){if(t=MP(n),t!==null){e.blockedOn=t,gO(e.priority,function(){OM(n)});return}}else if(t===31){if(t=jP(n),t!==null){e.blockedOn=t,gO(e.priority,function(){OM(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ib(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=zE(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tE=r,n.target.dispatchEvent(r),tE=null}else return t=nh(n),t!==null&&d4(t),e.blockedOn=n,!1;t.shift()}return!0}function jM(e,t,n){Ib(e)&&n.delete(t)}function wX(){$E=!1,gl!==null&&Ib(gl)&&(gl=null),yl!==null&&Ib(yl)&&(yl=null),bl!==null&&Ib(bl)&&(bl=null),Np.forEach(jM),Op.forEach(jM)}function Hy(e,t){e.blockedOn===t&&(e.blockedOn=null,$E||($E=!0,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,wX)))}var qy=null;function DM(e){qy!==e&&(qy=e,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,function(){qy===e&&(qy=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(rR(r||n)===null)continue;break}var a=nh(n);a!==null&&(e.splice(t,3),t-=3,yE(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function kd(e){function t(l){return Hy(l,e)}gl!==null&&Hy(gl,e),yl!==null&&Hy(yl,e),bl!==null&&Hy(bl,e),Np.forEach(t),Op.forEach(t);for(var n=0;n<Qo.length;n++){var r=Qo[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Qo.length&&(n=Qo[0],n.blockedOn===null);)m4(n),n.blockedOn===null&&Qo.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],s=i[si]||null;if(typeof a=="function")s||DM(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(i=a,s=a[si]||null)o=s.formAction;else if(rR(i)!==null)continue}else o=s.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),DM(n)}}}function p4(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(s){return i=s})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function iR(e){this._internalRoot=e}O0.prototype.render=iR.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));var n=t.current,r=Ci();f4(n,r,e,t,null,null)};O0.prototype.unmount=iR.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;f4(e.current,2,null,e,null,null),R0(),t[th]=null}};function O0(e){this._internalRoot=e}O0.prototype.unstable_scheduleHydration=function(e){if(e){var t=qP();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qo.length&&t!==0&&t<Qo[n].priority;n++);Qo.splice(n,0,e),n===0&&m4(e)}};var IM=NP.version;if(IM!=="19.2.4")throw Error(J(527,IM,"19.2.4"));gt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=QY(t),e=e!==null?DP(e):null,e=e===null?null:e.stateNode,e};var _X={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Pe,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vy.isDisabled&&Vy.supportsFiber)try{bg=Vy.inject(_X),Ei=Vy}catch{}}m0.createRoot=function(e,t){if(!OP(e))throw Error(J(299));var n=!1,r="",i=s3,a=o3,s=l3;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=c4(e,1,!1,null,null,n,r,null,i,a,s,p4),e[th]=t.current,QT(e),new iR(t)};m0.hydrateRoot=function(e,t,n){if(!OP(e))throw Error(J(299));var r=!1,i="",a=s3,s=o3,o=l3,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=c4(e,1,!0,t,n??null,r,i,l,a,s,o,p4),t.context=u4(null),n=t.current,r=Ci(),r=dT(r),i=dl(r),i.callback=null,hl(n,i,r),n=r,t.current.lanes=n,xg(t,n),_s(t),e[th]=t.current,QT(e),new O0(t)};m0.version="19.2.4";function g4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g4)}catch(e){console.error(e)}}g4(),_P.exports=m0;var EX=_P.exports;const kX=gg(EX);/**
50
+ * react-router v7.13.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var y4=e=>{throw TypeError(e)},CX=(e,t,n)=>t.has(e)||y4("Cannot "+n),m1=(e,t,n)=>(CX(e,t,"read from private field"),n?n.call(e):t.get(e)),TX=(e,t,n)=>t.has(e)?y4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zM="popstate";function RX(e={}){function t(r,i){let{pathname:a,search:s,hash:o}=r.location;return Mp("",{pathname:a,search:s,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ps(i)}return NX(t,n,null,e)}function et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ln(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function AX(){return Math.random().toString(36).substring(2,10)}function $M(e,t){return{usr:e.state,key:e.key,idx:t}}function Mp(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ql(t):t,state:n,key:t&&t.key||r||AX()}}function ps({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ql(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function NX(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o="POP",l=null,c=f();c==null&&(c=0,s.replaceState({...s.state,idx:c},""));function f(){return(s.state||{idx:null}).idx}function u(){o="POP";let x=f(),g=x==null?null:x-c;c=x,l&&l({action:o,location:b.location,delta:g})}function d(x,g){o="PUSH";let v=Mp(b.location,x,g);c=f()+1;let w=$M(v,c),E=b.createHref(v);try{s.pushState(w,"",E)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(E)}a&&l&&l({action:o,location:b.location,delta:1})}function h(x,g){o="REPLACE";let v=Mp(b.location,x,g);c=f();let w=$M(v,c),E=b.createHref(v);s.replaceState(w,"",E),a&&l&&l({action:o,location:b.location,delta:0})}function p(x){return b4(x)}let b={get action(){return o},get location(){return e(i,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(zM,u),l=x,()=>{i.removeEventListener(zM,u),l=null}},createHref(x){return t(i,x)},createURL:p,encodeLocation(x){let g=p(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:h,go(x){return s.go(x)}};return b}function b4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),et(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ps(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Sm,LM=class{constructor(e){if(TX(this,Sm,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(m1(this,Sm).has(e))return m1(this,Sm).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){m1(this,Sm).set(e,t)}};Sm=new WeakMap;var OX=new Set(["lazy","caseSensitive","path","id","index","children"]);function MX(e){return OX.has(e)}var jX=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function DX(e){return jX.has(e)}function IX(e){return e.index===!0}function jp(e,t,n=[],r={},i=!1){return e.map((a,s)=>{let o=[...n,String(s)],l=typeof a.id=="string"?a.id:o.join("-");if(et(a.index!==!0||!a.children,"Cannot specify children on an index route"),et(i||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),IX(a)){let c={...a,id:l};return r[l]=PM(c,t(c)),c}else{let c={...a,id:l,children:void 0};return r[l]=PM(c,t(c)),a.children&&(c.children=jp(a.children,t,o,r,i)),c}})}function PM(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Zo(e,t,n="/"){return wm(e,t,n,!1)}function wm(e,t,n,r){let i=typeof t=="string"?Ql(t):t,a=aa(i.pathname||"/",n);if(a==null)return null;let s=x4(e);zX(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let c=GX(a);o=VX(s[l],c,r)}return o}function v4(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function x4(e,t=[],n=[],r="",i=!1){let a=(s,o,l=i,c)=>{let f={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;et(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let u=us([r,f.relativePath]),d=n.concat(f);s.children&&s.children.length>0&&(et(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),x4(s.children,t,d,u,l)),!(s.path==null&&!s.index)&&t.push({path:u,score:HX(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))a(s,o);else for(let c of S4(s.path))a(s,o,!0,c)}),t}function S4(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=S4(r.join("/")),o=[];return o.push(...s.map(l=>l===""?a:[a,l].join("/"))),i&&o.push(...s),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function zX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:qX(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var $X=/^:[\w-]+$/,LX=3,PX=2,FX=1,UX=10,BX=-2,FM=e=>e==="*";function HX(e,t){let n=e.split("/"),r=n.length;return n.some(FM)&&(r+=BX),t&&(r+=PX),n.filter(i=>!FM(i)).reduce((i,a)=>i+($X.test(a)?LX:a===""?FX:UX),r)}function qX(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function VX(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",s=[];for(let o=0;o<r.length;++o){let l=r[o],c=o===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",u=qv({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),d=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=qv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(i,u.params),s.push({params:i,pathname:us([a,u.pathname]),pathnameBase:JX(us([a,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(a=us([a,u.pathnameBase]))}return s}function qv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=KX(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:u},d)=>{if(f==="*"){let p=o[d]||"";s=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const h=o[d];return u&&!h?c[f]=void 0:c[f]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:s,pattern:e}}function KX(e,t=!1,n=!0){ln(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function GX(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ln(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function YX({basename:e,pathname:t}){return t==="/"?e:us([e,t])}var w4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,aR=e=>w4.test(e);function WX(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ql(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=UM(n.substring(1),"/"):a=UM(n,t)):a=t,{pathname:a,search:XX(r),hash:QX(i)}}function UM(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function p1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function M0(e){let t=_4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function j0(e,t,n,r=!1){let i;typeof e=="string"?i=Ql(e):(i={...e},et(!i.pathname||!i.pathname.includes("?"),p1("?","pathname","search",i)),et(!i.pathname||!i.pathname.includes("#"),p1("#","pathname","hash",i)),et(!i.search||!i.search.includes("#"),p1("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let u=t.length-1;if(!r&&s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),u-=1;i.pathname=d.join("/")}o=u>=0?t[u]:"/"}let l=WX(i,o),c=s&&s!=="/"&&s.endsWith("/"),f=(a||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var us=e=>e.join("/").replace(/\/\/+/g,"/"),JX=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XX=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QX=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ag=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Dp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ng(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var E4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function k4(e,t){let n=e;if(typeof n!="string"||!w4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(E4)try{let a=new URL(window.location.href),s=n.startsWith("//")?new URL(a.protocol+n):new URL(n),o=aa(s.pathname,t);s.origin===a.origin&&o!=null?n=o+s.search+s.hash:i=!0}catch{ln(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var sl=Symbol("Uninstrumented");function ZX(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(a){let s=Object.keys(n);for(let o of s)a[o]&&n[o].push(a[o])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=Lf(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(a=>{let s=i[a],o=n[`lazy.${a}`];if(typeof s=="function"&&o.length>0){let l=Lf(o,s,()=>{});l&&(r.lazy=Object.assign(r.lazy||{},{[a]:l}))}})}return["loader","action"].forEach(i=>{let a=t[i];if(typeof a=="function"&&n[i].length>0){let s=a[sl]??a,o=Lf(n[i],s,(...l)=>BM(l[0]));o&&(i==="loader"&&s.hydrate===!0&&(o.hydrate=!0),o[sl]=s,r[i]=o)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let a=i[sl]??i,s=Lf(n.middleware,a,(...o)=>BM(o[0]));return s?(s[sl]=a,s):i})),r}function eQ(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let a=Object.keys(i);for(let s of a)i[s]&&n[s].push(i[s])}})),n.navigate.length>0){let r=e.navigate[sl]??e.navigate,i=Lf(n.navigate,r,(...a)=>{let[s,o]=a;return{to:typeof s=="number"||typeof s=="string"?s:s?ps(s):".",...HM(e,o??{})}});i&&(i[sl]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[sl]??e.fetch,i=Lf(n.fetch,r,(...a)=>{let[s,,o,l]=a;return{href:o??".",fetcherKey:s,...HM(e,l??{})}});i&&(i[sl]=r,e.fetch=i)}return e}function Lf(e,t,n){return e.length===0?null:async(...r)=>{let i=await C4(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function C4(e,t,n,r){let i=e[r],a;if(i){let s,o=async()=>(s?console.error("You cannot call instrumented handlers more than once"):s=C4(e,t,n,r-1),a=await s,et(a,"Expected a result"),a.type==="error"&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await i(o,t)}catch(l){console.error("An instrumentation function threw an error:",l)}s||await o(),await s}else try{a={type:"success",value:await n()}}catch(s){a={type:"error",value:s}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function BM(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:tQ(t),params:{...r},unstable_pattern:i,context:nQ(n)}}function HM(e,t){return{currentUrl:ps(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function tQ(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function nQ(e){if(iQ(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var rQ=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function iQ(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===rQ}var T4=["POST","PUT","PATCH","DELETE"],aQ=new Set(T4),sQ=["GET",...T4],oQ=new Set(sQ),R4=new Set([301,302,303,307,308]),lQ=new Set([307,308]),g1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},cQ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uQ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),A4="remix-router-transitions",N4=Symbol("ResetLoaderData");function fQ(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";et(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||uQ,a=i;if(e.unstable_instrumentations){let j=e.unstable_instrumentations;a=$=>({...i($),...ZX(j.map(H=>H.route).filter(Boolean),$)})}let s={},o=jp(e.routes,a,void 0,s),l,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let f=e.dataStrategy||gQ,u={...e.future},d=null,h=new Set,p=null,b=null,x=null,g=e.hydrationData!=null,v=Zo(o,e.history.location,c),w=!1,E=null,C;if(v==null&&!e.patchRoutesOnNavigation){let j=Ui(404,{pathname:e.history.location.pathname}),{matches:$,route:H}=Ky(o);C=!0,v=$,E={[H.id]:j}}else if(v&&!e.hydrationData&&qn(v,o,e.history.location.pathname).active&&(v=null),v)if(v.some(j=>j.route.lazy))C=!1;else if(!v.some(j=>sR(j.route)))C=!0;else{let j=e.hydrationData?e.hydrationData.loaderData:null,$=e.hydrationData?e.hydrationData.errors:null;if($){let H=v.findIndex(Z=>$[Z.route.id]!==void 0);C=v.slice(0,H+1).every(Z=>!PE(Z.route,j,$))}else C=v.every(H=>!PE(H.route,j,$))}else{C=!1,v=[];let j=qn(null,o,e.history.location.pathname);j.active&&j.matches&&(w=!0,v=j.matches)}let k,_={historyAction:e.history.action,location:e.history.location,matches:v,initialized:C,navigation:g1,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A="POP",D=null,O=!1,L,B=!1,X=new Map,W=null,U=!1,I=!1,F=new Set,z=new Map,V=0,N=-1,ue=new Map,q=new Set,T=new Map,K=new Map,G=new Set,oe=new Map,Q,se=null;function ye(){if(d=e.history.listen(({action:j,location:$,delta:H})=>{if(Q){Q(),Q=void 0;return}ln(oe.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Z=_y({currentLocation:_.location,nextLocation:$,historyAction:j});if(Z&&H!=null){let ce=new Promise(_e=>{Q=_e});e.history.go(H*-1),Yu(Z,{state:"blocked",location:$,proceed(){Yu(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),ce.then(()=>e.history.go(H))},reset(){let _e=new Map(_.blockers);_e.set(Z,Qh),ve({blockers:_e})}}),D==null||D.resolve(),D=null;return}return On(j,$)}),n){DQ(t,X);let j=()=>IQ(t,X);t.addEventListener("pagehide",j),W=()=>t.removeEventListener("pagehide",j)}return _.initialized||On("POP",_.location,{initialHydration:!0}),k}function Ae(){d&&d(),W&&W(),h.clear(),L&&L.abort(),_.fetchers.forEach((j,$)=>Hn($)),_.blockers.forEach((j,$)=>ha($))}function He(j){return h.add(j),()=>h.delete(j)}function ve(j,$={}){j.matches&&(j.matches=j.matches.map(ce=>{let _e=s[ce.route.id],Ne=ce.route;return Ne.element!==_e.element||Ne.errorElement!==_e.errorElement||Ne.hydrateFallbackElement!==_e.hydrateFallbackElement?{...ce,route:_e}:ce})),_={..._,...j};let H=[],Z=[];_.fetchers.forEach((ce,_e)=>{ce.state==="idle"&&(G.has(_e)?H.push(_e):Z.push(_e))}),G.forEach(ce=>{!_.fetchers.has(ce)&&!z.has(ce)&&H.push(ce)}),[...h].forEach(ce=>ce(_,{deletedFetchers:H,newErrors:j.errors??null,viewTransitionOpts:$.viewTransitionOpts,flushSync:$.flushSync===!0})),H.forEach(ce=>Hn(ce)),Z.forEach(ce=>_.fetchers.delete(ce))}function Jt(j,$,{flushSync:H}={}){var Ge,Ee;let Z=_.actionData!=null&&_.navigation.formMethod!=null&&xr(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ge=j.state)==null?void 0:Ge._isRedirect)!==!0,ce;$.actionData?Object.keys($.actionData).length>0?ce=$.actionData:ce=null:Z?ce=_.actionData:ce=null;let _e=$.loaderData?ZM(_.loaderData,$.loaderData,$.matches||[],$.errors):_.loaderData,Ne=_.blockers;Ne.size>0&&(Ne=new Map(Ne),Ne.forEach((Je,ft)=>Ne.set(ft,Qh)));let me=U?!1:jn(j,$.matches||_.matches),be=O===!0||_.navigation.formMethod!=null&&xr(_.navigation.formMethod)&&((Ee=j.state)==null?void 0:Ee._isRedirect)!==!0;l&&(o=l,l=void 0),U||A==="POP"||(A==="PUSH"?e.history.push(j,j.state):A==="REPLACE"&&e.history.replace(j,j.state));let Ce;if(A==="POP"){let Je=X.get(_.location.pathname);Je&&Je.has(j.pathname)?Ce={currentLocation:_.location,nextLocation:j}:X.has(j.pathname)&&(Ce={currentLocation:j,nextLocation:_.location})}else if(B){let Je=X.get(_.location.pathname);Je?Je.add(j.pathname):(Je=new Set([j.pathname]),X.set(_.location.pathname,Je)),Ce={currentLocation:_.location,nextLocation:j}}ve({...$,actionData:ce,loaderData:_e,historyAction:A,location:j,initialized:!0,navigation:g1,revalidation:"idle",restoreScrollPosition:me,preventScrollReset:be,blockers:Ne},{viewTransitionOpts:Ce,flushSync:H===!0}),A="POP",O=!1,B=!1,U=!1,I=!1,D==null||D.resolve(),D=null,se==null||se.resolve(),se=null}async function Nn(j,$){if(D==null||D.resolve(),D=null,typeof j=="number"){D||(D=rj());let ft=D.promise;return e.history.go(j),ft}let H=LE(_.location,_.matches,c,j,$==null?void 0:$.fromRouteId,$==null?void 0:$.relative),{path:Z,submission:ce,error:_e}=qM(!1,H,$),Ne=_.location,me=Mp(_.location,Z,$&&$.state);me={...me,...e.history.encodeLocation(me)};let be=$&&$.replace!=null?$.replace:void 0,Ce="PUSH";be===!0?Ce="REPLACE":be===!1||ce!=null&&xr(ce.formMethod)&&ce.formAction===_.location.pathname+_.location.search&&(Ce="REPLACE");let Ge=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,Ee=($&&$.flushSync)===!0,Je=_y({currentLocation:Ne,nextLocation:me,historyAction:Ce});if(Je){Yu(Je,{state:"blocked",location:me,proceed(){Yu(Je,{state:"proceeding",proceed:void 0,reset:void 0,location:me}),Nn(j,$)},reset(){let ft=new Map(_.blockers);ft.set(Je,Qh),ve({blockers:ft})}});return}await On(Ce,me,{submission:ce,pendingError:_e,preventScrollReset:Ge,replace:$&&$.replace,enableViewTransition:$&&$.viewTransition,flushSync:Ee,callSiteDefaultShouldRevalidate:$&&$.unstable_defaultShouldRevalidate})}function Ii(){se||(se=rj()),le(),ve({revalidation:"loading"});let j=se.promise;return _.navigation.state==="submitting"?j:_.navigation.state==="idle"?(On(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),j):(On(A||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:B===!0}),j)}async function On(j,$,H){L&&L.abort(),L=null,A=j,U=(H&&H.startUninterruptedRevalidation)===!0,gn(_.location,_.matches),O=(H&&H.preventScrollReset)===!0,B=(H&&H.enableViewTransition)===!0;let Z=l||o,ce=H&&H.overrideNavigation,_e=H!=null&&H.initialHydration&&_.matches&&_.matches.length>0&&!w?_.matches:Zo(Z,$,c),Ne=(H&&H.flushSync)===!0;if(_e&&_.initialized&&!I&&EQ(_.location,$)&&!(H&&H.submission&&xr(H.submission.formMethod))){Jt($,{matches:_e},{flushSync:Ne});return}let me=qn(_e,Z,$.pathname);if(me.active&&me.matches&&(_e=me.matches),!_e){let{error:Vn,notFoundMatches:Mr,route:Rt}=Wu($.pathname);Jt($,{matches:Mr,loaderData:{},errors:{[Rt.id]:Vn}},{flushSync:Ne});return}L=new AbortController;let be=pf(e.history,$,L.signal,H&&H.submission),Ce=e.getContext?await e.getContext():new LM,Ge;if(H&&H.pendingError)Ge=[el(_e).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&xr(H.submission.formMethod)){let Vn=await yr(be,$,H.submission,_e,Ce,me.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:Ne});if(Vn.shortCircuited)return;if(Vn.pendingActionResult){let[Mr,Rt]=Vn.pendingActionResult;if(pi(Rt)&&Dp(Rt.error)&&Rt.error.status===404){L=null,Jt($,{matches:Vn.matches,loaderData:{},errors:{[Mr]:Rt.error}});return}}_e=Vn.matches||_e,Ge=Vn.pendingActionResult,ce=y1($,H.submission),Ne=!1,me.active=!1,be=pf(e.history,be.url,be.signal)}let{shortCircuited:Ee,matches:Je,loaderData:ft,errors:nr}=await zo(be,$,_e,Ce,me.active,ce,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,Ne,Ge,H&&H.callSiteDefaultShouldRevalidate);Ee||(L=null,Jt($,{matches:Je||_e,...ej(Ge),loaderData:ft,errors:nr}))}async function yr(j,$,H,Z,ce,_e,Ne,me={}){le();let be=MQ($,H);if(ve({navigation:be},{flushSync:me.flushSync===!0}),_e){let Ee=await js(Z,$.pathname,j.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){if(Ee.partialMatches.length===0){let{matches:ft,route:nr}=Ky(o);return{matches:ft,pendingActionResult:[nr.id,{type:"error",error:Ee.error}]}}let Je=el(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,pendingActionResult:[Je,{type:"error",error:Ee.error}]}}else if(Ee.matches)Z=Ee.matches;else{let{notFoundMatches:Je,error:ft,route:nr}=Wu($.pathname);return{matches:Je,pendingActionResult:[nr.id,{type:"error",error:ft}]}}}let Ce,Ge=zb(Z,$);if(!Ge.route.action&&!Ge.route.lazy)Ce={type:"error",error:Ui(405,{method:j.method,pathname:$.pathname,routeId:Ge.route.id})};else{let Ee=Zf(a,s,j,Z,Ge,Ne?[]:r,ce),Je=await Ms(j,Ee,ce,null);if(Ce=Je[Ge.route.id],!Ce){for(let ft of Z)if(Je[ft.route.id]){Ce=Je[ft.route.id];break}}if(j.signal.aborted)return{shortCircuited:!0}}if(Oc(Ce)){let Ee;return me&&me.replace!=null?Ee=me.replace:Ee=JM(Ce.response.headers.get("Location"),new URL(j.url),c,e.history)===_.location.pathname+_.location.search,await ua(j,Ce,!0,{submission:H,replace:Ee}),{shortCircuited:!0}}if(pi(Ce)){let Ee=el(Z,Ge.route.id);return(me&&me.replace)!==!0&&(A="PUSH"),{matches:Z,pendingActionResult:[Ee.route.id,Ce,Ge.route.id]}}return{matches:Z,pendingActionResult:[Ge.route.id,Ce]}}async function zo(j,$,H,Z,ce,_e,Ne,me,be,Ce,Ge,Ee,Je){let ft=_e||y1($,Ne),nr=Ne||me||nj(ft),Vn=!U&&!Ce;if(ce){if(Vn){let vr=pn(Ee);ve({navigation:ft,...vr!==void 0?{actionData:vr}:{}},{flushSync:Ge})}let mt=await js(H,$.pathname,j.signal);if(mt.type==="aborted")return{shortCircuited:!0};if(mt.type==="error"){if(mt.partialMatches.length===0){let{matches:Xu,route:mc}=Ky(o);return{matches:Xu,loaderData:{},errors:{[mc.id]:mt.error}}}let vr=el(mt.partialMatches).route.id;return{matches:mt.partialMatches,loaderData:{},errors:{[vr]:mt.error}}}else if(mt.matches)H=mt.matches;else{let{error:vr,notFoundMatches:Xu,route:mc}=Wu($.pathname);return{matches:Xu,loaderData:{},errors:{[mc.id]:vr}}}}let Mr=l||o,{dsMatches:Rt,revalidatingFetchers:zi}=VM(j,Z,a,s,e.history,_,H,nr,$,Ce?[]:r,Ce===!0,I,F,G,T,q,Mr,c,e.patchRoutesOnNavigation!=null,Ee,Je);if(N=++V,!e.dataStrategy&&!Rt.some(mt=>mt.shouldLoad)&&!Rt.some(mt=>mt.route.middleware&&mt.route.middleware.length>0)&&zi.length===0){let mt=Mn();return Jt($,{matches:H,loaderData:{},errors:Ee&&pi(Ee[1])?{[Ee[0]]:Ee[1].error}:null,...ej(Ee),...mt?{fetchers:new Map(_.fetchers)}:{}},{flushSync:Ge}),{shortCircuited:!0}}if(Vn){let mt={};if(!ce){mt.navigation=ft;let vr=pn(Ee);vr!==void 0&&(mt.actionData=vr)}zi.length>0&&(mt.fetchers=Gu(zi)),ve(mt,{flushSync:Ge})}zi.forEach(mt=>{tr(mt.key),mt.controller&&z.set(mt.key,mt.controller)});let dc=()=>zi.forEach(mt=>tr(mt.key));L&&L.signal.addEventListener("abort",dc);let{loaderResults:Hh,fetcherResults:$o}=await Y(Rt,zi,j,Z);if(j.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",dc),zi.forEach(mt=>z.delete(mt.key));let Ka=Gy(Hh);if(Ka)return await ua(j,Ka.result,!0,{replace:be}),{shortCircuited:!0};if(Ka=Gy($o),Ka)return q.add(Ka.key),await ua(j,Ka.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:Aw,errors:qh}=QM(_,H,Hh,Ee,zi,$o);Ce&&_.errors&&(qh={..._.errors,...qh});let hc=Mn(),ky=da(N),Cy=hc||ky||zi.length>0;return{matches:H,loaderData:Aw,errors:qh,...Cy?{fetchers:new Map(_.fetchers)}:{}}}function pn(j){if(j&&!pi(j[1]))return{[j[0]]:j[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Gu(j){return j.forEach($=>{let H=_.fetchers.get($.key),Z=Zh(void 0,H?H.data:void 0);_.fetchers.set($.key,Z)}),new Map(_.fetchers)}async function Bh(j,$,H,Z){tr(j);let ce=(Z&&Z.flushSync)===!0,_e=l||o,Ne=LE(_.location,_.matches,c,H,$,Z==null?void 0:Z.relative),me=Zo(_e,Ne,c),be=qn(me,_e,Ne);if(be.active&&be.matches&&(me=be.matches),!me){$e(j,$,Ui(404,{pathname:Ne}),{flushSync:ce});return}let{path:Ce,submission:Ge,error:Ee}=qM(!0,Ne,Z);if(Ee){$e(j,$,Ee,{flushSync:ce});return}let Je=e.getContext?await e.getContext():new LM,ft=(Z&&Z.preventScrollReset)===!0;if(Ge&&xr(Ge.formMethod)){await er(j,$,Ce,me,Je,be.active,ce,ft,Ge,Z&&Z.unstable_defaultShouldRevalidate);return}T.set(j,{routeId:$,path:Ce}),await Va(j,$,Ce,me,Je,be.active,ce,ft,Ge)}async function er(j,$,H,Z,ce,_e,Ne,me,be,Ce){le(),T.delete(j);let Ge=_.fetchers.get(j);we(j,jQ(be,Ge),{flushSync:Ne});let Ee=new AbortController,Je=pf(e.history,H,Ee.signal,be);if(_e){let en=await js(Z,new URL(Je.url).pathname,Je.signal,j);if(en.type==="aborted")return;if(en.type==="error"){$e(j,$,en.error,{flushSync:Ne});return}else if(en.matches)Z=en.matches;else{$e(j,$,Ui(404,{pathname:H}),{flushSync:Ne});return}}let ft=zb(Z,H);if(!ft.route.action&&!ft.route.lazy){let en=Ui(405,{method:be.formMethod,pathname:H,routeId:$});$e(j,$,en,{flushSync:Ne});return}z.set(j,Ee);let nr=V,Vn=Zf(a,s,Je,Z,ft,r,ce),Mr=await Ms(Je,Vn,ce,j),Rt=Mr[ft.route.id];if(!Rt){for(let en of Vn)if(Mr[en.route.id]){Rt=Mr[en.route.id];break}}if(Je.signal.aborted){z.get(j)===Ee&&z.delete(j);return}if(G.has(j)){if(Oc(Rt)||pi(Rt)){we(j,Hs(void 0));return}}else{if(Oc(Rt))if(z.delete(j),N>nr){we(j,Hs(void 0));return}else return q.add(j),we(j,Zh(be)),ua(Je,Rt,!1,{fetcherSubmission:be,preventScrollReset:me});if(pi(Rt)){$e(j,$,Rt.error);return}}let zi=_.navigation.location||_.location,dc=pf(e.history,zi,Ee.signal),Hh=l||o,$o=_.navigation.state!=="idle"?Zo(Hh,_.navigation.location,c):_.matches;et($o,"Didn't find any matches after fetcher action");let Ka=++V;ue.set(j,Ka);let Aw=Zh(be,Rt.data);_.fetchers.set(j,Aw);let{dsMatches:qh,revalidatingFetchers:hc}=VM(dc,ce,a,s,e.history,_,$o,be,zi,r,!1,I,F,G,T,q,Hh,c,e.patchRoutesOnNavigation!=null,[ft.route.id,Rt],Ce);hc.filter(en=>en.key!==j).forEach(en=>{let Ty=en.key,aO=_.fetchers.get(Ty),CY=Zh(void 0,aO?aO.data:void 0);_.fetchers.set(Ty,CY),tr(Ty),en.controller&&z.set(Ty,en.controller)}),ve({fetchers:new Map(_.fetchers)});let ky=()=>hc.forEach(en=>tr(en.key));Ee.signal.addEventListener("abort",ky);let{loaderResults:Cy,fetcherResults:mt}=await Y(qh,hc,dc,ce);if(Ee.signal.aborted)return;if(Ee.signal.removeEventListener("abort",ky),ue.delete(j),z.delete(j),hc.forEach(en=>z.delete(en.key)),_.fetchers.has(j)){let en=Hs(Rt.data);_.fetchers.set(j,en)}let vr=Gy(Cy);if(vr)return ua(dc,vr.result,!1,{preventScrollReset:me});if(vr=Gy(mt),vr)return q.add(vr.key),ua(dc,vr.result,!1,{preventScrollReset:me});let{loaderData:Xu,errors:mc}=QM(_,$o,Cy,void 0,hc,mt);da(Ka),_.navigation.state==="loading"&&Ka>N?(et(A,"Expected pending action"),L&&L.abort(),Jt(_.navigation.location,{matches:$o,loaderData:Xu,errors:mc,fetchers:new Map(_.fetchers)})):(ve({errors:mc,loaderData:ZM(_.loaderData,Xu,$o,mc),fetchers:new Map(_.fetchers)}),I=!1)}async function Va(j,$,H,Z,ce,_e,Ne,me,be){let Ce=_.fetchers.get(j);we(j,Zh(be,Ce?Ce.data:void 0),{flushSync:Ne});let Ge=new AbortController,Ee=pf(e.history,H,Ge.signal);if(_e){let Rt=await js(Z,new URL(Ee.url).pathname,Ee.signal,j);if(Rt.type==="aborted")return;if(Rt.type==="error"){$e(j,$,Rt.error,{flushSync:Ne});return}else if(Rt.matches)Z=Rt.matches;else{$e(j,$,Ui(404,{pathname:H}),{flushSync:Ne});return}}let Je=zb(Z,H);z.set(j,Ge);let ft=V,nr=Zf(a,s,Ee,Z,Je,r,ce),Mr=(await Ms(Ee,nr,ce,j))[Je.route.id];if(z.get(j)===Ge&&z.delete(j),!Ee.signal.aborted){if(G.has(j)){we(j,Hs(void 0));return}if(Oc(Mr))if(N>ft){we(j,Hs(void 0));return}else{q.add(j),await ua(Ee,Mr,!1,{preventScrollReset:me});return}if(pi(Mr)){$e(j,$,Mr.error);return}we(j,Hs(Mr.data))}}async function ua(j,$,H,{submission:Z,fetcherSubmission:ce,preventScrollReset:_e,replace:Ne}={}){H||(D==null||D.resolve(),D=null),$.response.headers.has("X-Remix-Revalidate")&&(I=!0);let me=$.response.headers.get("Location");et(me,"Expected a Location header on the redirect Response"),me=JM(me,new URL(j.url),c,e.history);let be=Mp(_.location,me,{_isRedirect:!0});if(n){let nr=!1;if($.response.headers.has("X-Remix-Reload-Document"))nr=!0;else if(aR(me)){const Vn=b4(me,!0);nr=Vn.origin!==t.location.origin||aa(Vn.pathname,c)==null}if(nr){Ne?t.location.replace(me):t.location.assign(me);return}}L=null;let Ce=Ne===!0||$.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ge,formAction:Ee,formEncType:Je}=_.navigation;!Z&&!ce&&Ge&&Ee&&Je&&(Z=nj(_.navigation));let ft=Z||ce;if(lQ.has($.response.status)&&ft&&xr(ft.formMethod))await On(Ce,be,{submission:{...ft,formAction:me},preventScrollReset:_e||O,enableViewTransition:H?B:void 0});else{let nr=y1(be,Z);await On(Ce,be,{overrideNavigation:nr,fetcherSubmission:ce,preventScrollReset:_e||O,enableViewTransition:H?B:void 0})}}async function Ms(j,$,H,Z){var Ne;let ce,_e={};try{ce=await bQ(f,j,$,Z,H,!1)}catch(me){return $.filter(be=>be.shouldLoad).forEach(be=>{_e[be.route.id]={type:"error",error:me}}),_e}if(j.signal.aborted)return _e;if(!xr(j.method))for(let me of $){if(((Ne=ce[me.route.id])==null?void 0:Ne.type)==="error")break;!ce.hasOwnProperty(me.route.id)&&!_.loaderData.hasOwnProperty(me.route.id)&&(!_.errors||!_.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(ce[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,be]of Object.entries(ce))if(RQ(be)){let Ce=be.result;_e[me]={type:"redirect",response:wQ(Ce,j,me,$,c)}}else _e[me]=await SQ(be);return _e}async function Y(j,$,H,Z){let ce=Ms(H,j,Z,null),_e=Promise.all($.map(async be=>{if(be.matches&&be.match&&be.request&&be.controller){let Ge=(await Ms(be.request,be.matches,Z,be.key))[be.match.route.id];return{[be.key]:Ge}}else return Promise.resolve({[be.key]:{type:"error",error:Ui(404,{pathname:be.path})}})})),Ne=await ce,me=(await _e).reduce((be,Ce)=>Object.assign(be,Ce),{});return{loaderResults:Ne,fetcherResults:me}}function le(){I=!0,T.forEach((j,$)=>{z.has($)&&F.add($),tr($)})}function we(j,$,H={}){_.fetchers.set(j,$),ve({fetchers:new Map(_.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function $e(j,$,H,Z={}){let ce=el(_.matches,$);Hn(j),ve({errors:{[ce.route.id]:H},fetchers:new Map(_.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function nt(j){return K.set(j,(K.get(j)||0)+1),G.has(j)&&G.delete(j),_.fetchers.get(j)||cQ}function br(j,$){tr(j,$==null?void 0:$.reason),we(j,Hs(null))}function Hn(j){let $=_.fetchers.get(j);z.has(j)&&!($&&$.state==="loading"&&ue.has(j))&&tr(j),T.delete(j),ue.delete(j),q.delete(j),G.delete(j),F.delete(j),_.fetchers.delete(j)}function fi(j){let $=(K.get(j)||0)-1;$<=0?(K.delete(j),G.add(j)):K.set(j,$),ve({fetchers:new Map(_.fetchers)})}function tr(j,$){let H=z.get(j);H&&(H.abort($),z.delete(j))}function fa(j){for(let $ of j){let H=nt($),Z=Hs(H.data);_.fetchers.set($,Z)}}function Mn(){let j=[],$=!1;for(let H of q){let Z=_.fetchers.get(H);et(Z,`Expected fetcher: ${H}`),Z.state==="loading"&&(q.delete(H),j.push(H),$=!0)}return fa(j),$}function da(j){let $=[];for(let[H,Z]of ue)if(Z<j){let ce=_.fetchers.get(H);et(ce,`Expected fetcher: ${H}`),ce.state==="loading"&&(tr(H),ue.delete(H),$.push(H))}return fa($),$.length>0}function Or(j,$){let H=_.blockers.get(j)||Qh;return oe.get(j)!==$&&oe.set(j,$),H}function ha(j){_.blockers.delete(j),oe.delete(j)}function Yu(j,$){let H=_.blockers.get(j)||Qh;et(H.state==="unblocked"&&$.state==="blocked"||H.state==="blocked"&&$.state==="blocked"||H.state==="blocked"&&$.state==="proceeding"||H.state==="blocked"&&$.state==="unblocked"||H.state==="proceeding"&&$.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${$.state}`);let Z=new Map(_.blockers);Z.set(j,$),ve({blockers:Z})}function _y({currentLocation:j,nextLocation:$,historyAction:H}){if(oe.size===0)return;oe.size>1&&ln(!1,"A router only supports one blocker at a time");let Z=Array.from(oe.entries()),[ce,_e]=Z[Z.length-1],Ne=_.blockers.get(ce);if(!(Ne&&Ne.state==="proceeding")&&_e({currentLocation:j,nextLocation:$,historyAction:H}))return ce}function Wu(j){let $=Ui(404,{pathname:j}),H=l||o,{matches:Z,route:ce}=Ky(H);return{notFoundMatches:Z,route:ce,error:$}}function Ey(j,$,H){if(p=j,x=$,b=H||null,!g&&_.navigation===g1){g=!0;let Z=jn(_.location,_.matches);Z!=null&&ve({restoreScrollPosition:Z})}return()=>{p=null,x=null,b=null}}function qe(j,$){return b&&b(j,$.map(Z=>v4(Z,_.loaderData)))||j.key}function gn(j,$){if(p&&x){let H=qe(j,$);p[H]=x()}}function jn(j,$){if(p){let H=qe(j,$),Z=p[H];if(typeof Z=="number")return Z}return null}function qn(j,$,H){if(e.patchRoutesOnNavigation)if(j){if(Object.keys(j[0].params).length>0)return{active:!0,matches:wm($,H,c,!0)}}else return{active:!0,matches:wm($,H,c,!0)||[]};return{active:!1,matches:null}}async function js(j,$,H,Z){if(!e.patchRoutesOnNavigation)return{type:"success",matches:j};let ce=j;for(;;){let _e=l==null,Ne=l||o,me=s;try{await e.patchRoutesOnNavigation({signal:H,path:$,matches:ce,fetcherKey:Z,patch:(Ge,Ee)=>{H.aborted||KM(Ge,Ee,Ne,me,a,!1)}})}catch(Ge){return{type:"error",error:Ge,partialMatches:ce}}finally{_e&&!H.aborted&&(o=[...o])}if(H.aborted)return{type:"aborted"};let be=Zo(Ne,$,c),Ce=null;if(be){if(Object.keys(be[0].params).length===0)return{type:"success",matches:be};if(Ce=wm(Ne,$,c,!0),!(Ce&&ce.length<Ce.length&&yn(ce,Ce.slice(0,ce.length))))return{type:"success",matches:be}}if(Ce||(Ce=wm(Ne,$,c,!0)),!Ce||yn(ce,Ce))return{type:"success",matches:null};ce=Ce}}function yn(j,$){return j.length===$.length&&j.every((H,Z)=>H.route.id===$[Z].route.id)}function Wr(j){s={},l=jp(j,a,void 0,s)}function Ju(j,$,H=!1){let Z=l==null;KM(j,$,l||o,s,a,H),Z&&(o=[...o],ve({}))}return k={get basename(){return c},get future(){return u},get state(){return _},get routes(){return o},get window(){return t},initialize:ye,subscribe:He,enableScrollRestoration:Ey,navigate:Nn,fetch:Bh,revalidate:Ii,createHref:j=>e.history.createHref(j),encodeLocation:j=>e.history.encodeLocation(j),getFetcher:nt,resetFetcher:br,deleteFetcher:fi,dispose:Ae,getBlocker:Or,deleteBlocker:ha,patchRoutes:Ju,_internalFetchControllers:z,_internalSetRoutes:Wr,_internalSetStateDoNotUseOrYouWillBreakYourApp(j){ve(j)}},e.unstable_instrumentations&&(k=eQ(k,e.unstable_instrumentations.map(j=>j.router).filter(Boolean))),k}function dQ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function LE(e,t,n,r,i,a){let s,o;if(i){s=[];for(let c of t)if(s.push(c),c.route.id===i){o=c;break}}else s=t,o=t[t.length-1];let l=j0(r||".",M0(s),aa(e.pathname,n)||e.pathname,a==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&o){let c=lR(l.search);if(o.route.index&&!c)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!o.route.index&&c){let f=new URLSearchParams(l.search),u=f.getAll("index");f.delete("index"),u.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();l.search=d?`?${d}`:""}}return n!=="/"&&(l.pathname=YX({basename:n,pathname:l.pathname})),ps(l)}function qM(e,t,n){if(!n||!dQ(n))return{path:t};if(n.formMethod&&!OQ(n.formMethod))return{path:t,error:Ui(405,{method:n.formMethod})};let r=()=>({path:t,error:Ui(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),s=z4(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!xr(a))return r();let u=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((d,[h,p])=>`${d}${h}=${p}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:u}}}else if(n.formEncType==="application/json"){if(!xr(a))return r();try{let u=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:s,formEncType:n.formEncType,formData:void 0,json:u,text:void 0}}}catch{return r()}}}et(typeof FormData=="function","FormData is not available in this environment");let o,l;if(n.formData)o=UE(n.formData),l=n.formData;else if(n.body instanceof FormData)o=UE(n.body),l=n.body;else if(n.body instanceof URLSearchParams)o=n.body,l=XM(o);else if(n.body==null)o=new URLSearchParams,l=new FormData;else try{o=new URLSearchParams(n.body),l=XM(o)}catch{return r()}let c={formMethod:a,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(xr(c.formMethod))return{path:t,submission:c};let f=Ql(t);return e&&f.search&&lR(f.search)&&o.append("index",""),f.search=`?${o}`,{path:ps(f),submission:c}}function VM(e,t,n,r,i,a,s,o,l,c,f,u,d,h,p,b,x,g,v,w,E){var U;let C=w?pi(w[1])?w[1].error:w[1].data:void 0,k=i.createURL(a.location),_=i.createURL(l),A;if(f&&a.errors){let I=Object.keys(a.errors)[0];A=s.findIndex(F=>F.route.id===I)}else if(w&&pi(w[1])){let I=w[0];A=s.findIndex(F=>F.route.id===I)-1}let D=w?w[1].statusCode:void 0,O=D&&D>=400,L={currentUrl:k,currentParams:((U=a.matches[0])==null?void 0:U.params)||{},nextUrl:_,nextParams:s[0].params,...o,actionResult:C,actionStatus:D},B=Ng(s),X=s.map((I,F)=>{let{route:z}=I,V=null;if(A!=null&&F>A?V=!1:z.lazy?V=!0:sR(z)?f?V=PE(z,a.loaderData,a.errors):hQ(a.loaderData,a.matches[F],I)&&(V=!0):V=!1,V!==null)return FE(n,r,e,B,I,c,t,V);let N=!1;typeof E=="boolean"?N=E:O?N=!1:(u||k.pathname+k.search===_.pathname+_.search||k.search!==_.search||mQ(a.matches[F],I))&&(N=!0);let ue={...L,defaultShouldRevalidate:N},q=Jm(I,ue);return FE(n,r,e,B,I,c,t,q,ue,E)}),W=[];return p.forEach((I,F)=>{if(f||!s.some(G=>G.route.id===I.routeId)||h.has(F))return;let z=a.fetchers.get(F),V=z&&z.state!=="idle"&&z.data===void 0,N=Zo(x,I.path,g);if(!N){if(v&&V)return;W.push({key:F,routeId:I.routeId,path:I.path,matches:null,match:null,request:null,controller:null});return}if(b.has(F))return;let ue=zb(N,I.path),q=new AbortController,T=pf(i,I.path,q.signal),K=null;if(d.has(F))d.delete(F),K=Zf(n,r,T,N,ue,c,t);else if(V)u&&(K=Zf(n,r,T,N,ue,c,t));else{let G;typeof E=="boolean"?G=E:O?G=!1:G=u;let oe={...L,defaultShouldRevalidate:G};Jm(ue,oe)&&(K=Zf(n,r,T,N,ue,c,t,oe))}K&&W.push({key:F,routeId:I.routeId,path:I.path,matches:K,match:ue,request:T,controller:q})}),{dsMatches:X,revalidatingFetchers:W}}function sR(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function PE(e,t,n){if(e.lazy)return!0;if(!sR(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function hQ(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function mQ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function KM(e,t,n,r,i,a){let s;if(e){let c=r[e];et(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),s=c.children}else s=n;let o=[],l=[];if(t.forEach(c=>{let f=s.find(u=>O4(c,u));f?l.push({existingRoute:f,newRoute:c}):o.push(c)}),o.length>0){let c=jp(o,i,[e||"_","patch",String((s==null?void 0:s.length)||"0")],r);s.push(...c)}if(a&&l.length>0)for(let c=0;c<l.length;c++){let{existingRoute:f,newRoute:u}=l[c],d=f,[h]=jp([u],i,[],{},!0);Object.assign(d,{element:h.element?h.element:d.element,errorElement:h.errorElement?h.errorElement:d.errorElement,hydrateFallbackElement:h.hydrateFallbackElement?h.hydrateFallbackElement:d.hydrateFallbackElement})}}function O4(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(a=>O4(n,a))}):!1}var GM=new WeakMap,M4=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(et(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let a=i.lazy[e];if(!a)return;let s=GM.get(i);s||(s={},GM.set(i,s));let o=s[e];if(o)return o;let l=(async()=>{let c=MX(e),u=i[e]!==void 0&&e!=="hasErrorBoundary";if(c)ln(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),s[e]=Promise.resolve();else if(u)ln(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let d=await a();d!=null&&(Object.assign(i,{[e]:d}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(d=>d===void 0)&&(i.lazy=void 0))})();return s[e]=l,l},YM=new WeakMap;function pQ(e,t,n,r,i){let a=n[e.id];if(et(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=YM.get(a);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let u=(async()=>{et(typeof e.lazy=="function","No lazy route function found");let d=await e.lazy(),h={};for(let p in d){let b=d[p];if(b===void 0)continue;let x=DX(p),v=a[p]!==void 0&&p!=="hasErrorBoundary";x?ln(!x,"Route property "+p+" is not a supported property to be returned from a lazy route function. This property will be ignored."):v?ln(!v,`Route "${a.id}" has a static property "${p}" defined but its lazy function is also returning a value for this property. The lazy route property "${p}" will be ignored.`):h[p]=b}Object.assign(a,h),Object.assign(a,{...r(a),lazy:void 0})})();return YM.set(a,u),u.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:u}}let s=Object.keys(e.lazy),o=[],l;for(let f of s){if(i&&i.includes(f))continue;let u=M4({key:f,route:e,manifest:n,mapRouteProperties:r});u&&(o.push(u),f===t&&(l=u))}let c=o.length>0?Promise.all(o).then(()=>{}):void 0;return c==null||c.catch(()=>{}),l==null||l.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:l}}async function WM(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,a)=>{n[t[a].route.id]=i}),n}async function gQ(e){return e.matches.some(t=>t.route.middleware)?j4(e,()=>WM(e)):WM(e)}function j4(e,t){return yQ(e,t,r=>{if(NQ(r))throw r;return r},CQ,n);function n(r,i,a){if(a)return Promise.resolve(Object.assign(a.value,{[i]:{type:"error",result:r}}));{let{matches:s}=e,o=Math.min(Math.max(s.findIndex(c=>c.route.id===i),0),Math.max(s.findIndex(c=>c.shouldCallHandler()),0)),l=el(s,s[o].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function yQ(e,t,n,r,i){let{matches:a,request:s,params:o,context:l,unstable_pattern:c}=e,f=a.flatMap(d=>d.route.middleware?d.route.middleware.map(h=>[d.route.id,h]):[]);return await D4({request:s,params:o,context:l,unstable_pattern:c},f,t,n,r,i)}async function D4(e,t,n,r,i,a,s=0){let{request:o}=e;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let l=t[s];if(!l)return await n();let[c,f]=l,u,d=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await D4(e,t,n,r,i,a,s+1)},u.value}catch(h){return u={value:await a(h,c,u)},u.value}};try{let h=await f(e,d),p=h!=null?r(h):void 0;return i(p)?p:u?p??u.value:(u={value:await d()},u.value)}catch(h){return await a(h,c,u)}}function I4(e,t,n,r,i){let a=M4({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),s=pQ(r.route,xr(n.method)?"action":"loader",t,e,i);return{middleware:a,route:s.lazyRoutePromise,handler:s.lazyHandlerPromise}}function FE(e,t,n,r,i,a,s,o,l=null,c){let f=!1,u=I4(e,t,n,i,a);return{...i,_lazyPromises:u,shouldLoad:o,shouldRevalidateArgs:l,shouldCallHandler(d){return f=!0,l?typeof c=="boolean"?Jm(i,{...l,defaultShouldRevalidate:c}):typeof d=="boolean"?Jm(i,{...l,defaultShouldRevalidate:d}):Jm(i,l):o},resolve(d){let{lazy:h,loader:p,middleware:b}=i.route,x=f||o||d&&!xr(n.method)&&(h||p),g=b&&b.length>0&&!p&&!h;return x&&(xr(n.method)||!g)?vQ({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:d,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function Zf(e,t,n,r,i,a,s,o=null){return r.map(l=>l.route.id!==i.route.id?{...l,shouldLoad:!1,shouldRevalidateArgs:o,shouldCallHandler:()=>!1,_lazyPromises:I4(e,t,n,l,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:FE(e,t,n,Ng(r),l,a,s,!0,o))}async function bQ(e,t,n,r,i,a){n.some(c=>{var f;return(f=c._lazyPromises)==null?void 0:f.middleware})&&await Promise.all(n.map(c=>{var f;return(f=c._lazyPromises)==null?void 0:f.middleware}));let s={request:t,unstable_pattern:Ng(n),params:n[0].params,context:i,matches:n},l=await e({...s,fetcherKey:r,runClientMiddleware:c=>{let f=s;return j4(f,()=>c({...f,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(c=>{var f,u;return[(f=c._lazyPromises)==null?void 0:f.handler,(u=c._lazyPromises)==null?void 0:u.route]}))}catch{}return l}async function vQ({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:a,scopedContext:s}){let o,l,c=xr(e.method),f=c?"action":"loader",u=d=>{let h,p=new Promise((g,v)=>h=v);l=()=>h(),e.signal.addEventListener("abort",l);let b=g=>typeof d!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):d({request:e,unstable_pattern:t,params:n.params,context:s},...g!==void 0?[g]:[]),x=(async()=>{try{return{type:"data",result:await(a?a(v=>b(v)):b())}}catch(g){return{type:"error",result:g}}})();return Promise.race([x,p])};try{let d=c?n.route.action:n.route.loader;if(r||i)if(d){let h,[p]=await Promise.all([u(d).catch(b=>{h=b}),r,i]);if(h!==void 0)throw h;o=p}else{await r;let h=c?n.route.action:n.route.loader;if(h)[o]=await Promise.all([u(h),i]);else if(f==="action"){let p=new URL(e.url),b=p.pathname+p.search;throw Ui(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(d)o=await u(d);else{let h=new URL(e.url),p=h.pathname+h.search;throw Ui(404,{pathname:p})}}catch(d){return{type:"error",result:d}}finally{l&&e.signal.removeEventListener("abort",l)}return o}async function xQ(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function SQ(e){var r,i,a,s,o;let{result:t,type:n}=e;if(oR(t)){let l;try{l=await xQ(t)}catch(c){return{type:"error",error:c}}return n==="error"?{type:"error",error:new Ag(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:"data",data:l,statusCode:t.status,headers:t.headers}}return n==="error"?tj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:kQ(t),statusCode:Dp(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Dp(t)?t.status:void 0}:tj(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function wQ(e,t,n,r,i){let a=e.headers.get("Location");if(et(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!aR(a)){let s=r.slice(0,r.findIndex(o=>o.route.id===n)+1);a=LE(new URL(t.url),s,i,a),e.headers.set("Location",a)}return e}function JM(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(aR(e)){let a=e,s=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(i.includes(s.protocol))throw new Error("Invalid redirect location");let o=aa(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}try{let a=r.createURL(e);if(i.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return e}function pf(e,t,n,r){let i=e.createURL(z4(t)).toString(),a={signal:n};if(r&&xr(r.formMethod)){let{formMethod:s,formEncType:o}=r;a.method=s.toUpperCase(),o==="application/json"?(a.headers=new Headers({"Content-Type":o}),a.body=JSON.stringify(r.json)):o==="text/plain"?a.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?a.body=UE(r.formData):a.body=r.formData}return new Request(i,a)}function UE(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function XM(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function _Q(e,t,n,r=!1,i=!1){let a={},s=null,o,l=!1,c={},f=n&&pi(n[1])?n[1].error:void 0;return e.forEach(u=>{if(!(u.route.id in t))return;let d=u.route.id,h=t[d];if(et(!Oc(h),"Cannot handle redirect results in processLoaderData"),pi(h)){let p=h.error;if(f!==void 0&&(p=f,f=void 0),s=s||{},i)s[d]=p;else{let b=el(e,d);s[b.route.id]==null&&(s[b.route.id]=p)}r||(a[d]=N4),l||(l=!0,o=Dp(h.error)?h.error.status:500),h.headers&&(c[d]=h.headers)}else a[d]=h.data,h.statusCode&&h.statusCode!==200&&!l&&(o=h.statusCode),h.headers&&(c[d]=h.headers)}),f!==void 0&&n&&(s={[n[0]]:f},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:c}}function QM(e,t,n,r,i,a){let{loaderData:s,errors:o}=_Q(t,n,r);return i.filter(l=>!l.matches||l.matches.some(c=>c.shouldLoad)).forEach(l=>{let{key:c,match:f,controller:u}=l;if(u&&u.signal.aborted)return;let d=a[c];if(et(d,"Did not find corresponding fetcher result"),pi(d)){let h=el(e.matches,f==null?void 0:f.route.id);o&&o[h.route.id]||(o={...o,[h.route.id]:d.error}),e.fetchers.delete(c)}else if(Oc(d))et(!1,"Unhandled fetcher revalidation redirect");else{let h=Hs(d.data);e.fetchers.set(c,h)}}),{loaderData:s,errors:o}}function ZM(e,t,n,r){let i=Object.entries(t).filter(([,a])=>a!==N4).reduce((a,[s,o])=>(a[s]=o,a),{});for(let a of n){let s=a.route.id;if(!t.hasOwnProperty(s)&&e.hasOwnProperty(s)&&a.route.loader&&(i[s]=e[s]),r&&r.hasOwnProperty(s))break}return i}function ej(e){return e?pi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function el(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ky(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ui(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let s="Unknown Server Error",o="Unknown @remix-run/router error";return e===400?(s="Bad Request",r&&t&&n?o=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(o="Unable to encode submission body")):e===403?(s="Forbidden",o=`Route "${n}" does not match URL "${t}"`):e===404?(s="Not Found",o=`No route matches URL "${t}"`):e===405&&(s="Method Not Allowed",r&&t&&n?o=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(o=`Invalid request method "${r.toUpperCase()}"`)),new Ag(e||500,s,new Error(o),!0)}function Gy(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Oc(i))return{key:r,result:i}}}function z4(e){let t=typeof e=="string"?Ql(e):e;return ps({...t,hash:""})}function EQ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function kQ(e){var t,n;return new Ag(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function CQ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&TQ(n))}function TQ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function RQ(e){return oR(e.result)&&R4.has(e.result.status)}function pi(e){return e.type==="error"}function Oc(e){return(e&&e.type)==="redirect"}function tj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function oR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function AQ(e){return R4.has(e)}function NQ(e){return oR(e)&&AQ(e.status)&&e.headers.has("Location")}function OQ(e){return oQ.has(e.toUpperCase())}function xr(e){return aQ.has(e.toUpperCase())}function lR(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function zb(e,t){let n=typeof t=="string"?Ql(t).search:t.search;if(e[e.length-1].route.index&&lR(n||""))return e[e.length-1];let r=_4(e);return r[r.length-1]}function nj(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function y1(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function MQ(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Zh(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jQ(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Hs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function DQ(e,t){try{let n=e.sessionStorage.getItem(A4);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(i,new Set(a||[]))}}catch{}}function IQ(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(A4,JSON.stringify(n))}catch(r){ln(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function rj(){let e,t,n=new Promise((r,i)=>{e=async a=>{r(a);try{await n}catch{}},t=async a=>{i(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Nu=y.createContext(null);Nu.displayName="DataRouter";var Og=y.createContext(null);Og.displayName="DataRouterState";var $4=y.createContext(!1);function zQ(){return y.useContext($4)}var cR=y.createContext({isTransitioning:!1});cR.displayName="ViewTransition";var L4=y.createContext(new Map);L4.displayName="Fetchers";var $Q=y.createContext(null);$Q.displayName="Await";var Di=y.createContext(null);Di.displayName="Navigation";var D0=y.createContext(null);D0.displayName="Location";var la=y.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var uR=y.createContext(null);uR.displayName="RouteError";var P4="REACT_ROUTER_ERROR",LQ="REDIRECT",PQ="ROUTE_ERROR_RESPONSE";function FQ(e){if(e.startsWith(`${P4}:${LQ}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function UQ(e){if(e.startsWith(`${P4}:${PQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ag(t.status,t.statusText,t.data)}catch{}}function BQ(e,{relative:t}={}){et(lh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Di),{hash:i,pathname:a,search:s}=Mg(e,{relative:t}),o=a;return n!=="/"&&(o=a==="/"?n:us([n,a])),r.createHref({pathname:o,search:s,hash:i})}function lh(){return y.useContext(D0)!=null}function Es(){return et(lh(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(D0).location}var F4="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function U4(e){y.useContext(Di).static||y.useLayoutEffect(e)}function Fa(){let{isDataRoute:e}=y.useContext(la);return e?rZ():HQ()}function HQ(){et(lh(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Nu),{basename:t,navigator:n}=y.useContext(Di),{matches:r}=y.useContext(la),{pathname:i}=Es(),a=JSON.stringify(M0(r)),s=y.useRef(!1);return U4(()=>{s.current=!0}),y.useCallback((l,c={})=>{if(ln(s.current,F4),!s.current)return;if(typeof l=="number"){n.go(l);return}let f=j0(l,JSON.parse(a),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:us([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,a,i,e])}var qQ=y.createContext(null);function VQ(e){let t=y.useContext(la).outlet;return y.useMemo(()=>t&&y.createElement(qQ.Provider,{value:e},t),[t,e])}function fR(){let{matches:e}=y.useContext(la),t=e[e.length-1];return t?t.params:{}}function Mg(e,{relative:t}={}){let{matches:n}=y.useContext(la),{pathname:r}=Es(),i=JSON.stringify(M0(n));return y.useMemo(()=>j0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function KQ(e,t,n,r,i){et(lh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(Di),{matches:s}=y.useContext(la),o=s[s.length-1],l=o?o.params:{},c=o?o.pathname:"/",f=o?o.pathnameBase:"/",u=o&&o.route;{let v=u&&u.path||"";q4(c,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=Es(),h;h=d;let p=h.pathname||"/",b=p;if(f!=="/"){let v=f.replace(/^\//,"").split("/");b="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=Zo(e,{pathname:b});return ln(u||x!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),ln(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),XQ(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:us([f,a.encodeLocation?a.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?f:us([f,a.encodeLocation?a.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),s,n,r,i)}function GQ(){let e=nZ(),t=Dp(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,s)}var YQ=y.createElement(GQ,null),B4=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=UQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(la.Provider,{value:this.props.routeContext},y.createElement(uR.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(WQ,{error:e},t):t}};B4.contextType=$4;var b1=new WeakMap;function WQ({children:e,error:t}){let{basename:n}=y.useContext(Di);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=FQ(t.digest);if(r){let i=b1.get(t);if(i)throw i;let a=k4(r.location,n);if(E4&&!b1.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw b1.set(t,s),s}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function JQ({routeContext:e,match:t,children:n}){let r=y.useContext(Nu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(la.Provider,{value:e},n)}function XQ(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=n==null?void 0:n.errors;if(s!=null){let f=a.findIndex(u=>u.route.id&&(s==null?void 0:s[u.route.id])!==void 0);et(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let o=!1,l=-1;if(n)for(let f=0;f<a.length;f++){let u=a[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=f),u.route.id){let{loaderData:d,errors:h}=n,p=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!h||h[u.route.id]===void 0);if(u.route.lazy||p){o=!0,l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}let c=n&&r?(f,u)=>{var d,h;r(f,{location:n.location,params:((h=(d=n.matches)==null?void 0:d[0])==null?void 0:h.params)??{},unstable_pattern:Ng(n.matches),errorInfo:u})}:void 0;return a.reduceRight((f,u,d)=>{let h,p=!1,b=null,x=null;n&&(h=s&&u.route.id?s[u.route.id]:void 0,b=u.route.errorElement||YQ,o&&(l<0&&d===0?(q4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,x=null):l===d&&(p=!0,x=u.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,d+1)),v=()=>{let w;return h?w=b:p?w=x:u.route.Component?w=y.createElement(u.route.Component,null):u.route.element?w=u.route.element:w=f,y.createElement(JQ,{match:u,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?y.createElement(B4,{location:n.location,revalidation:n.revalidation,component:b,error:h,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:c}):v()},null)}function dR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function QQ(e){let t=y.useContext(Nu);return et(t,dR(e)),t}function H4(e){let t=y.useContext(Og);return et(t,dR(e)),t}function ZQ(e){let t=y.useContext(la);return et(t,dR(e)),t}function hR(e){let t=ZQ(e),n=t.matches[t.matches.length-1];return et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function eZ(){return hR("useRouteId")}function tZ(){let{matches:e,loaderData:t}=H4("useMatches");return y.useMemo(()=>e.map(n=>v4(n,t)),[e,t])}function nZ(){var r;let e=y.useContext(uR),t=H4("useRouteError"),n=hR("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function rZ(){let{router:e}=QQ("useNavigate"),t=hR("useNavigate"),n=y.useRef(!1);return U4(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{ln(n.current,F4),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var ij={};function q4(e,t,n){!t&&!ij[e]&&(ij[e]=!0,ln(!1,n))}var aj={};function sj(e,t){!e&&!aj[t]&&(aj[t]=!0,console.warn(t))}var iZ="useOptimistic",oj=h0[iZ],aZ=()=>{};function sZ(e){return oj?oj(e):[e,aZ]}function oZ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ln(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ln(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ln(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var lZ=["HydrateFallback","hydrateFallbackElement"],cZ=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function uZ({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=zQ()||r;let[a,s]=y.useState(e.state),[o,l]=sZ(a),[c,f]=y.useState(),[u,d]=y.useState({isTransitioning:!1}),[h,p]=y.useState(),[b,x]=y.useState(),[g,v]=y.useState(),w=y.useRef(new Map),E=y.useCallback((A,{deletedFetchers:D,newErrors:O,flushSync:L,viewTransitionOpts:B})=>{O&&n&&Object.values(O).forEach(W=>{var U;return n(W,{location:A.location,params:((U=A.matches[0])==null?void 0:U.params)??{},unstable_pattern:Ng(A.matches)})}),A.fetchers.forEach((W,U)=>{W.data!==void 0&&w.current.set(U,W.data)}),D.forEach(W=>w.current.delete(W)),sj(L===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let X=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(sj(B==null||X,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!X){t&&L?t(()=>s(A)):r===!1?s(A):y.startTransition(()=>{r===!0&&l(W=>lj(W,A)),s(A)});return}if(t&&L){t(()=>{b&&(h==null||h.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let W=e.window.document.startViewTransition(()=>{t(()=>s(A))});W.finished.finally(()=>{t(()=>{p(void 0),x(void 0),f(void 0),d({isTransitioning:!1})})}),t(()=>x(W));return}b?(h==null||h.resolve(),b.skipTransition(),v({state:A,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(f(A),d({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[e.window,t,b,h,r,l,n]);y.useLayoutEffect(()=>e.subscribe(E),[e,E]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new cZ)},[u]),y.useEffect(()=>{if(h&&c&&e.window){let A=c,D=h.promise,O=e.window.document.startViewTransition(async()=>{r===!1?s(A):y.startTransition(()=>{r===!0&&l(L=>lj(L,A)),s(A)}),await D});O.finished.finally(()=>{p(void 0),x(void 0),f(void 0),d({isTransitioning:!1})}),x(O)}},[c,h,e.window,r,l]),y.useEffect(()=>{h&&c&&o.location.key===c.location.key&&h.resolve()},[h,b,o.location,c]),y.useEffect(()=>{!u.isTransitioning&&g&&(f(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[u.isTransitioning,g]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,D,O)=>e.navigate(A,{state:D,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(A,D,O)=>e.navigate(A,{replace:!0,state:D,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[e]),k=e.basename||"/",_=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:n}),[e,C,k,n]);return y.createElement(y.Fragment,null,y.createElement(Nu.Provider,{value:_},y.createElement(Og.Provider,{value:o},y.createElement(L4.Provider,{value:w.current},y.createElement(cR.Provider,{value:u},y.createElement(pZ,{basename:k,location:o.location,navigationType:o.historyAction,navigator:C,unstable_useTransitions:r},y.createElement(fZ,{routes:e.routes,future:e.future,state:o,onError:n})))))),null)}function lj(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var fZ=y.memo(dZ);function dZ({routes:e,future:t,state:n,onError:r}){return KQ(e,void 0,n,r,t)}function hZ({to:e,replace:t,state:n,relative:r}){et(lh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(Di);ln(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(la),{pathname:s}=Es(),o=Fa(),l=j0(e,M0(a),s,r==="path"),c=JSON.stringify(l);return y.useEffect(()=>{o(JSON.parse(c),{replace:t,state:n,relative:r})},[o,c,r,t,n]),null}function mZ(e){return VQ(e.context)}function pZ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:s}){et(!lh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),l=y.useMemo(()=>({basename:o,navigator:i,static:a,unstable_useTransitions:s,future:{}}),[o,i,a,s]);typeof n=="string"&&(n=Ql(n));let{pathname:c="/",search:f="",hash:u="",state:d=null,key:h="default"}=n,p=y.useMemo(()=>{let b=aa(c,o);return b==null?null:{location:{pathname:b,search:f,hash:u,state:d,key:h},navigationType:r}},[o,c,f,u,d,h,r]);return ln(p!=null,`<Router basename="${o}"> is not able to match the URL "${c}${f}${u}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:y.createElement(Di.Provider,{value:l},y.createElement(D0.Provider,{children:t,value:p}))}var $b="get",Lb="application/x-www-form-urlencoded";function I0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function gZ(e){return I0(e)&&e.tagName.toLowerCase()==="button"}function yZ(e){return I0(e)&&e.tagName.toLowerCase()==="form"}function bZ(e){return I0(e)&&e.tagName.toLowerCase()==="input"}function vZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xZ(e,t){return e.button===0&&(!t||t==="_self")&&!vZ(e)}function BE(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function SZ(e,t){let n=BE(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Yy=null;function wZ(){if(Yy===null)try{new FormData(document.createElement("form"),0),Yy=!1}catch{Yy=!0}return Yy}var _Z=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function v1(e){return e!=null&&!_Z.has(e)?(ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lb}"`),null):e}function EZ(e,t){let n,r,i,a,s;if(yZ(e)){let o=e.getAttribute("action");r=o?aa(o,t):null,n=e.getAttribute("method")||$b,i=v1(e.getAttribute("enctype"))||Lb,a=new FormData(e)}else if(gZ(e)||bZ(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||o.getAttribute("action");if(r=l?aa(l,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||$b,i=v1(e.getAttribute("formenctype"))||v1(o.getAttribute("enctype"))||Lb,a=new FormData(o,e),!wZ()){let{name:c,type:f,value:u}=e;if(f==="image"){let d=c?`${c}.`:"";a.append(`${d}x`,"0"),a.append(`${d}y`,"0")}else c&&a.append(c,u)}}else{if(I0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=$b,r=null,i=Lb,s=e}return a&&i==="text/plain"&&(s=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mR(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kZ(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&aa(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function CZ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function TZ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function RZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let s=await CZ(a,n);return s.links?s.links():[]}return[]}));return MZ(r.flat(1).filter(TZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function cj(e,t,n,r,i,a){let s=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,o=(l,c)=>{var f;return n[c].pathname!==l.pathname||((f=n[c].route.path)==null?void 0:f.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return a==="assets"?t.filter((l,c)=>s(l,c)||o(l,c)):a==="data"?t.filter((l,c)=>{var u;let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(s(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((u=n[0])==null?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function AZ(e,t,{includeHydrateFallback:n}={}){return NZ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function NZ(e){return[...new Set(e)]}function OZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function MZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(OZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function V4(){let e=y.useContext(Nu);return mR(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function jZ(){let e=y.useContext(Og);return mR(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pR=y.createContext(void 0);pR.displayName="FrameworkContext";function K4(){let e=y.useContext(pR);return mR(e,"You must render this element inside a <HydratedRouter> element"),e}function DZ(e,t){let n=y.useContext(pR),[r,i]=y.useState(!1),[a,s]=y.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=t,d=y.useRef(null);y.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let b=g=>{g.forEach(v=>{s(v.isIntersecting)})},x=new IntersectionObserver(b,{threshold:.5});return d.current&&x.observe(d.current),()=>{x.disconnect()}}},[e]),y.useEffect(()=>{if(r){let b=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(b)}}},[r]);let h=()=>{i(!0)},p=()=>{i(!1),s(!1)};return n?e!=="intent"?[a,d,{}]:[a,d,{onFocus:em(o,h),onBlur:em(l,p),onMouseEnter:em(c,h),onMouseLeave:em(f,p),onTouchStart:em(u,h)}]:[!1,d,{}]}function em(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function IZ({page:e,...t}){let{router:n}=V4(),r=y.useMemo(()=>Zo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement($Z,{page:e,matches:r,...t}):null}function zZ(e){let{manifest:t,routeModules:n}=K4(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return RZ(e,t,n).then(s=>{a||i(s)}),()=>{a=!0}},[e,t,n]),r}function $Z({page:e,matches:t,...n}){let r=Es(),{future:i,manifest:a,routeModules:s}=K4(),{basename:o}=V4(),{loaderData:l,matches:c}=jZ(),f=y.useMemo(()=>cj(e,t,c,a,r,"data"),[e,t,c,a,r]),u=y.useMemo(()=>cj(e,t,c,a,r,"assets"),[e,t,c,a,r]),d=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,x=!1;if(t.forEach(v=>{var E;let w=a.routes[v.route.id];!w||!w.hasLoader||(!f.some(C=>C.route.id===v.route.id)&&v.route.id in l&&((E=s[v.route.id])!=null&&E.shouldRevalidate)||w.hasClientLoader?x=!0:b.add(v.route.id))}),b.size===0)return[];let g=kZ(e,o,i.unstable_trailingSlashAwareDataRequests,"data");return x&&b.size>0&&g.searchParams.set("_routes",t.filter(v=>b.has(v.route.id)).map(v=>v.route.id).join(",")),[g.pathname+g.search]},[o,i.unstable_trailingSlashAwareDataRequests,l,r,a,f,t,e,s]),h=y.useMemo(()=>AZ(u,a),[u,a]),p=zZ(u);return y.createElement(y.Fragment,null,d.map(b=>y.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),h.map(b=>y.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),p.map(({key:b,link:x})=>y.createElement("link",{key:b,nonce:n.nonce,...x,crossOrigin:x.crossOrigin??n.crossOrigin})))}function LZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var PZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PZ&&(window.__reactRouterVersion="7.13.0")}catch{}function FZ(e,t){return fQ({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:RX({window:t==null?void 0:t.window}),hydrationData:UZ(),routes:e,mapRouteProperties:oZ,hydrationRouteProperties:lZ,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function UZ(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:BZ(e.errors)}),e}function BZ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Ag(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let s=new a(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}var G4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qa=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:s,state:o,target:l,to:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d,...h},p){let{basename:b,unstable_useTransitions:x}=y.useContext(Di),g=typeof c=="string"&&G4.test(c),v=k4(c,b);c=v.to;let w=BQ(c,{relative:i}),[E,C,k]=DZ(r,h),_=KZ(c,{replace:s,state:o,target:l,preventScrollReset:f,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:x});function A(O){t&&t(O),O.defaultPrevented||_(O)}let D=y.createElement("a",{...h,...k,href:v.absoluteURL||w,onClick:v.isExternal||a?t:A,ref:LZ(p,C),target:l,"data-discover":!g&&n==="render"?"true":void 0});return E&&!g?y.createElement(y.Fragment,null,D,y.createElement(IZ,{page:w})):D});Qa.displayName="Link";var HZ=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:s,viewTransition:o,children:l,...c},f){let u=Mg(s,{relative:c.relative}),d=Es(),h=y.useContext(Og),{navigator:p,basename:b}=y.useContext(Di),x=h!=null&&XZ(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(v=v.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&b&&(w=aa(w,b)||w);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let C=v===g||!i&&v.startsWith(g)&&v.charAt(E)==="/",k=w!=null&&(w===g||!i&&w.startsWith(g)&&w.charAt(g.length)==="/"),_={isActive:C,isPending:k,isTransitioning:x},A=C?t:void 0,D;typeof r=="function"?D=r(_):D=[r,C?"active":null,k?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let O=typeof a=="function"?a(_):a;return y.createElement(Qa,{...c,"aria-current":A,className:D,ref:f,style:O,to:s,viewTransition:o},typeof l=="function"?l(_):l)});HZ.displayName="NavLink";var qZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:s=$b,action:o,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d,...h},p)=>{let{unstable_useTransitions:b}=y.useContext(Di),x=WZ(),g=JZ(o,{relative:c}),v=s.toLowerCase()==="get"?"get":"post",w=typeof o=="string"&&G4.test(o),E=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,_=(k==null?void 0:k.getAttribute("formmethod"))||s,A=()=>x(k||C.currentTarget,{fetcherKey:t,method:_,navigate:n,replace:i,state:a,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d});b&&n!==!1?y.startTransition(()=>A()):A()};return y.createElement("form",{ref:p,method:v,action:g,onSubmit:r?l:E,...h,"data-discover":!w&&e==="render"?"true":void 0})});qZ.displayName="Form";function VZ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y4(e){let t=y.useContext(Nu);return et(t,VZ(e)),t}function KZ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:o,unstable_useTransitions:l}={}){let c=Fa(),f=Es(),u=Mg(e,{relative:a});return y.useCallback(d=>{if(xZ(d,t)){d.preventDefault();let h=n!==void 0?n:ps(f)===ps(u),p=()=>c(e,{replace:h,state:r,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:o});l?y.startTransition(()=>p()):p()}},[f,c,u,n,r,t,e,i,a,s,o,l])}function W4(e){ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(BE(e)),n=y.useRef(!1),r=Es(),i=y.useMemo(()=>SZ(r.search,n.current?null:t.current),[r.search]),a=Fa(),s=y.useCallback((o,l)=>{const c=BE(typeof o=="function"?o(new URLSearchParams(i)):o);n.current=!0,a("?"+c,l)},[a,i]);return[i,s]}var GZ=0,YZ=()=>`__${String(++GZ)}__`;function WZ(){let{router:e}=Y4("useSubmit"),{basename:t}=y.useContext(Di),n=eZ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,s={})=>{let{action:o,method:l,encType:c,formData:f,body:u}=EZ(a,t);if(s.navigate===!1){let d=s.fetcherKey||YZ();await r(d,n,s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:u,formMethod:s.method||l,formEncType:s.encType||c,flushSync:s.flushSync})}else await i(s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:u,formMethod:s.method||l,formEncType:s.encType||c,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,i,t,n])}function JZ(e,{relative:t}={}){let{basename:n}=y.useContext(Di),r=y.useContext(la);et(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Mg(e||".",{relative:t})},s=Es();if(e==null){a.search=s.search;let o=new URLSearchParams(a.search),l=o.getAll("index");if(l.some(f=>f==="")){o.delete("index"),l.filter(u=>u).forEach(u=>o.append("index",u));let f=o.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:us([n,a.pathname])),ps(a)}function XZ(e,{relative:t}={}){let n=y.useContext(cR);et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Y4("useViewTransitionState"),i=Mg(e,{relative:t});if(!n.isTransitioning)return!1;let a=aa(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=aa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qv(i.pathname,s)!=null||qv(i.pathname,a)!=null}const Vv={dockerDismissed:"codecommit-docker-dismissed",grantedDismissed:"codecommit-granted-dismissed",theme:"codecommit-theme"},J4=y.createContext({theme:"system",setTheme:()=>{}}),QZ=()=>{const e=localStorage.getItem(Vv.theme);return e==="dark"||e==="light"||e==="system"?e:"system"};function ZZ({children:e}){const[t,n]=y.useState(QZ),r=y.useCallback(i=>{localStorage.setItem(Vv.theme,i),n(i)},[]);return y.useEffect(()=>{const i=document.documentElement,a=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;i.classList.remove("dark","light"),i.classList.add(a)},[t]),y.useEffect(()=>{if(t!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{const s=document.documentElement;s.classList.remove("dark","light"),s.classList.add(i.matches?"dark":"light")};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[t]),m.jsx(J4,{value:{theme:t,setTheme:r},children:e})}function X4(){return y.useContext(J4)}const eee=e=>typeof e=="function",R=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(i){return t(i,n)}};case 3:return function(n,r,i){return arguments.length>=3?t(n,r,i):function(a){return t(a,n,r)}};case 4:return function(n,r,i,a){return arguments.length>=4?t(n,r,i,a):function(s){return t(s,n,r,i)}};case 5:return function(n,r,i,a,s){return arguments.length>=5?t(n,r,i,a,s):function(o){return t(o,n,r,i,a)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},ke=e=>e,jg=e=>()=>e,HE=jg(!0),vl=jg(!1),tee=jg(null),Q4=jg(void 0),Cd=Q4;function M(e,t,n,r,i,a,s,o,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return s(a(i(r(n(t(e))))));case 8:return o(s(a(i(r(n(t(e)))))));case 9:return l(o(s(a(i(r(n(t(e))))))));default:{let c=arguments[0];for(let f=1;f<arguments.length;f++)c=arguments[f](c);return c}}}const Wy="effect/GlobalValue";let tm;const De=(e,t)=>(tm||(globalThis[Wy]??(globalThis[Wy]=new Map),tm=globalThis[Wy]),tm.has(e)||tm.set(e,t()),tm.get(e)),ji=e=>typeof e=="string",wo=e=>typeof e=="number",Td=e=>typeof e=="boolean",z0=e=>typeof e=="bigint",qE=e=>typeof e=="symbol",ch=eee,nee=e=>e===void 0,ree=e=>e!==void 0,x1=e=>e!==null,iee=e=>!1,gR=e=>typeof e=="object"&&e!==null,Oa=e=>gR(e)||ch(e),Re=R(2,(e,t)=>Oa(e)&&t in e),yR=R(2,(e,t)=>Re(e,"_tag")&&e._tag===t),ef=e=>e==null,aee=e=>e!=null,see=e=>e instanceof Uint8Array,Z4=e=>e instanceof Date,e5=e=>typeof e=="string"||Re(e,Symbol.iterator),oee=e=>gR(e)&&!Array.isArray(e),lee=e=>Re(e,"then")&&ch(e.then),$0=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;let t5=class n5{constructor(t){S(this,"self");S(this,"called",!1);this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new n5(this.self)}};const cee=335903614,uee=4150755663,fee=1481765933,dee=1284865837,hee=9007199254740992,mee=134217728;class pee{constructor(t,n,r,i){S(this,"_state");return ef(n)&&ef(t)?(n=Math.random()*4294967295>>>0,t=0):ef(n)&&(n=t,t=0),ef(i)&&ef(r)?(i=this._state?this._state[3]:uee,r=this._state?this._state[2]:cee):ef(i)&&(i=r,r=0),this._state=new Int32Array([0,0,r>>>0,((i||0)|1)>>>0]),this._next(),uj(this._state,this._state[0],this._state[1],t>>>0,n>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=t[3]|1}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){const t=(this._next()&67108863)*1,n=(this._next()&134217727)*1;return(t*mee+n)/hee}_next(){const t=this._state[0]>>>0,n=this._state[1]>>>0;gee(this._state,t,n,fee,dee),uj(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,i=(n>>>18|t<<14)>>>0;r=(r^t)>>>0,i=(i^n)>>>0;const a=(i>>>27|r<<5)>>>0,s=t>>>27,o=(-s>>>0&31)>>>0;return(a>>>s|a<<o)>>>0}}function gee(e,t,n,r,i){let a=(n>>>16)*(i&65535)>>>0,s=(n&65535)*(i>>>16)>>>0,o=(n&65535)*(i&65535)>>>0,l=(n>>>16)*(i>>>16)+((s>>>16)+(a>>>16))>>>0;s=s<<16>>>0,o=o+s>>>0,o>>>0<s>>>0&&(l=l+1>>>0),a=a<<16>>>0,o=o+a>>>0,o>>>0<a>>>0&&(l=l+1>>>0),l=l+Math.imul(n,r)>>>0,l=l+Math.imul(t,i)>>>0,e[0]=l,e[1]=o}function uj(e,t,n,r,i){let a=t+r>>>0;const s=n+i>>>0;s>>>0<n>>>0&&(a=a+1|0),e[0]=a,e[1]=s}const VE=Symbol.for("effect/Utils/YieldWrap");var pg;class Dg{constructor(t){Nw(this,pg);Ay(this,pg,t)}[VE](){return Ry(this,pg)}}pg=new WeakMap;function yee(e){if(typeof e=="object"&&e!==null&&VE in e)return e[VE]();throw new Error($0("yieldWrapGet"))}const $i=De("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),r5={effect_internal_function:e=>e()},bee={effect_internal_function:e=>{try{return e()}finally{}}};var V$;const vee=((V$=r5.effect_internal_function(()=>new Error().stack))==null?void 0:V$.includes("effect_internal_function"))===!0,lr=vee?r5.effect_internal_function:bee.effect_internal_function,S1=De(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),Fe=Symbol.for("effect/Hash"),de=e=>{if($i.enabled===!0)return 0;switch(typeof e){case"number":return vR(e);case"bigint":return qt(e.toString(10));case"boolean":return qt(String(e));case"symbol":return qt(String(e));case"string":return qt(e);case"undefined":return qt("undefined");case"function":case"object":return e===null?qt("null"):e instanceof Date?Number.isNaN(e.getTime())?qt("Invalid Date"):de(e.toISOString()):e instanceof URL?de(e.href):xee(e)?e[Fe]():bR(e);default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},bR=e=>(S1.has(e)||S1.set(e,vR(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),S1.get(e)),Be=e=>t=>t*53^e,L0=e=>e&3221225471|e>>>1&1073741824,xee=e=>Re(e,Fe),vR=e=>{if(e!==e||e===1/0)return 0;let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return L0(t)},qt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return L0(t)},See=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=M(qt(t[r]),Be(de(e[t[r]])));return L0(n)},i5=e=>See(e,Object.keys(e)),uh=e=>{let t=6151;for(let n=0;n<e.length;n++)t=M(t,Be(de(e[n])));return L0(t)},Tt=function(){if(arguments.length===1){const n=arguments[0];return function(r){return Object.defineProperty(n,Fe,{value(){return r},enumerable:!1}),r}}const e=arguments[0],t=arguments[1];return Object.defineProperty(e,Fe,{value(){return t},enumerable:!1}),t},Ue=Symbol.for("effect/Equal");function xe(){return arguments.length===1?e=>Kv(e,arguments[0]):Kv(arguments[0],arguments[1])}function Kv(e,t){if(e===t)return!0;const n=typeof e;if(n!==typeof t)return!1;if(n==="object"||n==="function"){if(e!==null&&t!==null){if(Ip(e)&&Ip(t))return de(e)===de(t)&&e[Ue](t)?!0:$i.enabled&&$i.tester?$i.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){const r=e.getTime(),i=t.getTime();return r===i||Number.isNaN(r)&&Number.isNaN(i)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if($i.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,i)=>Kv(r,t[i]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(e),i=Object.keys(t);if(r.length===i.length){for(const a of r)if(!(a in t&&Kv(e[a],t[a])))return $i.tester?$i.tester(e,t):!1;return!0}}return $i.tester?$i.tester(e,t):!1}}return $i.enabled&&$i.tester?$i.tester(e,t):!1}const Ip=e=>Re(e,Ue),xR=()=>xe,ut=Symbol.for("nodejs.util.inspect.custom"),Qt=e=>{try{if(Re(e,"toJSON")&&ch(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Qt)}catch{return{}}return SR(e)},w1="[Circular]";function a5(e){try{return e.toISOString()}catch{return"Invalid Date"}}function wee(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function P0(e){return ji(e)?JSON.stringify(e):String(e)}function No(e,t){const n=new WeakSet,r=(s,o)=>{const l=s==null?void 0:s.constructor;return l&&l!==Object.prototype.constructor&&l.name?`${l.name}(${o})`:o},i=s=>{try{return Reflect.ownKeys(s)}catch{return["[ownKeys threw]"]}};function a(s,o=0){if(Array.isArray(s))return n.has(s)?w1:(n.add(s),`[${s.map(l=>a(l,o)).join(",")}]`);if(Z4(s))return a5(s);if(Re(s,"toString")&&ch(s.toString)&&s.toString!==Object.prototype.toString&&s.toString!==Array.prototype.toString){const l=wee(s);return s instanceof Error&&s.cause?`${l} (cause: ${a(s.cause,o)})`:l}if(ji(s))return JSON.stringify(s);if(wo(s)||s==null||Td(s)||qE(s))return String(s);if(z0(s))return String(s)+"n";if(s instanceof Set||s instanceof Map)return n.has(s)?w1:(n.add(s),`${s.constructor.name}(${a(Array.from(s),o)})`);if(Oa(s)){if(n.has(s))return w1;n.add(s);const l=i(s);{const c=`{${l.map(f=>`${P0(f)}:${a(s[f],o)}`).join(",")}}`;return r(s,c)}}return String(s)}return a(e,0)}const Mt=e=>JSON.stringify(e,null,2),F0={toJSON(){return Qt(this)},[ut](){return this.toJSON()},toString(){return Mt(this.toJSON())}};let _ee=class{[ut](){return this.toJSON()}toString(){return Mt(this.toJSON())}};const Rd=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?s5(e,t):String(e)}catch{return String(e)}},s5=(e,t)=>{let n=[];const r=JSON.stringify(e,(i,a)=>typeof a=="object"&&a!==null?n.includes(a)?void 0:n.push(a)&&(Hc.fiberRefs!==void 0&&o5(a)?a[U0](Hc.fiberRefs):a):a,t);return n=void 0,r},U0=Symbol.for("effect/Inspectable/Redactable"),o5=e=>typeof e=="object"&&e!==null&&U0 in e,Hc=De("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),Eee=(e,t)=>{const n=Hc.fiberRefs;Hc.fiberRefs=e;try{return t()}finally{Hc.fiberRefs=n}},SR=e=>o5(e)&&Hc.fiberRefs!==void 0?e[U0](Hc.fiberRefs):e,he=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,i=t.length;r<i;r++)n=t[r](n);return n}}},Xm="Async",B0="Commit",Xn="Failure",Pb="OnFailure",Gv="OnSuccess",Yv="OnSuccessAndFailure",Qn="Success",l5="Sync",kee="Tag",fh="UpdateRuntimeFlags",Wv="While",Qm="Iterator",c5="WithRuntime",Fb="Yield",wR="RevertFlags";let Cee="3.19.19";const _R=()=>Cee,Tee=Symbol.for("effect/Effect"),Ree=Symbol.for("effect/Stream"),Aee=Symbol.for("effect/Sink"),Nee=Symbol.for("effect/Channel"),Ad={_R:e=>e,_E:e=>e,_A:e=>e,_V:_R()},Oee={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},Mee={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Ig={[Tee]:Ad,[Ree]:Ad,[Aee]:Oee,[Nee]:Mee,[Ue](e){return this===e},[Fe](){return Tt(this,bR(this))},[Symbol.iterator](){return new t5(new Dg(this))},pipe(){return he(this,arguments)}},zg={[Fe](){return Tt(this,i5(this))},[Ue](e){const t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(const r of t)if(!(r in e&&xe(this[r],e[r])))return!1;return!0}},$g={...Ig,_op:B0},jee={...$g,...zg},Dee=function(){function e(){}return e.prototype=$g,e}(),u5=Symbol.for("effect/Option"),f5={...Ig,[u5]:{_A:e=>e},[ut](){return this.toJSON()},toString(){return Mt(this.toJSON())}},Iee=Object.assign(Object.create(f5),{_tag:"Some",_op:"Some",[Ue](e){return ER(e)&&d5(e)&&xe(this.value,e.value)},[Fe](){return Tt(this,Be(de(this._tag))(de(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:Qt(this.value)}}}),zee=de("None"),$ee=Object.assign(Object.create(f5),{_tag:"None",_op:"None",[Ue](e){return ER(e)&&kR(e)},[Fe](){return zee},toJSON(){return{_id:"Option",_tag:this._tag}}}),ER=e=>Re(e,u5),kR=e=>e._tag==="None",d5=e=>e._tag==="Some",Nd=Object.create($ee),ro=e=>{const t=Object.create(Iee);return t.value=e,t},h5=Symbol.for("effect/Context/Tag"),Jv=Symbol.for("effect/Context/Reference"),Lee="effect/STM",Pee=Symbol.for(Lee),CR={...Ig,_op:"Tag",[Pee]:Ad,[h5]:{_Service:e=>e,_Identifier:e=>e},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[ut](){return this.toJSON()},of(e){return e},context(e){return g5(this,e)}},Fee={...CR,[Jv]:Jv},Uee=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;const r=Object.create(CR);return Object.defineProperty(r,"stack",{get(){return n.stack}}),r.key=e,r},Bee=e=>()=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,CR),r.key=e,Object.defineProperty(r,"stack",{get(){return n.stack}}),r},Hee=()=>(e,t)=>{const n=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=n;function i(){}return Object.setPrototypeOf(i,Fee),i.key=e,i.defaultValue=t.defaultValue,Object.defineProperty(i,"stack",{get(){return r.stack}}),i},m5=Symbol.for("effect/Context"),qee={[m5]:{_Services:e=>e},[Ue](e){if(p5(e)&&this.unsafeMap.size===e.unsafeMap.size){for(const t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!xe(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[Fe](){return Tt(this,vR(this.unsafeMap.size))},pipe(){return he(this,arguments)},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(Qt)}},[ut](){return this.toJSON()}},Il=e=>{const t=Object.create(qee);return t.unsafeMap=e,t},Vee=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
62
+ `);if(n.length>2){const r=n[2].match(/at (.*)/);r&&(t.message=t.message+` (defined at ${r[1]})`)}}if(t.stack){const n=t.stack.split(`
63
+ `);n.splice(1,3),t.stack=n.join(`
64
+ `)}return t},p5=e=>Re(e,m5),Kee=e=>Re(e,h5),Gee=e=>Re(e,Jv),Yee=Il(new Map),Wee=()=>Yee,g5=(e,t)=>Il(new Map([[e.key,t]])),Jee=R(3,(e,t,n)=>{const r=new Map(e.unsafeMap);return r.set(t.key,n),Il(r)}),_1=De("effect/Context/defaultValueCache",()=>new Map),TR=e=>{if(_1.has(e.key))return _1.get(e.key);const t=e.defaultValue();return _1.set(e.key,t),t},Xee=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):TR(t),y5=R(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Jv in t)return TR(t);throw Vee(t)}return e.unsafeMap.get(t.key)}),Qee=y5,Zee=R(2,(e,t)=>e.unsafeMap.has(t.key)?ro(e.unsafeMap.get(t.key)):Gee(t)?ro(TR(t)):Nd),ete=R(2,(e,t)=>{const n=new Map(e.unsafeMap);for(const[r,i]of t.unsafeMap)n.set(r,i);return Il(n)}),tte=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((r,i)=>{t.set(i,r)});return Il(t)},Zl=Uee,nte=Il,rte=p5,b5=Kee,gs=Wee,RR=g5,Xi=Jee,mo=Qee,v5=y5,dh=Zee,oi=ete,ite=tte,AR=Bee,hh=Hee,H0=e=>(t,n)=>t===n||e(t,n),ate=(e,t)=>e===t,ste=()=>ate,ote=ste(),x5=R(2,(e,t)=>H0((n,r)=>e(t(n),t(r)))),lte=x5(ote,e=>e.getTime()),cte=e=>H0((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}),NR=Symbol.for("effect/Either"),S5={...Ig,[NR]:{_R:e=>e},[ut](){return this.toJSON()},toString(){return Mt(this.toJSON())}},ute=Object.assign(Object.create(S5),{_tag:"Right",_op:"Right",[Ue](e){return OR(e)&&w5(e)&&xe(this.right,e.right)},[Fe](){return Be(de(this._tag))(de(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:Qt(this.right)}}}),fte=Object.assign(Object.create(S5),{_tag:"Left",_op:"Left",[Ue](e){return OR(e)&&MR(e)&&xe(this.left,e.left)},[Fe](){return Be(de(this._tag))(de(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:Qt(this.left)}}}),OR=e=>Re(e,NR),MR=e=>e._tag==="Left",w5=e=>e._tag==="Right",_5=e=>{const t=Object.create(fte);return t.left=e,t},E5=e=>{const t=Object.create(ute);return t.right=e,t},dte=e=>MR(e)?Nd:ro(e.right),hte=R(2,(e,t)=>kR(e)?_5(t()):E5(e.value)),mte=NR,Me=E5,je=_5,pte=hte,gte=e=>{if(ch(e))try{return Me(e())}catch(t){return je(t)}else try{return Me(e.try())}catch(t){return je(e.catch(t))}},k5=OR,Gn=MR,rs=w5,yte=R(2,(e,{onLeft:t,onRight:n})=>Gn(e)?je(t(e.left)):Me(n(e.right))),bte=R(2,(e,t)=>Gn(e)?je(t(e.left)):Me(e.right)),vte=R(2,(e,t)=>rs(e)?Me(t(e.right)):je(e.left)),ri=R(2,(e,{onLeft:t,onRight:n})=>Gn(e)?t(e.left):n(e.right)),xte=ri({onLeft:ke,onRight:ke}),C5=R(2,(e,t)=>{if(rs(e))return e.right;throw t(e.left)}),T5=C5(()=>new Error("getOrThrow called on a Left")),R5=e=>e.length>0,A5=e=>(t,n)=>t===n?0:e(t,n),Ste=A5((e,t)=>e<t?-1:1),N5=R(2,(e,t)=>A5((n,r)=>e(t(n),t(r)))),wte=e=>R(2,(t,n)=>e(t,n)===1),_te=Symbol.for("effect/Option"),ne=()=>Nd,ae=ro,Ete=ER,Yt=kR,zt=d5,Dt=R(2,(e,{onNone:t,onSome:n})=>Yt(e)?t():n(e.value)),kte=dte,Ut=R(2,(e,t)=>Yt(e)?t():e.value),Ta=R(2,(e,t)=>Yt(e)?t():e),Cte=R(2,(e,t)=>Yt(e)?ae(t()):e),mh=e=>e==null?ne():ae(e),Tte=Ut(tee),Vi=Ut(Q4),Rte=e=>(...t)=>{try{return ae(e(...t))}catch{return ne()}},O5=R(2,(e,t)=>{if(zt(e))return e.value;throw t()}),Ate=O5(()=>new Error("getOrThrow called on a None")),ii=R(2,(e,t)=>Yt(e)?ne():ae(t(e.value))),Oo=R(2,(e,t)=>Yt(e)?ne():t(e.value)),M5=R(2,(e,t)=>Yt(e)?ne():mh(t(e.value))),Nte=Oo,gf=R(2,(e,t)=>Nte(e,n=>t(n)?ro(n):Nd)),Ote=e=>H0((t,n)=>Yt(t)?Yt(n):Yt(n)?!1:e(t.value,n.value)),Mte=e=>R(2,(t,n)=>Yt(t)?!1:e(t.value,n)),jte=xR(),Dte=Mte(jte),Ite=R(2,(e,t)=>Yt(e)?!1:t(e.value)),zte=(...e)=>e,$te=()=>({}),Lte=e=>j5(e).length===0,Pf=R(2,(e,t)=>{const n={...e};for(const r of j5(e))n[r]=t(e[r],r);return n}),j5=e=>Object.keys(e),Pte=R(3,(e,t,n)=>({...e,[t]:n})),q0=e=>new Array(e),Fte=R(2,(e,t)=>{const n=Math.max(1,Math.floor(e)),r=new Array(n);for(let i=0;i<n;i++)r[i]=t(i);return r}),yt=e=>Array.isArray(e)?e:Array.from(e),Ute=e=>Array.isArray(e)?e:[e],Bte=R(2,(e,{onEmpty:t,onNonEmpty:n})=>cn(e)?n(Ur(e),nu(e)):t()),Xv=R(2,(e,t)=>[t,...e]),Hte=R(2,(e,t)=>[...e,t]),jR=R(2,(e,t)=>yt(e).concat(yt(t))),qte=Array.isArray,Vte=e=>e.length===0,Kte=Vte,ed=R5,cn=R5,D5=(e,t)=>e<0||e>=t.length,Gte=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),Yte=R(2,(e,t)=>{const n=Math.floor(t);return D5(n,e)?ne():ae(e[n])}),I5=R(2,(e,t)=>{const n=Math.floor(t);if(D5(n,e))throw new Error(`Index ${n} out of bounds`);return e[n]}),Zm=Yte(0),Ur=I5(0),Wte=e=>cn(e)?ae(z5(e)):ne(),z5=e=>e[e.length-1],nu=e=>e.slice(1),Jte=(e,t)=>{let n=0;for(const r of e){if(!t(r,n))break;n++}return n},Xte=R(2,(e,t)=>$5(e,Jte(e,t))),Qte=R(2,(e,t)=>{const n=yt(e);return n.slice(Gte(t,n),n.length)}),fj=e=>Array.from(e).reverse(),zp=R(2,(e,t)=>{const n=Array.from(e);return n.sort(t),n}),dj=R(2,(e,t)=>Zte(e,t,zte)),Zte=R(3,(e,t,n)=>{const r=yt(e),i=yt(t);if(cn(r)&&cn(i)){const a=[n(Ur(r),Ur(i))],s=Math.min(r.length,i.length);for(let o=1;o<s;o++)a[o]=n(r[o],i[o]);return a}return[]}),ene=xR(),$5=R(2,(e,t)=>{const n=Array.from(e),r=Math.floor(t);return cn(n)?r>=1?tne(n,r):[[],n]:[n,[]]}),tne=R(2,(e,t)=>{const n=Math.max(1,Math.floor(t));return n>=e.length?[_m(e),[]]:[Xv(e.slice(1,n),Ur(e)),e.slice(n)]}),_m=e=>e.slice(),nne=R(3,(e,t,n)=>{const r=yt(e),i=yt(t);return cn(r)?cn(i)?P5(n)(jR(r,i)):r:i}),Ub=R(2,(e,t)=>nne(e,t,ene)),zl=()=>[],va=e=>[e],qc=R(2,(e,t)=>e.map(t)),Qv=R(2,(e,t)=>{if(Kte(e))return[];const n=[];for(let r=0;r<e.length;r++){const i=t(e[r],r);for(let a=0;a<i.length;a++)n.push(i[a])}return n}),L5=Qv(ke),rne=R(2,(e,t)=>{const n=yt(e),r=[];for(let i=0;i<n.length;i++){const a=t(n[i],i);zt(a)&&r.push(a.value)}return r}),ine=R(2,(e,t)=>{const n=yt(e),r=[];for(let i=0;i<n.length;i++)t(n[i],i)&&r.push(n[i]);return r}),DR=R(3,(e,t,n)=>yt(e).reduce((r,i,a)=>n(r,i,a),t)),hj=(e,t)=>{const n=[];let r=e,i;for(;zt(i=t(r));){const[a,s]=i.value;n.push(a),r=s}return n},V0=cte,P5=R(2,(e,t)=>{const n=yt(e);if(cn(n)){const r=[Ur(n)],i=nu(n);for(const a of i)r.every(s=>!t(a,s))&&r.push(a);return r}return[]}),ane=e=>P5(e,xR()),ph=R(2,(e,t)=>yt(e).join(t)),F5=Symbol.for("effect/Chunk");function sne(e,t,n,r,i){for(let a=t;a<Math.min(e.length,t+i);a++)n[r+a-t]=e[a];return n}const U5=[],B5=e=>H0((t,n)=>t.length===n.length&&Br(t).every((r,i)=>e(r,xl(n,i)))),one=B5(xe),lne={[F5]:{_A:e=>e},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"Chunk",values:Br(this).map(Qt)}},[ut](){return this.toJSON()},[Ue](e){return K0(e)&&one(this,e)},[Fe](){return Tt(this,uh(Br(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return U5[Symbol.iterator]();default:return Br(this)[Symbol.iterator]()}},pipe(){return he(this,arguments)}},rn=e=>{const t=Object.create(lne);switch(t.backing=e,e._tag){case"IEmpty":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case"IConcat":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case"IArray":{t.length=e.array.length,t.depth=0,t.left=xa,t.right=xa;break}case"ISingleton":{t.length=1,t.depth=0,t.left=xa,t.right=xa;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=xa,t.right=xa;break}}return t},K0=e=>Re(e,F5),xa=rn({_tag:"IEmpty"}),Fn=()=>xa,E1=(...e)=>fne(e),Rn=e=>rn({_tag:"ISingleton",a:e}),_o=e=>K0(e)?e:Ir(yt(e)),KE=(e,t,n)=>{switch(e.backing._tag){case"IArray":{sne(e.backing.array,0,t,n,e.length);break}case"IConcat":{KE(e.left,t,n),KE(e.right,t,n+e.left.length);break}case"ISingleton":{t[n]=e.backing.a;break}case"ISlice":{let r=0,i=n;for(;r<e.length;)t[i]=xl(e,r),r+=1,i+=1;break}}},cne=e=>{switch(e.backing._tag){case"IEmpty":return U5;case"IArray":return e.backing.array;default:{const t=new Array(e.length);return KE(e,t,0),e.backing={_tag:"IArray",array:t},e.left=xa,e.right=xa,e.depth=0,t}}},Br=cne,une=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return rn({_tag:"IArray",array:fj(e.backing.array)});case"IConcat":return rn({_tag:"IConcat",left:Eo(e.backing.right),right:Eo(e.backing.left)});case"ISlice":return Ir(fj(Br(e)))}},Eo=une,H5=R(2,(e,t)=>t<0||t>=e.length?ne():ae(xl(e,t))),Ir=e=>e.length===0?Fn():e.length===1?Rn(e[0]):rn({_tag:"IArray",array:e}),fne=e=>Ir(e),xl=R(2,(e,t)=>{switch(e.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":{if(t!==0)throw new Error("Index out of bounds");return e.backing.a}case"IArray":{if(t>=e.length||t<0)throw new Error("Index out of bounds");return e.backing.array[t]}case"IConcat":return t<e.left.length?xl(e.left,t):xl(e.right,t-e.left.length);case"ISlice":return xl(e.backing.chunk,t+e.backing.offset)}}),GE=R(2,(e,t)=>kn(e,Rn(t))),Rr=R(2,(e,t)=>kn(Rn(t),e)),Zv=R(2,(e,t)=>{if(t<=0)return xa;if(t>=e.length)return e;switch(e.backing._tag){case"ISlice":return rn({_tag:"ISlice",chunk:e.backing.chunk,length:t,offset:e.backing.offset});case"IConcat":return t>e.left.length?rn({_tag:"IConcat",left:e.left,right:Zv(e.right,t-e.left.length)}):Zv(e.left,t);default:return rn({_tag:"ISlice",chunk:e,offset:0,length:t})}}),ol=R(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return xa;switch(e.backing._tag){case"ISlice":return rn({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":return t>e.left.length?ol(e.right,t-e.left.length):rn({_tag:"IConcat",left:ol(e.left,t),right:e.right});default:return rn({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}}),kn=R(2,(e,t)=>{if(e.backing._tag==="IEmpty")return t;if(t.backing._tag==="IEmpty")return e;const n=t.depth-e.depth;if(Math.abs(n)<=1)return rn({_tag:"IConcat",left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){const r=kn(e.right,t);return rn({_tag:"IConcat",left:e.left,right:r})}else{const r=kn(e.right.right,t);if(r.depth===e.depth-3){const i=rn({_tag:"IConcat",left:e.right.left,right:r});return rn({_tag:"IConcat",left:e.left,right:i})}else{const i=rn({_tag:"IConcat",left:e.left,right:e.right.left});return rn({_tag:"IConcat",left:i,right:r})}}else if(t.right.depth>=t.left.depth){const r=kn(e,t.left);return rn({_tag:"IConcat",left:r,right:t.right})}else{const r=kn(e,t.left.left);if(r.depth===t.depth-3){const i=rn({_tag:"IConcat",left:r,right:t.left.right});return rn({_tag:"IConcat",left:i,right:t.right})}else{const i=rn({_tag:"IConcat",left:t.left.right,right:t.right});return rn({_tag:"IConcat",left:r,right:i})}}}),IR=R(2,(e,t)=>Ir(ine(e,t))),G0=e=>e.length===0,ko=e=>e.length>0,zR=H5(0),$R=e=>xl(e,0),is=$R,dne=e=>H5(e,e.length-1),hne=R(2,(e,t)=>e.backing._tag==="ISingleton"?Rn(t(e.backing.a,0)):Ir(M(Br(e),qc((n,r)=>t(n,r))))),io=e=>ol(e,1),mne=R(2,(e,t)=>ol(e,e.length-t)),pne=DR,ru=5,LR=Math.pow(2,ru),gne=LR-1,yne=LR/2,bne=LR/4;function vne(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Od(e,t){return t>>>e&gne}function Ff(e){return 1<<e}function q5(e,t){return vne(e&t-1)}const xne=(e,t)=>({value:e,previous:t});function td(e,t,n,r){let i=r;if(!e){const a=r.length;i=new Array(a);for(let s=0;s<a;++s)i[s]=r[s]}return i[t]=n,i}function V5(e,t,n){const r=n.length-1;let i=0,a=0,s=n;if(e)i=a=t;else for(s=new Array(r);i<t;)s[a++]=n[i++];for(++i;i<=r;)s[a++]=n[i++];return e&&(s.length=r),s}function Sne(e,t,n,r){const i=r.length;if(e){let l=i;for(;l>=t;)r[l--]=r[l];return r[t]=n,r}let a=0,s=0;const o=new Array(i+1);for(;a<t;)o[s++]=r[a++];for(o[t]=n;a<i;)o[++s]=r[a++];return o}class $l{constructor(){S(this,"_tag","EmptyNode")}modify(t,n,r,i,a,s){const o=r(ne());return Yt(o)?new $l:(++s.value,new Vc(t,i,a,o))}}function ka(e){return yR(e,"EmptyNode")}function wne(e){return ka(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function Y0(e,t){return ka(e)?!1:t===e.edit}class Vc{constructor(t,n,r,i){S(this,"edit");S(this,"hash");S(this,"key");S(this,"value");S(this,"_tag","LeafNode");this.edit=t,this.hash=n,this.key=r,this.value=i}modify(t,n,r,i,a,s){if(xe(a,this.key)){const l=r(this.value);return l===this.value?this:Yt(l)?(--s.value,new $l):Y0(this,t)?(this.value=l,this):new Vc(t,i,a,l)}const o=r(ne());return Yt(o)?this:(++s.value,K5(t,n,this.hash,this,i,new Vc(t,i,a,o)))}}class PR{constructor(t,n,r){S(this,"edit");S(this,"hash");S(this,"children");S(this,"_tag","CollisionNode");this.edit=t,this.hash=n,this.children=r}modify(t,n,r,i,a,s){if(i===this.hash){const l=Y0(this,t),c=this.updateCollisionList(l,t,this.hash,this.children,r,a,s);return c===this.children?this:c.length>1?new PR(t,this.hash,c):c[0]}const o=r(ne());return Yt(o)?this:(++s.value,K5(t,n,this.hash,this,i,new Vc(t,i,a,o)))}updateCollisionList(t,n,r,i,a,s,o){const l=i.length;for(let f=0;f<l;++f){const u=i[f];if("key"in u&&xe(s,u.key)){const d=u.value,h=a(d);return h===d?i:Yt(h)?(--o.value,V5(t,f,i)):td(t,f,new Vc(n,r,s,h),i)}}const c=a(ne());return Yt(c)?i:(++o.value,td(t,l,new Vc(n,r,s,c),i))}}class Md{constructor(t,n,r){S(this,"edit");S(this,"mask");S(this,"children");S(this,"_tag","IndexedNode");this.edit=t,this.mask=n,this.children=r}modify(t,n,r,i,a,s){const o=this.mask,l=this.children,c=Od(n,i),f=Ff(c),u=q5(o,f),d=o&f,h=Y0(this,t);if(!d){const v=new $l().modify(t,n+ru,r,i,a,s);return v?l.length>=yne?Ene(t,c,v,o,l):new Md(t,o|f,Sne(h,u,v,l)):this}const p=l[u],b=p.modify(t,n+ru,r,i,a,s);if(p===b)return this;let x=o,g;if(ka(b)){if(x&=~f,!x)return new $l;if(l.length<=2&&wne(l[u^1]))return l[u^1];g=V5(h,u,l)}else g=td(h,u,b,l);return h?(this.mask=x,this.children=g,this):new Md(t,x,g)}}class FR{constructor(t,n,r){S(this,"edit");S(this,"size");S(this,"children");S(this,"_tag","ArrayNode");this.edit=t,this.size=n,this.children=r}modify(t,n,r,i,a,s){let o=this.size;const l=this.children,c=Od(n,i),f=l[c],u=(f||new $l).modify(t,n+ru,r,i,a,s);if(f===u)return this;const d=Y0(this,t);let h;if(ka(f)&&!ka(u))++o,h=td(d,c,u,l);else if(!ka(f)&&ka(u)){if(--o,o<=bne)return _ne(t,o,c,l);h=td(d,c,new $l,l)}else h=td(d,c,u,l);return d?(this.size=o,this.children=h,this):new FR(t,o,h)}}function _ne(e,t,n,r){const i=new Array(t-1);let a=0,s=0;for(let o=0,l=r.length;o<l;++o)if(o!==n){const c=r[o];c&&!ka(c)&&(i[a++]=c,s|=1<<o)}return new Md(e,s,i)}function Ene(e,t,n,r,i){const a=[];let s=r,o=0;for(let l=0;s;++l)s&1&&(a[l]=i[o++]),s>>>=1;return a[t]=n,new FR(e,o+1,a)}function kne(e,t,n,r,i,a){if(n===i)return new PR(e,n,[a,r]);const s=Od(t,n),o=Od(t,i);if(s===o)return l=>new Md(e,Ff(s)|Ff(o),[l]);{const l=s<o?[r,a]:[a,r];return new Md(e,Ff(s)|Ff(o),l)}}function K5(e,t,n,r,i,a){let s,o=t;for(;;){const l=kne(e,o,n,r,i,a);if(typeof l=="function")s=xne(l,s),o=o+ru;else{let c=l;for(;s!=null;)c=s.value(c),s=s.previous;return c}}}const G5="effect/HashMap",YE=Symbol.for(G5),Cne={[YE]:YE,[Symbol.iterator](){return new W0(this,(e,t)=>[e,t])},[Fe](){let e=de(G5);for(const t of this)e^=M(de(t[0]),Be(de(t[1])));return Tt(this,e)},[Ue](e){if(Ane(e)){if(e._size!==this._size)return!1;for(const t of this){const n=M(e,BR(t[0],de(t[0])));if(Yt(n))return!1;if(!xe(t[1],n.value))return!1}return!0}return!1},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(Qt)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},UR=(e,t,n,r)=>{const i=Object.create(Cne);return i._editable=e,i._edit=t,i._root=n,i._size=r,i};class W0{constructor(t,n){S(this,"map");S(this,"f");S(this,"v");this.map=t,this.f=n,this.v=Y5(this.map._root,this.f,void 0)}next(){if(Yt(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=ex(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new W0(this.map,this.f)}}const ex=e=>e?W5(e[0],e[1],e[2],e[3],e[4]):ne(),Y5=(e,t,n=void 0)=>{switch(e._tag){case"LeafNode":return zt(e.value)?ae({value:t(e.key,e.value.value),cont:n}):ex(n);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const r=e.children;return W5(r.length,r,0,t,n)}default:return ex(n)}},W5=(e,t,n,r,i)=>{for(;n<e;){const a=t[n++];if(a&&!ka(a))return Y5(a,r,[e,t,n,r,i])}return ex(i)},Tne=UR(!1,0,new $l,0),J0=()=>Tne,Rne=e=>{const t=X5(J0());for(const n of e)$p(t,n[0],n[1]);return Dne(t)},Ane=e=>Re(e,YE),Nne=e=>e&&ka(e._root),One=R(2,(e,t)=>BR(e,t,de(t))),BR=R(3,(e,t,n)=>{let r=e._root,i=0;for(;;)switch(r._tag){case"LeafNode":return xe(t,r.key)?r.value:ne();case"CollisionNode":{if(n===r.hash){const a=r.children;for(let s=0,o=a.length;s<o;++s){const l=a[s];if("key"in l&&xe(t,l.key))return l.value}}return ne()}case"IndexedNode":{const a=Od(i,n),s=Ff(a);if(r.mask&s){r=r.children[q5(r.mask,s)],i+=ru;break}return ne()}case"ArrayNode":{if(r=r.children[Od(i,n)],r){i+=ru;break}return ne()}default:return ne()}}),Mne=R(2,(e,t)=>zt(BR(e,t,de(t)))),$p=R(3,(e,t,n)=>HR(e,t,()=>ae(n))),jne=R(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:UR(e._editable,e._edit,t,n)),J5=e=>new W0(e,t=>t),WE=e=>e._size,X5=e=>UR(!0,e._edit+1,e._root,e._size),Dne=e=>(e._editable=!1,e),HR=R(3,(e,t,n)=>Ine(e,t,de(t),n)),Ine=R(4,(e,t,n,r)=>{const i={value:e._size},a=e._root.modify(e._editable?e._edit:NaN,0,r,n,t,i);return M(e,jne(a,i.value))}),mj=R(2,(e,t)=>HR(e,t,ne)),zne=R(2,(e,t)=>X0(e,J0(),(n,r,i)=>$p(n,i,t(r,i)))),Q5=R(2,(e,t)=>X0(e,void 0,(n,r,i)=>t(r,i))),X0=R(3,(e,t,n)=>{const r=e._root;if(r._tag==="LeafNode")return zt(r.value)?n(t,r.value.value,r.key):t;if(r._tag==="EmptyNode")return t;const i=[r.children];let a;for(;a=i.pop();)for(let s=0,o=a.length;s<o;){const l=a[s++];l&&!ka(l)&&(l._tag==="LeafNode"?zt(l.value)&&(t=n(t,l.value.value,l.key)):i.push(l.children))}return t}),Z5="effect/HashSet",JE=Symbol.for(Z5),$ne={[JE]:JE,[Symbol.iterator](){return J5(this._keyMap)},[Fe](){return Tt(this,Be(de(this._keyMap))(de(Z5)))},[Ue](e){return Lne(e)?WE(this._keyMap)===WE(e._keyMap)&&xe(this._keyMap,e._keyMap):!1},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(Qt)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},Q0=e=>{const t=Object.create($ne);return t._keyMap=e,t},Lne=e=>Re(e,JE),Pne=Q0(J0()),Z0=()=>Pne,Fne=e=>{const t=qR(Z0());for(const n of e)Lp(t,n);return VR(t)},Une=(...e)=>{const t=qR(Z0());for(const n of e)Lp(t,n);return VR(t)},Bne=R(2,(e,t)=>Mne(e._keyMap,t)),Hne=e=>WE(e._keyMap),qR=e=>Q0(X5(e._keyMap)),VR=e=>(e._keyMap._editable=!1,e),eU=R(2,(e,t)=>{const n=qR(e);return t(n),VR(n)}),Lp=R(2,(e,t)=>e._keyMap._editable?($p(t,!0)(e._keyMap),e):Q0($p(t,!0)(e._keyMap))),tU=R(2,(e,t)=>e._keyMap._editable?(mj(t)(e._keyMap),e):Q0(mj(t)(e._keyMap))),qne=R(2,(e,t)=>eU(e,n=>{for(const r of t)tU(n,r)})),Vne=R(2,(e,t)=>eU(Z0(),n=>{Kne(e,r=>Lp(n,r));for(const r of t)Lp(n,r)})),Kne=R(2,(e,t)=>Q5(e._keyMap,(n,r)=>t(r))),Gne=R(3,(e,t,n)=>X0(e._keyMap,t,(r,i,a)=>n(r,a))),iu=Z0,Yne=Fne,KR=Une,nU=Bne,GR=Hne,ep=Lp,rU=tU,pj=qne,Pp=Vne,Fp=Gne,Ou="Die",au="Empty",Mu="Fail",gh="Interrupt",jd="Parallel",Dd="Sequential",iU="effect/Cause",aU=Symbol.for(iU),Wne={_E:e=>e},yh={[aU]:Wne,[Fe](){return M(de(iU),Be(de(ore(this))),Tt(this))},[Ue](e){return Jne(e)&&sre(this,e)},pipe(){return he(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:Qt(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:Qt(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:Qt(this.left),right:Qt(this.right)}}},toString(){return bh(this)},[ut](){return this.toJSON()}},Ll=(()=>{const e=Object.create(yh);return e._tag=au,e})(),su=e=>{const t=Object.create(yh);return t._tag=Mu,t.error=e,t},ta=e=>{const t=Object.create(yh);return t._tag=Ou,t.defect=e,t},wa=e=>{const t=Object.create(yh);return t._tag=gh,t.fiberId=e,t},Pl=(e,t)=>{const n=Object.create(yh);return n._tag=jd,n.left=e,n.right=t,n},wr=(e,t)=>{const n=Object.create(yh);return n._tag=Dd,n.left=e,n.right=t,n},Jne=e=>Re(e,aU),Xne=e=>e._tag===au,Qne=e=>e._tag===Mu,sU=e=>e._tag===Ou,Zne=e=>e._tag===au?!0:Id(e,!0,(t,n)=>{switch(n._tag){case au:return ae(t);case Ou:case Mu:case gh:return ae(!1);default:return ne()}}),oU=e=>zt(nre(e)),eS=e=>nS(void 0,cre)(e),ere=e=>Eo(Id(e,Fn(),(t,n)=>n._tag===Mu?ae(M(t,Rr(n.error))):ne())),lU=e=>Eo(Id(e,Fn(),(t,n)=>n._tag===Ou?ae(M(t,Rr(n.defect))):ne())),YR=e=>Id(e,iu(),(t,n)=>n._tag===gh?ae(M(t,ep(n.fiberId))):ne()),WR=e=>tS(e,t=>t._tag===Mu?ae(t.error):ne()),cU=e=>{const t=WR(e);switch(t._tag){case"None":return Me(e);case"Some":return je(t.value)}},tre=e=>tS(e,t=>t._tag===Ou?ae(t.defect):ne()),nre=e=>tS(e,t=>t._tag===gh?ae(t.fiberId):ne()),gj=e=>JR(e,{onEmpty:Ll,onFail:()=>Ll,onDie:ta,onInterrupt:wa,onSequential:wr,onParallel:Pl}),rre=e=>JR(e,{onEmpty:Ll,onFail:ta,onDie:ta,onInterrupt:wa,onSequential:wr,onParallel:Pl}),ire=R(2,(e,t)=>are(e,n=>su(t(n)))),are=R(2,(e,t)=>JR(e,{onEmpty:Ll,onFail:n=>t(n),onDie:n=>ta(n),onInterrupt:n=>wa(n),onSequential:(n,r)=>wr(n,r),onParallel:(n,r)=>Pl(n,r)})),sre=(e,t)=>{let n=Rn(e),r=Rn(t);for(;ko(n)&&ko(r);){const[i,a]=M(is(n),Id([iu(),Fn()],([l,c],f)=>{const[u,d]=XE(f);return ae([M(l,Pp(u)),M(c,kn(d))])})),[s,o]=M(is(r),Id([iu(),Fn()],([l,c],f)=>{const[u,d]=XE(f);return ae([M(l,Pp(u)),M(c,kn(d))])}));if(!xe(i,s))return!1;n=a,r=o}return!0},ore=e=>lre(Rn(e),Fn()),lre=(e,t)=>{for(;;){const[n,r]=M(e,DR([iu(),Fn()],([a,s],o)=>{const[l,c]=XE(o);return[M(a,Pp(l)),M(s,kn(c))]})),i=GR(n)>0?M(t,Rr(n)):t;if(G0(r))return Eo(i);e=r,t=i}throw new Error($0("Cause.flattenCauseLoop"))},tS=R(2,(e,t)=>{const n=[e];for(;n.length>0;){const r=n.pop(),i=t(r);switch(i._tag){case"None":{switch(r._tag){case Dd:case jd:{n.push(r.right),n.push(r.left);break}}break}case"Some":return i}}return ne()}),XE=e=>{let t=e;const n=[];let r=iu(),i=Fn();for(;t!==void 0;)switch(t._tag){case au:{if(n.length===0)return[r,i];t=n.pop();break}case Mu:{if(r=ep(r,E1(t._tag,t.error)),n.length===0)return[r,i];t=n.pop();break}case Ou:{if(r=ep(r,E1(t._tag,t.defect)),n.length===0)return[r,i];t=n.pop();break}case gh:{if(r=ep(r,E1(t._tag,t.fiberId)),n.length===0)return[r,i];t=n.pop();break}case Dd:{switch(t.left._tag){case au:{t=t.right;break}case Dd:{t=wr(t.left.left,wr(t.left.right,t.right));break}case jd:{t=Pl(wr(t.left.left,t.right),wr(t.left.right,t.right));break}default:{i=Rr(i,t.right),t=t.left;break}}break}case jd:{n.push(t.right),t=t.left;break}}throw new Error($0("Cause.evaluateCauseLoop"))},cre={emptyCase:HE,failCase:vl,dieCase:vl,interruptCase:HE,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},yj="SequentialCase",bj="ParallelCase",JR=R(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:i,onParallel:a,onSequential:s})=>nS(e,void 0,{emptyCase:()=>n,failCase:(o,l)=>r(l),dieCase:(o,l)=>t(l),interruptCase:(o,l)=>i(l),sequentialCase:(o,l,c)=>s(l,c),parallelCase:(o,l,c)=>a(l,c)})),Id=R(3,(e,t,n)=>{let r=t,i=e;const a=[];for(;i!==void 0;){const s=n(r,i);switch(r=zt(s)?s.value:r,i._tag){case Dd:{a.push(i.right),i=i.left;break}case jd:{a.push(i.right),i=i.left;break}default:{i=void 0;break}}i===void 0&&a.length>0&&(i=a.pop())}return r}),nS=R(3,(e,t,n)=>{const r=[e],i=[];for(;r.length>0;){const s=r.pop();switch(s._tag){case au:{i.push(Me(n.emptyCase(t)));break}case Mu:{i.push(Me(n.failCase(t,s.error)));break}case Ou:{i.push(Me(n.dieCase(t,s.defect)));break}case gh:{i.push(Me(n.interruptCase(t,s.fiberId)));break}case Dd:{r.push(s.right),r.push(s.left),i.push(je({_tag:yj}));break}case jd:{r.push(s.right),r.push(s.left),i.push(je({_tag:bj}));break}}}const a=[];for(;i.length>0;){const s=i.pop();switch(s._tag){case"Left":{switch(s.left._tag){case yj:{const o=a.pop(),l=a.pop(),c=n.sequentialCase(t,o,l);a.push(c);break}case bj:{const o=a.pop(),l=a.pop(),c=n.parallelCase(t,o,l);a.push(c);break}}break}case"Right":{a.push(s.right);break}}}if(a.length===0)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return a.pop()}),bh=(e,t)=>eS(e)?"All fibers interrupted without errors.":fU(e).map(function(n){return(t==null?void 0:t.renderErrorCause)!==!0||n.cause===void 0?n.stack:`${n.stack} {
65
+ ${uU(n.cause," ")}
66
+ }`}).join(`
67
+ `),uU=(e,t)=>{const n=e.stack.split(`
68
+ `);let r=`${t}[cause]: ${n[0]}`;for(let i=1,a=n.length;i<a;i++)r+=`
69
+ ${t}${n[i]}`;return e.cause&&(r+=` {
70
+ ${uU(e.cause,`${t} `)}
71
+ ${t}}`),r};class tx extends globalThis.Error{constructor(n){const r=typeof n=="object"&&n!==null,i=Error.stackTraceLimit;Error.stackTraceLimit=1;super(ure(n),r&&"cause"in n&&typeof n.cause<"u"?{cause:new tx(n.cause)}:void 0);S(this,"span");this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=i,this.name=n instanceof Error?n.name:"Error",r&&(zd in n&&(this.span=n[zd]),Object.keys(n).forEach(a=>{a in this||(this[a]=n[a])})),this.stack=dre(`${this.name}: ${this.message}`,n instanceof Error&&n.stack?n.stack:"",this.span)}}const ure=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(Re(e,"toString")&&ch(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return s5(e)},fre=/\((.*)\)/g,nx=De("effect/Tracer/spanToTrace",()=>new WeakMap),dre=(e,t,n)=>{const r=[e],i=t.startsWith(e)?t.slice(e.length).split(`
72
+ `):t.split(`
73
+ `);for(let a=1;a<i.length;a++){if(i[a].includes(" at new BaseEffectError")||i[a].includes(" at new YieldableError")){a++;continue}if(i[a].includes("Generator.next")||i[a].includes("effect_internal_function"))break;r.push(i[a].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(n){let a=n,s=0;for(;a&&a._tag==="Span"&&s<10;){const o=nx.get(a);if(typeof o=="function"){const l=o();if(typeof l=="string"){const c=l.matchAll(fre);let f=!1;for(const[,u]of c)f=!0,r.push(` at ${a.name} (${u})`);f||r.push(` at ${a.name} (${l.replace(/^at /,"")})`)}else r.push(` at ${a.name}`)}else r.push(` at ${a.name}`);a=Vi(a.parent),s++}}return r.join(`
74
+ `)},zd=Symbol.for("effect/SpanAnnotation"),fU=e=>nS(e,void 0,{emptyCase:()=>[],dieCase:(t,n)=>[new tx(n)],failCase:(t,n)=>[new tx(n)],interruptCase:()=>[],parallelCase:(t,n,r)=>[...n,...r],sequentialCase:(t,n,r)=>[...n,...r]}),QE=Symbol.for("effect/Duration"),dU=BigInt(0),vj=BigInt(24),Jy=BigInt(60),ZE=BigInt(1e3),xj=BigInt(1e6),Sj=BigInt(1e9),hre=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,sa=e=>{if(hU(e))return e;if(wo(e))return Ld(e);if(z0(e))return k1(e);if(Array.isArray(e)&&e.length===2&&e.every(wo))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?$d:e[0]===1/0||e[1]===1/0?yre:k1(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(ji(e)){const t=hre.exec(e);if(t){const[n,r,i]=t,a=Number(r);switch(i){case"nano":case"nanos":return k1(BigInt(r));case"micro":case"micros":return bre(BigInt(r));case"milli":case"millis":return Ld(a);case"second":case"seconds":return pU(a);case"minute":case"minutes":return vre(a);case"hour":case"hours":return xre(a);case"day":case"days":return Sre(a);case"week":case"weeks":return wre(a)}}}throw new Error("Invalid DurationInput")},wj={_tag:"Millis",millis:0},mre={_tag:"Infinity"},pre={[QE]:QE,[Fe](){return Tt(this,i5(this.value))},[Ue](e){return hU(e)&&Are(this,e)},toString(){return`Duration(${Ore(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:Ere(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},ks=e=>{const t=Object.create(pre);return wo(e)?isNaN(e)||e<=0?t.value=wj:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=mre:e<=dU?t.value=wj:t.value={_tag:"Nanos",nanos:e},t},hU=e=>Re(e,QE),mU=e=>e.value._tag!=="Infinity",gre=e=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===dU;case"Infinity":return!1}},$d=ks(0),yre=ks(1/0),k1=e=>ks(e),bre=e=>ks(e*ZE),Ld=e=>ks(e),pU=e=>ks(e*1e3),vre=e=>ks(e*6e4),xre=e=>ks(e*36e5),Sre=e=>ks(e*864e5),wre=e=>ks(e*6048e5),rx=e=>kre(e,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),_re=e=>{const t=sa(e);switch(t.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return BigInt(Math.round(t.value.millis*1e6))}},Ere=e=>{const t=sa(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/Sj),Number(t.value.nanos%Sj)];case"Millis":return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},kre=R(2,(e,t)=>{const n=sa(e);switch(n.value._tag){case"Nanos":return t.onNanos(n.value.nanos);case"Infinity":return t.onMillis(1/0);case"Millis":return t.onMillis(n.value.millis)}}),XR=R(3,(e,t,n)=>{const r=sa(e),i=sa(t);if(r.value._tag==="Infinity"||i.value._tag==="Infinity")return n.onMillis(rx(r),rx(i));if(r.value._tag==="Nanos"||i.value._tag==="Nanos"){const a=r.value._tag==="Nanos"?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),s=i.value._tag==="Nanos"?i.value.nanos:BigInt(Math.round(i.value.millis*1e6));return n.onNanos(a,s)}return n.onMillis(r.value.millis,i.value.millis)}),Cre=(e,t)=>XR(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r}),Tre=R(2,(e,t)=>XR(e,t,{onMillis:(n,r)=>n<=r,onNanos:(n,r)=>n<=r})),Rre=R(2,(e,t)=>XR(e,t,{onMillis:(n,r)=>n>=r,onNanos:(n,r)=>n>=r})),Are=R(2,(e,t)=>Cre(sa(e),sa(t))),Nre=e=>{const t=sa(e);if(t.value._tag==="Infinity")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const n=_re(t),r=n/xj,i=r/ZE,a=i/Jy,s=a/Jy,o=s/vj;return{days:Number(o),hours:Number(s%vj),minutes:Number(a%Jy),seconds:Number(i%Jy),millis:Number(r%ZE),nanos:Number(n%xj)}},Ore=e=>{const t=sa(e);if(t.value._tag==="Infinity")return"Infinity";if(gre(t))return"0";const n=Nre(t),r=[];return n.days!==0&&r.push(`${n.days}d`),n.hours!==0&&r.push(`${n.hours}h`),n.minutes!==0&&r.push(`${n.minutes}m`),n.seconds!==0&&r.push(`${n.seconds}s`),n.millis!==0&&r.push(`${n.millis}ms`),n.nanos!==0&&r.push(`${n.nanos}ns`),r.join(" ")},_j=Symbol.for("effect/MutableRef"),Mre={[_j]:_j,toString(){return Mt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:Qt(this.current)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},Lg=e=>{const t=Object.create(Mre);return t.current=e,t},jre=R(3,(e,t,n)=>xe(t,e.current)?(e.current=n,!0):!1),In=e=>e.current,Pg=R(2,(e,t)=>(e.current=t,e)),rS="effect/FiberId",ou=Symbol.for(rS),Pd="None",ek="Runtime",tk="Composite",Dre=qt(`${rS}-${Pd}`);var K$;let Ire=class{constructor(){S(this,K$,ou);S(this,"_tag",Pd);S(this,"id",-1);S(this,"startTimeMillis",-1)}[(K$=ou,Fe)](){return Dre}[Ue](t){return QR(t)&&t._tag===Pd}toString(){return Mt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[ut](){return this.toJSON()}};var G$;class gU{constructor(t,n){S(this,"id");S(this,"startTimeMillis");S(this,G$,ou);S(this,"_tag",ek);this.id=t,this.startTimeMillis=n}[(G$=ou,Fe)](){return Tt(this,qt(`${rS}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[Ue](t){return QR(t)&&t._tag===ek&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Mt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[ut](){return this.toJSON()}}var Y$;let zre=class{constructor(t,n){S(this,"left");S(this,"right");S(this,Y$,ou);S(this,"_tag",tk);S(this,"_hash");this.left=t,this.right=n}[(Y$=ou,Fe)](){return M(qt(`${rS}-${this._tag}`),Be(de(this.left)),Be(de(this.right)),Tt(this))}[Ue](t){return QR(t)&&t._tag===tk&&xe(this.left,t.left)&&xe(this.right,t.right)}toString(){return Mt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:Qt(this.left),right:Qt(this.right)}}[ut](){return this.toJSON()}};const yU=new Ire,QR=e=>Re(e,ou),bU=R(2,(e,t)=>e._tag===Pd?t:t._tag===Pd?e:new zre(e,t)),$re=e=>M(e,Fp(yU,(t,n)=>bU(n)(t))),ix=e=>{switch(e._tag){case Pd:return iu();case ek:return KR(e.id);case tk:return M(ix(e.left),Pp(ix(e.right)))}},Ej=De(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>Lg(0)),Lre=(e,t)=>new gU(e,t),vU=e=>Array.from(ix(e)).map(n=>`#${n}`).join(","),Pre=()=>{const e=In(Ej);return M(Ej,Pg(e+1)),new gU(e,Date.now())},Ti=yU,tp=bU,Fre=$re,xU=ix,Ure=Lre,Bre=vU,SU=Pre,iS=J0,Hre=Rne,qre=Nne,wU=One,_U=$p,EU=J5,Vre=HR,Kre=zne,Gre=Q5,kU=X0,Up=Symbol.for("effect/List"),nk=e=>yt(e),Yre=e=>x5(V0(e),nk),Wre=Yre(xe),Jre={[Up]:Up,_tag:"Cons",toString(){return Mt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:nk(this).map(Qt)}},[ut](){return this.toJSON()},[Ue](e){return TU(e)&&this._tag===e._tag&&Wre(this,e)},[Fe](){return Tt(this,uh(nk(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag==="Nil")return e=!0,this.return();const n=t.head;return t=t.tail,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},pipe(){return he(this,arguments)}},ax=(e,t)=>{const n=Object.create(Jre);return n.head=e,n.tail=t,n},Xre=qt("Nil"),Qre={[Up]:Up,_tag:"Nil",toString(){return Mt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[ut](){return this.toJSON()},[Fe](){return Xre},[Ue](e){return TU(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return he(this,arguments)}},CU=Object.create(Qre),TU=e=>Re(e,Up),po=e=>e._tag==="Nil",Zre=e=>e._tag==="Cons",eie=()=>CU,lu=(e,t)=>ax(e,t),Fd=eie,ZR=e=>ax(e,CU),tie=R(2,(e,t)=>rie(t,e)),nie=R(2,(e,t)=>lu(t,e)),rie=R(2,(e,t)=>{if(po(e))return t;if(po(t))return e;{const n=ax(t.head,e);let r=n,i=t.tail;for(;!po(i);){const a=ax(i.head,e);r.tail=a,r=a,i=i.tail}return n}}),iie=R(3,(e,t,n)=>{let r=t,i=e;for(;!po(i);)r=n(r,i.head),i=i.tail;return r}),aie=e=>{let t=Fd(),n=e;for(;!po(n);)t=nie(t,n.head),n=n.tail;return t},sie=Object.assign(Object.create(Array.prototype),{[Fe](){return Tt(this,uh(this))},[Ue](e){return Array.isArray(e)&&this.length===e.length?this.every((t,n)=>xe(t,e[n])):!1}}),Fg=function(){function e(t){t&&Object.assign(this,t)}return e.prototype=zg,e}(),oie=e=>Object.assign(Object.create(zg),e),lie=Symbol.for("effect/DifferContextPatch");function kj(e){return e}const Ug={...Fg.prototype,[lie]:{_Value:kj,_Patch:kj}},cie=Object.assign(Object.create(Ug),{_tag:"Empty"}),uie=Object.create(cie),RU=()=>uie,fie=Object.assign(Object.create(Ug),{_tag:"AndThen"}),die=(e,t)=>{const n=Object.create(fie);return n.first=e,n.second=t,n},hie=Object.assign(Object.create(Ug),{_tag:"AddService"}),mie=(e,t)=>{const n=Object.create(hie);return n.key=e,n.service=t,n},pie=Object.assign(Object.create(Ug),{_tag:"RemoveService"}),gie=e=>{const t=Object.create(pie);return t.key=e,t},yie=Object.assign(Object.create(Ug),{_tag:"UpdateService"}),bie=(e,t)=>{const n=Object.create(yie);return n.key=e,n.update=t,n},vie=(e,t)=>{const n=new Map(e.unsafeMap);let r=RU();for(const[i,a]of t.unsafeMap.entries())if(n.has(i)){const s=n.get(i);n.delete(i),xe(s,a)||(r=Bb(bie(i,()=>a))(r))}else n.delete(i),r=Bb(mie(i,a))(r);for(const[i]of n.entries())r=Bb(gie(i))(r);return r},Bb=R(2,(e,t)=>die(e,t)),xie=R(2,(e,t)=>{if(e._tag==="Empty")return t;let n=!1,r=Rn(e);const i=new Map(t.unsafeMap);for(;ko(r);){const s=is(r),o=io(r);switch(s._tag){case"Empty":{r=o;break}case"AddService":{i.set(s.key,s.service),r=o;break}case"AndThen":{r=Rr(Rr(o,s.second),s.first);break}case"RemoveService":{i.delete(s.key),r=o;break}case"UpdateService":{i.set(s.key,s.update(i.get(s.key))),n=!0,r=o;break}}}if(!n)return Il(i);const a=new Map;for(const[s]of t.unsafeMap)i.has(s)&&(a.set(s,i.get(s)),i.delete(s));for(const[s,o]of i)a.set(s,o);return Il(a)}),Sie=Symbol.for("effect/DifferHashSetPatch");function C1(e){return e}const aS={...Fg.prototype,[Sie]:{_Value:C1,_Key:C1,_Patch:C1}},wie=Object.assign(Object.create(aS),{_tag:"Empty"}),_ie=Object.create(wie),AU=()=>_ie,Eie=Object.assign(Object.create(aS),{_tag:"AndThen"}),kie=(e,t)=>{const n=Object.create(Eie);return n.first=e,n.second=t,n},Cie=Object.assign(Object.create(aS),{_tag:"Add"}),Tie=e=>{const t=Object.create(Cie);return t.value=e,t},Rie=Object.assign(Object.create(aS),{_tag:"Remove"}),Aie=e=>{const t=Object.create(Rie);return t.value=e,t},Nie=(e,t)=>{const[n,r]=Fp([e,AU()],([i,a],s)=>nU(s)(i)?[rU(s)(i),a]:[i,rk(Tie(s))(a)])(t);return Fp(r,(i,a)=>rk(Aie(a))(i))(n)},rk=R(2,(e,t)=>kie(e,t)),Oie=R(2,(e,t)=>{if(e._tag==="Empty")return t;let n=t,r=Rn(e);for(;ko(r);){const i=is(r),a=io(r);switch(i._tag){case"Empty":{r=a;break}case"AndThen":{r=Rr(i.first)(Rr(i.second)(a));break}case"Add":{n=ep(i.value)(n),r=a;break}case"Remove":n=rU(i.value)(n),r=a}}return n}),Mie=Symbol.for("effect/DifferReadonlyArrayPatch");function Cj(e){return e}const Bg={...Fg.prototype,[Mie]:{_Value:Cj,_Patch:Cj}},jie=Object.assign(Object.create(Bg),{_tag:"Empty"}),Die=Object.create(jie),NU=()=>Die,Iie=Object.assign(Object.create(Bg),{_tag:"AndThen"}),zie=(e,t)=>{const n=Object.create(Iie);return n.first=e,n.second=t,n},$ie=Object.assign(Object.create(Bg),{_tag:"Append"}),Lie=e=>{const t=Object.create($ie);return t.values=e,t},Pie=Object.assign(Object.create(Bg),{_tag:"Slice"}),Fie=(e,t)=>{const n=Object.create(Pie);return n.from=e,n.until=t,n},Uie=Object.assign(Object.create(Bg),{_tag:"Update"}),Bie=(e,t)=>{const n=Object.create(Uie);return n.index=e,n.patch=t,n},Hie=e=>{let t=0,n=NU();for(;t<e.oldValue.length&&t<e.newValue.length;){const r=e.oldValue[t],i=e.newValue[t],a=e.differ.diff(r,i);xe(a,e.differ.empty)||(n=Hb(n,Bie(t,a))),t=t+1}return t<e.oldValue.length&&(n=Hb(n,Fie(0,t))),t<e.newValue.length&&(n=Hb(n,Lie(Qte(t)(e.newValue)))),n},Hb=R(2,(e,t)=>zie(e,t)),qie=R(3,(e,t,n)=>{if(e._tag==="Empty")return t;let r=t.slice(),i=va(e);for(;ed(i);){const a=Ur(i),s=nu(i);switch(a._tag){case"Empty":{i=s;break}case"AndThen":{s.unshift(a.first,a.second),i=s;break}case"Append":{for(const o of a.values)r.push(o);i=s;break}case"Slice":{r=r.slice(a.from,a.until),i=s;break}case"Update":{r[a.index]=n.patch(a.patch,r[a.index]),i=s;break}}}return r}),Vie=Symbol.for("effect/Differ"),Kie={[Vie]:{_P:ke,_V:ke},pipe(){return he(this,arguments)}},vh=e=>{const t=Object.create(Kie);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},Gie=()=>vh({empty:RU(),combine:(e,t)=>Bb(t)(e),diff:(e,t)=>vie(e,t),patch:(e,t)=>xie(t)(e)}),Yie=()=>vh({empty:AU(),combine:(e,t)=>rk(t)(e),diff:(e,t)=>Nie(e,t),patch:(e,t)=>Oie(t)(e)}),Wie=e=>vh({empty:NU(),combine:(t,n)=>Hb(t,n),diff:(t,n)=>Hie({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>qie(t,n,e)}),OU=()=>Jie((e,t)=>t),Jie=e=>vh({empty:ke,combine:(t,n)=>t===ke?n:n===ke?t:r=>n(t(r)),diff:(t,n)=>xe(t,n)?ke:jg(n),patch:(t,n)=>e(n,t(n))}),Bp=255,MU=8,ik=e=>e&Bp,ak=e=>e>>MU&Bp,Hg=(e,t)=>(e&Bp)+((t&e&Bp)<<MU),Xie=Hg(0,0),Qie=e=>Hg(e,e),Zie=e=>Hg(e,0),eae=R(2,(e,t)=>Hg(ik(e)&~t,ak(e))),tae=R(2,(e,t)=>e|t),nae=e=>~e>>>0&Bp,rae=0,ju=1,iae=2,jU=4,sk=16,DU=32,aae=e=>sS(e,DU),sae=R(2,(e,t)=>e&~t),oae=R(2,(e,t)=>e|t),Go=e=>IU(e)&&!cae(e),IU=e=>sS(e,ju),sS=R(2,(e,t)=>(e&t)!==0),zU=(...e)=>e.reduce((t,n)=>t|n,0),lae=zU(rae),Tj=e=>sS(e,jU),cae=e=>sS(e,sk),Sl=R(2,(e,t)=>Hg(e^t,t)),nd=R(2,(e,t)=>e&(nae(ik(t))|ak(t))|ik(t)&ak(t)),Rj=vh({empty:Xie,diff:(e,t)=>Sl(e,t),combine:(e,t)=>tae(t)(e),patch:(e,t)=>nd(t,e)}),uae=Qie,$U=Zie,Aj=eae,LU=(e,t)=>({_tag:"Par",left:e,right:t}),Xy=(e,t)=>({_tag:"Seq",left:e,right:t}),fae=e=>{let t=ZR(e),n=Fd();for(;;){const[r,i]=iie(t,[PU(),Fd()],([a,s],o)=>{const[l,c]=dae(o);return[yae(a,l),tie(s,c)]});if(n=hae(n,r),po(i))return aie(n);t=i}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},dae=e=>{let t=e,n=PU(),r=Fd(),i=Fd();for(;;)switch(t._tag){case"Empty":{if(po(r))return[n,i];t=r.head,r=r.tail;break}case"Par":{r=lu(t.right,r),t=t.left;break}case"Seq":{const a=t.left,s=t.right;switch(a._tag){case"Empty":{t=s;break}case"Par":{const o=a.left,l=a.right;t=LU(Xy(o,s),Xy(l,s));break}case"Seq":{const o=a.left,l=a.right;t=Xy(o,Xy(l,s));break}case"Single":{t=a,i=lu(s,i);break}}break}case"Single":{if(n=gae(n,t),po(r))return[n,i];t=r.head,r=r.tail;break}}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},hae=(e,t)=>{if(po(e))return ZR(T1(t));if(bae(t))return e;const n=Eae(e.head),r=vae(t);return n.length===1&&r.length===1&&xe(n[0],r[0])?lu(_ae(e.head,T1(t)),e.tail):lu(T1(t),e)},mae=Symbol.for("effect/RequestBlock/RequestBlockParallel"),pae={_R:e=>e};var W$;W$=mae;class eA{constructor(t){S(this,"map");S(this,W$,pae);this.map=t}}const PU=()=>new eA(iS()),gae=(e,t)=>new eA(Vre(e.map,t.dataSource,n=>Cte(ii(n,GE(t.blockedRequest)),()=>Rn(t.blockedRequest)))),yae=(e,t)=>new eA(kU(e.map,t.map,(n,r,i)=>_U(n,i,Dt(wU(n,i),{onNone:()=>r,onSome:a=>kn(r,a)})))),bae=e=>qre(e.map),vae=e=>Array.from(EU(e.map)),T1=e=>wae(Kre(e.map,t=>Rn(t))),xae=Symbol.for("effect/RequestBlock/RequestBlockSequential"),Sae={_R:e=>e};var J$;J$=xae;class FU{constructor(t){S(this,"map");S(this,J$,Sae);this.map=t}}const wae=e=>new FU(e),_ae=(e,t)=>new FU(kU(t.map,e.map,(n,r,i)=>_U(n,i,Dt(wU(n,i),{onNone:()=>Fn(),onSome:a=>kn(a,r)})))),Eae=e=>Array.from(EU(e.map)),kae=e=>Array.from(e.map),qg="Pending",oS="Done",Cae="effect/Deferred",Tae=Symbol.for(Cae),Rae={_E:e=>e,_A:e=>e},Aae=e=>({_tag:qg,joiners:e}),UU=e=>({_tag:oS,effect:e});class Vg{constructor(t){S(this,"self");S(this,"called",!1);this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new Vg(this.self)}}const BU=(e,t)=>{const n=new An("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},Nae=e=>{const t=new An("RunBlocked");return t.effect_instruction_i0=e,t},cu=Symbol.for("effect/Effect");class Oae{constructor(t,n){S(this,"patch");S(this,"op");S(this,"_op",wR);this.patch=t,this.op=n}}var X$;class An{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,X$,Ad);this._op=t}[(X$=cu,Ue)](t){return this===t}[Fe](){return Tt(this,bR(this))}pipe(){return he(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:Qt(this.effect_instruction_i0),effect_instruction_i1:Qt(this.effect_instruction_i1),effect_instruction_i2:Qt(this.effect_instruction_i2)}}toString(){return Mt(this.toJSON())}[ut](){return this.toJSON()}[Symbol.iterator](){return new Vg(new Dg(this))}}var Q$;class HU{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,Q$,Ad);this._op=t,this._tag=t}[(Q$=cu,Ue)](t){return yS(t)&&t._op==="Failure"&&xe(this.effect_instruction_i0,t.effect_instruction_i0)}[Fe](){return M(qt(this._tag),Be(de(this.effect_instruction_i0)),Tt(this))}get cause(){return this.effect_instruction_i0}pipe(){return he(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Mt(this.toJSON())}[ut](){return this.toJSON()}[Symbol.iterator](){return new Vg(new Dg(this))}}var Z$;class qU{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,Z$,Ad);this._op=t,this._tag=t}[(Z$=cu,Ue)](t){return yS(t)&&t._op==="Success"&&xe(this.effect_instruction_i0,t.effect_instruction_i0)}[Fe](){return M(qt(this._tag),Be(de(this.effect_instruction_i0)),Tt(this))}get value(){return this.effect_instruction_i0}pipe(){return he(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:Qt(this.value)}}toString(){return Mt(this.toJSON())}[ut](){return this.toJSON()}[Symbol.iterator](){return new Vg(new Dg(this))}}const Mo=e=>Re(e,cu),ht=e=>{const t=new An(c5);return t.effect_instruction_i0=e,t},VU=R(3,(e,t,n)=>ja(r=>te(e,i=>te(wl(Ve(()=>r(t(i)))),a=>Ve(()=>n(i,a)).pipe(oa({onFailure:s=>{switch(a._tag){case Xn:return Un(wr(a.effect_instruction_i0,s));case Qn:return Un(s)}},onSuccess:()=>a})))))),Vr=R(2,(e,t)=>te(e,()=>fe(t))),ca=e=>Vr(e,void 0),KU=function(){const e=new An(B0);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw new Error($0("you're not supposed to end up here"))}return e},sx=(e,t=Ti)=>{const n=new An(Xm);let r;return n.effect_instruction_i0=i=>{r=e(i)},n.effect_instruction_i1=t,Gg(n,i=>Mo(r)?r:kt)},ll=(e,t=Ti)=>Ve(()=>sx(e,t)),Ma=(e,t=Ti)=>KU(e,function(){let n,r;function i(l){n?n(l):r===void 0&&(r=l)}const a=new An(Xm);a.effect_instruction_i0=l=>{n=l,r&&l(r)},a.effect_instruction_i1=t;let s,o;return this.effect_instruction_i0.length!==1?(o=new AbortController,s=lr(()=>this.effect_instruction_i0(i,o.signal))):s=lr(()=>this.effect_instruction_i0(i)),s||o?Gg(a,l=>(o&&o.abort(),s??kt)):a}),GU=R(2,(e,t)=>{const n=new An(Pb);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Hp=R(2,(e,t)=>Fl(e,{onFailure:t,onSuccess:fe})),Nj=Symbol.for("effect/OriginalAnnotation"),tA=(e,t)=>zt(t)?new Proxy(e,{has(n,r){return r===zd||r===Nj||r in n},get(n,r){return r===zd?t.value:r===Nj?e:n[r]}}):e,cl=e=>Oa(e)&&!(zd in e)?ht(t=>Un(ta(tA(e,yA(t))))):Un(ta(e)),YU=e=>WU(()=>ta(new use(e))),Ud=e=>Fl(e,{onFailure:t=>fe(je(t)),onSuccess:t=>fe(Me(t))}),wl=e=>JU(e,{onFailure:wt,onSuccess:Et}),un=e=>Oa(e)&&!(zd in e)?ht(t=>Un(su(tA(e,yA(t))))):Un(su(e)),lS=e=>te(ie(e),un),Un=e=>{const t=new HU(Xn);return t.effect_instruction_i0=e,t},WU=e=>te(ie(e),Un),cS=ht(e=>fe(e.id())),Kg=e=>ht(t=>e(t.id())),te=R(2,(e,t)=>{const n=new An(Gv);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Mae=e=>{const t=new An("OnStep");return t.effect_instruction_i0=e,t},uS=e=>te(e,ke),JU=R(2,(e,t)=>oa(e,{onFailure:n=>fe(t.onFailure(n)),onSuccess:n=>fe(t.onSuccess(n))})),oa=R(2,(e,t)=>{const n=new An(Yv);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),Fl=R(2,(e,t)=>oa(e,{onFailure:n=>{if(lU(n).length>0)return Un(rre(n));const i=ere(n);return i.length>0?t.onFailure($R(i)):Un(n)},onSuccess:t.onSuccess})),ao=R(2,(e,t)=>Ve(()=>{const n=yt(e),r=q0(n.length);let i=0;return Vr(sA({while:()=>i<n.length,body:()=>t(n[i],i),step:a=>{r[i++]=a}}),r)})),fS=R(2,(e,t)=>Ve(()=>{const n=yt(e);let r=0;return sA({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),Vs=te(cS,e=>XU(e)),XU=e=>Un(wa(e)),nA=e=>{const t=new An(fh);return t.effect_instruction_i0=uae(ju),t.effect_instruction_i1=()=>e,t},QU=R(2,(e,t)=>ja(n=>te(wl(n(e)),r=>mB(t,r)))),Qe=R(2,(e,t)=>te(e,n=>ie(()=>t(n)))),rA=R(2,(e,t)=>Fl(e,{onFailure:n=>lS(()=>t.onFailure(n)),onSuccess:n=>ie(()=>t.onSuccess(n))})),dS=R(2,(e,t)=>oa(e,{onFailure:n=>{const r=cU(n);switch(r._tag){case"Left":return lS(()=>t(r.left));case"Right":return Un(r.right)}},onSuccess:fe})),uu=R(2,(e,t)=>ja(n=>oa(n(e),{onFailure:r=>{const i=wt(r);return oa(t(i),{onFailure:a=>wt(wr(r,a)),onSuccess:()=>i})},onSuccess:r=>{const i=Et(r);return sn(t(i),i)}}))),Gg=R(2,(e,t)=>uu(e,bS({onFailure:n=>eS(n)?ca(t(YR(n))):kt,onSuccess:()=>kt}))),jae=e=>Dae(e,ke),Dae=R(2,(e,t)=>Fl(e,{onFailure:n=>cl(t(n)),onSuccess:fe})),Iae=ht((e,t)=>fe(t.runtimeFlags)),fe=e=>{const t=new qU(Qn);return t.effect_instruction_i0=e,t},Ve=e=>{const t=new An(B0);return t.commit=e,t},ie=e=>{const t=new An(l5);return t.effect_instruction_i0=e,t},iA=R(e=>e.length===3||e.length===2&&!(Oa(e[1])&&"onlyEffect"in e[1]),(e,t)=>te(e,n=>{const r=typeof t=="function"?t(n):t;return Mo(r)?Vr(r,n):lee(r)?sx(i=>{r.then(a=>i(fe(n)),a=>i(un(new dA(a,"An unknown error occurred in Effect.tap"))))}):fe(n)})),zae=e=>ht(t=>{const n=t.getFiberRef(ck),r=M(n,Ut(()=>t.scope()));return e(xh(ck,ae(r)))}),Yg=e=>{const t=new An(fh);return t.effect_instruction_i0=$U(ju),t.effect_instruction_i1=()=>e,t},ja=e=>KU(e,function(){const t=new An(fh);return t.effect_instruction_i0=$U(ju),t.effect_instruction_i1=n=>IU(n)?lr(()=>this.effect_instruction_i0(nA)):lr(()=>this.effect_instruction_i0(Yg)),t}),kt=fe(void 0),ZU=e=>{const t=new An(fh);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},aA=R(2,(e,t)=>te(t,n=>n?M(e,Qe(ae)):fe(ne()))),sA=e=>{const t=new An(Wv);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},ok=e=>Ve(()=>{const t=new An(Qm);return t.effect_instruction_i0=e(),t}),eB=function(){const e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return ok(()=>e(M))},tB=(e,...t)=>Object.defineProperty(t.length===0?function(...n){return ok(()=>e.apply(this,n))}:function(...n){let r=ok(()=>e.apply(this,n));for(const i of t)r=i(r,...n);return r},"length",{value:e.length,configurable:!0}),$ae=R(2,(e,t)=>{const n=new An(fh);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),oA=e=>{const t=new An(Fb);return typeof(e==null?void 0:e.priority)<"u"?tse(t,e.priority):t},hS=R(2,(e,t)=>te(e,n=>Qe(t,r=>[n,r]))),mS=R(2,(e,t)=>te(e,n=>Vr(t,n))),sn=R(2,(e,t)=>te(e,()=>t)),nB=R(3,(e,t,n)=>te(e,r=>Qe(t,i=>n(r,i)))),Lae=ll(()=>{const e=setInterval(()=>{},2147483647);return ie(()=>clearInterval(e))}),lA=e=>te(cS,t=>M(e,qp(t))),qp=R(2,(e,t)=>te(e.interruptAsFork(t),()=>e.await)),Pae={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return he(this,arguments)}},Fae={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:5e4,pipe(){return he(this,arguments)}},Uae={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return he(this,arguments)}},rB={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return he(this,arguments)}},iB={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return he(this,arguments)}},aB={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return he(this,arguments)}},Bae={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return he(this,arguments)}},Hae={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return he(this,arguments)}},qae="effect/FiberRef",Vae=Symbol.for(qae),Kae={_A:e=>e},cA=e=>ht(t=>Et(t.getFiberRef(e))),pS=R(2,(e,t)=>te(cA(e),t)),Oj=R(2,(e,t)=>Gae(e,()=>[void 0,t])),Gae=R(2,(e,t)=>ht(n=>{const[r,i]=t(n.getFiberRef(e));return n.setFiberRef(e,i),fe(r)})),xh=R(3,(e,t,n)=>VU(mS(cA(t),Oj(t,n)),()=>e,r=>Oj(t,r))),Yae=R(3,(e,t,n)=>pS(t,r=>xh(e,t,n(r)))),Bn=(e,t)=>Sh(e,{differ:OU(),fork:(t==null?void 0:t.fork)??ke,join:t==null?void 0:t.join}),Wae=e=>{const t=Yie();return Sh(e,{differ:t,fork:t.empty})},Jae=e=>{const t=Wie(OU());return Sh(e,{differ:t,fork:t.empty})},sB=e=>{const t=Gie();return Sh(e,{differ:t,fork:t.empty})},Sh=(e,t)=>({...$g,[Vae]:Kae,initial:e,commit(){return cA(this)},diff:(r,i)=>t.differ.diff(r,i),combine:(r,i)=>t.differ.combine(r,i),patch:r=>i=>t.differ.patch(r,i),fork:t.fork,join:t.join??((r,i)=>i)}),Xae=e=>Sh(e,{differ:Rj,fork:Rj.empty}),Cs=De(Symbol.for("effect/FiberRef/currentContext"),()=>sB(gs())),wh=De(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Bn(0)),oB=De(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Bn(2048)),Qae=De(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Bn(iS())),Zae=De(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Bn(iB)),ese=De(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Bn(Fd())),tse=R(2,(e,t)=>xh(e,wh,t)),nse=De(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Bn("unbounded")),rse=De(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Bn(!0)),ise=De(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Bn(ae(aB))),ase=De(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Bn(ae(rB))),lk=De(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>Jae(zl())),ck=De(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Bn(ne(),{fork:()=>ne(),join:(e,t)=>e})),Qy=De(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Bn(Ll,{fork:()=>Ll,join:(e,t)=>e})),lB=De(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Bn(!0)),cB=De(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Bn(!0)),sse=De(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Bn(iS())),ose=De(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Bn(Fn())),Mj=Symbol.for("effect/Scope"),jj=Symbol.for("effect/CloseableScope"),uB=(e,t)=>e.addFinalizer(()=>ca(t)),ox=(e,t)=>e.addFinalizer(t),uk=(e,t)=>e.close(t),Qs=(e,t)=>e.fork(t),lse=e=>cse(ke)(e),cse=R(2,(e,t)=>{const n=M(e,WR,ii(t));switch(n._tag){case"None":return M(lU(e),zR,Dt({onNone:()=>{const r=yt(YR(e)).flatMap(i=>yt(xU(i)).map(a=>`#${a}`));return new fse(r?`Interrupted by fibers: ${r.join(", ")}`:void 0)},onSome:ke}));case"Some":return n.value}}),uA=function(){class e extends globalThis.Error{commit(){return un(this)}toJSON(){const n={...this};return this.message&&(n.message=this.message),this.cause&&(n.cause=this.cause),n}[ut](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}
75
+ ${this.stack.split(`
76
+ `).slice(1).join(`
77
+ `)}`:this.toString():"Bun"in globalThis?bh(su(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,jee),e}(),fA=(e,t)=>{class n extends uA{constructor(){super(...arguments);S(this,"_tag",t)}}return Object.assign(n.prototype,e),n.prototype.name=t,n},Dj=Symbol.for("effect/Cause/errors/RuntimeException"),use=fA({[Dj]:Dj},"RuntimeException"),fk=Symbol.for("effect/Cause/errors/InterruptedException"),fse=fA({[fk]:fk},"InterruptedException"),dse=e=>Re(e,fk),Ij=Symbol.for("effect/Cause/errors/NoSuchElement"),gS=fA({[Ij]:Ij},"NoSuchElementException"),zj=Symbol.for("effect/Cause/errors/UnknownException"),dA=function(){class e extends uA{constructor(r,i){super(i??"An unknown error occurred",{cause:r});S(this,"_tag","UnknownException");S(this,"error");this.error=r}}return Object.assign(e.prototype,{[zj]:zj,name:"UnknownException"}),e}(),yS=e=>Mo(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure"),fB=e=>e._tag==="Failure",hse=e=>e._tag==="Success",qb=R(2,(e,t)=>{switch(e._tag){case Xn:return wt(e.effect_instruction_i0);case Qn:return Et(t)}}),R1=e=>qb(e,void 0),rd=(e,t)=>bse(e,t!=null&&t.parallel?Pl:wr),dB=e=>wt(ta(e)),Vp=e=>wt(su(e)),wt=e=>{const t=new HU(Xn);return t.effect_instruction_i0=e,t},mse=R(2,(e,t)=>{switch(e._tag){case Xn:return wt(e.effect_instruction_i0);case Qn:return t(e.effect_instruction_i0)}}),pse=e=>M(e,mse(ke)),gse=e=>wt(wa(e)),Vb=R(2,(e,t)=>{switch(e._tag){case Xn:return wt(e.effect_instruction_i0);case Qn:return Et(t(e.effect_instruction_i0))}}),bS=R(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Xn:return t(e.effect_instruction_i0);case Qn:return n(e.effect_instruction_i0)}}),dk=R(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Xn:return t(e.effect_instruction_i0);case Qn:return n(e.effect_instruction_i0)}}),Et=e=>{const t=new qU(Qn);return t.effect_instruction_i0=e,t},_r=Et(void 0),yse=R(2,(e,t)=>hA(e,t,{onSuccess:(n,r)=>[n,r],onFailure:wr})),hB=R(2,(e,t)=>hA(e,t,{onSuccess:(n,r)=>r,onFailure:wr})),hA=R(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case Xn:switch(t._tag){case Qn:return wt(e.effect_instruction_i0);case Xn:return wt(n(e.effect_instruction_i0,t.effect_instruction_i0))}case Qn:switch(t._tag){case Qn:return Et(r(e.effect_instruction_i0,t.effect_instruction_i0));case Xn:return wt(t.effect_instruction_i0)}}}),bse=(e,t)=>{const n=_o(e);return ko(n)?M(io(n),DR(M(is(n),Vb(Rn)),(r,i)=>M(r,hA(i,{onSuccess:(a,s)=>M(a,Rr(s)),onFailure:t}))),Vb(Eo),Vb(r=>Br(r)),ae):ne()},vS=e=>({...$g,[Tae]:Rae,state:Lg(Aae([])),commit(){return Ul(this)},blockingOn:e}),xS=()=>te(cS,e=>vse(e)),vse=e=>ie(()=>vS(e)),Ul=e=>ll(t=>{const n=In(e.state);switch(n._tag){case oS:return t(n.effect);case qg:return n.joiners.push(t),Sse(e,t)}},e.blockingOn),SS=R(2,(e,t)=>ie(()=>{const n=In(e.state);switch(n._tag){case oS:return!1;case qg:{Pg(e.state,UU(t));for(let r=0,i=n.joiners.length;r<i;r++)n.joiners[r](t);return!0}}})),mB=R(2,(e,t)=>SS(e,t)),pB=R(2,(e,t)=>SS(e,Un(t))),gB=R(2,(e,t)=>SS(e,XU(t))),xse=e=>ie(()=>In(e.state)._tag===oS),mA=R(2,(e,t)=>SS(e,fe(t))),wS=(e,t)=>{const n=In(e.state);if(n._tag===qg){Pg(e.state,UU(t));for(let r=0,i=n.joiners.length;r<i;r++)n.joiners[r](t)}},Sse=(e,t)=>ie(()=>{const n=In(e.state);if(n._tag===qg){const r=n.joiners.indexOf(t);r>=0&&n.joiners.splice(r,1)}}),wse=ht(e=>Et(e.currentContext)),pA=()=>wse,Du=e=>te(pA(),e),_S=R(2,(e,t)=>xh(Cs,t)(e)),gA=R(2,(e,t)=>Yae(Cs,n=>oi(n,t))(e)),yB=R(2,(e,t)=>Du(n=>_S(e,t(n)))),yA=e=>{const t=e.currentSpan;return t!==void 0&&t._tag==="Span"?ae(t):ne()},_se={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:_r},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},Ese=e=>Object.assign(Object.create(_se),e),kse="effect/Clock",$j=Symbol.for(kse),_h=Zl("effect/Clock"),Cse=2**31-1,Lj={unsafeSchedule(e,t){const n=rx(t);if(n>Cse)return vl;let r=!1;const i=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(i),!r)}},Pj=function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now!="function")return()=>BigInt(Date.now())*e;let t;return()=>(t===void 0&&(t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6))),t+BigInt(Math.round(performance.now()*1e6)))}(),Tse=function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return Pj;const t=Pj()-e.bigint();return()=>t+e.bigint()}();var eL;eL=$j;class Rse{constructor(){S(this,eL,$j);S(this,"currentTimeMillis",ie(()=>this.unsafeCurrentTimeMillis()));S(this,"currentTimeNanos",ie(()=>this.unsafeCurrentTimeNanos()))}unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Tse()}scheduler(){return fe(Lj)}sleep(t){return Ma(n=>{const r=Lj.unsafeSchedule(()=>n(kt),t);return ca(ie(r))})}}const Ase=()=>new Rse,Bd=Ste,Nse=e=>{if(e==="NaN")return ro(NaN);if(e==="Infinity")return ro(1/0);if(e==="-Infinity")return ro(-1/0);if(e.trim()==="")return Nd;const t=Number(e);return Number.isNaN(t)?Nd:ro(t)},lx=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),bB="And",vB="Or",xB="InvalidData",SB="MissingData",wB="SourceUnavailable",_B="Unsupported",Ose="effect/ConfigError",Fj=Symbol.for(Ose),Eh={_tag:"ConfigError",[Fj]:Fj},EB=(e,t)=>{const n=Object.create(Eh);return n._op=bB,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},kB=(e,t)=>{const n=Object.create(Eh);return n._op=vB,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},Mse=(e,t,n={pathDelim:"."})=>{const r=Object.create(Eh);return r._op=xB,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Invalid data at ${M(this.path,ph(n.pathDelim))}: "${this.message}")`}}),r},fu=(e,t,n={pathDelim:"."})=>{const r=Object.create(Eh);return r._op=SB,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Missing data at ${M(this.path,ph(n.pathDelim))}: "${this.message}")`}}),r},jse=(e,t,n,r={pathDelim:"."})=>{const i=Object.create(Eh);return i._op=wB,i.path=e,i.message=t,i.cause=n,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Source unavailable at ${M(this.path,ph(r.pathDelim))}: "${this.message}")`}}),i},Dse=(e,t,n={pathDelim:"."})=>{const r=Object.create(Eh);return r._op=_B,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${M(this.path,ph(n.pathDelim))}: "${this.message}")`}}),r},Mc=R(2,(e,t)=>{switch(e._op){case bB:return EB(Mc(e.left,t),Mc(e.right,t));case vB:return kB(Mc(e.left,t),Mc(e.right,t));case xB:return Mse([...t,...e.path],e.message);case SB:return fu([...t,...e.path],e.message);case wB:return jse([...t,...e.path],e.message,e.cause);case _B:return Dse([...t,...e.path],e.message)}}),Ise={_tag:"Empty"},A1=R(2,(e,t)=>{let n=ZR(t),r=e;for(;Zre(n);){const i=n.head;switch(i._tag){case"Empty":{n=n.tail;break}case"AndThen":{n=lu(i.first,lu(i.second,n.tail));break}case"MapName":{r=qc(r,i.f),n=n.tail;break}case"Nested":{r=Xv(r,i.name),n=n.tail;break}case"Unnested":{if(M(Zm(r),Dte(i.name)))r=nu(r),n=n.tail;else return je(fu(r,`Expected ${i.name} to be in path in ConfigProvider#unnested`));break}}}return Me(r)}),zse="Constant",$se="Fail",Lse="Fallback",Pse="Described",Fse="Lazy",Use="MapOrFail",Bse="Nested",Hse="Primitive",qse="Sequence",Vse="HashMap",Kse="ZipWith";var Uj={};const cx=(e,t)=>[...e,...t],Gse="effect/ConfigProvider",Bj=Symbol.for(Gse),Yse=Zl("effect/ConfigProvider"),Wse="effect/ConfigProviderFlat",Hj=Symbol.for(Wse),Jse=e=>({[Bj]:Bj,pipe(){return he(this,arguments)},...e}),Xse=e=>({[Hj]:Hj,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),Qse=e=>Jse({load:t=>te(Li(e,zl(),t,!1),n=>Dt(Zm(n),{onNone:()=>un(fu(zl(),`Expected a single value having structure: ${t}`)),onSome:fe})),flattened:e}),Zse=e=>{const{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:"_",seqDelim:","},e),r=l=>M(l,ph(t)),i=l=>l.split(t),a=()=>typeof process<"u"&&"env"in process&&typeof Uj=="object"?Uj:{};return Qse(Xse({load:(l,c,f=!0)=>{const u=r(l),d=a(),h=u in d?ae(d[u]):ne();return M(h,dS(()=>fu(l,`Expected ${u} to exist in the process context`)),te(p=>ioe(p,l,c,n,f)))},enumerateChildren:l=>ie(()=>{const c=a(),d=Object.keys(c).map(h=>i(h.toUpperCase())).filter(h=>{for(let p=0;p<l.length;p++){const b=M(l,I5(p)),x=h[p];if(x===void 0||b!==x)return!1}return!0}).flatMap(h=>h.slice(l.length,l.length+1));return Yne(d)}),patch:Ise}))},eoe=(e,t,n,r)=>{const i=hj(n.length,l=>l>=r.length?ne():ae([e(l),l+1])),a=hj(r.length,l=>l>=n.length?ne():ae([t(l),l+1])),s=cx(n,i),o=cx(r,a);return[s,o]},toe=(e,t)=>{let n=t;if(n._tag==="Nested"){const r=e.slice();for(;n._tag==="Nested";)r.push(n.name),n=n.config;return r}return e},Li=(e,t,n,r)=>{const i=n;switch(i._tag){case zse:return fe(va(i.value));case Pse:return Ve(()=>Li(e,t,i.config,r));case $se:return un(fu(t,i.message));case Lse:return M(Ve(()=>Li(e,t,i.first,r)),Hp(a=>i.condition(a)?M(Li(e,t,i.second,r),Hp(s=>un(kB(a,s)))):un(a)));case Fse:return Ve(()=>Li(e,t,i.config(),r));case Use:return Ve(()=>M(Li(e,t,i.original,r),te(ao(a=>M(i.mapOrFail(a),dS(Mc(toe(t,i.original))))))));case Bse:return Ve(()=>Li(e,cx(t,va(i.name)),i.config,r));case Hse:return M(A1(t,e.patch),te(a=>M(e.load(a,i,r),te(s=>{if(s.length===0){const o=M(Wte(a),Ut(()=>"<n/a>"));return un(fu([],`Expected ${i.description} with name ${o}`))}return fe(s)}))));case qse:return M(A1(t,e.patch),te(a=>M(e.enumerateChildren(a),te(soe),te(s=>s.length===0?Ve(()=>Qe(Li(e,t,i.config,!0),va)):M(ao(s,o=>Li(e,Hte(t,`[${o}]`),i.config,!0)),Qe(o=>{const l=L5(o);return l.length===0?va(zl()):va(l)}))))));case Vse:return Ve(()=>M(A1(t,e.patch),te(a=>M(e.enumerateChildren(a),te(s=>M(s,ao(o=>Li(e,cx(a,va(o)),i.valueConfig,r)),Qe(o=>o.length===0?va(iS()):M(aoe(o),qc(l=>Hre(dj(yt(s),l)))))))))));case Kse:return Ve(()=>M(Li(e,t,i.left,r),Ud,te(a=>M(Li(e,t,i.right,r),Ud,te(s=>{if(Gn(a)&&Gn(s))return un(EB(a.left,s.left));if(Gn(a)&&rs(s))return un(a.left);if(rs(a)&&Gn(s))return un(s.left);if(rs(a)&&rs(s)){const o=M(t,ph(".")),l=noe(t,o),[c,f]=eoe(l,l,M(a.right,qc(Me)),M(s.right,qc(Me)));return M(c,dj(f),ao(([u,d])=>M(hS(u,d),Qe(([h,p])=>i.zip(h,p)))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},noe=(e,t)=>n=>je(fu(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),roe=(e,t)=>e.split(new RegExp(`\\s*${lx(t)}\\s*`)),ioe=(e,t,n,r,i)=>i?M(roe(e,r),ao(a=>n.parse(a.trim())),dS(Mc(t))):M(n.parse(e),rA({onFailure:Mc(t),onSuccess:va})),aoe=e=>Object.keys(e[0]).map(t=>e.map(n=>n[t])),soe=e=>M(ao(e,loe),rA({onFailure:()=>zl(),onSuccess:zp(Bd)}),Ud,Qe(xte)),ooe=/^(\[(\d+)\])$/,loe=e=>{const t=e.match(ooe);if(t!==null){const n=t[2];return M(n!==void 0&&n.length>0?ae(n):ne(),Oo(coe))}return ne()},coe=e=>{const t=Number.parseInt(e);return Number.isNaN(t)?ne():ae(t)},qj=Symbol.for("effect/Console"),CB=Zl("effect/Console"),uoe={[qj]:qj,assert(e,...t){return ie(()=>{console.assert(e,...t)})},clear:ie(()=>{console.clear()}),count(e){return ie(()=>{console.count(e)})},countReset(e){return ie(()=>{console.countReset(e)})},debug(...e){return ie(()=>{console.debug(...e)})},dir(e,t){return ie(()=>{console.dir(e,t)})},dirxml(...e){return ie(()=>{console.dirxml(...e)})},error(...e){return ie(()=>{console.error(...e)})},group(e){return e!=null&&e.collapsed?ie(()=>console.groupCollapsed(e==null?void 0:e.label)):ie(()=>console.group(e==null?void 0:e.label))},groupEnd:ie(()=>{console.groupEnd()}),info(...e){return ie(()=>{console.info(...e)})},log(...e){return ie(()=>{console.log(...e)})},table(e,t){return ie(()=>{console.table(e,t)})},time(e){return ie(()=>console.time(e))},timeEnd(e){return ie(()=>console.timeEnd(e))},timeLog(e,...t){return ie(()=>{console.timeLog(e,...t)})},trace(...e){return ie(()=>{console.trace(...e)})},warn(...e){return ie(()=>{console.warn(...e)})},unsafe:console},foe="effect/Random",Vj=Symbol.for(foe),doe=Zl("effect/Random");var tL;tL=Vj;class hoe{constructor(t){S(this,"seed");S(this,tL,Vj);S(this,"PRNG");this.seed=t,this.PRNG=new pee(t)}get next(){return ie(()=>this.PRNG.number())}get nextBoolean(){return Qe(this.next,t=>t>.5)}get nextInt(){return ie(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(t,n){return Qe(this.next,r=>(n-t)*r+t)}nextIntBetween(t,n){return ie(()=>this.PRNG.integer(n-t)+t)}shuffle(t){return moe(t,n=>this.nextIntBetween(0,n))}}const moe=(e,t)=>Ve(()=>M(ie(()=>Array.from(e)),te(n=>{const r=[];for(let i=n.length;i>=2;i=i-1)r.push(i);return M(r,fS(i=>M(t(i),Qe(a=>poe(n,i-1,a)))),Vr(_o(n)))}))),poe=(e,t,n)=>{const r=e[t];return e[t]=e[n],e[n]=r,e},goe=e=>new hoe(de(e)),Kj=Symbol.for("effect/Tracer"),yoe=e=>({[Kj]:Kj,...e}),bA=Zl("effect/Tracer"),ES=Zl("effect/ParentSpan"),Gj=function(){const e="abcdef0123456789",t=e.length;return function(n){let r="";for(let i=0;i<n;i++)r+=e.charAt(Math.floor(Math.random()*t));return r}}();class boe{constructor(t,n,r,i,a,s){S(this,"name");S(this,"parent");S(this,"context");S(this,"startTime");S(this,"kind");S(this,"_tag","Span");S(this,"spanId");S(this,"traceId","native");S(this,"sampled",!0);S(this,"status");S(this,"attributes");S(this,"events",[]);S(this,"links");this.name=t,this.parent=n,this.context=r,this.startTime=a,this.kind=s,this.status={_tag:"Started",startTime:a},this.attributes=new Map,this.traceId=n._tag==="Some"?n.value.traceId:Gj(32),this.spanId=Gj(16),this.links=Array.from(i)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,r){this.events.push([t,n,r??{}])}addLinks(t){this.links.push(...t)}}const voe=yoe({span:(e,t,n,r,i,a)=>new boe(e,t,n,r,i,a),context:e=>e()}),xoe=e=>{if((e==null?void 0:e.captureStackTrace)===!1)return e;if((e==null?void 0:e.captureStackTrace)!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;Error.stackTraceLimit=t;let r=!1;return{...e,captureStackTrace:()=>{if(r!==!1)return r;if(n.stack!==void 0){const i=n.stack.split(`
78
+ `);if(i[3]!==void 0)return r=i[3].trim(),r}}}},hk=hh()("effect/Tracer/DisablePropagation",{defaultValue:vl}),Soe=M(gs(),Xi(_h,Ase()),Xi(CB,uoe),Xi(doe,goe(Math.random())),Xi(Yse,Zse()),Xi(bA,voe)),Hd=De(Symbol.for("effect/DefaultServices/currentServices"),()=>sB(Soe)),woe=e=>{const t=sa(e);return TB(n=>n.sleep(t))},_oe=e=>ht(t=>e(t.currentDefaultServices)),TB=e=>_oe(t=>e(t.unsafeMap.get(_h.key))),Eoe=TB(e=>e.currentTimeMillis),koe=Ig,Coe=Dee;let kh=class extends Coe{};const RB="Sequential",AB="Parallel",Toe="ParallelN",Kc={_tag:RB},mk={_tag:AB},Roe=e=>({_tag:Toe,parallelism:e}),Aoe=e=>e._tag===RB,Noe=e=>e._tag===AB,ux=Kc,pk=mk,gk=Roe;function Ooe(e){return new Bl(e)}function Moe(){return Ooe(new Map)}const Yj=Symbol.for("effect/FiberRefs");var nL;nL=Yj;class Bl{constructor(t){S(this,"locals");S(this,nL,Yj);this.locals=t}pipe(){return he(this,arguments)}}const joe=(e,t,n,r=!1)=>{const i=e;let a=t,s=n,o=r,l;for(;l===void 0;)if(cn(a)&&cn(s)){const c=Ur(a)[0],f=nu(a),u=Ur(s)[0],d=Ur(s)[1],h=nu(s);c.startTimeMillis<u.startTimeMillis?(s=h,o=!0):c.startTimeMillis>u.startTimeMillis?a=f:c.id<u.id?(s=h,o=!0):c.id>u.id?a=f:l=[d,o]}else l=[i.initial,!0];return l},Doe=R(3,(e,t,n)=>{const r=new Map(e.locals);return n.locals.forEach((i,a)=>{const s=i[0][1];if(!i[0][0][Ue](t)){if(!r.has(a)){if(xe(s,a.initial))return;r.set(a,[[t,a.join(a.initial,s)]]);return}const o=r.get(a),[l,c]=joe(a,o,i);if(c){const f=a.diff(l,s),u=o[0][1],d=a.join(u,a.patch(f)(u));if(!xe(u,d)){let h;const p=o[0][0];p[Ue](t)?h=[[p,d],...o.slice(1)]:h=[[t,d],...o],r.set(a,h)}}}}),new Bl(r)}),Ioe=R(2,(e,t)=>{const n=new Map;return NB(e,n,t),new Bl(n)}),NB=(e,t,n)=>{e.locals.forEach((r,i)=>{const a=r[0][1],s=i.patch(i.fork)(a);xe(a,s)?t.set(i,r):t.set(i,[[n,s],...r])})},OB=R(2,(e,t)=>{const n=new Map(e.locals);return n.delete(t),new Bl(n)}),MB=R(2,(e,t)=>e.locals.has(t)?ae(Ur(e.locals.get(t))[1]):ne()),Kp=R(2,(e,t)=>M(MB(e,t),Ut(()=>t.initial))),yk=R(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new Bl(new Map([[n,[[t,r]]]]));const i=new Map(e.locals);return bk(i,t,n,r),new Bl(i)}),bk=(e,t,n,r)=>{const i=e.get(n)??[];let a;if(cn(i)){const[s,o]=Ur(i);if(s[Ue](t)){if(xe(o,r))return;a=[[t,r],...i.slice(1)]}else a=[[t,r],...i]}else a=[[t,r]];e.set(n,a)},zoe=R(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new Bl(new Map(t));const r=new Map(e.locals);return n!==void 0&&NB(e,r,n),t.forEach(([i,a])=>{a.length===1?bk(r,a[0][0],i,a[0][1]):a.forEach(([s,o])=>{bk(r,s,i,o)})}),new Bl(r)}),Wj=MB,jB=Kp,$oe=zoe,Loe=Moe,DB="Empty",IB="Add",zB="Remove",$B="Update",LB="AndThen",Poe={_tag:DB},vA=(e,t)=>{const n=new Map(e.locals);let r=Poe;for(const[i,a]of t.locals.entries()){const s=Ur(a)[1],o=n.get(i);if(o!==void 0){const l=Ur(o)[1];xe(l,s)||(r=N1({_tag:$B,fiberRef:i,patch:i.diff(l,s)})(r))}else r=N1({_tag:IB,fiberRef:i,value:s})(r);n.delete(i)}for(const[i]of n.entries())r=N1({_tag:zB,fiberRef:i})(r);return r},N1=R(2,(e,t)=>({_tag:LB,first:e,second:t})),PB=R(3,(e,t,n)=>{let r=n,i=va(e);for(;cn(i);){const a=Ur(i),s=nu(i);switch(a._tag){case DB:{i=s;break}case IB:{r=yk(r,{fiberId:t,fiberRef:a.fiberRef,value:a.value}),i=s;break}case zB:{r=OB(r,a.fiberRef),i=s;break}case $B:{const o=Kp(r,a.fiberRef);r=yk(r,{fiberId:t,fiberRef:a.fiberRef,value:a.fiberRef.patch(a.patch)(o)}),i=s;break}case LB:{i=Xv(a.first)(Xv(a.second)(s));break}}}return r}),Gp=vA,Yp=PB,kS="effect/FiberStatus",du=Symbol.for(kS),fx="Done",Jj="Running",Xj="Suspended",Foe=qt(`${kS}-${fx}`);var rL;let Uoe=class{constructor(){S(this,rL,du);S(this,"_tag",fx)}[(rL=du,Fe)](){return Foe}[Ue](t){return xA(t)&&t._tag===fx}};var iL;class Boe{constructor(t){S(this,"runtimeFlags");S(this,iL,du);S(this,"_tag",Jj);this.runtimeFlags=t}[(iL=du,Fe)](){return M(de(kS),Be(de(this._tag)),Be(de(this.runtimeFlags)),Tt(this))}[Ue](t){return xA(t)&&t._tag===Jj&&this.runtimeFlags===t.runtimeFlags}}var aL;class Hoe{constructor(t,n){S(this,"runtimeFlags");S(this,"blockingOn");S(this,aL,du);S(this,"_tag",Xj);this.runtimeFlags=t,this.blockingOn=n}[(aL=du,Fe)](){return M(de(kS),Be(de(this._tag)),Be(de(this.runtimeFlags)),Be(de(this.blockingOn)),Tt(this))}[Ue](t){return xA(t)&&t._tag===Xj&&this.runtimeFlags===t.runtimeFlags&&xe(this.blockingOn,t.blockingOn)}}const qoe=new Uoe,Voe=e=>new Boe(e),Koe=(e,t)=>new Hoe(e,t),xA=e=>Re(e,du),Goe=e=>e._tag===fx,Yoe=qoe,FB=Voe,Woe=Koe,Joe=Goe,Xoe=Pae,Qoe=Fae,Zoe=Uae,ele=rB,tle=iB,nle=aB,rle=Bae,ile=Hae,ale=M(Bd,N5(e=>e.ordinal)),sle=wte(ale),ole=e=>{switch(e){case"All":return Xoe;case"Debug":return nle;case"Error":return Zoe;case"Fatal":return Qoe;case"Info":return tle;case"Trace":return rle;case"None":return ile;case"Warning":return ele}},lle=Symbol.for("effect/Micro"),dx=Symbol.for("effect/Micro/MicroExit"),Qj=Symbol.for("effect/Micro/MicroCause"),cle={_E:ke};var sL;class UB extends globalThis.Error{constructor(n,r,i){const a=`MicroCause.${n}`;let s,o,l;if(r instanceof globalThis.Error){s=`(${a}) ${r.name}`,o=r.message;const c=o.split(`
79
+ `).length;l=r.stack?`(${a}) ${r.stack.split(`
80
+ `).slice(0,c+3).join(`
81
+ `)}`:`${s}: ${o}`}else s=a,o=Rd(r,0),l=`${s}: ${o}`;i.length>0&&(l+=`
82
+ ${i.join(`
83
+ `)}`);super(o);S(this,"_tag");S(this,"traces");S(this,sL);this._tag=n,this.traces=i,this[Qj]=cle,this.name=s,this.stack=l}pipe(){return he(this,arguments)}toString(){return this.stack}[(sL=Qj,ut)](){return this.stack}}class ule extends UB{constructor(n,r=[]){super("Die",n,r);S(this,"defect");this.defect=n}}const fle=(e,t=[])=>new ule(e,t);let dle=class extends UB{constructor(t=[]){super("Interrupt","interrupted",t)}};const hle=(e=[])=>new dle(e),mle=e=>e._tag==="Interrupt",Zj=Symbol.for("effect/Micro/MicroFiber"),ple={_A:ke,_E:ke};var oL;oL=Zj;class gle{constructor(t,n=!0){S(this,"context");S(this,"interruptible");S(this,oL);S(this,"_stack",[]);S(this,"_observers",[]);S(this,"_exit");S(this,"_children");S(this,"currentOpCount",0);S(this,"_interrupted",!1);S(this,"_yielded");this.context=t,this.interruptible=n,this[Zj]=ple}getRef(t){return Xee(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Cd):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(kA))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(this._yielded!==void 0){const i=this._yielded;this._yielded=void 0,i()}const n=this.runLoop(t);if(n===Zy)return;const r=eD.interruptChildren&&eD.interruptChildren(this);if(r!==void 0)return this.evaluate(mx(r,()=>n));this._exit=n;for(let i=0;i<this._observers.length;i++)this._observers[i](n);this._observers.length=0}runLoop(t){let n=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!n&&this.getRef(CA).shouldYield(this)){n=!0;const i=r;r=mx(Sle,()=>i)}if(r=r[vk](this),r===Zy){const i=this._yielded;return dx in i?(this._yielded=void 0,i):Zy}}}catch(i){return Re(r,vk)?xk(i):xk(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[hx]&&n[hx](this);if(r)return{[t]:r};if(n[t])return n}}yieldWith(t){return this._yielded=t,Zy}children(){return this._children??(this._children=new Set)}}const eD=De("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0})),BB=Symbol.for("effect/Micro/identifier"),zn=Symbol.for("effect/Micro/args"),vk=Symbol.for("effect/Micro/evaluate"),qd=Symbol.for("effect/Micro/successCont"),id=Symbol.for("effect/Micro/failureCont"),hx=Symbol.for("effect/Micro/ensureCont"),Zy=Symbol.for("effect/Micro/Yield"),yle={_A:ke,_E:ke,_R:ke},ble={...koe,_op:"Micro",[lle]:yle,pipe(){return he(this,arguments)},[Symbol.iterator](){return new t5(new Dg(this))},toJSON(){return{_id:"Micro",op:this[BB],...zn in this?{args:this[zn]}:void 0}},toString(){return Mt(this)},[ut](){return Mt(this)}};function vle(e){return xk("Micro.evaluate: Not implemented")}const CS=e=>({...ble,[BB]:e.op,[vk]:e.eval??vle,[qd]:e.contA,[id]:e.contE,[hx]:e.ensure}),SA=e=>{const t=CS(e);return function(){const n=Object.create(t);return n[zn]=e.single===!1?arguments:arguments[0],n}},HB=e=>{const t={...CS(e),[dx]:dx,_tag:e.op,get[e.prop](){return this[zn]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[zn]}},[Ue](n){return Ele(n)&&n._tag===e.op&&xe(this[zn],n[zn])},[Fe](){return Tt(this,Be(qt(e.op))(de(this[zn])))}};return function(n){const r=Object.create(t);return r[zn]=n,r[qd]=void 0,r[id]=void 0,r[hx]=void 0,r}},wA=HB({op:"Success",prop:"value",eval(e){const t=e.getCont(qd);return t?t[qd](this[zn],e):e.yieldWith(this)}}),qB=HB({op:"Failure",prop:"cause",eval(e){let t=e.getCont(id);for(;mle(this[zn])&&t&&e.interruptible;)t=e.getCont(id);return t?t[id](this[zn],e):e.yieldWith(this)}}),xle=SA({op:"Yield",eval(e){let t=!1;return e.getRef(CA).scheduleTask(()=>{t||e.evaluate(kle)},this[zn]??0),e.yieldWith(()=>{t=!0})}}),Sle=xle(0),wle=wA(void 0),_A=SA({op:"WithMicroFiber",eval(e){return this[zn](e)}}),mx=R(2,(e,t)=>{const n=Object.create(_le);return n[zn]=e,n[qd]=t,n}),_le=CS({op:"OnSuccess",eval(e){return e._stack.push(this),this[zn]}}),Ele=e=>Re(e,dx),VB=wA,EA=qB,kA=EA(hle()),xk=e=>EA(fle(e)),kle=VB(void 0),Cle="setImmediate"in globalThis?globalThis.setImmediate:e=>setTimeout(e,0);class KB{constructor(){S(this,"tasks",[]);S(this,"running",!1);S(this,"afterScheduled",()=>{this.running=!1,this.runTasks()})}scheduleTask(t,n){this.tasks.push(t),this.running||(this.running=!0,Cle(this.afterScheduled))}runTasks(){const t=this.tasks;this.tasks=[];for(let n=0,r=t.length;n<r;n++)t[n]()}shouldYield(t){return t.currentOpCount>=t.getRef(Ale)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const Tle=R(2,(e,t)=>_A(n=>{const r=n.context;return n.context=t(r),Mle(e,()=>(n.context=r,wle))})),Rle=R(2,(e,t)=>Tle(e,oi(t)));class Ale extends hh()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class CA extends hh()("effect/Micro/currentScheduler",{defaultValue:()=>new KB}){}const Nle=R(2,(e,t)=>{const n=Object.create(Ole);return n[zn]=e,n[qd]=t.onSuccess,n[id]=t.onFailure,n}),Ole=CS({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[zn]}}),Mle=R(2,(e,t)=>Dle(n=>Nle(n(e),{onFailure:r=>mx(t(EA(r)),()=>qB(r)),onSuccess:r=>mx(t(VB(r)),()=>wA(r))}))),GB=SA({op:"SetInterruptible",ensure(e){if(e.interruptible=this[zn],e._interrupted&&e.interruptible)return()=>kA}}),jle=e=>_A(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(GB(!1)),t._interrupted?kA:e)),Dle=e=>_A(t=>t.interruptible?(t.interruptible=!1,t._stack.push(GB(!0)),e(jle)):e(ke)),Ile=(e,t)=>{const n=new gle(CA.context(new KB));return n.evaluate(e),n},px=Symbol.for("effect/Readable"),YB=Symbol.for("effect/Ref"),WB={_A:e=>e};var lL,cL,uL;class zle extends(uL=kh,cL=YB,lL=px,uL){constructor(n){super();S(this,"ref");S(this,cL,WB);S(this,lL,px);S(this,"get");this.ref=n,this.get=ie(()=>In(this.ref))}commit(){return this.get}modify(n){return ie(()=>{const r=In(this.ref),[i,a]=n(r);return r!==a&&Pg(a)(this.ref),i})}}const TA=e=>new zle(Lg(e)),gx=e=>ie(()=>TA(e)),fs=e=>e.get,ad=R(2,(e,t)=>e.modify(()=>[void 0,t])),$le=R(2,(e,t)=>e.modify(n=>[n,t])),JB=R(2,(e,t)=>e.modify(t)),yx=R(2,(e,t)=>e.modify(n=>[void 0,t(n)])),RA=gx,Lle=fs,Ple=$le,nm=JB,Fle=ad,Ule=yx;class XB{constructor(){S(this,"buckets",[])}scheduleTask(t,n){const r=this.buckets.length;let i,a=0;for(;a<r&&this.buckets[a][0]<=n;a++)i=this.buckets[a];i&&i[0]===n?i[1].push(t):a===r?this.buckets.push([n,[t]]):this.buckets.splice(a,0,[n,[t]])}}class Ble{constructor(t){S(this,"maxNextTickBeforeTimer");S(this,"running",!1);S(this,"tasks",new XB);this.maxNextTickBeforeTimer=t}starveInternal(t){const n=this.tasks.buckets;this.tasks.buckets=[];for(const[r,i]of n)for(let a=0;a<i.length;a++)i[a]();this.tasks.buckets.length===0?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout(()=>this.starveInternal(0),0):Promise.resolve(void 0).then(()=>this.starveInternal(t+1))}shouldYield(t){return t.currentOpCount>t.getFiberRef(oB)?t.getFiberRef(wh):!1}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running||(this.running=!0,this.starve())}}const QB=De(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new Ble(2048));class AA{constructor(){S(this,"tasks",new XB);S(this,"deferred",!1)}scheduleTask(t,n){this.deferred?QB.scheduleTask(t,n):this.tasks.scheduleTask(t,n)}shouldYield(t){return t.currentOpCount>t.getFiberRef(oB)?t.getFiberRef(wh):!1}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[n,r]of t)for(let i=0;i<r.length;i++)r[i]()}this.deferred=!0}}const NA=De(Symbol.for("effect/FiberRef/currentScheduler"),()=>Bn(QB)),ZB=De(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Bn(new Map)),tD=(e,t,n,r)=>{switch(e){case void 0:return t();case"unbounded":return n();case"inherit":return pS(nse,i=>i==="unbounded"?n():i>1?r(i):t());default:return e>1?r(e):t()}},Hle=woe,qle=Eoe,Vle=_h,e6=e=>e.replace(/[\s="]/g,"_"),Kle=e=>t=>`${e6(t.label)}=${e-t.startTime}ms`,t6="effect/MetricLabel",Sk=Symbol.for(t6);var fL;class Gle{constructor(t,n){S(this,"key");S(this,"value");S(this,fL,Sk);S(this,"_hash");this.key=t,this.value=n,this._hash=qt(t6+this.key+this.value)}[(fL=Sk,Fe)](){return this._hash}[Ue](t){return Wle(t)&&this.key===t.key&&this.value===t.value}pipe(){return he(this,arguments)}}const Yle=(e,t)=>new Gle(e,t),Wle=e=>Re(e,Sk),Jle=e=>Qe(e,ae),n6=e=>{let t,n;return typeof e=="function"?t=e:(t=e.try,n=e.catch),Ve(()=>{try{return fe(lr(t))}catch(r){return un(n?lr(()=>n(r)):new dA(r,"An unknown error occurred in Effect.try"))}})},Xle=e=>o6(e,i6,vA),Qle=e=>o6(e,hS(i6,Iae),([t,n],[r,i])=>[vA(t,r),Sl(n,i)]),r6=R(2,(e,t)=>Fl(e,{onFailure:n=>fe(t.onFailure(n)),onSuccess:n=>fe(t.onSuccess(n))})),i6=ht(e=>fe(e.getFiberRefs())),Zle=e=>r6(e,{onFailure:Cd,onSuccess:Cd}),nD=R(2,(e,t)=>oa(e,{onFailure:n=>WU(()=>t(n)),onSuccess:fe})),ece=e=>M(xS(),te(t=>M(Qle(e),QU(t),nce,Qe(n=>sn(n,M(Ul(t),te(([r,i])=>Vr(hS(a6(r[0]),ZU(r[1])),i)))))))),tce=e=>Qe(e,t=>!t),nce=e=>Qe(RA(!0),t=>ca(aA(e,Ple(t,!1)))),a6=e=>cce((t,n)=>M(e,PB(t,n))),rce=e=>e.length>=1?Ma((t,n)=>{try{e(n).then(r=>t(fe(r)),r=>t(cl(r)))}catch(r){t(cl(r))}}):Ma(t=>{try{e().then(n=>t(fe(n)),n=>t(cl(n)))}catch(n){t(cl(n))}}),s6=R(3,(e,t,n)=>Du(r=>_S(e,Xi(r,t,n)))),rD=R(3,(e,t,n)=>Du(r=>te(n,i=>_S(e,M(r,Xi(t,i)))))),ice=Hle,ace=fe(ne()),o6=R(3,(e,t,n)=>te(t,r=>te(e,i=>Qe(t,a=>[n(r,a),i])))),sce=R(2,(e,t)=>oa(e,{onFailure:n=>sn(t(n),Un(n)),onSuccess:fe})),oce=e=>{let t,n;typeof e=="function"?t=e:(t=e.try,n=e.catch);const r=i=>n?lS(()=>n(i)):un(new dA(i,"An unknown error occurred in Effect.tryPromise"));return t.length>=1?Ma((i,a)=>{try{t(a).then(s=>i(fe(s)),s=>i(r(s)))}catch(s){i(r(s))}}):Ma(i=>{try{t().then(a=>i(fe(a)),a=>i(r(a)))}catch(a){i(r(a))}})},lce=R(2,(e,t)=>te(e,n=>n6({try:()=>t.try(n),catch:t.catch}))),cce=e=>ht(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),kt)),uce=R(2,(e,t)=>Ve(()=>t()?Qe(e,ae):fe(ne()))),fce=e=>new Proxy({},{get(t,n,r){return(...i)=>te(e,a=>a[n](...i))}}),l6=BigInt(0),c6=Oo(e=>mo(e.context,hk)?e._tag==="Span"?c6(e.parent):ne():ae(e)),dce=(e,t,n)=>{const r=!e.getFiberRef(lB)||n.context&&mo(n.context,hk),i=e.getFiberRef(Cs),a=n.parent?ae(n.parent):n.root?ne():c6(dh(i,ES));let s;if(r)s=Ese({name:t,parent:a,context:Xi(n.context??gs(),hk,!0)});else{const o=e.getFiberRef(Hd),l=mo(o,bA),c=mo(o,Vle),f=e.getFiberRef(cB),u=e.getFiberRefs(),d=Wj(u,sse),h=Wj(u,ose),p=h._tag==="Some"?n.links!==void 0?[...Br(h.value),...n.links??[]]:Br(h.value):n.links??zl();s=l.span(t,a,n.context??gs(),p,f?c.unsafeCurrentTimeNanos():l6,n.kind??"internal",n),d._tag==="Some"&&Gre(d.value,(b,x)=>s.attribute(x,b)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([b,x])=>s.attribute(b,x))}return typeof n.captureStackTrace=="function"&&nx.set(s,n.captureStackTrace),s},hce=(e,t,n,r)=>ie(()=>{e.status._tag!=="Ended"&&(fB(t)&&nx.has(e)&&e.attribute("code.stacktrace",nx.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():l6,t))}),mce=(e,...t)=>{const n=xoe(t.length===1?void 0:t[0]),r=t[t.length-1];return ht(i=>{const a=dce(i,e,n),s=i.getFiberRef(cB),o=mo(i.getFiberRef(Hd),_h);return uu(r(a),l=>hce(a,l,o,s))})},pce=R(2,(e,t)=>s6(e,ES,t)),OA=fB,u6=hse,gce=rd,yce=dB,bx=Vp,Er=wt,bce=pse,vce=Vb,so=bS,xi=Et,MA=_r,iD=yse,Wp=hB,jA="InterruptSignal",DA="Stateful",IA="Resume",zA="YieldNow",O1=e=>({_tag:jA,cause:e}),Kb=e=>({_tag:DA,onFiber:e}),tf=e=>({_tag:IA,effect:e}),xce=()=>({_tag:zA}),Sce="effect/FiberScope",vx=Symbol.for(Sce);var dL;dL=vx;class wce{constructor(){S(this,dL,vx);S(this,"fiberId",Ti);S(this,"roots",new Set)}add(t,n){this.roots.add(n),n.addObserver(()=>{this.roots.delete(n)})}}var hL;hL=vx;class _ce{constructor(t,n){S(this,"fiberId");S(this,"parent");S(this,hL,vx);this.fiberId=t,this.parent=n}add(t,n){this.parent.tell(Kb(r=>{r.addChild(n),n.addObserver(()=>{r.removeChild(n)})}))}}const Ece=e=>new _ce(e.id(),e),TS=De(Symbol.for("effect/FiberScope/Global"),()=>new wce),kce="effect/Fiber",Cce=Symbol.for(kce),Tce={_E:e=>e,_A:e=>e},Rce="effect/Fiber",Ace=Symbol.for(Rce),Nce=e=>e.await,Oce=e=>e.inheritAll,Jp=e=>mS(uS(e.await),e.inheritAll);({...$g});const Bo="effect/FiberCurrent",Mce=()=>mh(globalThis[Bo]),jce="effect/Logger",Dce=Symbol.for(jce),Ice={_Message:e=>e,_Output:e=>e},$A=e=>({[Dce]:Ice,log:e,pipe(){return he(this,arguments)}}),zce=/^[^\s"=]*$/,$ce=(e,t)=>({annotations:n,cause:r,date:i,fiberId:a,logLevel:s,message:o,spans:l})=>{const c=p=>p.match(zce)?p:e(p),f=(p,b)=>`${e6(p)}=${c(b)}`,u=(p,b)=>" "+f(p,b);let d=f("timestamp",i.toISOString());d+=u("level",s.label),d+=u("fiber",vU(a));const h=Ute(o);for(let p=0;p<h.length;p++)d+=u("message",Rd(h[p],t));Xne(r)||(d+=u("cause",bh(r,{renderErrorCause:!0})));for(const p of l)d+=" "+Kle(i.getTime())(p);for(const[p,b]of n)d+=u(p,Rd(b,t));return d},Lce=e=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,Pce=$A($ce(Lce)),Fce=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;Fce&&process.stdout.isTTY;const f6="effect/MetricBoundaries",wk=Symbol.for(f6);var mL;class Uce{constructor(t){S(this,"values");S(this,mL,wk);S(this,"_hash");this.values=t,this._hash=M(qt(f6),Be(uh(this.values)))}[(mL=wk,Fe)](){return this._hash}[Ue](t){return Bce(t)&&xe(this.values,t.values)}pipe(){return he(this,arguments)}}const Bce=e=>Re(e,wk),Hce=e=>{const t=M(e,jR(Rn(Number.POSITIVE_INFINITY)),ane);return new Uce(t)},qce=e=>M(Fte(e.count-1,t=>e.start*Math.pow(e.factor,t)),Ir,Hce),Vce="effect/MetricKeyType",d6=Symbol.for(Vce),h6="effect/MetricKeyType/Counter",_k=Symbol.for(h6),Kce="effect/MetricKeyType/Frequency",Gce=Symbol.for(Kce),Yce="effect/MetricKeyType/Gauge",Wce=Symbol.for(Yce),m6="effect/MetricKeyType/Histogram",Ek=Symbol.for(m6),Jce="effect/MetricKeyType/Summary",Xce=Symbol.for(Jce),p6={_In:e=>e,_Out:e=>e};var pL,gL;class Qce{constructor(t,n){S(this,"incremental");S(this,"bigint");S(this,gL,p6);S(this,pL,_k);S(this,"_hash");this.incremental=t,this.bigint=n,this._hash=qt(h6)}[(gL=d6,pL=_k,Fe)](){return this._hash}[Ue](t){return g6(t)}pipe(){return he(this,arguments)}}var yL,bL;class Zce{constructor(t){S(this,"boundaries");S(this,bL,p6);S(this,yL,Ek);S(this,"_hash");this.boundaries=t,this._hash=M(qt(m6),Be(de(this.boundaries)))}[(bL=d6,yL=Ek,Fe)](){return this._hash}[Ue](t){return y6(t)&&xe(this.boundaries,t.boundaries)}pipe(){return he(this,arguments)}}const eue=e=>new Qce((e==null?void 0:e.incremental)??!1,(e==null?void 0:e.bigint)??!1),tue=e=>new Zce(e),g6=e=>Re(e,_k),nue=e=>Re(e,Gce),rue=e=>Re(e,Wce),y6=e=>Re(e,Ek),iue=e=>Re(e,Xce),aue="effect/MetricKey",b6=Symbol.for(aue),sue={_Type:e=>e},oue=V0(xe);var vL;class LA{constructor(t,n,r,i=[]){S(this,"name");S(this,"keyType");S(this,"description");S(this,"tags");S(this,vL,sue);S(this,"_hash");this.name=t,this.keyType=n,this.description=r,this.tags=i,this._hash=M(qt(this.name+this.description),Be(de(this.keyType)),Be(uh(this.tags)))}[(vL=b6,Fe)](){return this._hash}[Ue](t){return lue(t)&&this.name===t.name&&xe(this.keyType,t.keyType)&&xe(this.description,t.description)&&oue(this.tags,t.tags)}pipe(){return he(this,arguments)}}const lue=e=>Re(e,b6),cue=(e,t)=>new LA(e,eue(t),mh(t==null?void 0:t.description)),uue=(e,t,n)=>new LA(e,tue(t),mh(n)),fue=R(2,(e,t)=>t.length===0?e:new LA(e.name,e.keyType,e.description,Ub(e.tags,t))),aD=Symbol.for("effect/MutableHashMap"),due={[aD]:aD,[Symbol.iterator](){return new PA(this)},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(Qt)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}};class PA{constructor(t){S(this,"self");S(this,"referentialIterator");S(this,"bucketIterator");this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new hue(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new PA(this.self)}}class hue{constructor(t){S(this,"backing");S(this,"currentBucket");this.backing=t}next(){if(this.currentBucket===void 0){const n=this.backing.next();if(n.done)return n;this.currentBucket=n.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const kk=()=>{const e=Object.create(due);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},Js=R(2,(e,t)=>{if(Ip(t)===!1)return e.referential.has(t)?ae(e.referential.get(t)):ne();const n=t[Fe](),r=e.buckets.get(n);return r===void 0?ne():mue(e,r,t)}),mue=(e,t,n,r=!1)=>{for(let i=0,a=t.length;i<a;i++)if(n[Ue](t[i][0])){const s=t[i][1];return r&&(t.splice(i,1),e.bucketsSize--),ae(s)}return ne()},rm=R(2,(e,t)=>zt(Js(e,t))),Tc=R(3,(e,t,n)=>{if(Ip(t)===!1)return e.referential.set(t,n),e;const r=t[Fe](),i=e.buckets.get(r);return i===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(v6(e,i,t),i.push([t,n]),e.bucketsSize++,e)}),v6=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(n[Ue](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},pue=R(2,(e,t)=>{if(Ip(t)===!1)return e.referential.delete(t),e;const n=t[Fe](),r=e.buckets.get(n);return r===void 0||(v6(e,r,t),r.length===0&&e.buckets.delete(n)),e}),gue="effect/MetricState",Wg=Symbol.for(gue),x6="effect/MetricState/Counter",Ck=Symbol.for(x6),S6="effect/MetricState/Frequency",Tk=Symbol.for(S6),w6="effect/MetricState/Gauge",Rk=Symbol.for(w6),_6="effect/MetricState/Histogram",Ak=Symbol.for(_6),E6="effect/MetricState/Summary",Nk=Symbol.for(E6),Jg={_A:e=>e};var xL,SL;class yue{constructor(t){S(this,"count");S(this,SL,Jg);S(this,xL,Ck);this.count=t}[(SL=Wg,xL=Ck,Fe)](){return M(de(x6),Be(de(this.count)),Tt(this))}[Ue](t){return Rue(t)&&this.count===t.count}pipe(){return he(this,arguments)}}const bue=V0(xe);var wL,_L;class vue{constructor(t){S(this,"occurrences");S(this,_L,Jg);S(this,wL,Tk);S(this,"_hash");this.occurrences=t}[(_L=Wg,wL=Tk,Fe)](){return M(qt(S6),Be(uh(yt(this.occurrences.entries()))),Tt(this))}[Ue](t){return Aue(t)&&bue(yt(this.occurrences.entries()),yt(t.occurrences.entries()))}pipe(){return he(this,arguments)}}var EL,kL;class xue{constructor(t){S(this,"value");S(this,kL,Jg);S(this,EL,Rk);this.value=t}[(kL=Wg,EL=Rk,Fe)](){return M(de(w6),Be(de(this.value)),Tt(this))}[Ue](t){return Nue(t)&&this.value===t.value}pipe(){return he(this,arguments)}}var CL,TL;class Sue{constructor(t,n,r,i,a){S(this,"buckets");S(this,"count");S(this,"min");S(this,"max");S(this,"sum");S(this,TL,Jg);S(this,CL,Ak);this.buckets=t,this.count=n,this.min=r,this.max=i,this.sum=a}[(TL=Wg,CL=Ak,Fe)](){return M(de(_6),Be(de(this.buckets)),Be(de(this.count)),Be(de(this.min)),Be(de(this.max)),Be(de(this.sum)),Tt(this))}[Ue](t){return Oue(t)&&xe(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return he(this,arguments)}}var RL,AL;class wue{constructor(t,n,r,i,a,s){S(this,"error");S(this,"quantiles");S(this,"count");S(this,"min");S(this,"max");S(this,"sum");S(this,AL,Jg);S(this,RL,Nk);this.error=t,this.quantiles=n,this.count=r,this.min=i,this.max=a,this.sum=s}[(AL=Wg,RL=Nk,Fe)](){return M(de(E6),Be(de(this.error)),Be(de(this.quantiles)),Be(de(this.count)),Be(de(this.min)),Be(de(this.max)),Be(de(this.sum)),Tt(this))}[Ue](t){return Mue(t)&&this.error===t.error&&xe(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return he(this,arguments)}}const _ue=e=>new yue(e),Eue=e=>new vue(e),kue=e=>new xue(e),Cue=e=>new Sue(e.buckets,e.count,e.min,e.max,e.sum),Tue=e=>new wue(e.error,e.quantiles,e.count,e.min,e.max,e.sum),Rue=e=>Re(e,Ck),Aue=e=>Re(e,Tk),Nue=e=>Re(e,Rk),Oue=e=>Re(e,Ak),Mue=e=>Re(e,Nk),jue="effect/MetricHook",Due=Symbol.for(jue),Iue={_In:e=>e,_Out:e=>e},Xg=e=>({[Due]:Iue,pipe(){return he(this,arguments)},...e}),sD=BigInt(0),zue=e=>{let t=e.keyType.bigint?sD:0;const n=e.keyType.incremental?e.keyType.bigint?i=>i>=sD:i=>i>=0:i=>!0,r=i=>{n(i)&&(t=t+i)};return Xg({get:()=>_ue(t),update:r,modify:r})},$ue=e=>{const t=new Map;for(const r of e.keyType.preregisteredWords)t.set(r,0);const n=r=>{const i=t.get(r)??0;t.set(r,i+1)};return Xg({get:()=>Eue(t),update:n,modify:n})},Lue=(e,t)=>{let n=t;return Xg({get:()=>kue(n),update:r=>{n=r},modify:r=>{n=n+r}})},Pue=e=>{const t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),i=new Float64Array(n);let a=0,s=0,o=Number.MAX_VALUE,l=Number.MIN_VALUE;M(t,zp(Bd),qc((u,d)=>{i[d]=u}));const c=u=>{let d=0,h=n;for(;d!==h;){const p=Math.floor(d+(h-d)/2),b=i[p];u<=b?h=p:d=p,h===d+1&&(u<=i[d]?h=d:d=h)}r[d]=r[d]+1,a=a+1,s=s+u,u<o&&(o=u),u>l&&(l=u)},f=()=>{const u=q0(n);let d=0;for(let h=0;h<n;h++){const p=i[h],b=r[h];d=d+b,u[h]=[p,d]}return u};return Xg({get:()=>Cue({buckets:f(),count:a,min:o,max:l,sum:s}),update:c,modify:c})},Fue=e=>{const{error:t,maxAge:n,maxSize:r,quantiles:i}=e.keyType,a=M(i,zp(Bd)),s=q0(r);let o=0,l=0,c=0,f=0,u=0;const d=p=>{const b=[];let x=0;for(;x!==r-1;){const g=s[x];if(g!=null){const[v,w]=g,E=Ld(p-v);Rre(E,$d)&&Tre(E,n)&&b.push(w)}x=x+1}return Uue(t,a,zp(b,Bd))},h=(p,b)=>{if(r>0){o=o+1;const x=o%r;s[x]=[b,p]}f=l===0?p:Math.min(f,p),u=l===0?p:Math.max(u,p),l=l+1,c=c+p};return Xg({get:()=>Tue({error:t,quantiles:d(Date.now()),count:l,min:f,max:u,sum:c}),update:([p,b])=>h(p,b),modify:([p,b])=>h(p,b)})},Uue=(e,t,n)=>{const r=n.length;if(!cn(t))return zl();const i=t[0],a=t.slice(1),s=oD(e,r,ne(),0,i,n),o=va(s);return a.forEach(l=>{o.push(oD(e,r,s.value,s.consumed,l,s.rest))}),qc(o,l=>[l.quantile,l.value])},oD=(e,t,n,r,i,a)=>{let s=e,o=t,l=n,c=r,f=i,u=a,d=e,h=t,p=n,b=r,x=i,g=a;for(;;){if(!cn(u))return{quantile:f,value:ne(),consumed:c,rest:[]};if(f===1)return{quantile:f,value:ae(z5(u)),consumed:c+u.length,rest:[]};const v=Ur(u),w=Xte(u,A=>A===v),E=f*o,C=s/2*E,k=c+w[0].length,_=Math.abs(k-E);if(k<E-C){d=s,h=o,p=Zm(u),b=k,x=f,g=w[1],s=d,o=h,l=p,c=b,f=x,u=g;continue}if(k>E+C){const A=Yt(l)?ae(v):l;return{quantile:f,value:A,consumed:c,rest:u}}switch(l._tag){case"None":{d=s,h=o,p=Zm(u),b=k,x=f,g=w[1],s=d,o=h,l=p,c=b,f=x,u=g;continue}case"Some":{const A=Math.abs(E-l.value);if(_<A){d=s,h=o,p=Zm(u),b=k,x=f,g=w[1],s=d,o=h,l=p,c=b,f=x,u=g;continue}return{quantile:f,value:ae(l.value),consumed:c,rest:u}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},Bue="effect/MetricPair",Hue=Symbol.for(Bue),que={_Type:e=>e},Vue=(e,t)=>({[Hue]:que,metricKey:e,metricState:t,pipe(){return he(this,arguments)}}),Kue="effect/MetricRegistry",lD=Symbol.for(Kue);var NL;NL=lD;class Gue{constructor(){S(this,NL,lD);S(this,"map",kk())}snapshot(){const t=[];for(const[n,r]of this.map)t.push(Vue(n,r.get()));return t}get(t){const n=M(this.map,Js(t),Vi);if(n==null){if(g6(t.keyType))return this.getCounter(t);if(rue(t.keyType))return this.getGauge(t);if(nue(t.keyType))return this.getFrequency(t);if(y6(t.keyType))return this.getHistogram(t);if(iue(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}else return n}getCounter(t){let n=M(this.map,Js(t),Vi);if(n==null){const r=zue(t);M(this.map,rm(t))||M(this.map,Tc(t,r)),n=r}return n}getFrequency(t){let n=M(this.map,Js(t),Vi);if(n==null){const r=$ue(t);M(this.map,rm(t))||M(this.map,Tc(t,r)),n=r}return n}getGauge(t){let n=M(this.map,Js(t),Vi);if(n==null){const r=Lue(t,t.keyType.bigint?BigInt(0):0);M(this.map,rm(t))||M(this.map,Tc(t,r)),n=r}return n}getHistogram(t){let n=M(this.map,Js(t),Vi);if(n==null){const r=Pue(t);M(this.map,rm(t))||M(this.map,Tc(t,r)),n=r}return n}getSummary(t){let n=M(this.map,Js(t),Vi);if(n==null){const r=Fue(t);M(this.map,rm(t))||M(this.map,Tc(t,r)),n=r}return n}}const Yue=()=>new Gue,Wue="effect/Metric",Jue=Symbol.for(Wue),Xue={_Type:e=>e,_In:e=>e,_Out:e=>e},cD=De(Symbol.for("effect/Metric/globalMetricRegistry"),()=>Yue()),k6=function(e,t,n,r){const i=Object.assign(a=>iA(a,s=>tfe(i,s)),{[Jue]:Xue,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return he(this,arguments)}});return i},RS=(e,t)=>C6(cue(e,t)),C6=e=>{let t;const n=new WeakMap,r=i=>{if(i.length===0)return t!==void 0||(t=cD.get(e)),t;let a=n.get(i);return a!==void 0||(a=cD.get(fue(e,i)),n.set(i,a)),a};return k6(e.keyType,(i,a)=>r(a).update(i),i=>r(i).get(),(i,a)=>r(a).modify(i))},Que=(e,t,n)=>C6(uue(e,t,n)),Zue=R(3,(e,t,n)=>efe(e,[Yle(t,n)])),efe=R(2,(e,t)=>k6(e.keyType,(n,r)=>e.unsafeUpdate(n,Ub(t,r)),n=>e.unsafeValue(Ub(t,n)),(n,r)=>e.unsafeModify(n,Ub(t,r)))),tfe=R(2,(e,t)=>pS(lk,n=>ie(()=>e.unsafeUpdate(t,n))));({...zg});const nfe=R(2,(e,t)=>pS(ZB,n=>ie(()=>{if(n.has(e)){const r=n.get(e);r.state.completed||(r.state.completed=!0,wS(r.result,t))}}))),rfe="effect/Supervisor",AS=Symbol.for(rfe),FA={_T:e=>e};var OL;OL=AS;const nO=class nO{constructor(t,n){S(this,"underlying");S(this,"value0");S(this,OL,FA);this.underlying=t,this.value0=n}get value(){return this.value0}onStart(t,n,r,i){this.underlying.onStart(t,n,r,i)}onEnd(t,n){this.underlying.onEnd(t,n)}onEffect(t,n){this.underlying.onEffect(t,n)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new nO(this,M(this.value,Qe(t)))}zip(t){return new Sx(this,t)}};let xx=nO;var ML;ML=AS;const rO=class rO{constructor(t,n){S(this,"left");S(this,"right");S(this,"_tag","Zip");S(this,ML,FA);this.left=t,this.right=n}get value(){return hS(this.left.value,this.right.value)}onStart(t,n,r,i){this.left.onStart(t,n,r,i),this.right.onStart(t,n,r,i)}onEnd(t,n){this.left.onEnd(t,n),this.right.onEnd(t,n)}onEffect(t,n){this.left.onEffect(t,n),this.right.onEffect(t,n)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new xx(this,M(this.value,Qe(t)))}zip(t){return new rO(this,t)}};let Sx=rO;const T6=e=>Re(e,AS)&&yR(e,"Zip");var jL;jL=AS;class ife{constructor(t){S(this,"effect");S(this,jL,FA);this.effect=t}get value(){return this.effect}onStart(t,n,r,i){}onEnd(t,n){}onEffect(t,n){}onSuspend(t){}onResume(t){}map(t){return new xx(this,M(this.value,Qe(t)))}zip(t){return new Sx(this,t)}onRun(t,n){return t()}}const afe=e=>new ife(e),NS=De("effect/Supervisor/none",()=>afe(kt)),sfe=vh,R6="Empty",A6="AddSupervisor",N6="RemoveSupervisor",O6="AndThen",np={_tag:R6},Gb=(e,t)=>({_tag:O6,first:e,second:t}),ofe=(e,t)=>lfe(t,Rn(e)),lfe=(e,t)=>{let n=e,r=t;for(;ko(r);){const i=is(r);switch(i._tag){case R6:{r=io(r);break}case A6:{n=n.zip(i.supervisor),r=io(r);break}case N6:{n=Ok(n,i.supervisor),r=io(r);break}case O6:{r=Rr(i.first)(Rr(i.second)(io(r)));break}}}return n},Ok=(e,t)=>xe(e,t)?NS:T6(e)?Ok(e.left,t).zip(Ok(e.right,t)):e,wx=e=>xe(e,NS)?iu():T6(e)?M(wx(e.left),Pp(wx(e.right))):KR(e),cfe=(e,t)=>{if(xe(e,t))return np;const n=wx(e),r=wx(t),i=M(r,pj(n),Fp(np,(s,o)=>Gb(s,{_tag:A6,supervisor:o}))),a=M(n,pj(r),Fp(np,(s,o)=>Gb(s,{_tag:N6,supervisor:o})));return Gb(i,a)},ufe=sfe({empty:np,patch:ofe,combine:Gb,diff:cfe}),ffe=RS("effect_fiber_started",{incremental:!0}),uD=RS("effect_fiber_active"),dfe=RS("effect_fiber_successes",{incremental:!0}),hfe=RS("effect_fiber_failures",{incremental:!0}),mfe=Zue(Que("effect_fiber_lifetimes",qce({start:.5,factor:2,count:35})),"time_unit","milliseconds"),im="Continue",pfe="Done",fD="Yield",gfe={_E:e=>e,_A:e=>e},eb=e=>{throw new Error(`BUG: FiberRuntime - ${Rd(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},Ls=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),Ps=De("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),am={[Gv]:(e,t,n)=>lr(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>Et(Et(n)),[Yv]:(e,t,n)=>lr(()=>t.effect_instruction_i2(n)),[wR]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),Go(e.currentRuntimeFlags)&&e.isInterrupted()?wt(e.getInterruptedCause()):Et(n)),[Wv]:(e,t,n)=>(lr(()=>t.effect_instruction_i2(n)),lr(()=>t.effect_instruction_i0())?(e.pushStack(t),lr(()=>t.effect_instruction_i1())):kt),[Qm]:(e,t,n)=>{for(;;){const r=lr(()=>t.effect_instruction_i0.next(n));if(r.done)return Et(r.value);const i=yee(r.value);if(yS(i)){if(i._tag==="Failure")return i}else return e.pushStack(t),i;n=i.value}}},yfe={[jA]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),Go(t)?wt(r.cause):n),[IA]:(e,t,n,r)=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[DA]:(e,t,n,r)=>(r.onFiber(e,FB(t)),n),[zA]:(e,t,n,r)=>te(oA(),()=>n)},bfe=e=>fS(fae(e),t=>ds(kae(t),([n,r])=>{const i=new Map,a=[];for(const o of r){a.push(Br(o));for(const l of o)i.set(l.request,l)}const s=a.flat();return xh(Ufe(n.runAll(a),s,()=>s.forEach(o=>{o.listeners.interrupted=!0})),ZB,i)},!1,!1)),vfe=_R();var DL,IL;class M6 extends kh{constructor(n,r,i){super();S(this,IL,Tce);S(this,DL,gfe);S(this,"_fiberRefs");S(this,"_fiberId");S(this,"_queue",new Array);S(this,"_children",null);S(this,"_observers",new Array);S(this,"_running",!1);S(this,"_stack",[]);S(this,"_asyncInterruptor",null);S(this,"_asyncBlockingOn",null);S(this,"_exitValue",null);S(this,"_steps",[]);S(this,"_isYielding",!1);S(this,"currentRuntimeFlags");S(this,"currentOpCount",0);S(this,"currentSupervisor");S(this,"currentScheduler");S(this,"currentTracer");S(this,"currentSpan");S(this,"currentContext");S(this,"currentDefaultServices");S(this,"run",()=>{this.drainQueueOnCurrentThread()});if(this.currentRuntimeFlags=i,this._fiberId=n,this._fiberRefs=r,Tj(i)){const a=this.getFiberRef(lk);ffe.unsafeUpdate(1,a),uD.unsafeUpdate(1,a)}this.refreshRefCache()}commit(){return Jp(this)}id(){return this._fiberId}resume(n){this.tell(tf(n))}get status(){return this.ask((n,r)=>r)}get runtimeFlags(){return this.ask((n,r)=>Joe(r)?n.currentRuntimeFlags:r.runtimeFlags)}scope(){return Ece(this)}get children(){return this.ask(n=>Array.from(n.getChildren()))}getChildren(){return this._children===null&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Qy)}fiberRefs(){return this.ask(n=>n.getFiberRefs())}ask(n){return Ve(()=>{const r=vS(this._fiberId);return this.tell(Kb((i,a)=>{wS(r,ie(()=>n(i,a)))})),Ul(r)})}tell(n){this._queue.push(n),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Ma(n=>{const r=i=>n(fe(i));if(this._exitValue!==null){r(this._exitValue);return}return this.tell(Kb((i,a)=>{i._exitValue!==null?r(this._exitValue):i.addObserver(r)})),ie(()=>this.tell(Kb((i,a)=>{i.removeObserver(r)})))},this.id())}get inheritAll(){return ht((n,r)=>{const i=n.id(),a=n.getFiberRefs(),s=r.runtimeFlags,o=this.getFiberRefs(),l=Doe(a,i,o);n.setFiberRefs(l);const c=n.getFiberRef(pD),f=M(Sl(s,c),Aj(ju),Aj(sk));return ZU(f)})}get poll(){return ie(()=>mh(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(n){return ie(()=>this.tell(O1(wa(n))))}unsafeInterruptAsFork(n){this.tell(O1(wa(n)))}addObserver(n){this._exitValue!==null?n(this._exitValue):this._observers.push(n)}removeObserver(n){this._observers=this._observers.filter(r=>r!==n)}getFiberRefs(){return this.setFiberRef(pD,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(n){this._fiberRefs=OB(this._fiberRefs,n)}getFiberRef(n){return this._fiberRefs.locals.has(n)?this._fiberRefs.locals.get(n)[0][1]:n.initial}setFiberRef(n,r){this._fiberRefs=yk(this._fiberRefs,{fiberId:this._fiberId,fiberRef:n,value:r}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Hd),this.currentTracer=this.currentDefaultServices.unsafeMap.get(bA.key),this.currentSupervisor=this.getFiberRef(Lfe),this.currentScheduler=this.getFiberRef(NA),this.currentContext=this.getFiberRef(Cs),this.currentSpan=this.currentContext.unsafeMap.get(ES.key)}setFiberRefs(n){this._fiberRefs=n,this.refreshRefCache()}addChild(n){this.getChildren().add(n)}removeChild(n){this.getChildren().delete(n)}transferChildren(n){const r=this._children;if(this._children=null,r!==null&&r.size>0)for(const i of r)i._exitValue===null&&n.add(this.currentRuntimeFlags,i)}drainQueueOnCurrentThread(){let n=!0;for(;n;){let r=im;const i=globalThis[Bo];globalThis[Bo]=this;try{for(;r===im;)r=this._queue.length===0?pfe:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[Bo]=i}this._queue.length>0&&!this._running?(this._running=!0,r===fD?(this.drainQueueLaterOnExecutor(),n=!1):n=!0):n=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(wh))}drainQueueWhileRunning(n,r){let i=r;for(;this._queue.length>0;){const a=this._queue.splice(0,1)[0];i=yfe[a._tag](this,n,i,a)}return i}isInterrupted(){return!Zne(this.getFiberRef(Qy))}addInterruptedCause(n){const r=this.getFiberRef(Qy);this.setFiberRef(Qy,wr(r,n))}processNewInterruptSignal(n){this.addInterruptedCause(n),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let n=!1;for(const r of this._children)r.tell(O1(wa(this.id()))),n=!0;return n}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const n=this._children.values();this._children=null;let r=!1;return sA({while:()=>!r,body:()=>{const a=n.next();return a.done?ie(()=>{r=!0}):ca(a.value.await)},step:()=>{}})}return null}reportExitValue(n){if(Tj(this.currentRuntimeFlags)){const r=this.getFiberRef(lk),i=this.id().startTimeMillis,a=Date.now();switch(mfe.unsafeUpdate(a-i,r),uD.unsafeUpdate(-1,r),n._tag){case Qn:{dfe.unsafeUpdate(1,r);break}case Xn:{hfe.unsafeUpdate(1,r);break}}}if(n._tag==="Failure"){const r=this.getFiberRef(ise);!eS(n.cause)&&r._tag==="Some"&&this.log("Fiber terminated with an unhandled error",n.cause,r)}}setExitValue(n){this._exitValue=n,this.reportExitValue(n);for(let r=this._observers.length-1;r>=0;r--)this._observers[r](n);this._observers=[]}getLoggers(){return this.getFiberRef(Efe)}log(n,r,i){const a=zt(i)?i.value:this.getFiberRef(Zae),s=this.getFiberRef(xfe);if(sle(s,a))return;const o=this.getFiberRef(ese),l=this.getFiberRef(Qae),c=this.getLoggers(),f=this.getFiberRefs();if(GR(c)>0){const u=mo(this.getFiberRef(Hd),_h),d=new Date(u.unsafeCurrentTimeMillis());Eee(f,()=>{for(const h of c)h.log({fiberId:this.id(),logLevel:a,message:n,cause:r,context:f,spans:o,annotations:l,date:d})})}}evaluateMessageWhileSuspended(n){switch(n._tag){case zA:return fD;case jA:return this.processNewInterruptSignal(n.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(wt(n.cause)),this._asyncInterruptor=null),im;case IA:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(n.effect),im;case DA:return n.onFiber(this,this._exitValue!==null?Yoe:Woe(this.currentRuntimeFlags,this._asyncBlockingOn)),im;default:return eb(n)}}evaluateEffect(n){this.currentSupervisor.onResume(this);try{let r=Go(this.currentRuntimeFlags)&&this.isInterrupted()?wt(this.getInterruptedCause()):n;for(;r!==null;){const i=r,a=this.runLoop(i);if(a===Ls){const s=Ps.currentOp;Ps.currentOp=null,s._op===Fb?aae(this.currentRuntimeFlags)?(this.tell(xce()),this.tell(tf(_r)),r=null):r=_r:s._op===Xm&&(r=null)}else{this.currentRuntimeFlags=M(this.currentRuntimeFlags,oae(sk));const s=this.interruptAllChildren();s!==null?r=te(s,()=>a):(this._queue.length===0?this.setExitValue(a):this.tell(tf(a)),r=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(n){if(this._running)this.tell(tf(n));else{this._running=!0;const r=globalThis[Bo];globalThis[Bo]=this;try{this.evaluateEffect(n)}finally{this._running=!1,globalThis[Bo]=r,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(n){this.tell(tf(n))}patchRuntimeFlags(n,r){const i=nd(n,r);return globalThis[Bo]=this,this.currentRuntimeFlags=i,i}initiateAsync(n,r){let i=!1;const a=s=>{i||(i=!0,this.tell(tf(s)))};Go(n)&&(this._asyncInterruptor=a);try{r(a)}catch(s){a(Un(ta(s)))}}pushStack(n){this._stack.push(n),n._op==="OnStep"&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const n=this._stack.pop();if(n)return n._op==="OnStep"&&this._steps.pop(),n}getNextSuccessCont(){let n=this.popStack();for(;n;){if(n._op!==Pb)return n;n=this.popStack()}}getNextFailCont(){let n=this.popStack();for(;n;){if(n._op!==Gv&&n._op!==Wv&&n._op!==Qm)return n;n=this.popStack()}}[(IL=Cce,DL=Ace,kee)](n){return ie(()=>v5(this.currentContext,n))}Left(n){return un(n.left)}None(n){return un(new gS)}Right(n){return Et(n.right)}Some(n){return Et(n.value)}Micro(n){return sx(r=>{let i=r;const a=Ile(Rle(n,this.currentContext));return a.addObserver(s=>{if(s._tag==="Success")return i(Et(s.value));switch(s.cause._tag){case"Interrupt":return i(wt(wa(Ti)));case"Fail":return i(un(s.cause.error));case"Die":return i(cl(s.cause.defect))}}),sx(s=>{i=o=>{s(kt)},a.unsafeInterrupt()})})}[l5](n){const r=lr(()=>n.effect_instruction_i0()),i=this.getNextSuccessCont();return i!==void 0?(i._op in am||eb(i),am[i._op](this,i,r)):(Ps.currentOp=Et(r),Ls)}[Qn](n){const r=n,i=this.getNextSuccessCont();return i!==void 0?(i._op in am||eb(i),am[i._op](this,i,r.effect_instruction_i0)):(Ps.currentOp=r,Ls)}[Xn](n){const r=n.effect_instruction_i0,i=this.getNextFailCont();if(i!==void 0)switch(i._op){case Pb:case Yv:return Go(this.currentRuntimeFlags)&&this.isInterrupted()?wt(gj(r)):lr(()=>i.effect_instruction_i1(r));case"OnStep":return Go(this.currentRuntimeFlags)&&this.isInterrupted()?wt(gj(r)):Et(wt(r));case wR:return this.patchRuntimeFlags(this.currentRuntimeFlags,i.patch),Go(this.currentRuntimeFlags)&&this.isInterrupted()?wt(wr(r,this.getInterruptedCause())):wt(r);default:eb(i)}else return Ps.currentOp=wt(r),Ls}[c5](n){return lr(()=>n.effect_instruction_i0(this,FB(this.currentRuntimeFlags)))}Blocked(n){const r=this.getFiberRefs(),i=this.currentRuntimeFlags;if(this._steps.length>0){const a=[],s=this._steps[this._steps.length-1];let o=this.popStack();for(;o&&o._op!=="OnStep";)a.push(o),o=this.popStack();this.setFiberRefs(s.refs),this.currentRuntimeFlags=s.flags;const l=Gp(s.refs,r),c=Sl(s.flags,i);return Et(BU(n.effect_instruction_i0,ht(f=>{for(;a.length>0;)f.pushStack(a.pop());return f.setFiberRefs(Yp(f.id(),f.getFiberRefs())(l)),f.currentRuntimeFlags=nd(c)(f.currentRuntimeFlags),n.effect_instruction_i1})))}return ja(a=>te(UA(Nae(n.effect_instruction_i0)),()=>a(n.effect_instruction_i1)))}RunBlocked(n){return bfe(n.effect_instruction_i0)}[fh](n){const r=n.effect_instruction_i0,i=this.currentRuntimeFlags,a=nd(i,r);if(Go(a)&&this.isInterrupted())return wt(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,r),n.effect_instruction_i1){const s=Sl(a,i);return this.pushStack(new Oae(s,n)),lr(()=>n.effect_instruction_i1(i))}else return _r}[Gv](n){return this.pushStack(n),n.effect_instruction_i0}OnStep(n){return this.pushStack(n),n.effect_instruction_i0}[Pb](n){return this.pushStack(n),n.effect_instruction_i0}[Yv](n){return this.pushStack(n),n.effect_instruction_i0}[Xm](n){return this._asyncBlockingOn=n.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,n.effect_instruction_i0),Ps.currentOp=n,Ls}[Fb](n){return this._isYielding=!1,Ps.currentOp=n,Ls}[Wv](n){const r=n.effect_instruction_i0,i=n.effect_instruction_i1;return r()?(this.pushStack(n),i()):_r}[Qm](n){return am[Qm](this,n,void 0)}[B0](n){return lr(()=>n.commit())}runLoop(n){let r=n;for(this.currentOpCount=0;;){if(this.currentRuntimeFlags&iae&&this.currentSupervisor.onEffect(this,r),this._queue.length>0&&(r=this.drainQueueWhileRunning(this.currentRuntimeFlags,r)),!this._isYielding){this.currentOpCount+=1;const i=this.currentScheduler.shouldYield(this);if(i!==!1){this._isYielding=!0,this.currentOpCount=0;const a=r;r=te(oA({priority:i}),()=>a)}}try{if(r=this.currentTracer.context(()=>{if(vfe!==r[cu]._V){const i=this.getFiberRef(ase);if(i._tag==="Some"){const a=r[cu]._V;this.log(`Executing an Effect versioned ${a} with a Runtime of version ${_R()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Ll,i)}}return this[r._op](r)},this),r===Ls){const i=Ps.currentOp;return i._op===Fb||i._op===Xm?Ls:(Ps.currentOp=null,i._op===Qn||i._op===Xn?i:wt(ta(i)))}}catch(i){r!==Ls&&!Re(r,"_op")||!(r._op in this)?r=YU(`Not a valid effect: ${Rd(r)}`):dse(i)?r=wt(wr(ta(i),wa(Ti))):r=cl(i)}}}}const xfe=De("effect/FiberRef/currentMinimumLogLevel",()=>Bn(ole("Info"))),Sfe=e=>$A(t=>{const n=jB(t.context,Hd);mo(n,CB).unsafe.log(e.log(t))}),wfe=De(Symbol.for("effect/Logger/defaultLogger"),()=>Sfe(Pce)),_fe=De(Symbol.for("effect/Logger/tracerLogger"),()=>$A(({annotations:e,cause:t,context:n,fiberId:r,logLevel:i,message:a})=>{const s=dh(Kp(n,Cs),ES);if(s._tag==="None"||s.value._tag==="ExternalSpan")return;const o=v5(Kp(n,Hd),_h),l={};for(const[c,f]of e)l[c]=f;l["effect.fiberId"]=Bre(r),l["effect.logLevel"]=i.label,t!==null&&t._tag!=="Empty"&&(l["effect.cause"]=bh(t,{renderErrorCause:!0})),s.value.event(Rd(Array.isArray(a)&&a.length===1?a[0]:a),o.unsafeCurrentTimeNanos(),l)})),Efe=De(Symbol.for("effect/FiberRef/currentLoggers"),()=>Wae(KR(wfe,_fe))),kfe=R(e=>Mo(e[0]),(e,t)=>Yg(iA(e,n=>Cfe(r=>t(n,r))))),Cfe=e=>ht(t=>{const n=t.getFiberRefs(),r=sae(t.currentRuntimeFlags,ju);return te(L6,i=>ox(i,a=>ht(s=>{const o=s.getFiberRefs(),l=s.currentRuntimeFlags,c=Gp(o,n),f=Sl(l,r),u=Gp(n,o);return s.setFiberRefs(Yp(c,s.id(),n)),Xp($ae(e(a),f),ie(()=>{s.setFiberRefs(Yp(u,s.id(),s.getFiberRefs()))}))})))}),Tfe=e=>{if(Array.isArray(e)||e5(e))return[e,ne()];const t=Object.keys(e),n=t.length;return[t.map(r=>e[r]),ae(r=>{const i={};for(let a=0;a<n;a++)i[t[a]]=r[a];return i})]},Rfe=(e,t,n)=>{const r=[];for(const i of e)r.push(Ud(i));return te(Vd(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),i=>{const a=ne(),s=i.length,o=new Array(s),l=new Array(s);let c=!1;for(let f=0;f<s;f++){const u=i[f];u._tag==="Left"?(o[f]=ae(u.left),c=!0):(l[f]=u.right,o[f]=a)}return c?t._tag==="Some"?un(t.value(o)):un(o):n!=null&&n.discard?kt:t._tag==="Some"?fe(t.value(l)):fe(l)})},Afe=(e,t,n)=>{const r=[];for(const i of e)r.push(Ud(i));return n!=null&&n.discard?Vd(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,discard:!0,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}):Qe(Vd(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),i=>t._tag==="Some"?t.value(i):i)},j6=(e,t)=>{const[n,r]=Tfe(e);return(t==null?void 0:t.mode)==="validate"?Rfe(n,r,t):(t==null?void 0:t.mode)==="either"?Afe(n,r,t):(t==null?void 0:t.discard)!==!0&&r._tag==="Some"?Qe(Vd(n,ke,t),r.value):Vd(n,ke,t)},Vd=R(e=>e5(e[0]),(e,t,n)=>ht(r=>{const i=(n==null?void 0:n.batching)===!0||(n==null?void 0:n.batching)==="inherit"&&r.getFiberRef(rse);return n!=null&&n.discard?tD(n.concurrency,()=>nf(ux,n==null?void 0:n.concurrentFinalizers)(a=>i?ds(e,(s,o)=>a(t(s,o)),!0,!1,1):fS(e,(s,o)=>a(t(s,o)))),()=>nf(pk,n==null?void 0:n.concurrentFinalizers)(a=>ds(e,(s,o)=>a(t(s,o)),i,!1)),a=>nf(gk(a),n==null?void 0:n.concurrentFinalizers)(s=>ds(e,(o,l)=>s(t(o,l)),i,!1,a))):tD(n==null?void 0:n.concurrency,()=>nf(ux,n==null?void 0:n.concurrentFinalizers)(a=>i?Mk(e,1,(s,o)=>a(t(s,o)),!0):ao(e,(s,o)=>a(t(s,o)))),()=>nf(pk,n==null?void 0:n.concurrentFinalizers)(a=>D6(e,(s,o)=>a(t(s,o)),i)),a=>nf(gk(a),n==null?void 0:n.concurrentFinalizers)(s=>Mk(e,a,(o,l)=>s(t(o,l)),i)))})),D6=(e,t,n)=>Ve(()=>{const r=yt(e),i=new Array(r.length);return sn(ds(r,(s,o)=>te(t(s,o),l=>ie(()=>i[o]=l)),n,!1),fe(i))}),ds=(e,t,n,r,i)=>ja(a=>zae(s=>ht(o=>{let l=Array.from(e).reverse(),c=l.length;if(c===0)return kt;let f=0,u=!1;const d=i?Math.min(l.length,i):l.length,h=new Set,p=new Array,b=()=>h.forEach(A=>{A.currentScheduler.scheduleTask(()=>{A.unsafeInterruptAsFork(o.id())},0)}),x=new Array,g=new Array,v=new Array,w=()=>{const A=p.filter(({exit:D})=>D._tag==="Failure").sort((D,O)=>D.index<O.index?-1:D.index===O.index?0:1).map(({exit:D})=>D);return A.length===0&&A.push(_r),A},E=(A,D=!1)=>{const O=Yg(s(A)),L=Nfe(O,o,o.currentRuntimeFlags,TS);return o.currentScheduler.scheduleTask(()=>{D&&L.unsafeInterruptAsFork(o.id()),L.resume(O)},0),L},C=()=>{r||(c-=l.length,l=[]),u=!0,b()},k=n?Mae:wl,_=E(Ma(A=>{const D=(L,B)=>{L._op==="Blocked"?v.push(L):(p.push({index:B,exit:L}),L._op==="Failure"&&!u&&C())},O=()=>{if(l.length>0){const L=l.pop();let B=f++;const X=()=>{const F=l.pop();return B=f++,te(oA(),()=>te(k(a(t(F,B))),W))},W=F=>l.length>0&&(D(F,B),l.length>0)?X():fe(F),U=te(k(a(t(L,B))),W),I=E(U);x.push(I),h.add(I),u&&I.currentScheduler.scheduleTask(()=>{I.unsafeInterruptAsFork(o.id())},0),I.addObserver(F=>{let z;if(F._op==="Failure"?z=F:z=F.effect_instruction_i0,g.push(I),h.delete(I),D(z,B),p.length===c)A(fe(Ut(rd(w(),{parallel:!0}),()=>_r)));else if(v.length+p.length===c){const V=w(),N=v.map(ue=>ue.effect_instruction_i0).reduce(LU);A(fe(BU(N,ds([Ut(rd(V,{parallel:!0}),()=>_r),...v.map(ue=>ue.effect_instruction_i1)],ue=>ue,n,!0,i))))}else O()})}};for(let L=0;L<d;L++)O()}));return ca(uu(uS(a(Jp(_))),bS({onFailure:A=>{C();const D=v.length+1,O=Math.min(typeof i=="number"?i:v.length,v.length),L=Array.from(v);return Ma(B=>{let X=0,W=0;const U=(F,z)=>V=>{X++,X===D&&B(Et(wt(A))),L.length>0&&z&&I()},I=()=>{E(L.pop(),!0).addObserver(U(W,!0)),W++};_.addObserver(U(W,!1)),W++;for(let F=0;F<O;F++)I()})},onSuccess:()=>ao(g,A=>A.inheritAll)})))}))),Mk=(e,t,n,r)=>Ve(()=>{const i=yt(e),a=new Array(i.length);return sn(ds(i,(o,l)=>Qe(n(o,l),c=>a[l]=c),r,!1,t),fe(a))}),UA=e=>Ofe(e,TS),I6=(e,t,n,r=null)=>{const i=_x(e,t,n,r);return i.resume(e),i},Nfe=(e,t,n,r=null)=>_x(e,t,n,r),_x=(e,t,n,r=null)=>{const i=SU(),a=t.getFiberRefs(),s=Ioe(a,i),o=new M6(i,s,n),l=Kp(s,Cs),c=o.currentSupervisor;return c.onStart(l,e,ae(t),o),o.addObserver(u=>c.onEnd(u,o)),(r!==null?r:M(t.getFiberRef(ck),Ut(()=>t.scope()))).add(n,o),o},Ofe=(e,t)=>ht((n,r)=>fe(I6(e,n,r.runtimeFlags,t))),dD=e=>Du(t=>Dt(dh(t,ec),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return te(Qs(n,pk),r=>Zg(e,r))}}})),hD=e=>t=>Du(n=>Dt(dh(n,ec),{onNone:()=>t,onSome:r=>r.strategy._tag==="ParallelN"&&r.strategy.parallelism===e?t:te(Qs(r,gk(e)),i=>Zg(t,i))})),nf=(e,t)=>n=>Du(r=>Dt(dh(r,ec),{onNone:()=>n(ke),onSome:i=>{if(t===!0){const a=e._tag==="Parallel"?dD:e._tag==="Sequential"?mD:hD(e.parallelism);switch(i.strategy._tag){case"Parallel":return a(n(dD));case"Sequential":return a(n(mD));case"ParallelN":return a(n(hD(i.strategy.parallelism)))}}else return n(ke)}})),z6=e=>te(ec,e),$6=e=>te(BA(),t=>uu(e(t),n=>t.close(n))),mD=e=>Du(t=>Dt(dh(t,ec),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return te(Qs(n,ux),r=>Zg(e,r))}}})),Mfe=R(e=>Mo(e[1]),(e,t,n)=>Qg(e,t,(r,i)=>[r,i],n)),jfe=R(e=>Mo(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?mS(e,t):Qg(e,t,(r,i)=>r,n)),Dfe=R(e=>Mo(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?sn(e,t):Qg(e,t,(r,i)=>i,n)),Qg=R(e=>Mo(e[1]),(e,t,n,r)=>Qe(j6([e,t],{concurrency:r!=null&&r.concurrent?2:1,batching:r==null?void 0:r.batching,concurrentFinalizers:r==null?void 0:r.concurrentFinalizers}),([i,a])=>n(i,a))),ec=Zl("effect/Scope"),L6=ec,Ife=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.set({},t)},zfe={[Mj]:Mj,[jj]:jj,pipe(){return he(this,arguments)},fork(e){return ie(()=>{const t=P6(e);if(this.state._tag==="Closed")return t.state=this.state,t;const n={},r=i=>t.close(i);return this.state.finalizers.set(n,r),Ife(t,i=>ie(()=>{this.state._tag==="Open"&&this.state.finalizers.delete(n)})),t})},close(e){return Ve(()=>{if(this.state._tag==="Closed")return kt;const t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:e},t.length===0?kt:Aoe(this.strategy)?M(ao(t,n=>wl(n(e))),te(n=>M(rd(n),ii(R1),Ut(()=>_r)))):Noe(this.strategy)?M(D6(t,n=>wl(n(e)),!1),te(n=>M(rd(n,{parallel:!0}),ii(R1),Ut(()=>_r)))):M(Mk(t,this.strategy.parallelism,n=>wl(n(e)),!1),te(n=>M(rd(n,{parallel:!0}),ii(R1),Ut(()=>_r))))})},addFinalizer(e){return Ve(()=>this.state._tag==="Closed"?e(this.state.exit):(this.state.finalizers.set({},e),kt))}},P6=(e=Kc)=>{const t=Object.create(zfe);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},BA=(e=Kc)=>ie(()=>P6(e)),Zg=R(2,(e,t)=>yB(e,oi(RR(ec,t)))),$fe=e=>Sh(e,{differ:ufe,fork:np}),pD=Xae(lae),Lfe=$fe(NS),F6=R(3,(e,t,n)=>Ffe(e,t,{onSelfWin:(r,i)=>te(r.await,a=>{switch(a._tag){case Qn:return te(r.inheritAll,()=>n.onSelfDone(a,i));case Xn:return n.onSelfDone(a,i)}}),onOtherWin:(r,i)=>te(r.await,a=>{switch(a._tag){case Qn:return te(r.inheritAll,()=>n.onOtherDone(a,i));case Xn:return n.onOtherDone(a,i)}})})),Pfe=R(2,(e,t)=>Kg(n=>F6(e,t,{onSelfDone:(r,i)=>dk(r,{onFailure:a=>M(Jp(i),nD(s=>Pl(a,s))),onSuccess:a=>M(i,qp(n),Vr(a))}),onOtherDone:(r,i)=>dk(r,{onFailure:a=>M(Jp(i),nD(s=>Pl(s,a))),onSuccess:a=>M(i,qp(n),Vr(a))})}))),Ffe=R(3,(e,t,n)=>ht((r,i)=>{const a=i.runtimeFlags,s=Lg(!0),o=_x(e,r,a,n.selfScope),l=_x(t,r,a,n.otherScope);return Ma(c=>{o.addObserver(()=>gD(o,l,n.onSelfWin,s,c)),l.addObserver(()=>gD(l,o,n.onOtherWin,s,c)),o.startFork(e),l.startFork(t)},tp(o.id(),l.id()))})),gD=(e,t,n,r,i)=>{jre(!0,!1)(r)&&i(n(e,t))},Xp=R(2,(e,t)=>ja(n=>oa(n(e),{onFailure:r=>oa(t,{onFailure:i=>Un(wr(r,i)),onSuccess:()=>Un(r)}),onSuccess:r=>Vr(t,r)}))),Ufe=(e,t,n)=>Kg(r=>te(te(UA(nA(e)),i=>Ma(a=>{const s=t.map(c=>c.listeners.count),o=()=>{s.every(c=>c===0)&&t.every(c=>c.result.state.current._tag==="Pending"?!0:!!(c.result.state.current._tag==="Done"&&yS(c.result.state.current.effect)&&c.result.state.current.effect._tag==="Failure"&&oU(c.result.state.current.effect.cause)))&&(l.forEach(c=>c()),n==null||n(),a(lA(i)))};i.addObserver(c=>{l.forEach(f=>f()),a(c)});const l=t.map((c,f)=>{const u=d=>{s[f]=d,o()};return c.listeners.addObserver(u),()=>c.listeners.removeObserver(u)});return o(),ie(()=>{l.forEach(c=>c())})})),()=>Ve(()=>{const i=t.flatMap(a=>a.state.completed?[]:[a]);return fS(i,a=>nfe(a.request,gse(r)))}))),Bfe=Ll,U6=su,jk=ta,B6=wa,Hfe=Pl,qfe=Qne,Vfe=sU,Ex=oU,Kfe=eS,Gfe=YR,Yfe=WR,Wfe=cU,Jfe=tre,Xfe=ire,HA=lse,Qfe=nS,Ch=gS,Zfe=bh,ede="effect/ScheduleInterval",kx=Symbol.for(ede),H6={[kx]:kx,startMillis:0,endMillis:0},q6=(e,t)=>e>t?H6:{[kx]:kx,startMillis:e,endMillis:t},tde=R(2,(e,t)=>nde(e,t)===e),nde=R(2,(e,t)=>e.endMillis<=t.startMillis?e:t.endMillis<=e.startMillis?t:e.startMillis<t.startMillis?e:t.startMillis<e.startMillis?t:e.endMillis<=t.endMillis?e:t),rde=e=>e.startMillis>=e.endMillis,ide=R(2,(e,t)=>{const n=Math.max(e.startMillis,t.startMillis),r=Math.min(e.endMillis,t.endMillis);return q6(n,r)}),ade=e=>q6(e,Number.POSITIVE_INFINITY),V6=H6,sde=tde,ode=rde,lde=ide,cde=ade,ude="effect/ScheduleIntervals",yD=Symbol.for(ude),K6=e=>({[yD]:yD,intervals:e}),fde=R(2,(e,t)=>dde(e.intervals,t.intervals,Fn())),dde=(e,t,n)=>{let r=e,i=t,a=n;for(;ko(r)&&ko(i);){const s=M(is(r),lde(is(i))),o=ode(s)?a:M(a,Rr(s));M(is(r),sde(is(i)))?r=io(r):i=io(i),a=o}return K6(Eo(a))},Dk=e=>M(e.intervals,zR,Ut(()=>V6)).startMillis,hde=e=>M(e.intervals,zR,Ut(()=>V6)).endMillis,mde=R(2,(e,t)=>Dk(e)<Dk(t)),pde=e=>ko(e.intervals),gde=K6,yde=fde,bde=Dk,bD=hde,vde=mde,xde=pde,qA="Continue",G6="Done",Sde=e=>({_tag:qA,intervals:e}),wde=e=>({_tag:qA,intervals:gde(Rn(e))}),_de={_tag:G6},Ede=e=>e._tag===qA,kde=e=>e._tag===G6,Cde=Sde,Tde=wde,Qp=_de,vD=Ede,Cx=kde,Rde=ec,Tx=uB,Ade=ox,Rx=uk,Nde=Zg,Y6=Qs,W6=BA;class Ode{constructor(t){S(this,"permits");S(this,"waiters",new Set);S(this,"taken",0);S(this,"take",t=>ll(n=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),n(Ve(()=>this.free<t?this.take(t):(this.taken+=t,fe(t)))))};return this.waiters.add(r),ie(()=>{this.waiters.delete(r)})}n(Ve(()=>this.free<t?this.take(t):(this.taken+=t,fe(t))))}));S(this,"resize",t=>ca(ht(n=>(this.permits=t,this.free<0?kt:this.updateTakenUnsafe(n,r=>r)))));S(this,"release",t=>this.updateTaken(n=>n-t));S(this,"releaseAll",this.updateTaken(t=>0));S(this,"withPermits",t=>n=>ja(r=>te(r(this.take(t)),i=>Xp(r(n),this.release(i)))));S(this,"withPermitsIfAvailable",t=>n=>ja(r=>Ve(()=>this.free<t?ace:(this.taken+=t,Xp(r(Jle(n)),this.release(t))))));this.permits=t}get free(){return this.permits-this.taken}updateTakenUnsafe(t,n){return this.taken=n(this.taken),this.waiters.size>0&&t.getFiberRef(NA).scheduleTask(()=>{const r=this.waiters.values();let i=r.next();for(;i.done===!1&&this.free>0;)i.value(),i=r.next()},t.getFiberRef(wh)),fe(this.free)}updateTaken(t){return ht(n=>this.updateTakenUnsafe(n,t))}}const VA=e=>new Ode(e),Mde=e=>ie(()=>VA(e));class jde extends kh{constructor(n){super();S(this,"isOpen");S(this,"waiters",[]);S(this,"scheduled",!1);S(this,"flushWaiters",()=>{this.scheduled=!1;const n=this.waiters;this.waiters=[];for(let r=0;r<n.length;r++)n[r](_r)});S(this,"open",ht(n=>this.isOpen?kt:(this.isOpen=!0,this.unsafeSchedule(n))));S(this,"release",ht(n=>this.isOpen?kt:this.unsafeSchedule(n)));S(this,"await",ll(n=>this.isOpen?n(kt):(this.waiters.push(n),ie(()=>{const r=this.waiters.indexOf(n);r!==-1&&this.waiters.splice(r,1)}))));S(this,"close",ie(()=>{this.isOpen=!1}));S(this,"whenOpen",n=>sn(this.await,n));this.isOpen=n}commit(){return this.await}unsafeSchedule(n){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,n.currentScheduler.scheduleTask(this.flushWaiters,n.getFiberRef(wh))),kt}unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}unsafeClose(){this.isOpen=!1}}const Dde=e=>new jde(e??!1),Ide=R(2,(e,t)=>ht((n,r)=>{const i=t,a=I6(e,n,r.runtimeFlags,TS);if(i.state._tag==="Open"){const s=()=>Kg(l=>xe(l,a.id())?kt:ca(lA(a))),o={};i.state.finalizers.set(o,s),a.addObserver(()=>{i.state._tag!=="Closed"&&i.state.finalizers.delete(o)})}else a.unsafeInterruptAsFork(n.id());return fe(a)})),zde="effect/Ref/SynchronizedRef",$de=Symbol.for(zde),Lde={_A:e=>e};var zL,$L,LL,PL;class Pde extends(PL=kh,LL=$de,$L=YB,zL=px,PL){constructor(n,r){super();S(this,"ref");S(this,"withLock");S(this,LL,Lde);S(this,$L,WB);S(this,zL,px);S(this,"get");this.ref=n,this.withLock=r,this.get=fs(this.ref)}commit(){return this.get}modify(n){return this.modifyEffect(r=>fe(n(r)))}modifyEffect(n){return this.withLock(M(te(fs(this.ref),n),te(([r,i])=>Vr(ad(this.ref,i),r))))}}const Fde=e=>ie(()=>J6(e)),J6=e=>{const t=TA(e),n=VA(1);return new Pde(t,n.withPermits(1))},Ude=Symbol.for("effect/ManagedRuntime"),Bde="Fresh",Hde="FromEffect",qde="Scoped",Vde="Suspend",Kde="Provide",X6="ProvideMerge",Gde="MergeAll",Q6=Nce,Yde=Mce,xD=Oce,_l=lA,KA=qp,SD=Jp,Th=e=>function(){if(arguments.length===1){const t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},ey=Th((e,t,n)=>{const r=SU(),i=[[Cs,[[r,e.context]]]];n!=null&&n.scheduler&&i.push([NA,[[r,n.scheduler]]]);let a=$oe(e.fiberRefs,{entries:i,forkAs:r});n!=null&&n.updateRefs&&(a=n.updateRefs(a,r));const s=new M6(r,a,e.runtimeFlags);let o=t;n!=null&&n.scope&&(o=te(Y6(n.scope,Kc),c=>sn(uB(c,Kg(f=>xe(f,s.id())?kt:qp(s,f))),uu(t,f=>Rx(c,f)))));const l=s.currentSupervisor;return l!==NS&&(l.onStart(e.context,o,ne(),s),s.addObserver(c=>l.onEnd(c,s))),TS.add(e.runtimeFlags,s),(n==null?void 0:n.immediate)===!1?s.resume(o):s.start(o),s}),Z6=Th((e,t,n={})=>{const r=ey(e,t,n);return n.onExit&&r.addObserver(i=>{n.onExit(i)}),(i,a)=>Z6(e)(M(r,KA(i??Ti)),{...a,onExit:a!=null&&a.onExit?s=>a.onExit(bce(s)):void 0})}),eH=Th((e,t)=>{const n=Qde(e)(t);if(n._tag==="Failure")throw tH(n.effect_instruction_i0);return n.effect_instruction_i0});class Wde extends Error{constructor(n){super(`Fiber #${n.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);S(this,"fiber");S(this,"_tag","AsyncFiberException");this.fiber=n,this.name=this._tag,this.stack=this.message}}const Jde=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Wde(e);return Error.stackTraceLimit=t,n},M1=Symbol.for("effect/Runtime/FiberFailure"),tb=Symbol.for("effect/Runtime/FiberFailure/Cause");var FL,UL;class Xde extends Error{constructor(n){const r=fU(n)[0];super((r==null?void 0:r.message)||"An error has occurred");S(this,UL);S(this,FL);this[M1]=M1,this[tb]=n,this.name=r?`(FiberFailure) ${r.name}`:"FiberFailure",r!=null&&r.stack&&(this.stack=r.stack)}toJSON(){return{_id:"FiberFailure",cause:this[tb].toJSON()}}toString(){return"(FiberFailure) "+bh(this[tb],{renderErrorCause:!0})}[(UL=M1,FL=tb,ut)](){return this.toString()}}const tH=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Xde(e);return Error.stackTraceLimit=t,n},nH=e=>{const t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return Vp(t.left);case"Right":return Et(t.right);case"Some":return Et(t.value);case"None":return Vp(new gS)}},Qde=Th((e,t)=>{const n=nH(t);if(n)return n;const r=new AA,i=ey(e)(t,{scheduler:r});r.flush();const a=i.unsafePoll();return a||dB(tA(Jde(i),yA(i)))}),Zde=Th((e,t,n)=>rH(e,t,n).then(r=>{switch(r._tag){case Qn:return r.effect_instruction_i0;case Xn:throw tH(r.effect_instruction_i0)}})),rH=Th((e,t,n)=>new Promise(r=>{const i=nH(t);i&&r(i);const a=ey(e)(t);a.addObserver(s=>{r(s)}),(n==null?void 0:n.signal)!==void 0&&(n.signal.aborted?a.unsafeInterruptAsFork(a.id()):n.signal.addEventListener("abort",()=>{a.unsafeInterruptAsFork(a.id())},{once:!0}))}));class iH{constructor(t,n,r){S(this,"context");S(this,"runtimeFlags");S(this,"fiberRefs");this.context=t,this.runtimeFlags=n,this.fiberRefs=r}pipe(){return he(this,arguments)}}const aH=e=>new iH(e.context,e.runtimeFlags,e.fiberRefs),ehe=()=>ht((e,t)=>fe(new iH(e.getFiberRef(Cs),t.runtimeFlags,e.getFiberRefs()))),the=zU(ju,DU,jU),hu=aH({context:gs(),runtimeFlags:the,fiberRefs:Loe()}),nhe=ey(hu),rhe=Zde(hu),ihe=rH(hu),ahe=eH(hu),she=R(2,(e,t)=>e.modifyEffect(t)),ohe="effect/Layer",sH=Symbol.for(ohe),lhe={_RIn:e=>e,_E:e=>e,_ROut:e=>e},mu={[sH]:lhe,pipe(){return he(this,arguments)}},che="effect/Layer/MemoMap",j1=Symbol.for(che),uhe=hh()("effect/Layer/CurrentMemoMap",{defaultValue:()=>hhe()}),fhe=e=>Re(e,sH),dhe=e=>e._op_layer===Bde;var BL;BL=j1;class oH{constructor(t){S(this,"ref");S(this,BL);this.ref=t,this[j1]=j1}getOrElseMemoize(t,n){return M(she(this.ref,r=>{const i=r.get(t);if(i!==void 0){const[a,s]=i,o=M(a,te(([l,c])=>M(a6(l),Vr(c))),uu(bS({onFailure:()=>kt,onSuccess:()=>ox(n,s)})));return fe([o,r])}return M(gx(0),te(a=>M(xS(),te(s=>M(gx(()=>kt),Qe(o=>{const l=ja(f=>M(BA(),te(u=>M(f(te(fH(t,u,!0),d=>Xle(d(this)))),wl,te(d=>{switch(d._tag){case Xn:return M(pB(s,d.effect_instruction_i0),sn(uk(u,d)),sn(Un(d.effect_instruction_i0)));case Qn:return M(ad(o,h=>M(uk(u,h),aA(JB(a,p=>[p===1,p-1])),ca)),sn(yx(a,h=>h+1)),sn(ox(n,h=>M(ie(()=>r.delete(t)),sn(fs(o)),te(p=>p(h))))),sn(mA(s,d.effect_instruction_i0)),Vr(d.effect_instruction_i0[1]))}}))))),c=[M(Ul(s),uu(dk({onFailure:()=>kt,onSuccess:()=>yx(a,f=>f+1)}))),f=>M(fs(o),te(u=>u(f)))];return[l,dhe(t)?r:r.set(t,c)]}))))))}),uS)}}const lH=Ve(()=>Qe(Fde(new Map),e=>new oH(e))),hhe=()=>new oH(J6(new Map)),cH=R(2,(e,t)=>te(lH,n=>uH(e,n,t))),uH=R(3,(e,t,n)=>te(fH(e,n),r=>s6(r(t),uhe,t))),fH=(e,t,n=!1)=>{const r=e;switch(r._op_layer){case"Locally":return ie(()=>i=>r.f(i.getOrElseMemoize(r.self,t)));case"ExtendScope":return ie(()=>i=>z6(a=>i.getOrElseMemoize(r.layer,a)));case"Fold":return ie(()=>i=>M(i.getOrElseMemoize(r.layer,t),oa({onFailure:a=>i.getOrElseMemoize(r.failureK(a),t),onSuccess:a=>i.getOrElseMemoize(r.successK(a),t)})));case"Fresh":return ie(()=>i=>M(r.layer,cH(t)));case"FromEffect":return ie(n?()=>i=>r.effect:()=>i=>i.getOrElseMemoize(e,t));case"Provide":return ie(()=>i=>M(i.getOrElseMemoize(r.first,t),te(a=>M(i.getOrElseMemoize(r.second,t),_S(a)))));case"Scoped":return ie(n?()=>i=>Zg(r.effect,t):()=>i=>i.getOrElseMemoize(e,t));case"Suspend":return ie(()=>i=>i.getOrElseMemoize(r.evaluate(),t));case"ProvideMerge":return ie(()=>i=>M(i.getOrElseMemoize(r.first,t),nB(i.getOrElseMemoize(r.second,t),r.zipK)));case"ZipWith":return eB(function*(){const i=yield*Qs(t,mk),a=yield*Qs(i,Kc),s=yield*Qs(i,Kc);return o=>M(o.getOrElseMemoize(r.first,a),Qg(o.getOrElseMemoize(r.second,s),r.zipK,{concurrent:!0}))});case"MergeAll":{const i=r.layers;return Qe(Qs(t,mk),a=>s=>{const o=new Array(i.length);return Qe(ds(i,tB(function*(l,c){const f=yield*Qs(a,Kc),u=yield*s.getOrElseMemoize(l,f);o[c]=u}),!1,!1),()=>ite(...o))})}}},mhe=()=>dH(pA()),phe=R(2,(e,t)=>{const n=b5(e),r=n?e:t;return dH(Qe(n?t:e,a=>RR(r,a)))});function dH(e){const t=Object.create(mu);return t._op_layer=Hde,t.effect=e,t}const hH=(...e)=>{const t=Object.create(mu);return t._op_layer=Gde,t.layers=e,t},ghe=R(2,(e,t)=>{const n=b5(e),r=n?e:t;return yhe(Qe(n?t:e,a=>RR(r,a)))}),yhe=e=>{const t=Object.create(mu);return t._op_layer=qde,t.effect=e,t},bhe=e=>{const t=Object.create(mu);return t._op_layer=Vde,t.evaluate=e,t},mH=R(2,(e,t)=>bhe(()=>{const n=Object.create(mu);return n._op_layer=Kde,n.first=Object.create(mu,{_op_layer:{value:X6,enumerable:!0},first:{value:mhe(),enumerable:!0},second:{value:Array.isArray(t)?hH(...t):t},zipK:{value:(r,i)=>M(r,oi(i))}}),n.second=e,n})),vhe=R(2,(e,t)=>{const n=Object.create(mu);return n._op_layer=X6,n.first=t,n.second=mH(e,t),n.zipK=(r,i)=>M(r,oi(i)),n}),wD=R(2,(e,t)=>$6(n=>te(cH(t,n),r=>gA(e,r)))),_D=R(2,(e,t)=>{const n=Gp(hu.fiberRefs,t.fiberRefs),r=Sl(hu.runtimeFlags,t.runtimeFlags);return ja(i=>ht(a=>{const s=a.getFiberRef(Cs),o=a.getFiberRefs(),l=Yp(a.id(),o)(n),c=a.currentRuntimeFlags,f=nd(r)(c),u=Gp(l,o),d=Sl(f,c);return a.setFiberRefs(l),a.currentRuntimeFlags=f,Xp(gA(i(e),oi(s,t.context)),ht(h=>(h.setFiberRefs(Yp(h.id(),h.getFiberRefs())(u)),h.currentRuntimeFlags=nd(d)(h.currentRuntimeFlags),kt)))}))}),xhe=R(2,(e,t)=>Array.isArray(t)?wD(e,hH(...t)):fhe(t)?wD(e,t):rte(t)?gA(e,t):Ude in t?te(t.runtimeEffect,n=>_D(e,n)):_D(e,t)),Em=oie,ED=e=>She(e.slice(0)),She=e=>Object.setPrototypeOf(e,sie),whe=e=>t=>{const n=t===void 0?Object.create(zg):Em(t);return n._tag=e,n},GA=Fg,_he=Fg,Ehe=()=>new Proxy({},{get(e,t,n){return t==="$is"?yR:t==="$match"?khe:whe(t)}});function khe(){if(arguments.length===1){const n=arguments[0];return function(r){return n[r._tag](r)}}const e=arguments[0];return arguments[1][e._tag](e)}const YA=function(){const e=Symbol.for("effect/Data/Error/plainArgs");return{BaseEffectError:class extends uA{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}.BaseEffectError}(),Che=e=>{const t={BaseEffectError:class extends YA{constructor(){super(...arguments);S(this,"_tag",e)}}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},The="effect/Schedule",pH=Symbol.for(The),Rhe=e=>Re(e,pH),Ahe="effect/ScheduleDriver",Nhe=Symbol.for(Ahe),Ik={start:0,now:0,input:void 0,output:void 0,elapsed:$d,elapsedSincePrevious:$d,recurrence:0},kD=hh()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>Ik}),Ohe={_Out:e=>e,_In:e=>e,_R:e=>e},Mhe={_Out:e=>e,_In:e=>e,_R:e=>e};var HL;HL=pH;class jhe{constructor(t,n){S(this,"initial");S(this,"step");S(this,HL,Ohe);this.initial=t,this.step=n}pipe(){return he(this,arguments)}}const CD=(e,t,n,r)=>yx(e,i=>i.recurrence===0?{now:t,input:n,output:r,recurrence:i.recurrence+1,elapsed:$d,elapsedSincePrevious:$d,start:t}:{now:t,input:n,output:r,recurrence:i.recurrence+1,elapsed:Ld(t-i.start),elapsedSincePrevious:Ld(t-i.now),start:i.start});var qL;qL=Nhe;class Dhe{constructor(t,n){S(this,"schedule");S(this,"ref");S(this,qL,Mhe);S(this,"iterationMeta",TA(Ik));this.schedule=t,this.ref=n}get state(){return Qe(fs(this.ref),t=>t[1])}get last(){return te(fs(this.ref),([t,n])=>{switch(t._tag){case"None":return lS(()=>new gS);case"Some":return fe(t.value)}})}get reset(){return ad(this.ref,[ne(),this.schedule.initial]).pipe(mS(ad(this.iterationMeta,Ik)))}next(t){return M(Qe(fs(this.ref),n=>n[1]),te(n=>M(qle,te(r=>M(Ve(()=>this.schedule.step(r,t,n)),te(([i,a,s])=>{const o=ad(this.ref,[ae(a),i]);if(Cx(s))return o.pipe(sn(un(ne())));const l=bde(s.intervals)-r;if(l<=0)return o.pipe(sn(CD(this.iterationMeta,r,t,a)),Vr(a));const c=Ld(l);return M(o,sn(CD(this.iterationMeta,r,t,a)),sn(ice(c)),Vr(a))}))))))}}const ty=(e,t)=>new jhe(e,t),Ihe=R(2,(e,t)=>WA(e,(n,r)=>ie(()=>t(n,r)))),WA=R(2,(e,t)=>ty(e.initial,(n,r,i)=>te(e.step(n,r,i),([a,s,o])=>Cx(o)?fe([a,s,Qp]):Qe(t(r,s),l=>l?[a,s,o]:[a,s,Qp])))),zhe=e=>M(gx([ne(),e.initial]),Qe(t=>new Dhe(e,t))),$he=R(2,(e,t)=>Lhe(e,t,yde)),Lhe=R(3,(e,t,n)=>ty([e.initial,t.initial],(r,i,a)=>M(nB(e.step(r,i,a[0]),t.step(r,i,a[1]),(s,o)=>[s,o]),te(([[s,o,l],[c,f,u]])=>vD(l)&&vD(u)?zk(e,t,i,s,o,l.intervals,c,f,u.intervals,n):fe([[s,c],[o,f],Qp]))))),zk=(e,t,n,r,i,a,s,o,l,c)=>{const f=c(a,l);return xde(f)?fe([[r,s],[i,o],Cde(f)]):M(a,vde(l))?te(e.step(bD(a),n,r),([u,d,h])=>Cx(h)?fe([[u,s],[d,o],Qp]):zk(e,t,n,u,d,h.intervals,s,o,l,c)):te(t.step(bD(l),n,s),([u,d,h])=>Cx(h)?fe([[r,u],[i,d],Qp]):zk(e,t,n,r,i,a,u,d,h.intervals,c))},Phe=R(2,(e,t)=>Fhe(e,n=>ie(()=>t(n)))),Fhe=R(2,(e,t)=>ty(e.initial,(n,r,i)=>te(e.step(n,r,i),([a,s,o])=>Qe(t(s),l=>[a,l,o])))),Uhe=e=>ty(e.initial,(t,n,r)=>M(e.step(t,n,r),Qe(([i,a,s])=>[i,n,s]))),Bhe=e=>Khe(yH,t=>t<e),Hhe=(e,t)=>ty(e,(n,r,i)=>ie(()=>[t(i),i,Tde(cde(n))])),qhe=R(2,(e,t)=>WA(e,(n,r)=>tce(t(n)))),Vhe=R(2,(e,t)=>WA(e,(n,r)=>t(n))),Khe=R(2,(e,t)=>Ihe(e,(n,r)=>t(r))),Yb=Symbol.for("effect/Schedule/ScheduleDefect");var VL;VL=Yb;class Ghe{constructor(t){S(this,"error");S(this,VL);this.error=t,this[Yb]=Yb}}const Yhe=e=>Re(e,Yb),TD=e=>Hp(e,t=>cl(new Ghe(t))),Whe=e=>Dt(tS(e,t=>sU(t)&&Yhe(t.defect)?ae(t.defect):ne()),{onNone:()=>e,onSome:t=>su(t.error)}),Jhe=e=>GU(e,t=>Un(Whe(t))),RD=R(2,(e,t)=>Qhe(e,t,(n,r)=>un(n))),Xhe=R(2,(e,t)=>{if(Rhe(t))return RD(e,t);const n=t.schedule??Uhe(yH),r=t.while?Vhe(n,s=>{const o=t.while(s);return typeof o=="boolean"?fe(o):TD(o)}):n,i=t.until?qhe(r,s=>{const o=t.until(s);return typeof o=="boolean"?fe(o):TD(o)}):r,a=t.times?$he(i,Bhe(t.times)).pipe(Phe(s=>s[0])):i;return Jhe(RD(e,a))}),Qhe=R(3,(e,t,n)=>te(zhe(t),r=>Fl(e,{onFailure:i=>n(i,ne()),onSuccess:i=>gH(rD(e,kD,fs(r.iterationMeta)),r,(a,s)=>rD(n(a,s),kD,fs(r.iterationMeta)),i)}))),gH=(e,t,n,r)=>Fl(t.next(r),{onFailure:()=>jae(t.last),onSuccess:i=>Fl(e,{onFailure:a=>n(a,ae(i)),onSuccess:a=>gH(e,t,n,a)})}),yH=Hhe(0,e=>e+1),as=xS,$r=Ul,Zhe=mB,eme=pB,$k=xse,oo=mA,tme=wS,AD=Symbol.for("effect/MutableList"),nme={[AD]:AD,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();const n=t.value;return t=t.next,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(Qt)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},rme=e=>({value:e,removed:!1,prev:void 0,next:void 0}),ime=()=>{const e=Object.create(nme);return e.head=void 0,e.tail=void 0,e._length=0,e},bH=e=>JA(e)===0,JA=e=>e._length,ame=R(2,(e,t)=>{const n=rme(t);return e.head===void 0&&(e.head=n),e.tail===void 0||(e.tail.next=n,n.prev=e.tail),e.tail=n,e._length+=1,e}),sme=e=>{const t=e.head;if(t!==void 0)return ome(e,t),t.value},ome=(e,t)=>{t.removed||(t.removed=!0,t.prev!==void 0&&t.next!==void 0?(t.prev.next=t.next,t.next.prev=t.prev):t.prev!==void 0?(e.tail=t.prev,t.prev.next=void 0):t.next!==void 0?(e.head=t.next,t.next.prev=void 0):(e.tail=void 0,e.head=void 0),e._length>0&&(e._length-=1))},ND=Symbol.for("effect/MutableQueue"),ni=Symbol.for("effect/mutable/MutableQueue/Empty"),lme={[ND]:ND,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return Mt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(Qt)}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},vH=e=>{const t=Object.create(lme);return t.queue=ime(),t.capacity=e,t},cme=e=>vH(e),XA=()=>vH(void 0),QA=e=>JA(e.queue),Lk=e=>bH(e.queue),ume=e=>e.capacity===void 0?1/0:e.capacity,Zp=R(2,(e,t)=>{const n=JA(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(ame(t)(e.queue),!0)}),xH=R(2,(e,t)=>{const n=t[Symbol.iterator]();let r,i=Fn(),a=!0;for(;a&&(r=n.next())&&!r.done;)a=Zp(r.value)(e);for(;r!=null&&!r.done;)i=Rr(r.value)(i),r=n.next();return Eo(i)}),El=R(2,(e,t)=>bH(e.queue)?t:sme(e.queue)),ZA=R(2,(e,t)=>{let n=Fn(),r=0;for(;r<t;){const i=El(ni)(e);if(i===ni)break;n=Rr(i)(n),r+=1}return Eo(n)}),Pk=cu,tc=Mo,D1=ece,fme=j6,hs=Vd,Ax=Ma,Nx=ht,Ts=un,Ra=Un,dme=YU,sd=eB,I1=Lae,hme=rce,Vt=fe,fn=Ve,Nt=ie,lt=kt,SH=Hp,eN=GU,mme=Zle,pme=n6,gme=lce,rp=oce,Cc=Vs,_a=nA,yme=Gg,km=Yg,Ox=ja,z1=Vr,tN=ca,bt=Qe,bme=rA,nN=dS,Mx=kfe,vme=VU,Uf=Xp,OS=L6,xme=z6,Fk=$6,Sme=Kg,wme=UA,Gc=Ide,wH=pA,_H=yB,jx=xhe,_me=fce,rf=Ud,dr=wl,EH=QU,Eme=uce,Te=te,yf=uS,$1=Pfe,kH=F6,CH=iA,TH=sce,OD=Xhe,kme=xh,Cme=r6,Uk=JU,Ea=oa,ny=ehe,Tme=VA,Rme=Mde,Ame=Dde,rN=nhe,Nme=rhe,Ome=ihe,na=ahe,Dx=Mfe,iN=jfe,cr=Dfe,MS=Qg,Mme=mce,jme=pce,RH=tB,jS=ey,Dme=eH,Ime=Z6,DS=hu,aN=aH,Bk=Symbol.for("effect/FiberHandle"),zme=e=>Re(e,Bk),$me={[Bk]:Bk,toString(){return Mt(this.toJSON())},toJSON(){return{_id:"FiberHandle",state:this.state}},[ut](){return this.toJSON()},pipe(){return he(this,arguments)}},Lme=e=>{const t=Object.create($me);return t.state={_tag:"Open",fiber:void 0},t.deferred=e,t},Pme=()=>Mx(bt(as(),e=>Lme(e)),e=>Nx(t=>{const n=e.state;return n._tag==="Closed"?lt:(e.state={_tag:"Closed"},n.fiber?EH(tN(KA(n.fiber,tp(t.id(),Wb))),e.deferred):Zhe(e.deferred,MA))})),Fme=()=>Te(Pme(),e=>Hme(e)()),AH=-1,Wb=Ure(AH,0),Ume=Qfe(void 0,{emptyCase:vl,failCase:vl,dieCase:vl,interruptCase:(e,t)=>nU(xU(t),AH),sequentialCase:(e,t,n)=>t||n,parallelCase:(e,t,n)=>t||n}),Bme=R(e=>zme(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(tp((n==null?void 0:n.interruptAs)??Ti,Wb));return}else if(e.state.fiber!==void 0){if((n==null?void 0:n.onlyIfMissing)===!0){t.unsafeInterruptAsFork(tp((n==null?void 0:n.interruptAs)??Ti,Wb));return}else if(e.state.fiber===t)return;e.state.fiber.unsafeInterruptAsFork(tp((n==null?void 0:n.interruptAs)??Ti,Wb)),e.state.fiber=void 0}e.state.fiber=t,t.addObserver(r=>{e.state._tag==="Open"&&t===e.state.fiber&&(e.state.fiber=void 0),OA(r)&&((n==null?void 0:n.propagateInterruption)===!0?!Ume(r.cause):!Kfe(r.cause))&&tme(e.deferred,r)})}),MD=function(){let e;return()=>(e===void 0&&(e=rN(Cc)),e)}(),Hme=e=>()=>bt(ny(),t=>{const n=jS(t);return(r,i)=>{if(e.state._tag==="Closed")return MD();if(e.state.fiber!==void 0&&(i==null?void 0:i.onlyIfMissing)===!0)return MD();const a=n(r,i);return Bme(e,a,i),a}}),qme=phe,NH=ghe,OH=mH,L1=vhe,Vme=lH,jD=uH,sN=Bn,MH=Cs,Kme=lB,Gme="effect/QueueEnqueue",Yme=Symbol.for(Gme),Wme="effect/QueueDequeue",Jme=Symbol.for(Wme),Xme="effect/QueueStrategy",jH=Symbol.for(Xme),Qme="effect/BackingQueue",Zme=Symbol.for(Qme),DH={_A:e=>e},epe={_A:e=>e},tpe={_In:e=>e},npe={_Out:e=>e};var KL,GL,YL;class rpe extends(YL=kh,GL=Yme,KL=Jme,YL){constructor(n,r,i,a,s){super();S(this,"queue");S(this,"takers");S(this,"shutdownHook");S(this,"shutdownFlag");S(this,"strategy");S(this,GL,tpe);S(this,KL,npe);this.queue=n,this.takers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=s}pipe(){return he(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return Ve(()=>Hp(this.unsafeSize(),()=>Vs))}unsafeSize(){return In(this.shutdownFlag)?ne():ae(this.queue.length()-QA(this.takers)+this.strategy.surplusSize())}get isEmpty(){return Qe(this.size,n=>n<=0)}get isFull(){return Qe(this.size,n=>n>=this.capacity())}get shutdown(){return Yg(ht(n=>(M(this.shutdownFlag,Pg(!0)),M(ds(od(this.takers),r=>gB(r,n.id()),!1,!1),sn(this.strategy.shutdown),aA(mA(this.shutdownHook,void 0)),ca))))}get isShutdown(){return ie(()=>In(this.shutdownFlag))}get awaitShutdown(){return Ul(this.shutdownHook)}isActive(){return!In(this.shutdownFlag)}unsafeOffer(n){if(In(this.shutdownFlag))return!1;let r;if(this.queue.length()===0){const a=M(this.takers,El(ni));a!==ni?(Yc(a,n),r=!0):r=!1}else r=!1;if(r)return!0;const i=this.queue.offer(n);return Bf(this.strategy,this.queue,this.takers),i}offer(n){return Ve(()=>{if(In(this.shutdownFlag))return Vs;let r;if(this.queue.length()===0){const a=M(this.takers,El(ni));a!==ni?(Yc(a,n),r=!0):r=!1}else r=!1;if(r)return fe(!0);const i=this.queue.offer(n);return Bf(this.strategy,this.queue,this.takers),i?fe(!0):this.strategy.handleSurplus([n],this.queue,this.takers,this.shutdownFlag)})}offerAll(n){return Ve(()=>{if(In(this.shutdownFlag))return Vs;const r=yt(n),i=this.queue.length()===0?yt(vpe(this.takers,r.length)):zl,[a,s]=M(r,$5(i.length));for(let l=0;l<i.length;l++){const c=i[l],f=a[l];Yc(c,f)}if(s.length===0)return fe(!0);const o=this.queue.offerAll(s);return Bf(this.strategy,this.queue,this.takers),G0(o)?fe(!0):this.strategy.handleSurplus(o,this.queue,this.takers,this.shutdownFlag)})}get take(){return ht(n=>{if(In(this.shutdownFlag))return Vs;const r=this.queue.poll(ni);if(r!==ni)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),fe(r);{const i=vS(n.id());return M(Ve(()=>(M(this.takers,Zp(i)),Bf(this.strategy,this.queue,this.takers),In(this.shutdownFlag)?Vs:Ul(i))),Gg(()=>ie(()=>xpe(this.takers,i))))}})}get takeAll(){return Ve(()=>In(this.shutdownFlag)?Vs:ie(()=>{const n=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),_o(n)}))}takeUpTo(n){return Ve(()=>In(this.shutdownFlag)?Vs:ie(()=>{const r=this.queue.pollUpTo(n);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),_o(r)}))}takeBetween(n,r){return Ve(()=>IH(this,n,r,Fn()))}}const IH=(e,t,n,r)=>n<t?fe(r):M(hpe(e,n),te(i=>{const a=t-i.length;return a===1?M(Hk(e),Qe(s=>M(r,kn(i),GE(s)))):a>1?M(Hk(e),te(s=>IH(e,a-1,n-i.length-1,M(r,kn(i),GE(s))))):fe(M(r,kn(i)))})),ipe=e=>M(ie(()=>cme(e)),te(t=>zH($H(t),ppe()))),ape=()=>M(ie(()=>XA()),te(e=>zH($H(e),gpe()))),spe=(e,t,n,r,i)=>new rpe(e,t,n,r,i),zH=(e,t)=>M(xS(),Qe(n=>spe(e,XA(),n,Lg(!1),t)));var WL;WL=Zme;class ope{constructor(t){S(this,"mutable");S(this,WL,epe);this.mutable=t}poll(t){return El(this.mutable,t)}pollUpTo(t){return ZA(this.mutable,t)}offerAll(t){return xH(this.mutable,t)}offer(t){return Zp(this.mutable,t)}capacity(){return ume(this.mutable)}length(){return QA(this.mutable)}}const $H=e=>new ope(e),lpe=e=>e.size,cpe=e=>e.isShutdown,upe=e=>e.shutdown,fpe=R(2,(e,t)=>e.offer(t)),dpe=R(2,(e,t)=>e.unsafeOffer(t)),Hk=e=>e.take,hpe=R(2,(e,t)=>e.takeUpTo(t)),mpe=R(3,(e,t,n)=>e.takeBetween(t,n)),ppe=()=>new ype,gpe=()=>new bpe;var JL;JL=jH;class ype{constructor(){S(this,JL,DH);S(this,"putters",XA())}surplusSize(){return QA(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!Lk(this.putters)&&!Lk(t);){const n=El(t,void 0),r=El(this.putters,void 0);r[2]&&Yc(r[1],!0),Yc(n,r[0])}}get shutdown(){return M(cS,te(t=>M(ie(()=>od(this.putters)),te(n=>ds(n,([r,i,a])=>a?M(gB(i,t),ca):kt,!1,!1)))))}handleSurplus(t,n,r,i){return ht(a=>{const s=vS(a.id());return M(Ve(()=>(this.unsafeOffer(t,s),this.unsafeOnQueueEmptySpace(n,r),Bf(this,n,r),In(i)?Vs:Ul(s))),Gg(()=>ie(()=>this.unsafeRemove(s))))})}unsafeOnQueueEmptySpace(t,n){let r=!0;for(;r&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const i=M(this.putters,El(ni));if(i===ni)r=!1;else{const a=t.offer(i[0]);a&&i[2]?Yc(i[1],!0):a||Ix(this.putters,M(od(this.putters),Rr(i))),Bf(this,t,n)}}}unsafeOffer(t,n){const r=yt(t);for(let i=0;i<r.length;i++){const a=r[i];i===r.length-1?M(this.putters,Zp([a,n,!0])):M(this.putters,Zp([a,n,!1]))}}unsafeRemove(t){Ix(this.putters,M(od(this.putters),IR(([,n])=>n!==t)))}}var XL;XL=jH;class bpe{constructor(){S(this,XL,DH)}surplusSize(){return 0}get shutdown(){return kt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,r,i){return fe(!1)}unsafeOnQueueEmptySpace(t,n){}}const Yc=(e,t)=>wS(e,fe(t)),Ix=(e,t)=>M(e,xH(t)),od=e=>M(e,ZA(Number.POSITIVE_INFINITY)),vpe=(e,t)=>M(e,ZA(t)),xpe=(e,t)=>{Ix(e,M(od(e),IR(n=>t!==n)))},Bf=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){const i=M(n,El(ni));if(i!==ni){const a=t.poll(ni);a!==ni?(Yc(i,a),e.unsafeOnQueueEmptySpace(t,n)):Ix(n,M(od(n),Rr(i))),r=!0}else r=!1}r&&t.length()===0&&!Lk(n)&&e.onCompleteTakersWithEmptyQueue(n)},Spe=R(2,(e,t)=>e.publish(t)),wpe=Spe,LH=ipe,_pe=ape,Epe=lpe,kpe=cpe,zx=upe,af=fpe,Cpe=dpe,DD=Hk,Tpe=mpe,PH="Continue",Rpe="Close",Ape="Yield",Npe="effect/ChannelChildExecutorDecision",ID=Symbol.for(Npe),Ope={[ID]:ID},FH=e=>{const t=Object.create(Ope);return t._tag=PH,t},Jb="ContinuationK",Mpe="ContinuationFinalizer",UH=Symbol.for("effect/ChannelContinuation"),BH={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutDone:e=>e,_OutErr2:e=>e,_OutElem:e=>e,_OutDone2:e=>e};var QL;QL=UH;class HH{constructor(t,n){S(this,"onSuccess");S(this,"onHalt");S(this,"_tag",Jb);S(this,QL,BH);this.onSuccess=t,this.onHalt=n}onExit(t){return OA(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}var ZL;ZL=UH;class jpe{constructor(t){S(this,"finalizer");S(this,"_tag",Mpe);S(this,ZL,BH);this.finalizer=t}}const qH="PullAfterNext",Dpe="PullAfterAllEnqueued",Ipe="effect/ChannelUpstreamPullStrategy",zpe=Symbol.for(Ipe),$pe={_A:e=>e},Lpe={[zpe]:$pe},VH=e=>{const t=Object.create(Lpe);return t._tag=qH,t.emitSeparator=e,t},KH="BracketOut",GH="Bridge",oN="ConcatAll",YH="Emit",WH="Ensuring",JH="Fail",XH="Fold",QH="FromEffect",ZH="PipeTo",Ppe="Provide",e8="Read",t8="Succeed",n8="SucceedNow",r8="Suspend",Fpe="effect/Channel",i8=Symbol.for(Fpe),Upe={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},ci={[i8]:Upe,pipe(){return he(this,arguments)}},a8=e=>Re(e,i8)||tc(e),Bpe=R(2,(e,t)=>{const n=Object.create(ci);return n._tag=KH,n.acquire=()=>e,n.finalizer=t,n}),s8=(e,t,n)=>{const r=Object.create(ci);return r._tag=oN,r.combineInners=t,r.combineAll=n,r.onPull=()=>VH(ne()),r.onEmit=()=>FH,r.value=()=>e,r.k=ke,r},Hpe=R(4,(e,t,n,r)=>{const i=Object.create(ci);return i._tag=oN,i.combineInners=n,i.combineAll=r,i.onPull=()=>VH(ne()),i.onEmit=()=>FH,i.value=()=>e,i.k=t,i}),o8=R(2,(e,t)=>{const n=Object.create(ci);return n._tag=GH,n.input=t,n.channel=e,n}),qpe=R(2,(e,t)=>{const n=Object.create(ci);return n._tag=WH,n.channel=e,n.finalizer=t,n}),lN=e=>Ri(U6(e)),Ri=e=>Vpe(()=>e),Vpe=e=>{const t=Object.create(ci);return t._tag=JH,t.error=e,t},Cn=R(2,(e,t)=>{const n=Object.create(ci);return n._tag=XH,n.channel=e,n.k=new HH(t,Ri),n}),zr=e=>{const t=Object.create(ci);return t._tag=QH,t.effect=()=>e,t},Aa=R(2,(e,t)=>{const n=Object.create(ci);return n._tag=ZH,n.left=()=>e,n.right=()=>t,n}),l8=e=>Rh({onInput:e.onInput,onFailure:t=>ri(Wfe(t),{onLeft:e.onFailure,onRight:Ri}),onDone:e.onDone}),Rh=e=>{const t=Object.create(ci);return t._tag=e8,t.more=e.onInput,t.done=new HH(e.onDone,e.onFailure),t},c8=e=>uN(()=>e),eg=e=>{const t=Object.create(ci);return t._tag=n8,t.terminal=e,t},cN=e=>{const t=Object.create(ci);return t._tag=r8,t.channel=e,t},uN=e=>{const t=Object.create(ci);return t._tag=t8,t.evaluate=e,t},jo=eg(void 0),pr=e=>{const t=Object.create(ci);return t._tag=YH,t.out=e,t},ry="Done",iy="Emit",Ah="FromEffect",ay="Read",Kpe=Symbol.for("effect/ChannelState"),Gpe={_E:e=>e,_R:e=>e},IS={[Kpe]:Gpe},sf=()=>{const e=Object.create(IS);return e._tag=ry,e},P1=()=>{const e=Object.create(IS);return e._tag=iy,e},sm=e=>{const t=Object.create(IS);return t._tag=Ah,t.effect=e,t},F1=(e,t,n,r)=>{const i=Object.create(IS);return i._tag=ay,i.upstream=e,i.onEffect=t,i.onEmit=n,i.onDone=r,i},$x=e=>e._tag===Ah,Ype=e=>$x(e)?e.effect:lt,zD=e=>$x(e)?mme(e.effect):void 0,u8="PullFromChild",qk="PullFromUpstream",Vk="DrainChildExecutors",f8="Emit";class nb{constructor(t,n,r){S(this,"childExecutor");S(this,"parentSubexecutor");S(this,"onEmit");S(this,"_tag",u8);this.childExecutor=t,this.parentSubexecutor=n,this.onEmit=r}close(t){const n=this.childExecutor.close(t),r=this.parentSubexecutor.close(t);return n!==void 0&&r!==void 0?MS(dr(n),dr(r),(i,a)=>M(i,Wp(a))):n!==void 0?n:r!==void 0?r:void 0}enqueuePullFromChild(t){return this}}class Rc{constructor(t,n,r,i,a,s,o,l){S(this,"upstreamExecutor");S(this,"createChild");S(this,"lastDone");S(this,"activeChildExecutors");S(this,"combineChildResults");S(this,"combineWithChildResult");S(this,"onPull");S(this,"onEmit");S(this,"_tag",qk);this.upstreamExecutor=t,this.createChild=n,this.lastDone=r,this.activeChildExecutors=i,this.combineChildResults=a,this.combineWithChildResult=s,this.onPull=o,this.onEmit=l}close(t){const n=this.upstreamExecutor.close(t),i=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,s)=>a!==void 0&&s!==void 0?MS(a,dr(s),(o,l)=>Wp(o,l)):a!==void 0?a:s!==void 0?dr(s):void 0,void 0);return i}enqueuePullFromChild(t){return new Rc(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class Hf{constructor(t,n,r,i,a,s,o){S(this,"upstreamExecutor");S(this,"lastDone");S(this,"activeChildExecutors");S(this,"upstreamDone");S(this,"combineChildResults");S(this,"combineWithChildResult");S(this,"onPull");S(this,"_tag",Vk);this.upstreamExecutor=t,this.lastDone=n,this.activeChildExecutors=r,this.upstreamDone=i,this.combineChildResults=a,this.combineWithChildResult=s,this.onPull=o}close(t){const n=this.upstreamExecutor.close(t),i=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,s)=>a!==void 0&&s!==void 0?MS(a,dr(s),(o,l)=>Wp(o,l)):a!==void 0?a:s!==void 0?dr(s):void 0,void 0);return i}enqueuePullFromChild(t){return new Hf(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class U1{constructor(t,n){S(this,"value");S(this,"next");S(this,"_tag",f8);this.value=t,this.next=n}close(t){const n=this.next.close(t);return n}enqueuePullFromChild(t){return this}}const Wpe="Pulled",Jpe="NoUpstream",Xpe="effect/ChannelUpstreamPullRequest",Qpe=Symbol.for(Xpe),Zpe={_A:e=>e},d8={[Qpe]:Zpe},$D=e=>{const t=Object.create(d8);return t._tag=Wpe,t.value=e,t},ege=e=>{const t=Object.create(d8);return t._tag=Jpe,t.activeDownstreamCount=e,t};class jc{constructor(t,n,r){S(this,"_activeSubexecutor");S(this,"_cancelled");S(this,"_closeLastSubstream");S(this,"_currentChannel");S(this,"_done");S(this,"_doneStack",[]);S(this,"_emitted");S(this,"_executeCloseLastSubstream");S(this,"_input");S(this,"_inProgressFinalizer");S(this,"_providedEnv");this._currentChannel=t,this._executeCloseLastSubstream=r,this._providedEnv=n}run(){let t;for(;t===void 0;)if(this._cancelled!==void 0)t=this.processCancellation();else if(this._activeSubexecutor!==void 0)t=this.runSubexecutor();else try{if(this._currentChannel===void 0)t=sf();else switch(tc(this._currentChannel)&&(this._currentChannel=zr(this._currentChannel)),this._currentChannel._tag){case KH:{t=this.runBracketOut(this._currentChannel);break}case GH:{const n=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,this._input!==void 0){const r=this._input;this._input=void 0;const i=()=>Te(n.awaitRead(),()=>fn(()=>{const a=r.run();switch(a._tag){case ry:return so(r.getDone(),{onFailure:s=>n.error(s),onSuccess:s=>n.done(s)});case iy:return Te(n.emit(r.getEmit()),()=>i());case Ah:return Ea(a.effect,{onFailure:s=>n.error(s),onSuccess:()=>i()});case ay:return fN(a,()=>i(),s=>n.error(s))}}));t=sm(Te(wme(_a(i())),a=>Nt(()=>this.addFinalizer(s=>Te(_l(a),()=>fn(()=>{const o=this.restorePipe(s,r);return o!==void 0?o:lt}))))))}break}case oN:{const n=new jc(this._currentChannel.value(),this._providedEnv,i=>Nt(()=>{const a=this._closeLastSubstream===void 0?lt:this._closeLastSubstream;this._closeLastSubstream=M(a,cr(i))}));n._input=this._input;const r=this._currentChannel;this._activeSubexecutor=new Rc(n,i=>r.k(i),void 0,[],(i,a)=>r.combineInners(i,a),(i,a)=>r.combineAll(i,a),i=>r.onPull(i),i=>r.onEmit(i)),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case YH:{this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor!==void 0?void 0:jo,t=P1();break}case WH:{this.runEnsuring(this._currentChannel);break}case JH:{t=this.doneHalt(this._currentChannel.error());break}case XH:{this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break}case QH:{const n=this._providedEnv===void 0?this._currentChannel.effect():M(this._currentChannel.effect(),jx(this._providedEnv));t=sm(Ea(n,{onFailure:r=>{const i=this.doneHalt(r);return i!==void 0&&$x(i)?i.effect:lt},onSuccess:r=>{const i=this.doneSucceed(r);return i!==void 0&&$x(i)?i.effect:lt}}));break}case ZH:{const n=this._input,r=new jc(this._currentChannel.left(),this._providedEnv,i=>this._executeCloseLastSubstream(i));r._input=n,this._input=r,this.addFinalizer(i=>{const a=this.restorePipe(i,n);return a!==void 0?a:lt}),this._currentChannel=this._currentChannel.right();break}case Ppe:{const n=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>Nt(()=>{this._providedEnv=n}));break}case e8:{const n=this._currentChannel;t=F1(this._input,ke,r=>{try{this._currentChannel=n.more(r)}catch(i){this._currentChannel=n.done.onExit(yce(i))}},r=>{const i=a=>n.done.onExit(a);this._currentChannel=i(r)});break}case t8:{t=this.doneSucceed(this._currentChannel.evaluate());break}case n8:{t=this.doneSucceed(this._currentChannel.terminal);break}case r8:{this._currentChannel=this._currentChannel.channel();break}}}catch(n){this._currentChannel=Ri(jk(n))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const n=[];let r=this._doneStack.pop();for(;r;)r._tag==="ContinuationFinalizer"&&n.push(r.finalizer),r=this._doneStack.pop();const i=n.length===0?lt:H1(n,t);return this.storeInProgressFinalizer(i),i}popNextFinalizers(){const t=[];for(;this._doneStack.length!==0;){const n=this._doneStack[this._doneStack.length-1];if(n._tag===Jb)return t;t.push(n),this._doneStack.pop()}return t}restorePipe(t,n){const r=this._input;return this._input=n,r!==void 0?r.close(t):lt}close(t){let n;const r=this._inProgressFinalizer;r!==void 0&&(n=M(r,Uf(Nt(()=>this.clearInProgressFinalizer()))));let i;const a=this.popAllFinalizers(t);a!==void 0&&(i=M(a,Uf(Nt(()=>this.clearInProgressFinalizer()))));const s=this._activeSubexecutor===void 0?void 0:this._activeSubexecutor.close(t);if(!(s===void 0&&n===void 0&&i===void 0))return M(dr(B1(s)),Dx(dr(B1(n))),Dx(dr(B1(i))),bt(([[o,l],c])=>M(o,Wp(l),Wp(c))),km,Te(o=>fn(()=>o)))}doneSucceed(t){if(this._doneStack.length===0)return this._done=xi(t),this._currentChannel=void 0,sf();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Jb){this._doneStack.pop(),this._currentChannel=n.onSuccess(t);return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=xi(t),this._currentChannel=void 0,sf();const i=H1(r.map(s=>s.finalizer),xi(t));this.storeInProgressFinalizer(i);const a=M(i,Uf(Nt(()=>this.clearInProgressFinalizer())),km,Te(()=>Nt(()=>this.doneSucceed(t))));return sm(a)}doneHalt(t){if(this._doneStack.length===0)return this._done=Er(t),this._currentChannel=void 0,sf();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Jb){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(s){this._currentChannel=Ri(jk(s))}return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=Er(t),this._currentChannel=void 0,sf();const i=H1(r.map(s=>s.finalizer),Er(t));this.storeInProgressFinalizer(i);const a=M(i,Uf(Nt(()=>this.clearInProgressFinalizer())),km,Te(()=>Nt(()=>this.doneHalt(t))));return sm(a)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,sf()}runBracketOut(t){const n=km(Ea(this.provide(t.acquire()),{onFailure:r=>Nt(()=>{this._currentChannel=Ri(r)}),onSuccess:r=>Nt(()=>{this.addFinalizer(i=>this.provide(t.finalizer(r,i))),this._currentChannel=pr(r)})}));return sm(n)}provide(t){return this._providedEnv===void 0?t:M(t,jx(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new jpe(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case u8:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case qk:return this.pullFromUpstream(t);case Vk:return this.drainChildExecutors(t);case f8:return this._emitted=t.value,this._activeSubexecutor=t.next,P1()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const n=so(t,{onFailure:r=>this.doneHalt(r),onSuccess:r=>this.doneSucceed(r)});return this._activeSubexecutor=void 0,n===void 0?lt:Ype(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer(()=>M(n,hs(i=>M(Nt(()=>i(t)),Te(a=>a!==void 0?a:lt)),{discard:!0})));const r=M(t,so({onFailure:i=>this.doneHalt(i),onSuccess:i=>this.doneSucceed(i)}));return this._activeSubexecutor=void 0,r}applyUpstreamPullStrategy(t,n,r){switch(r._tag){case qH:{const i=!t||n.some(a=>a!==void 0);return[r.emitSeparator,i?[void 0,...n]:n]}case Dpe:{const i=!t||n.some(a=>a!==void 0);return[r.emitSeparator,i?[...n,void 0]:n]}}}pullFromChild(t,n,r,i){return F1(t,ke,a=>{const s=r(a);switch(s._tag){case PH:break;case Rpe:{this.finishWithDoneValue(t,n,s.value);break}case Ape:{const o=n.enqueuePullFromChild(i);this.replaceSubexecutor(o);break}}this._activeSubexecutor=new U1(a,this._activeSubexecutor)},so({onFailure:a=>{const s=this.handleSubexecutorFailure(t,n,a);return s===void 0?void 0:zD(s)},onSuccess:a=>{this.finishWithDoneValue(t,n,a)}}))}finishWithDoneValue(t,n,r){const i=n;switch(i._tag){case qk:{const a=new Rc(i.upstreamExecutor,i.createChild,i.lastDone!==void 0?i.combineChildResults(i.lastDone,r):r,i.activeChildExecutors,i.combineChildResults,i.combineWithChildResult,i.onPull,i.onEmit);this._closeLastSubstream=t.close(xi(r)),this.replaceSubexecutor(a);break}case Vk:{const a=new Hf(i.upstreamExecutor,i.lastDone!==void 0?i.combineChildResults(i.lastDone,r):r,i.activeChildExecutors,i.upstreamDone,i.combineChildResults,i.combineWithChildResult,i.onPull);this._closeLastSubstream=t.close(xi(r)),this.replaceSubexecutor(a);break}}}handleSubexecutorFailure(t,n,r){return this.finishSubexecutorWithCloseEffect(Er(r),i=>n.close(i),i=>t.close(i))}pullFromUpstream(t){if(t.activeChildExecutors.length===0)return this.performPullFromUpstream(t);const n=t.activeChildExecutors[0],r=new Rc(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(n===void 0)return this.performPullFromUpstream(r);this.replaceSubexecutor(new nb(n.childExecutor,r,n.onEmit))}performPullFromUpstream(t){return F1(t.upstreamExecutor,n=>{const r=this._closeLastSubstream===void 0?lt:this._closeLastSubstream;return this._closeLastSubstream=void 0,M(this._executeCloseLastSubstream(r),cr(n))},n=>{if(this._closeLastSubstream!==void 0){const s=this._closeLastSubstream;return this._closeLastSubstream=void 0,M(this._executeCloseLastSubstream(s),bt(()=>{const o=new jc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);o._input=this._input;const[l,c]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull($D(n)));this._activeSubexecutor=new nb(o,new Rc(t.upstreamExecutor,t.createChild,t.lastDone,c,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),zt(l)&&(this._activeSubexecutor=new U1(l.value,this._activeSubexecutor))}))}const r=new jc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;const[i,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull($D(n)));this._activeSubexecutor=new nb(r,new Rc(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),zt(i)&&(this._activeSubexecutor=new U1(i.value,this._activeSubexecutor))},n=>{if(t.activeChildExecutors.some(a=>a!==void 0)){const a=new Hf(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==void 0){const s=this._closeLastSubstream;return this._closeLastSubstream=void 0,M(this._executeCloseLastSubstream(s),bt(()=>this.replaceSubexecutor(a)))}this.replaceSubexecutor(a);return}const r=this._closeLastSubstream,i=this.finishSubexecutorWithCloseEffect(M(n,vce(a=>t.combineWithChildResult(t.lastDone,a))),()=>r,a=>t.upstreamExecutor.close(a));return i===void 0?void 0:zD(i)})}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const a=this._closeLastSubstream;return a!==void 0&&this.addFinalizer(()=>Vt(a)),this.finishSubexecutorWithCloseEffect(t.upstreamDone,()=>a,s=>t.upstreamExecutor.close(s))}const n=t.activeChildExecutors[0],r=t.activeChildExecutors.slice(1);if(n===void 0){const[a,s]=this.applyUpstreamPullStrategy(!0,r,t.onPull(ege(r.reduce((o,l)=>l!==void 0?o+1:o,0))));return this.replaceSubexecutor(new Hf(t.upstreamExecutor,t.lastDone,s,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),zt(a)?(this._emitted=a.value,P1()):void 0}const i=new Hf(t.upstreamExecutor,t.lastDone,r,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new nb(n.childExecutor,i,n.onEmit))}}const B1=e=>e!==void 0?e:lt,H1=(e,t)=>M(hs(e,n=>dr(n(t))),bt(n=>M(gce(n),Ut(()=>MA))),Te(n=>fn(()=>n))),fN=(e,t,n)=>{const r=[e],i=()=>{const a=r.pop();if(a===void 0||a.upstream===void 0)return dme("Unexpected end of input for channel execution");const s=a.upstream.run();switch(s._tag){case iy:{const o=a.onEmit(a.upstream.getEmit());return r.length===0?o===void 0?fn(t):M(o,Ea({onFailure:n,onSuccess:t})):o===void 0?fn(()=>i()):M(o,Ea({onFailure:n,onSuccess:()=>i()}))}case ry:{const o=a.onDone(a.upstream.getDone());return r.length===0?o===void 0?fn(t):M(o,Ea({onFailure:n,onSuccess:t})):o===void 0?fn(()=>i()):M(o,Ea({onFailure:n,onSuccess:()=>i()}))}case Ah:return r.push(a),M(a.onEffect(s.effect),eN(o=>fn(()=>{const l=a.onDone(Er(o));return l===void 0?lt:l})),Ea({onFailure:n,onSuccess:()=>i()}));case ay:return r.push(a),r.push(s),fn(()=>i())}};return i()},tge=R(2,(e,t)=>{const n=(r,i,a)=>vme(Nt(()=>new jc(e,void 0,ke)),s=>fn(()=>Xb(s.run(),s).pipe(EH(r),cr($r(r)),iN($r(i)))),(s,o)=>{const l=s.close(o);return l===void 0?lt:TH(l,c=>Tx(a,Ra(c)))});return Ox(r=>fme([Y6(t,ux),as(),as()]).pipe(Te(([i,a,s])=>r(n(a,s,i)).pipe(Gc(t),Te(o=>t.addFinalizer(l=>{const c=OA(l)?Gfe(l.cause):void 0;return $k(a).pipe(Te(f=>f?oo(s,void 0).pipe(cr(Q6(o)),cr(xD(o))):oo(s,void 0).pipe(cr(c&&GR(c)>0?KA(o,Fre(c)):_l(o)),cr(xD(o)))))}).pipe(cr(r($r(a)))))))))}),Xb=(e,t)=>{const n=e;switch(n._tag){case Ah:return M(n.effect,Te(()=>Xb(t.run(),t)));case iy:return Xb(t.run(),t);case ry:return fn(()=>t.getDone());case ay:return fN(n,()=>Xb(t.run(),t),Ra)}},nge="Done",rge="Await",ige="effect/ChannelMergeDecision",age=Symbol.for(ige),sge={[age]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}},LD=e=>{const t=Object.create(sge);return t._tag=rge,t.f=e,t},h8="BothRunning",m8="LeftDone",p8="RightDone",oge="effect/ChannelMergeState",PD=Symbol.for(oge),dN={[PD]:PD},q1=(e,t)=>{const n=Object.create(dN);return n._tag=h8,n.left=e,n.right=t,n},FD=e=>{const t=Object.create(dN);return t._tag=m8,t.f=e,t},UD=e=>{const t=Object.create(dN);return t._tag=p8,t.f=e,t},g8="BackPressure",y8="BufferSliding",lge="effect/ChannelMergeStrategy",BD=Symbol.for(lge),b8={[BD]:BD},cge=e=>{const t=Object.create(b8);return t._tag=g8,t},uge=e=>{const t=Object.create(b8);return t._tag=y8,t},fge=R(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case g8:return t();case y8:return n()}}),bf="Empty",Cm="Emit",Tm="Error",Rm="Done",v8=e=>({_tag:bf,notifyProducer:e}),V1=e=>({_tag:Cm,notifyConsumers:e}),dge=e=>({_tag:Tm,cause:e}),hge=e=>({_tag:Rm,done:e});class mge{constructor(t){S(this,"ref");this.ref=t}awaitRead(){return yf(nm(this.ref,t=>t._tag===bf?[$r(t.notifyProducer),t]:[lt,t]))}get close(){return Sme(t=>this.error(B6(t)))}done(t){return yf(nm(this.ref,n=>{switch(n._tag){case bf:return[$r(n.notifyProducer),n];case Cm:return[hs(n.notifyConsumers,r=>oo(r,je(t)),{discard:!0}),hge(t)];case Tm:return[Cc,n];case Rm:return[Cc,n]}}))}emit(t){return Te(as(),n=>yf(nm(this.ref,r=>{switch(r._tag){case bf:return[$r(r.notifyProducer),r];case Cm:{const i=r.notifyConsumers[0],a=r.notifyConsumers.slice(1);if(i!==void 0)return[oo(i,Me(t)),a.length===0?v8(n):V1(a)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Tm:return[Cc,r];case Rm:return[Cc,r]}})))}error(t){return yf(nm(this.ref,n=>{switch(n._tag){case bf:return[$r(n.notifyProducer),n];case Cm:return[hs(n.notifyConsumers,r=>eme(r,t),{discard:!0}),dge(t)];case Tm:return[Cc,n];case Rm:return[Cc,n]}}))}get take(){return this.takeWith(t=>Er(Xfe(t,je)),t=>xi(t),t=>bx(Me(t)))}takeWith(t,n,r){return Te(as(),i=>yf(nm(this.ref,a=>{switch(a._tag){case bf:return[cr(oo(a.notifyProducer,void 0),Uk($r(i),{onFailure:t,onSuccess:ri({onLeft:r,onRight:n})})),V1([i])];case Cm:return[Uk($r(i),{onFailure:t,onSuccess:ri({onLeft:r,onRight:n})}),V1([...a.notifyConsumers,i])];case Tm:return[Vt(t(a.cause)),a];case Rm:return[Vt(r(a.done)),a]}})))}}const x8=()=>M(as(),Te(e=>RA(v8(e))),bt(e=>new mge(e))),Kk=R(2,(e,t)=>Hpe(e,t,()=>{},()=>{})),pge=e=>{const t=Rh({onInput:()=>t,onFailure:Ri,onDone:c8});return Aa(e,t)},S8=R(2,(e,t)=>qpe(e,()=>t)),gge=e=>Cn(e,ke),hN=e=>kl(e.takeWith(Ri,t=>Cn(pr(t),()=>hN(e)),c8)),w8=R(2,(e,t)=>Cn(e,n=>uN(()=>t(n)))),_8=R(2,(e,t)=>{const n=l8({onInput:r=>Cn(pr(t(r)),()=>n),onFailure:lN,onDone:eg});return Aa(e,n)}),yge=e=>t=>bge(e)(t,Cd),bge=({bufferSize:e=16,concurrency:t,mergeStrategy:n=cge()})=>(r,i)=>T8(a=>sd(function*(){const s=t==="unbounded"?Number.MAX_SAFE_INTEGER:t,o=yield*x8(),l=hN(o),c=yield*LH(e);yield*Tx(a,zx(c));const f=yield*_pe();yield*Tx(a,zx(f));const u=yield*RA(ne()),d=yield*as(),h=(yield*Rme(s)).withPermits,p=yield*ld(Aa(l,r),a);function b(g){return g.pipe(Te(ri({onLeft:v=>Vt(ae(v)),onRight:v=>z1(af(c,Vt(Me(v))),ne())})),OD({until:v=>zt(v)}),Te(v=>Ule(u,Dt({onNone:()=>ae(v.value),onSome:w=>ae(i(w,v.value))}))),eN(v=>Ex(v)?Ra(v):af(c,Ra(v)).pipe(cr(oo(d,void 0)),tN)))}yield*p.pipe(Ea({onFailure:g=>af(c,Ra(g)).pipe(cr(Vt(!1))),onSuccess:ri({onLeft:g=>kH(_a($r(d)),_a(h(s)(lt)),{onSelfDone:(v,w)=>z1(_l(w),!1),onOtherDone:(v,w)=>cr(_l(w),Lle(u).pipe(Te(Dt({onNone:()=>af(c,Vt(je(g))),onSome:E=>af(c,Vt(je(i(E,g))))})),z1(!1)))}),onRight:g=>fge(n,{onBackPressure:()=>sd(function*(){const v=yield*as(),w=Fk(C=>ld(Aa(l,g),C).pipe(Te(k=>$1(dr(b(k)),dr(_a($r(d))))),Te(ke)));return yield*oo(v,void 0).pipe(cr(w),h(1),Gc(a)),yield*$r(v),!(yield*$k(d))}),onBufferSliding:()=>sd(function*(){const v=yield*as(),w=yield*as(),E=yield*Epe(f);yield*DD(f).pipe(Te(_=>oo(_,void 0)),Eme(()=>E>=s)),yield*af(f,v);const C=Fk(_=>ld(Aa(l,g),_).pipe(Te(A=>dr(b(A)).pipe($1(dr(_a($r(d)))),$1(dr(_a($r(v)))))),Te(ke)));return yield*oo(w,void 0).pipe(cr(C),h(1),Gc(a)),yield*$r(w),!(yield*$k(d))})})})}),OD({while:g=>g}),Gc(a));const x=M(DD(c),yf,Uk({onFailure:Ri,onSuccess:ri({onLeft:eg,onRight:g=>Cn(pr(g),()=>x)})}),kl);return o8(x,o)})),E8=R(3,(e,t,n)=>yge(n)(_8(e,t))),vge=R(2,(e,t)=>{function n(r){return sd(function*(){const i=yield*x8(),a=hN(i),s=yield*ld(Aa(a,e),r),o=yield*ld(Aa(a,t.other),r);function l(f,u,d){return(h,p,b)=>{function x(g){const v=g;return v._tag===nge?Vt(zr(cr(_l(u),v.effect))):bt(Q6(u),so({onFailure:w=>zr(v.f(Er(w))),onSuccess:ri({onLeft:w=>zr(v.f(xi(w))),onRight:w=>mN(pr(w),c(b(v.f)))})}))}return so(f,{onFailure:g=>x(h(Er(g))),onSuccess:ri({onLeft:g=>x(h(xi(g))),onRight:g=>Vt(Cn(pr(g),()=>Cn(zr(Gc(_a(d),r)),v=>c(p(v,u)))))})})}}function c(f){switch(f._tag){case h8:{const u=_a(SD(f.left)),d=_a(SD(f.right));return kl(kH(u,d,{onSelfDone:(h,p)=>cr(_l(p),l(h,f.right,s)(t.onSelfDone,q1,b=>FD(b))),onOtherDone:(h,p)=>cr(_l(p),l(h,f.left,o)(t.onOtherDone,(b,x)=>q1(x,b),b=>UD(b)))}))}case m8:return kl(bt(dr(o),so({onFailure:u=>zr(f.f(Er(u))),onSuccess:ri({onLeft:u=>zr(f.f(xi(u))),onRight:u=>Cn(pr(u),()=>c(FD(f.f)))})})));case p8:return kl(bt(dr(s),so({onFailure:u=>zr(f.f(Er(u))),onSuccess:ri({onLeft:u=>zr(f.f(xi(u))),onRight:u=>Cn(pr(u),()=>c(UD(f.f)))})})))}}return zr(Nx(f=>{const u=Nx(p=>(p.transferChildren(f.scope()),lt)),d=_a(s).pipe(Uf(u),Gc(r)),h=_a(o).pipe(Uf(u),Gc(r));return MS(d,h,(p,b)=>q1(p,b))})).pipe(Cn(c),o8(i))})}return T8(n)}),xge=R(2,(e,t)=>cN(()=>{let n;const r=l8({onInput:a=>Cn(pr(a),()=>r),onFailure:a=>(n=Cge(a),Ri(jk(n))),onDone:eg}),i=Rh({onInput:a=>M(pr(a),Cn(()=>i)),onFailure:a=>Vfe(a)&&Tge(a.defect)&&xe(a.defect,n)?lN(a.defect.error):Ri(a),onDone:eg});return Aa(Aa(Aa(e,r),t),i)})),Sge=e=>Fk(t=>tge(e,t)),k8=e=>Sge(pge(e)),C8=e=>kl(Ox(t=>bt(W6(),n=>Bpe(TH(t(Nde(e,n)),r=>Rx(n,Er(r))),(r,i)=>Rx(n,i))))),wge=e=>Ege(bt(OS,t=>Cn(zr(e(t)),pr))),_ge=e=>Te(OS,t=>ld(e,t)),ld=R(2,(e,t)=>Dx(Nt(()=>new jc(e,void 0,ke)),ny()).pipe(CH(([n,r])=>Ade(t,i=>{const a=n.close(i);return a!==void 0?jx(a,r):lt})),km,bt(([n])=>fn(()=>Gk(n.run(),n))))),Gk=(e,t)=>{const n=e;switch(n._tag){case ry:return so(t.getDone(),{onFailure:Ra,onSuccess:r=>Vt(je(r))});case iy:return Vt(Me(t.getEmit()));case Ah:return M(n.effect,Te(()=>Gk(t.run(),t)));case ay:return fN(n,()=>Gk(t.run(),t),r=>Ra(r))}},kl=e=>gge(zr(e)),Ege=e=>s8(C8(e),(t,n)=>t,(t,n)=>t),T8=e=>s8(wge(e),(t,n)=>t,(t,n)=>t),R8=e=>A8(0,e.length,e),A8=(e,t,n)=>e===t?jo:M(pr(M(n,xl(e))),Cn(()=>A8(e+1,t,n))),kge=R(e=>a8(e[1]),(e,t,n)=>n!=null&&n.concurrent?vge(e,{other:t,onSelfDone:r=>LD(i=>fn(()=>iD(r,i))),onOtherDone:r=>LD(i=>fn(()=>iD(i,r)))}):Cn(e,r=>w8(t,i=>[r,i]))),mN=R(e=>a8(e[1]),(e,t,n)=>n!=null&&n.concurrent?w8(kge(e,t,{concurrent:!0}),r=>r[1]):Cn(e,()=>t)),Yk=Symbol.for("effect/Channel/ChannelException"),Cge=e=>({_tag:"ChannelException",[Yk]:Yk,error:e}),Tge=e=>Re(e,Yk),Rge=Symbol.for("effect/Sink"),Age={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e};var eP;eP=Rge;class pN{constructor(t){S(this,"channel");S(this,eP,Age);this.channel=t}pipe(){return he(this,arguments)}}const Nge=e=>{const t=Rh({onInput:n=>M(zr(hs(n,r=>e(r),{discard:!0})),Cn(()=>t)),onFailure:Ri,onDone:()=>jo});return new pN(t)},Oge=e=>{const t=Rh({onInput:n=>M(zr(e(n)),Cn(()=>t)),onFailure:Ri,onDone:()=>jo});return new pN(t)},Mge=e=>new pN(zr(e)),N8=e=>tc(e)?N8(Mge(e)):e.channel,jge=()=>Ts(ne()),Dge=e=>nN(Ra(e),ae),Ige="effect/Stream",gN=Symbol.for(Ige),zge={_R:e=>e,_E:e=>e,_A:e=>e};var tP;tP=gN;class Da{constructor(t){S(this,"channel");S(this,tP,zge);this.channel=t}pipe(){return he(this,arguments)}}const zS=e=>Re(e,gN)||tc(e),$ge=4096,O8=R(2,(e,t)=>new Da(M(Qi(e),S8(t)))),Lge=e=>D8(Ts(ae(e))),Pge=e=>j8(Ra(e)),Fge=R(2,(e,t)=>Kge(e,IR(t))),M8=R(e=>zS(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.bufferSize)??16;return n!=null&&n.switch?HD(n==null?void 0:n.concurrency,()=>qD(e,1,r,t),i=>qD(e,i,r,t)):HD(n==null?void 0:n.concurrency,()=>new Da(Kk(Qi(e),i=>M(i,hne(a=>Qi(t(a))),pne(jo,(a,s)=>M(a,mN(s)))))),i=>new Da(M(Qi(e),Kk(R8),E8(a=>Qi(t(a)),n))))}),HD=(e,t,n)=>{switch(e){case void 0:return t();case"unbounded":return n(Number.MAX_SAFE_INTEGER);default:return e>1?n(e):t()}},qD=R(4,(e,t,n,r)=>new Da(M(Qi(e),Kk(R8),E8(i=>Qi(r(i)),{concurrency:t,mergeStrategy:uge(),bufferSize:n})))),Uge=R(e=>zS(e[0]),(e,t)=>M8(e,ke,t)),Bge=e=>new Da(e),Qi=e=>{if("channel"in e)return e.channel;if(tc(e))return Qi(j8(e));throw new TypeError("Expected a Stream.")},Hge=e=>new Da(G0(e)?jo:pr(e)),j8=e=>M(e,nN(ae),D8),D8=e=>new Da(kl(Cme(e,{onFailure:Dt({onNone:()=>jo,onSome:lN}),onSuccess:t=>pr(Rn(t))}))),qge=(e,t)=>M(Tpe(e,1,(t==null?void 0:t.maxChunkSize)??$ge),eN(n=>M(kpe(e),Te(r=>r&&Ex(n)?jge():Dge(n)))),I8,t!=null&&t.shutdown?O8(zx(e)):ke),Vge=(...e)=>{const t=e.length===1?e[0].evaluate:e[0],n=e.length===1?e[0].onError:e[1],r=e.length===1?e[0].releaseLockOnEnd===!0:!1;return L8(bt(Mx(Nt(()=>t().getReader()),i=>r?Nt(()=>i.releaseLock()):hme(()=>i.cancel())),i=>Gge(Te(rp({try:()=>i.read(),catch:a=>ae(n(a))}),({done:a,value:s})=>a?Ts(ne()):Vt(s)))))},Kge=R(2,(e,t)=>new Da(M(Qi(e),_8(t)))),I8=e=>eye(e,t=>M(bt(t,n=>ae([n,t])),SH(Dt({onNone:()=>Vt(ne()),onSome:Ts})))),Gge=e=>I8(M(e,bt(Rn))),z8=R(2,(e,t)=>Qi(e).pipe(xge(N8(t)),k8)),Yge=R(2,(e,t)=>z8(e,Nge(t))),Wge=R(2,(e,t)=>z8(e,Oge(t))),Jge=e=>new Da(S8(C8(M(e,bt(Rn))),lt)),Xge=e=>Hge(Rn(e)),$8=e=>new Da(cN(()=>Qi(e()))),Qge=R(e=>zS(e[0]),(e,t)=>bt(ny(),n=>Zge(e,n,t))),Zge=R(e=>zS(e[0]),(e,t,n)=>{const r=jS(t);let i,a;const s=Ame(!1);return new ReadableStream({start(o){a=r(Wge(e,l=>l.length===0?lt:s.whenOpen(Nt(()=>{s.unsafeClose();for(const c of l)o.enqueue(c);i(),i=void 0})))),a.addObserver(l=>{try{l._tag==="Failure"?o.error(HA(l.cause)):o.close()}catch{}})},pull(){return new Promise(o=>{i=o,na(s.open)})},cancel(){if(a)return Nme(tN(_l(a)))}},n==null?void 0:n.strategy)}),eye=(e,t)=>$8(()=>{const n=r=>kl(bt(t(r),Dt({onNone:()=>jo,onSome:([i,a])=>Cn(pr(i),()=>n(a))})));return new Da(n(e))}),L8=e=>Uge(Jge(e)),VD=Symbol.for("effect/Mailbox"),KD=Symbol.for("effect/Mailbox/ReadonlyMailbox"),Ac=Fn(),GD=Et(Ac),rb=Et(!1),ib=Et(!0),YD=[Ac,!0];var nP,rP;class tye extends kh{constructor(n,r,i){super();S(this,"scheduler");S(this,"capacity");S(this,"strategy");S(this,rP,VD);S(this,nP,KD);S(this,"state",{_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set});S(this,"messages",[]);S(this,"messagesChunk",Fn());S(this,"shutdown",ie(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=Ac;const n=this.state.offers;if(this.finalize(this.state._tag==="Open"?_r:this.state.exit),n.size>0){for(const r of n)r._tag==="Single"?r.resume(rb):r.resume(Et(Ir(r.remaining.slice(r.offset))));n.clear()}return!0}));S(this,"end",this.done(_r));S(this,"clear",Ve(()=>{if(this.state._tag==="Done")return qb(this.state.exit,Ac);const n=this.unsafeTakeAll();return this.releaseCapacity(),fe(n)}));S(this,"takeAll",Ve(()=>{if(this.state._tag==="Done")return qb(this.state.exit,YD);const n=this.unsafeTakeAll();return n.length===0?sn(this.awaitTake,this.takeAll):fe([n,this.releaseCapacity()])}));S(this,"take",Ve(()=>this.unsafeTake()??sn(this.awaitTake,this.take)));S(this,"await",ll(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.awaiters.add(n),ie(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(n)}))));S(this,"size",ie(()=>this.unsafeSize()));S(this,"awaitTake",ll(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.takers.add(n),ie(()=>{this.state._tag!=="Done"&&this.state.takers.delete(n)}))));S(this,"scheduleRunning",!1);S(this,"releaseTaker",()=>{if(this.scheduleRunning=!1,this.state._tag!=="Done"&&this.state.takers.size!==0){for(const n of this.state.takers)if(this.state.takers.delete(n),n(_r),this.messages.length+this.messagesChunk.length===0)break}});this.scheduler=n,this.capacity=r,this.strategy=i}offer(n){return Ve(()=>{if(this.state._tag!=="Open")return rb;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return rb;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(n),this.releaseTaker(),ib):this.offerRemainingSingle(n);case"sliding":return this.unsafeTake(),this.messages.push(n),ib}return this.messages.push(n),this.scheduleReleaseTaker(),ib})}unsafeOffer(n){return this.state._tag!=="Open"?!1:this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy==="sliding"?(this.unsafeTake(),this.messages.push(n),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(n),this.releaseTaker(),!0):!1:(this.messages.push(n),this.scheduleReleaseTaker(),!0)}offerAll(n){return Ve(()=>{if(this.state._tag!=="Open")return fe(_o(n));const r=this.unsafeOfferAllArray(n);return r.length===0?GD:this.strategy==="dropping"?fe(Ir(r)):this.offerRemainingArray(r)})}unsafeOfferAll(n){return Ir(this.unsafeOfferAllArray(n))}unsafeOfferAllArray(n){if(this.state._tag!=="Open")return yt(n);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=kn(this.messagesChunk,Ir(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(kn(_o(n)),mne(this.capacity)):K0(n)?this.messagesChunk=kn(this.messagesChunk,n):this.messages=yt(n),this.scheduleReleaseTaker(),[];const r=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(r===0)return yt(n);const i=[];let a=0;for(const s of n)a<r?this.messages.push(s):i.push(s),a++;return this.scheduleReleaseTaker(),i}fail(n){return this.done(Vp(n))}failCause(n){return this.done(wt(n))}unsafeDone(n){return this.state._tag!=="Open"?!1:this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(n),!0):(this.state={...this.state,_tag:"Closing",exit:n},!0)}done(n){return ie(()=>this.unsafeDone(n))}takeN(n){return Ve(()=>{if(this.state._tag==="Done")return qb(this.state.exit,YD);if(n<=0)return fe([Ac,!1]);n=Math.min(n,this.capacity);let r;if(n<=this.messagesChunk.length)r=Zv(this.messagesChunk,n),this.messagesChunk=ol(this.messagesChunk,n);else if(n<=this.messages.length+this.messagesChunk.length)this.messagesChunk=kn(this.messagesChunk,Ir(this.messages)),this.messages=[],r=Zv(this.messagesChunk,n),this.messagesChunk=ol(this.messagesChunk,n);else return sn(this.awaitTake,this.takeN(n));return fe([r,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return hB(this.state.exit,Vp(new Ch));let n;if(this.messagesChunk.length>0)n=$R(this.messagesChunk),this.messagesChunk=ol(this.messagesChunk,1);else if(this.messages.length>0)n=this.messages[0],this.messagesChunk=ol(Ir(this.messages),1),this.messages=[];else return this.capacity<=0&&this.state.offers.size>0?(this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?Et(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),Et(n)}unsafeSize(){const n=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?ne():ae(n)}commit(){return this.takeAll}pipe(){return he(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return Mt(this)}[(rP=VD,nP=KD,ut)](){return Mt(this)}offerRemainingSingle(n){return ll(r=>{if(this.state._tag!=="Open")return r(rb);const i={_tag:"Single",message:n,resume:r};return this.state.offers.add(i),ie(()=>{this.state._tag==="Open"&&this.state.offers.delete(i)})})}offerRemainingArray(n){return ll(r=>{if(this.state._tag!=="Open")return r(Et(Ir(n)));const i={_tag:"Array",remaining:n,offset:0,resume:r};return this.state.offers.add(i),ie(()=>{this.state._tag==="Open"&&this.state.offers.delete(i)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";if(this.state.offers.size===0)return this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag==="Success"):!1;let n=this.capacity-this.messages.length-this.messagesChunk.length;for(const r of this.state.offers){if(n===0)return!1;if(r._tag==="Single")this.messages.push(r.message),n--,r.resume(ib),this.state.offers.delete(r);else{for(;r.offset<r.remaining.length;r.offset++){if(n===0)return!1;this.messages.push(r.remaining[r.offset]),n--}r.resume(GD),this.state.offers.delete(r)}}return!1}scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}unsafeTakeAll(){if(this.messagesChunk.length>0){const n=this.messages.length>0?kn(this.messagesChunk,Ir(this.messages)):this.messagesChunk;return this.messagesChunk=Ac,this.messages=[],n}else if(this.messages.length>0){const n=Ir(this.messages);return this.messages=[],n}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,Rn(this.messages.pop());return Ac}finalize(n){if(this.state._tag==="Done")return;const r=this.state;this.state={_tag:"Done",exit:n};for(const i of r.takers)i(n);r.takers.clear();for(const i of r.awaiters)i(n);r.awaiters.clear()}}const nye=e=>ht(t=>fe(new tye(t.currentScheduler,typeof e=="number"?e:(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":(e==null?void 0:e.strategy)??"suspend"))),rye=e=>{const t=Cn(e.takeAll,([n,r])=>r?n.length===0?jo:pr(n):mN(pr(n),t));return t},iye=e=>Bge(rye(e)),aye=nye,sye=iye,K1=gN,P8=O8,oye=Lge,lye=Pge,cye=Fge,uye=M8,F8=Qi,fye=qge,dye=Vge,hye=Yge,mye=Xge,pye=$8,gye=Qge,U8=L8;class sy extends AR("@effect/experimental/Reactivity")(){}const yye=Nt(()=>{const e=new Map,t=o=>{if(Array.isArray(o))for(let l=0;l<o.length;l++){const c=e.get(Wk(o[l]));if(c!==void 0)for(const f of c)f()}else{const l=o;for(const c in l){const f=H8(c,l[c]);for(let d=0;d<f.length;d++){const h=e.get(f[d]);if(h!==void 0)for(const p of h)p()}const u=e.get(c);if(u!==void 0)for(const d of u)d()}}},n=o=>Nt(()=>t(o)),r=(o,l)=>iN(l,n(o)),i=(o,l)=>{const c=Array.isArray(o)?o.map(Wk):vye(o);for(let f=0;f<c.length;f++){let u=e.get(c[f]);u===void 0&&(u=new Set,e.set(c[f],u)),u.add(l)}return()=>{for(let f=0;f<c.length;f++){const u=e.get(c[f]);u.delete(l),u.size===0&&e.delete(c[f])}}},a=(o,l)=>sd(function*(){const c=yield*OS,f=yield*aye(),u=yield*Fme();let d=!1,h=!1;const p=g=>{g._tag==="Failure"?f.unsafeDone(Er(g.cause)):f.unsafeOffer(g.value),h?(h=!1,u(l).addObserver(p)):d=!1};function b(){if(d){h=!0;return}d=!0,u(l).addObserver(p)}const x=i(o,b);return yield*Tx(c,Nt(x)),b(),f}),s=(o,l)=>a(o,l).pipe(bt(sye),U8);return sy.of({mutation:r,query:a,stream:s,unsafeInvalidate:t,invalidate:n,unsafeRegister:i})}),B8=R(2,(e,t)=>Te(sy,n=>n.mutation(t,e))),bye=e=>Te(sy,t=>t.invalidate(e)),G1=NH(sy,yye);function Wk(e){return typeof e=="string"?e:de(e)}const H8=(e,t)=>{const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=`${e}:${Wk(t[r])}`;return n},vye=e=>{const t=[];for(const n in e){t.push(n);for(const r of H8(n,e[n]))t.push(r)}return t},q8="effect/Redacted",Qb=De("effect/Redacted/redactedRegistry",()=>new WeakMap),V8=Symbol.for(q8),xye={[V8]:{_A:e=>e},pipe(){return he(this,arguments)},toString(){return"<redacted>"},toJSON(){return"<redacted>"},[ut](){return"<redacted>"},[Fe](){return M(de(q8),Be(de(Qb.get(this))),Tt(this))},[Ue](e){return Sye(e)&&xe(Qb.get(this),Qb.get(e))}},Sye=e=>Re(e,V8),wye=e=>{const t=Object.create(xye);return Qb.set(t,e),t},K8=(e,t)=>{switch(t._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return K8(e,t.from)}},G8=e=>{let t=!1,n;return()=>(t||(n=e(),t=!0),n)},yN=e=>Array.isArray(e),_ye=e=>!Array.isArray(e),WD=e=>`[${P0(e)}]`,Y8=e=>yN(e)?e.map(WD).join(""):WD(e),nc=(e,t,n,r)=>{let i=e;return n&&cn(n)&&(i+=`
84
+ at path: ${Y8(n)}`),t!==void 0&&(i+=`
85
+ details: ${t}`),r&&(i+=`
86
+ schema (${r._tag}): ${r}`),i},W8=(e,t,n)=>nc("Unsupported schema or overlapping types",`cannot extend ${e} with ${t}`,n),Eye=e=>nc("Unsupported key schema",void 0,void 0,e),kye=e=>nc("Unsupported literal",`literal value: ${No(e)}`),JD=e=>nc("Duplicate index signature",`${e} index signature`),Cye=nc("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),Tye=nc("Invalid element","A required element cannot follow an optional element. ts(1257)"),XD=e=>nc("Duplicate property signature transformation",`Duplicate key ${No(e)}`),J8=e=>nc("Duplicate property signature",`Duplicate key ${No(e)}`),Rye=Symbol.for("effect/SchemaId/DateFromSelf"),Aye=Symbol.for("effect/SchemaId/GreaterThanOrEqualTo"),Nye=Symbol.for("effect/SchemaId/Between"),Oye=Symbol.for("effect/annotation/TypeConstructor"),X8=Symbol.for("effect/annotation/Brand"),Mye=Symbol.for("effect/annotation/SchemaId"),Q8=Symbol.for("effect/annotation/Message"),bN=Symbol.for("effect/annotation/MissingMessage"),oy=Symbol.for("effect/annotation/Identifier"),Ua=Symbol.for("effect/annotation/Title"),cd=Symbol.for("effect/annotation/AutoTitle"),Iu=Symbol.for("effect/annotation/Description"),Z8=Symbol.for("effect/annotation/Examples"),e9=Symbol.for("effect/annotation/Default"),t9=Symbol.for("effect/annotation/JSONSchema"),n9=Symbol.for("effect/annotation/Arbitrary"),r9=Symbol.for("effect/annotation/Pretty"),i9=Symbol.for("effect/annotation/Equivalence"),jye=Symbol.for("effect/annotation/Documentation"),a9=Symbol.for("effect/annotation/Concurrency"),s9=Symbol.for("effect/annotation/Batching"),o9=Symbol.for("effect/annotation/ParseIssueTitle"),l9=Symbol.for("effect/annotation/ParseOptions"),c9=Symbol.for("effect/annotation/DecodingFallback"),Lx=Symbol.for("effect/annotation/Surrogate"),Dye=Symbol.for("effect/annotation/StableFilter"),Gr=R(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?ae(e.annotations[t]):ne()),u9=Gr(X8),Iye=Gr(Q8),zye=Gr(bN),f9=Gr(Ua),d9=Gr(cd),$S=Gr(oy),h9=Gr(Iu),$ye=Gr(a9),Lye=Gr(s9),Pye=Gr(o9),Fye=Gr(l9),Uye=Gr(c9),m9=Gr(Lx),Bye=Gr(Dye),Hye=e=>Ite(Bye(e),t=>t===!0),p9=Symbol.for("effect/annotation/JSONIdentifier"),qye=Gr(p9),Vye=e=>Ta(qye(e),()=>$S(e)),Kye=Symbol.for("effect/schema/ParseJson");class LS{constructor(t,n,r,i={}){S(this,"typeParameters");S(this,"decodeUnknown");S(this,"encodeUnknown");S(this,"annotations");S(this,"_tag","Declaration");this.typeParameters=t,this.decodeUnknown=n,this.encodeUnknown=r,this.annotations=i}toString(){return Ut(ys(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(t=>t.toJSON()),annotations:mn(this.annotations)}}}const Ba=e=>t=>t._tag===e;let Px=class{constructor(t,n={}){S(this,"literal");S(this,"annotations");S(this,"_tag","Literal");this.literal=t,this.annotations=n}toString(){return Ut(ys(this),()=>No(this.literal))}toJSON(){return{_tag:this._tag,literal:z0(this.literal)?String(this.literal):this.literal,annotations:mn(this.annotations)}}};const ip=Ba("Literal"),Gye=new Px(null);class Yye{constructor(t,n={}){S(this,"symbol");S(this,"annotations");S(this,"_tag","UniqueSymbol");this.symbol=t,this.annotations=n}toString(){return Ut(ys(this),()=>No(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:mn(this.annotations)}}}class Wye{constructor(t={}){S(this,"annotations");S(this,"_tag","UndefinedKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const Jk=new Wye({[Ua]:"undefined"});class Jye{constructor(t={}){S(this,"annotations");S(this,"_tag","VoidKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const Xye=new Jye({[Ua]:"void"}),Qye=Ba("VoidKeyword");class Zye{constructor(t={}){S(this,"annotations");S(this,"_tag","NeverKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const vN=new Zye({[Ua]:"never"}),ebe=Ba("NeverKeyword");class tbe{constructor(t={}){S(this,"annotations");S(this,"_tag","UnknownKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const g9=new tbe({[Ua]:"unknown"});class nbe{constructor(t={}){S(this,"annotations");S(this,"_tag","AnyKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const rbe=new nbe({[Ua]:"any"});class ibe{constructor(t={}){S(this,"annotations");S(this,"_tag","StringKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const Xk=new ibe({[Ua]:"string",[Iu]:"a string"}),Qk=Ba("StringKeyword");class abe{constructor(t={}){S(this,"annotations");S(this,"_tag","NumberKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const Zk=new abe({[Ua]:"number",[Iu]:"a number"}),QD=Ba("NumberKeyword");class sbe{constructor(t={}){S(this,"annotations");S(this,"_tag","BooleanKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const eC=new sbe({[Ua]:"boolean",[Iu]:"a boolean"}),ZD=Ba("BooleanKeyword");class obe{constructor(t={}){S(this,"annotations");S(this,"_tag","SymbolKeyword");this.annotations=t}toString(){return Do(this)}toJSON(){return{_tag:this._tag,annotations:mn(this.annotations)}}}const lbe=new obe({[Ua]:"symbol",[Iu]:"a symbol"}),cbe=Ba("SymbolKeyword");let PS=class{constructor(t,n={}){S(this,"type");S(this,"annotations");this.type=t,this.annotations=n}toJSON(){return{type:this.type.toJSON(),annotations:mn(this.annotations)}}toString(){return String(this.type)}};class zu extends PS{constructor(n,r,i={}){super(n,i);S(this,"isOptional");this.isOptional=r}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:mn(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}}const y9=e=>e.map(t=>t.type);class xN{constructor(t,n,r,i={}){S(this,"elements");S(this,"rest");S(this,"isReadonly");S(this,"annotations");S(this,"_tag","TupleType");this.elements=t,this.rest=n,this.isReadonly=r,this.annotations=i;let a=!1,s=!1;for(const o of t)if(o.isOptional)a=!0;else if(a){s=!0;break}if(s||a&&n.length>1)throw new Error(Tye)}toString(){return Ut(ys(this),()=>ube(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(t=>t.toJSON()),rest:this.rest.map(t=>t.toJSON()),isReadonly:this.isReadonly,annotations:mn(this.annotations)}}}const ube=e=>{const t=e.elements.map(String).join(", ");return Bte(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{const i=String(n),a=i.includes(" | ")?`(${i})`:i;if(r.length>0){const s=r.map(String).join(", ");return e.elements.length>0?`readonly [${t}, ...${a}[], ${s}]`:`readonly [...${a}[], ${s}]`}else return e.elements.length>0?`readonly [${t}, ...${a}[]]`:`ReadonlyArray<${i}>`}})};class sr extends zu{constructor(n,r,i,a,s){super(r,i,s);S(this,"name");S(this,"isReadonly");this.name=n,this.isReadonly=a}toString(){return(this.isReadonly?"readonly ":"")+String(this.name)+(this.isOptional?"?":"")+": "+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:mn(this.annotations)}}}const b9=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return b9(e.from)}return!1};class FS{constructor(t,n,r){S(this,"type");S(this,"isReadonly");S(this,"parameter");if(this.type=n,this.isReadonly=r,b9(t))this.parameter=t;else throw new Error(Cye)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class Cl{constructor(t,n,r={}){S(this,"annotations");S(this,"_tag","TypeLiteral");S(this,"propertySignatures");S(this,"indexSignatures");this.annotations=r;const i={};for(let s=0;s<t.length;s++){const o=t[s].name;if(Object.prototype.hasOwnProperty.call(i,o))throw new Error(J8(o));i[o]=null}const a={string:!1,symbol:!1};for(let s=0;s<n.length;s++){const o=k9(n[s].parameter);if(Qk(o)){if(a.string)throw new Error(JD("string"));a.string=!0}else if(cbe(o)){if(a.symbol)throw new Error(JD("symbol"));a.symbol=!0}}this.propertySignatures=t,this.indexSignatures=n}toString(){return Ut(ys(this),()=>fbe(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(t=>t.toJSON()),indexSignatures:this.indexSignatures.map(t=>t.toJSON()),annotations:mn(this.annotations)}}}const eI=e=>e.map(String).join("; "),fbe=e=>{if(e.propertySignatures.length>0){const t=e.propertySignatures.map(String).join("; ");return e.indexSignatures.length>0?`{ ${t}; ${eI(e.indexSignatures)} }`:`{ ${t} }`}else return e.indexSignatures.length>0?`{ ${eI(e.indexSignatures)} }`:"{}"},tI=Ba("TypeLiteral"),dbe=zp(N5(Bd,e=>{switch(e._tag){case"AnyKeyword":return 0;case"UnknownKeyword":return 1;case"ObjectKeyword":return 2;case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":return 3}return 4})),hbe={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"},v9=e=>Qv(e,t=>US(t)?v9(t.types):[t]),mbe=e=>{const t=dbe(e),n=[],r={},i=[];for(const a of t)switch(a._tag){case"NeverKeyword":break;case"AnyKeyword":return[rbe];case"UnknownKeyword":return[g9];case"ObjectKeyword":case"UndefinedKeyword":case"VoidKeyword":case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":{r[a._tag]||(r[a._tag]=a,n.push(a));break}case"Literal":{const s=typeof a.literal;switch(s){case"string":case"number":case"bigint":case"boolean":{const o=hbe[s];!r[o]&&!i.includes(a.literal)&&(i.push(a.literal),n.push(a));break}case"object":{i.includes(a.literal)||(i.push(a.literal),n.push(a));break}}break}case"UniqueSymbol":{!r.SymbolKeyword&&!i.includes(a.symbol)&&(i.push(a.symbol),n.push(a));break}case"TupleType":{r.ObjectKeyword||n.push(a);break}case"TypeLiteral":{a.propertySignatures.length===0&&a.indexSignatures.length===0?r["{}"]||(r["{}"]=a,n.push(a)):r.ObjectKeyword||n.push(a);break}default:n.push(a)}return n};var Zs;let yi=(Zs=class{constructor(t,n={}){S(this,"types");S(this,"annotations");S(this,"_tag","Union");this.types=t,this.annotations=n}toString(){return Ut(ys(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map(t=>t.toJSON()),annotations:mn(this.annotations)}}},S(Zs,"make",(t,n)=>SN(t)?new Zs(t,n):t.length===1?t[0]:vN),S(Zs,"unify",(t,n)=>Zs.make(mbe(v9(t)),n)),Zs);const pbe=(e,t)=>e.map(t),SN=e=>e.length>1,US=Ba("Union"),Y1=De(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);class tg{constructor(t,n={}){S(this,"f");S(this,"annotations");S(this,"_tag","Suspend");this.f=t,this.annotations=n,this.f=G8(t)}toString(){return ys(this).pipe(Ta(()=>Oo(Rte(this.f)(),t=>ys(t))),Ut(()=>"<suspended schema>"))}toJSON(){const t=this.f();let n=Y1.get(t);return n||(Y1.set(t,{_tag:this._tag}),n={_tag:this._tag,ast:t.toJSON(),annotations:mn(this.annotations)},Y1.set(t,n),n)}}let wN=class{constructor(t,n,r={}){S(this,"from");S(this,"filter");S(this,"annotations");S(this,"_tag","Refinement");this.from=t,this.filter=n,this.annotations=r}toString(){return $S(this).pipe(Ut(()=>Dt(C9(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:t=>ud(this.from)?String(this.from)+" & "+t:t})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:mn(this.annotations)}}};const ud=Ba("Refinement"),W1={};let Dc=class{constructor(t,n,r,i={}){S(this,"from");S(this,"to");S(this,"transformation");S(this,"annotations");S(this,"_tag","Transformation");this.from=t,this.to=n,this.transformation=r,this.annotations=i}toString(){return Ut(ys(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:mn(this.annotations)}}};const gbe=Ba("Transformation");class x9{constructor(t,n){S(this,"decode");S(this,"encode");S(this,"_tag","FinalTransformation");this.decode=t,this.encode=n}}const ybe=e=>t=>t._tag===e;class bbe{constructor(){S(this,"_tag","ComposeTransformation")}}const S9=new bbe;let vbe=class{constructor(t,n,r,i){S(this,"from");S(this,"to");S(this,"decode");S(this,"encode");this.from=t,this.to=n,this.decode=r,this.encode=i}};class tC{constructor(t){S(this,"propertySignatureTransformations");S(this,"_tag","TypeLiteralTransformation");this.propertySignatureTransformations=t;const n={},r={};for(const i of t){const a=i.from;if(n[a])throw new Error(XD(a));n[a]=!0;const s=i.to;if(r[s])throw new Error(XD(s));r[s]=!0}}}const nI=ybe("TypeLiteralTransformation"),Nh=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[oy];const i={...r,...t},a=m9(e);return zt(a)&&(i[Lx]=Nh(a.value,t)),n.annotations.value=i,Object.create(Object.getPrototypeOf(e),n)},xbe="[\\s\\S]*?",Sbe="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",w9=(e,t)=>{switch(e._tag){case"Literal":return lx(String(e.literal));case"StringKeyword":return xbe;case"NumberKeyword":return Sbe;case"TemplateLiteral":return _9(e);case"Union":return e.types.map(n=>w9(n)).join("|")}},wbe=(e,t,n,r)=>US(e)?`(${t})`:t,_9=(e,t,n)=>{let r="";if(e.head!==""){const i=lx(e.head);r+=i}for(const i of e.spans){const a=w9(i.type);if(r+=wbe(i.type,a),i.literal!==""){const s=lx(i.literal);r+=s}}return r},_be=e=>new RegExp(`^${_9(e)}$`),rI=(e,t)=>{const n=[],r=[],i=a=>{switch(a._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":r.push(new FS(a,t,!0));break;case"Literal":if(ji(a.literal)||wo(a.literal))n.push(new sr(a.literal,t,!1,!0));else throw new Error(kye(a.literal));break;case"Enums":{for(const[s,o]of a.enums)n.push(new sr(o,t,!1,!0));break}case"UniqueSymbol":n.push(new sr(a.symbol,t,!1,!0));break;case"Union":a.types.forEach(i);break;default:throw new Error(Eye(a))}};return i(e),{propertySignatures:n,indexSignatures:r}},E9=e=>t=>{let n;for(const r of e)Object.prototype.hasOwnProperty.call(t.annotations,r)&&(n===void 0&&(n={}),n[r]=t.annotations[r]);return n},Ebe=e=>t=>{const n={...t.annotations};for(const r of e)delete n[r];return n},kbe=E9([Z8,e9,t9,n9,r9,i9]),xn=e=>{switch(e._tag){case"Declaration":{const t=Ki(e.typeParameters,xn);return t===e.typeParameters?e:new LS(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case"TupleType":{const t=Ki(e.elements,i=>{const a=xn(i.type);return a===i.type?i:new zu(a,i.isOptional)}),n=y9(e.rest),r=Ki(n,xn);return t===e.elements&&r===n?e:new xN(t,r.map(i=>new PS(i)),e.isReadonly,e.annotations)}case"TypeLiteral":{const t=Ki(e.propertySignatures,r=>{const i=xn(r.type);return i===r.type?r:new sr(r.name,i,r.isOptional,r.isReadonly)}),n=Ki(e.indexSignatures,r=>{const i=xn(r.type);return i===r.type?r:new FS(r.parameter,i,r.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new Cl(t,n,e.annotations)}case"Union":{const t=Ki(e.types,xn);return t===e.types?e:yi.make(t,e.annotations)}case"Suspend":return new tg(()=>xn(e.f()),e.annotations);case"Refinement":{const t=xn(e.from);return t===e.from?e:new wN(t,e.filter,e.annotations)}case"Transformation":{const t=kbe(e);return xn(t!==void 0?Nh(e.to,t):e.to)}}return e};function Ki(e,t){let n=!1;const r=q0(e.length);for(let i=0;i<e.length;i++){const a=e[i],s=t(a);s!==a&&(n=!0),r[i]=s}return n?r:e}const Ya=(e,t)=>{switch(e._tag){case"Declaration":{const n=Ki(e.typeParameters,r=>Ya(r));return n===e.typeParameters?e:new LS(n,e.decodeUnknown,e.encodeUnknown)}case"TupleType":{const n=Ki(e.elements,a=>{const s=Ya(a.type);return s===a.type?a:new zu(s,a.isOptional)}),r=y9(e.rest),i=Ki(r,a=>Ya(a));return n===e.elements&&i===r?e:new xN(n,i.map(a=>new PS(a)),e.isReadonly)}case"TypeLiteral":{const n=Ki(e.propertySignatures,i=>{const a=Ya(i.type);return a===i.type?i:new sr(i.name,a,i.isOptional,i.isReadonly)}),r=Ki(e.indexSignatures,i=>{const a=Ya(i.type);return a===i.type?i:new FS(i.parameter,a,i.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new Cl(n,r)}case"Union":{const n=Ki(e.types,r=>Ya(r));return n===e.types?e:yi.make(n)}case"Suspend":{let n;const r=Vye(e);if(zt(r)){const i="";n={[p9]:`${r.value}Encoded${i}`}}return new tg(()=>Ya(e.f()),n)}case"Refinement":return Ya(e.from);case"Transformation":return Ya(e.from)}return e},Fx=e=>Ya(e),mn=e=>{const t={};for(const n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},k9=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return e;case"Refinement":return k9(e.from)}},Cbe=(e,t)=>new Dc(e,t,S9),Do=e=>Ut(ys(e),()=>e._tag);function Tbe(e){return Dt(u9(e),{onNone:()=>"",onSome:t=>t.map(n=>` & Brand<${No(n)}>`).join("")})}const C9=e=>f9(e).pipe(Ta(()=>h9(e)),Ta(()=>d9(e)),ii(t=>t+Tbe(e))),ys=e=>Ta($S(e),()=>C9(e));class rr{constructor(t,n,r){S(this,"path");S(this,"actual");S(this,"issue");S(this,"_tag","Pointer");this.path=t,this.actual=n,this.issue=r}}class iI{constructor(t,n){S(this,"actual");S(this,"message");S(this,"_tag","Unexpected");this.actual=t,this.message=n}}class om{constructor(t,n){S(this,"ast");S(this,"message");S(this,"_tag","Missing");S(this,"actual");this.ast=t,this.message=n}}class nn{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"issues");S(this,"output");S(this,"_tag","Composite");this.ast=t,this.actual=n,this.issues=r,this.output=i}}class J1{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"kind");S(this,"issue");S(this,"_tag","Refinement");this.ast=t,this.actual=n,this.kind=r,this.issue=i}}class X1{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"kind");S(this,"issue");S(this,"_tag","Transformation");this.ast=t,this.actual=n,this.kind=r,this.issue=i}}class on{constructor(t,n,r){S(this,"ast");S(this,"actual");S(this,"message");S(this,"_tag","Type");this.ast=t,this.actual=n,this.message=r}}class nC{constructor(t,n,r){S(this,"ast");S(this,"actual");S(this,"message");S(this,"_tag","Forbidden");this.ast=t,this.actual=n,this.message=r}}const aI=Symbol.for("effect/Schema/ParseErrorTypeId");var iP;class Rbe extends Che("ParseError"){constructor(){super(...arguments);S(this,iP,aI)}get message(){return this.toString()}toString(){return sp.formatIssueSync(this.issue)}toJSON(){return{_id:"ParseError",message:this.toString()}}[(iP=aI,ut)](){return this.toJSON()}}const _N=e=>new Rbe({issue:e}),kr=Me,lo=je,Ux=gte,Abe=pte,Sr=k5,Ca=R(2,(e,t)=>Sr(e)?ri(e,{onLeft:je,onRight:t}):Te(e,t)),or=R(2,(e,t)=>Sr(e)?vte(e,t):bt(e,t)),ap=R(2,(e,t)=>Sr(e)?bte(e,t):nN(e,t)),Nbe=R(2,(e,t)=>Sr(e)?yte(e,{onLeft:t.onFailure,onRight:t.onSuccess}):bme(e,t)),T9=R(2,(e,t)=>Sr(e)?ri(e,{onLeft:t,onRight:Me}):SH(e,t)),BS=(e,t)=>t===void 0||wo(t)?e:e===void 0?t:{...e,...t},R9=(e,t,n)=>{const r=Kn(e,t);return(i,a)=>r(i,BS(n,a))},A9=(e,t,n)=>{const r=R9(e,t,n);return(i,a)=>C5(r(i,a),_N)},Obe=(e,t,n)=>{const r=R9(e,t,n);return(i,a)=>kte(r(i,a))},N9=(e,t,n)=>{const r=Kn(e,t);return(i,a)=>r(i,{...BS(n,a),isEffectAllowed:!0})},O9=(e,t)=>A9(e.ast,!0,t),Mbe=(e,t)=>Obe(e.ast,!0,t),EN=(e,t)=>N9(e.ast,!0,t),HS=(e,t)=>N9(e.ast,!1,t),M9=O9,jbe=Mbe,qS=(e,t)=>A9(xn(e.ast),!0,t),Dbe=(e,t)=>{const n=Kn(xn(e.ast),!0);return(r,i)=>rs(n(r,{exact:!0,...BS(t,i)}))},Ibe=De(Symbol.for("effect/ParseResult/decodeMemoMap"),()=>new WeakMap),zbe=De(Symbol.for("effect/ParseResult/encodeMemoMap"),()=>new WeakMap),Kn=(e,t)=>{const n=t?Ibe:zbe,r=n.get(e);if(r)return r;const i=$be(e,t),a=Fye(e),s=zt(a)?(c,f)=>i(c,BS(f,a.value)):i,o=Uye(e),l=t&&zt(o)?(c,f)=>Nm(T9(s(c,f),o.value),e,c,f):s;return n.set(e,l),l},Q1=e=>Vi($ye(e)),Z1=e=>Vi(Lye(e)),$be=(e,t)=>{switch(e._tag){case"Refinement":if(t){const n=Kn(e.from,!0);return(r,i)=>{i=i??W1;const a=(i==null?void 0:i.errors)==="all",s=Ca(T9(n(r,i),o=>{const l=new J1(e,r,"From",o);return a&&Hye(e)&&z9(o)?Dt(e.filter(r,i,e),{onNone:()=>je(l),onSome:c=>je(new nn(e,r,[l,new J1(e,r,"Predicate",c)]))}):je(l)}),o=>Dt(e.filter(o,i,e),{onNone:()=>Me(o),onSome:l=>je(new J1(e,r,"Predicate",l))}));return Nm(s,e,r,i)}}else{const n=Kn(xn(e),!0),r=Kn(j9(e.from),!1);return(i,a)=>Nm(Ca(n(i,a),s=>r(s,a)),e,i,a)}case"Transformation":{const n=Fbe(e.transformation,t),r=t?Kn(e.from,!0):Kn(e.to,!1),i=t?Kn(e.to,!0):Kn(e.from,!1);return(a,s)=>Nm(Ca(ap(r(a,s),o=>new X1(e,a,t?"Encoded":"Type",o)),o=>Ca(ap(n(o,s??W1,e,a),l=>new X1(e,a,"Transformation",l)),l=>ap(i(l,s),c=>new X1(e,a,t?"Type":"Encoded",c)))),e,a,s)}case"Declaration":{const n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(r,i)=>Nm(n(r,i??W1,e),e,r,i)}case"Literal":return di(e,n=>n===e.literal);case"UniqueSymbol":return di(e,n=>n===e.symbol);case"UndefinedKeyword":return di(e,nee);case"NeverKeyword":return di(e,iee);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return Me;case"StringKeyword":return di(e,ji);case"NumberKeyword":return di(e,wo);case"BooleanKeyword":return di(e,Td);case"BigIntKeyword":return di(e,z0);case"SymbolKeyword":return di(e,qE);case"ObjectKeyword":return di(e,Oa);case"Enums":return di(e,n=>e.enums.some(([r,i])=>i===n));case"TemplateLiteral":{const n=_be(e);return di(e,r=>ji(r)&&n.test(r))}case"TupleType":{const n=e.elements.map(c=>Kn(c.type,t)),r=e.rest.map(c=>Kn(c.type,t));let i=e.elements.filter(c=>!c.isOptional);e.rest.length>0&&(i=i.concat(e.rest.slice(1)));const a=i.length,s=e.elements.length>0?e.elements.map((c,f)=>f).join(" | "):"never",o=Q1(e),l=Z1(e);return(c,f)=>{if(!qte(c))return je(new on(e,c));const u=(f==null?void 0:f.errors)==="all",d=[];let h=0;const p=[],b=c.length;for(let w=b;w<=a-1;w++){const E=new rr(w,c,new om(i[w-b]));if(u){d.push([h++,E]);continue}else return je(new nn(e,c,E,p))}if(e.rest.length===0)for(let w=e.elements.length;w<=b-1;w++){const E=new rr(w,c,new iI(c[w],`is unexpected, expected: ${s}`));if(u){d.push([h++,E]);continue}else return je(new nn(e,c,E,p))}let x=0,g;for(;x<n.length;x++)if(b<x+1){if(e.elements[x].isOptional)continue}else{const w=n[x],E=w(c[x],f);if(Sr(E)){if(Gn(E)){const C=new rr(x,c,E.left);if(u){d.push([h++,C]);continue}else return je(new nn(e,c,C,pa(p)))}p.push([h++,E.right])}else{const C=h++,k=x;g||(g=[]),g.push(({es:_,output:A})=>Te(rf(E),D=>{if(Gn(D)){const O=new rr(k,c,D.left);return u?(_.push([C,O]),lt):je(new nn(e,c,O,pa(A)))}return A.push([C,D.right]),lt}))}}if(cn(r)){const[w,...E]=r;for(;x<b-E.length;x++){const C=w(c[x],f);if(Sr(C))if(Gn(C)){const k=new rr(x,c,C.left);if(u){d.push([h++,k]);continue}else return je(new nn(e,c,k,pa(p)))}else p.push([h++,C.right]);else{const k=h++,_=x;g||(g=[]),g.push(({es:A,output:D})=>Te(rf(C),O=>{if(Gn(O)){const L=new rr(_,c,O.left);return u?(A.push([k,L]),lt):je(new nn(e,c,L,pa(D)))}else return D.push([k,O.right]),lt}))}}for(let C=0;C<E.length;C++)if(x+=C,!(b<x+1)){const k=E[C](c[x],f);if(Sr(k)){if(Gn(k)){const _=new rr(x,c,k.left);if(u){d.push([h++,_]);continue}else return je(new nn(e,c,_,pa(p)))}p.push([h++,k.right])}else{const _=h++,A=x;g||(g=[]),g.push(({es:D,output:O})=>Te(rf(k),L=>{if(Gn(L)){const B=new rr(A,c,L.left);return u?(D.push([_,B]),lt):je(new nn(e,c,B,pa(O)))}return O.push([_,L.right]),lt}))}}}const v=({es:w,output:E})=>ed(w)?je(new nn(e,c,pa(w),pa(E))):Me(pa(E));if(g&&g.length>0){const w=g;return fn(()=>{const E={es:_m(d),output:_m(p)};return Te(hs(w,C=>C(E),{concurrency:o,batching:l,discard:!0}),()=>v(E))})}return v({output:p,es:d})}}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return di(e,aee);const n=[],r={},i=[];for(const f of e.propertySignatures)n.push([Kn(f.type,t),f]),r[f.name]=null,i.push(f.name);const a=e.indexSignatures.map(f=>[Kn(f.parameter,t),Kn(f.type,t),f.parameter]),s=yi.make(e.indexSignatures.map(f=>f.parameter).concat(i.map(f=>qE(f)?new Yye(f):new Px(f)))),o=Kn(s,t),l=Q1(e),c=Z1(e);return(f,u)=>{if(!oee(f))return je(new on(e,f));const d=(u==null?void 0:u.errors)==="all",h=[];let p=0;const b=(u==null?void 0:u.onExcessProperty)==="error",x=(u==null?void 0:u.onExcessProperty)==="preserve",g={};let v;if(b||x){v=Reflect.ownKeys(f);for(const k of v){const _=o(k,u);if(Sr(_)&&Gn(_))if(b){const A=new rr(k,f,new iI(f[k],`is unexpected, expected: ${String(s)}`));if(d){h.push([p++,A]);continue}else return je(new nn(e,f,A,g))}else g[k]=f[k]}}let w;const E=(u==null?void 0:u.exact)===!0;for(let k=0;k<n.length;k++){const _=n[k][1],A=_.name,D=Object.prototype.hasOwnProperty.call(f,A);if(!D){if(_.isOptional)continue;if(E){const B=new rr(A,f,new om(_));if(d){h.push([p++,B]);continue}else return je(new nn(e,f,B,g))}}const O=n[k][0],L=O(f[A],u);if(Sr(L)){if(Gn(L)){const B=new rr(A,f,D?L.left:new om(_));if(d){h.push([p++,B]);continue}else return je(new nn(e,f,B,g))}g[A]=L.right}else{const B=p++,X=A;w||(w=[]),w.push(({es:W,output:U})=>Te(rf(L),I=>{if(Gn(I)){const F=new rr(X,f,D?I.left:new om(_));return d?(W.push([B,F]),lt):je(new nn(e,f,F,U))}return U[X]=I.right,lt}))}}for(let k=0;k<a.length;k++){const _=a[k],A=_[0],D=_[1],O=K8(f,_[2]);for(const L of O){const B=A(L,u);if(Sr(B)&&rs(B)){const X=D(f[L],u);if(Sr(X))if(Gn(X)){const W=new rr(L,f,X.left);if(d){h.push([p++,W]);continue}else return je(new nn(e,f,W,g))}else Object.prototype.hasOwnProperty.call(r,L)||(g[L]=X.right);else{const W=p++,U=L;w||(w=[]),w.push(({es:I,output:F})=>Te(rf(X),z=>{if(Gn(z)){const V=new rr(U,f,z.left);return d?(I.push([W,V]),lt):je(new nn(e,f,V,F))}else return Object.prototype.hasOwnProperty.call(r,L)||(F[L]=z.right),lt}))}}}}const C=({es:k,output:_})=>{if(ed(k))return je(new nn(e,f,pa(k),_));if((u==null?void 0:u.propertyOrder)==="original"){const A=v||Reflect.ownKeys(f);for(const O of i)A.indexOf(O)===-1&&A.push(O);const D={};for(const O of A)Object.prototype.hasOwnProperty.call(_,O)&&(D[O]=_[O]);return Me(D)}return Me(_)};if(w&&w.length>0){const k=w;return fn(()=>{const _={es:_m(h),output:Object.assign({},g)};return Te(hs(k,A=>A(_),{concurrency:l,batching:c,discard:!0}),()=>C(_))})}return C({es:h,output:g})}}case"Union":{const n=Lbe(e.types,t),r=Reflect.ownKeys(n.keys),i=r.length,a=e.types.length,s=new Map;for(let c=0;c<a;c++)s.set(e.types[c],Kn(e.types[c],t));const o=Q1(e)??1,l=Z1(e);return(c,f)=>{const u=[];let d=0,h=[];if(i>0)if(gR(c))for(let x=0;x<i;x++){const g=r[x],v=n.keys[g].buckets;if(Object.prototype.hasOwnProperty.call(c,g)){const w=String(c[g]);if(Object.prototype.hasOwnProperty.call(v,w))h=h.concat(v[w]);else{const{candidates:E,literals:C}=n.keys[g],k=yi.make(C),_=E.length===a?new Cl([new sr(g,k,!1,!0)],[]):yi.make(E);u.push([d++,new nn(_,c,new rr(g,c,new on(k,c[g])))])}}else{const{candidates:w,literals:E}=n.keys[g],C=new sr(g,yi.make(E),!1,!0),k=w.length===a?new Cl([C],[]):yi.make(w);u.push([d++,new nn(k,c,new rr(g,c,new om(C)))])}}else{const x=n.candidates.length===a?e:yi.make(n.candidates);u.push([d++,new on(x,c)])}n.otherwise.length>0&&(h=h.concat(n.otherwise));let p;for(let x=0;x<h.length;x++){const g=h[x],v=s.get(g)(c,f);if(Sr(v)&&(!p||p.length===0)){if(rs(v))return v;u.push([d++,v.left])}else{const w=d++;p||(p=[]),p.push(E=>fn(()=>"finalResult"in E?lt:Te(rf(v),C=>(rs(C)?E.finalResult=C:E.es.push([w,C.left]),lt))))}}const b=x=>ed(x)?x.length===1&&x[0][1]._tag==="Type"?je(x[0][1]):je(new nn(e,c,pa(x))):je(new on(e,c));if(p&&p.length>0){const x=p;return fn(()=>{const g={es:_m(u)};return Te(hs(x,v=>v(g),{concurrency:o,batching:l,discard:!0}),()=>"finalResult"in g?g.finalResult:b(g.es))})}return b(u)}}case"Suspend":{const n=G8(()=>Kn(e.f(),t));return(r,i)=>n()(r,i)}}},di=(e,t)=>n=>t(n)?Me(n):je(new on(e,n)),Am=(e,t)=>{switch(e._tag){case"Declaration":{const n=m9(e);if(zt(n))return Am(n.value,t);break}case"TypeLiteral":{const n=[];for(let r=0;r<e.propertySignatures.length;r++){const i=e.propertySignatures[r],a=t?Fx(i.type):xn(i.type);ip(a)&&!i.isOptional&&n.push([i.name,a])}return n}case"TupleType":{const n=[];for(let r=0;r<e.elements.length;r++){const i=e.elements[r],a=t?Fx(i.type):xn(i.type);ip(a)&&!i.isOptional&&n.push([r,a])}return n}case"Refinement":return Am(e.from,t);case"Suspend":return Am(e.f(),t);case"Transformation":return Am(t?e.from:e.to,t)}return[]},Lbe=(e,t)=>{const n={},r=[],i=[];for(let a=0;a<e.length;a++){const s=e[a],o=Am(s,t);if(o.length>0){i.push(s);for(let l=0;l<o.length;l++){const[c,f]=o[l],u=String(f.literal);n[c]=n[c]||{buckets:{},literals:[],candidates:[]};const d=n[c].buckets;if(Object.prototype.hasOwnProperty.call(d,u)){if(l<o.length-1)continue;d[u].push(s),n[c].literals.push(f),n[c].candidates.push(s)}else{d[u]=[s],n[c].literals.push(f),n[c].candidates.push(s);break}}}else r.push(s)}return{keys:n,otherwise:r,candidates:i}},j9=e=>ud(e)?j9(e.from):e,Nm=(e,t,n,r)=>{if((r==null?void 0:r.isEffectAllowed)===!0||Sr(e))return e;const i=new AA,a=rN(e,{scheduler:i});i.flush();const s=a.unsafePoll();if(s){if(u6(s))return Me(s.value);const o=s.cause;return qfe(o)?je(o.error):je(new nC(t,n,Zfe(o)))}return je(new nC(t,n,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},Pbe=([e],[t])=>e>t?1:e<t?-1:0;function pa(e){return e.sort(Pbe).map(t=>t[1])}const Fbe=(e,t)=>{switch(e._tag){case"FinalTransformation":return t?e.decode:e.encode;case"ComposeTransformation":return Me;case"TypeLiteralTransformation":return n=>{let r=Me(n);for(const i of e.propertySignatureTransformations){const[a,s]=t?[i.from,i.to]:[i.to,i.from],o=t?i.decode:i.encode;r=or(r,c=>{const f=o(Object.prototype.hasOwnProperty.call(c,a)?ae(c[a]):ne());return delete c[a],zt(f)&&(c[s]=f.value),c})}return r}}},jr=(e,t=[])=>({value:e,forest:t}),sp={formatIssue:e=>or(vf(e),Ube),formatIssueSync:e=>{const t=sp.formatIssue(e);return Sr(t)?T5(t):na(t)},formatError:e=>sp.formatIssue(e.issue),formatErrorSync:e=>sp.formatIssueSync(e.issue)},Ube=e=>e.value+D9(`
87
+ `,e.forest),D9=(e,t)=>{let n="";const r=t.length;let i;for(let a=0;a<r;a++){i=t[a];const s=a===r-1;n+=e+(s?"└":"├")+"─ "+i.value,n+=D9(e+(r>1&&!s?"│ ":" "),i.forest)}return n},Bbe=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},Hbe=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},I9=e=>"ast"in e?ae(e.ast):ne(),rC=Me(void 0),qbe=e=>I9(e).pipe(Oo(Iye),Dt({onNone:()=>rC,onSome:t=>{const n=t(e);return ji(n)?Me({message:n,override:!1}):tc(n)?bt(n,r=>({message:r,override:!1})):ji(n.message)?Me({message:n.message,override:n.override}):bt(n.message,r=>({message:r,override:n.override}))}})),kN=e=>t=>t._tag===e,z9=kN("Composite"),sI=kN("Refinement"),oI=kN("Transformation"),Tl=e=>Ca(qbe(e),t=>t!==void 0?!t.override&&(z9(e)||sI(e)&&e.kind==="From"||oI(e)&&e.kind!=="Transformation")?oI(e)||sI(e)?Tl(e.issue):rC:Me(t.message):rC),$9=e=>I9(e).pipe(Oo(Pye),M5(t=>t(e)),Vi);function Vbe(e){return h9(e).pipe(Ta(()=>f9(e)),Ta(()=>d9(e)),Ta(()=>$S(e)),Ut(()=>`{ ${e.from} | filter }`))}function Kbe(e){return e.message!==void 0?e.message:`Expected ${ud(e.ast)?Vbe(e.ast):String(e.ast)}, actual ${No(e.actual)}`}const L9=e=>or(Tl(e),t=>t??$9(e)??Kbe(e)),ab=e=>$9(e)??String(e.ast),P9=e=>e.message??"is forbidden",F9=e=>e.message??"is unexpected",U9=e=>{const t=zye(e.ast);if(zt(t)){const n=t.value();return ji(n)?Me(n):n}return Me(e.message??"is missing")},vf=e=>{switch(e._tag){case"Type":return or(L9(e),jr);case"Forbidden":return Me(jr(ab(e),[jr(P9(e))]));case"Unexpected":return Me(jr(F9(e)));case"Missing":return or(U9(e),jr);case"Transformation":return Ca(Tl(e),t=>t!==void 0?Me(jr(t)):or(vf(e.issue),n=>jr(ab(e),[jr(Bbe(e.kind),[n])])));case"Refinement":return Ca(Tl(e),t=>t!==void 0?Me(jr(t)):or(vf(e.issue),n=>jr(ab(e),[jr(Hbe(e.kind),[n])])));case"Pointer":return or(vf(e.issue),t=>jr(Y8(e.path),[t]));case"Composite":return Ca(Tl(e),t=>{if(t!==void 0)return Me(jr(t));const n=ab(e);return yN(e.issues)?or(hs(e.issues,vf),r=>jr(n,r)):or(vf(e.issues),r=>jr(n,[r]))})}},gc=(e,t,n)=>({_tag:e,path:t,message:n}),Zb={formatIssue:e=>xf(e,void 0,[]),formatIssueSync:e=>{const t=Zb.formatIssue(e);return Sr(t)?T5(t):na(t)},formatError:e=>Zb.formatIssue(e.issue),formatErrorSync:e=>Zb.formatIssueSync(e.issue)},xf=(e,t,n)=>{const r=e._tag;switch(r){case"Type":return or(L9(e),i=>[gc(t??r,n,i)]);case"Forbidden":return Me([gc(r,n,P9(e))]);case"Unexpected":return Me([gc(r,n,F9(e))]);case"Missing":return or(U9(e),i=>[gc(r,n,i)]);case"Pointer":return xf(e.issue,void 0,n.concat(e.path));case"Composite":return Ca(Tl(e),i=>i!==void 0?Me([gc(r,n,i)]):yN(e.issues)?or(hs(e.issues,a=>xf(a,void 0,n)),L5):xf(e.issues,void 0,n));case"Refinement":return Ca(Tl(e),i=>i!==void 0?Me([gc(r,n,i)]):xf(e.issue,e.kind==="Predicate"?r:void 0,n));case"Transformation":return Ca(Tl(e),i=>i!==void 0?Me([gc(r,n,i)]):xf(e.issue,e.kind==="Transformation"?r:void 0,n))}},lI=wye,Gbe=R(e=>Oa(e[0]),(e,...t)=>{const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}),B9=R(e=>Oa(e[0]),(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n}),Kd=Symbol.for("effect/Schema");function jt(e){var t,n,r;return n=Kd,t=Kd,r=class{constructor(){S(this,n,iC)}static annotations(a){return jt(Ha(this.ast,a))}static pipe(){return he(this,arguments)}static toString(){return String(e)}},S(r,"ast",e),S(r,"Type"),S(r,"Encoded"),S(r,"Context"),S(r,t,iC),r}const iC={_A:e=>e,_I:e=>e,_R:e=>e},cI={typeConstructor:Oye,schemaId:Mye,message:Q8,missingMessage:bN,identifier:oy,title:Ua,description:Iu,examples:Z8,default:e9,documentation:jye,jsonSchema:t9,arbitrary:n9,pretty:r9,equivalence:i9,concurrency:a9,batching:s9,parseIssueTitle:o9,parseOptions:l9,decodingFallback:c9},$u=e=>{if(!e)return{};const t={...e};for(const n in cI)if(n in e){const r=cI[n];t[r]=e[n],delete t[n]}return t},Ha=(e,t)=>Nh(e,$u(t));const Ybe=e=>String(e.ast),Wbe=e=>jt(Fx(e.ast)),ya=e=>jt(xn(e.ast)),lm=(e,t)=>{const n=HS(e,t);return(r,i)=>ap(n(r,i),_N)},Jbe=(e,t)=>{const n=EN(e,t);return(r,i)=>ap(n(r,i),_N)},Xbe=Jbe,Ia=e=>Re(e,Kd)&&Oa(e[Kd]);function Qbe(e){return SN(e)?yi.make(pbe(e,t=>new Px(t))):new Px(e[0])}function H9(e,t=Qbe(e)){var n;return n=class extends jt(t){static annotations(i){return H9(this.literals,Ha(this.ast,i))}},S(n,"literals",[...e]),n}function Rs(...e){return cn(e)?H9(e):ng}const Zbe=(e,t,n)=>CN(e,new LS(e.map(r=>r.ast),(...r)=>t.decode(...r.map(jt)),(...r)=>t.encode(...r.map(jt)),$u(n))),eve=(e,t)=>{const n=()=>(i,a,s)=>e(i)?kr(i):lo(new on(s,i)),r=n;return CN([],new LS([],n,r,$u(t)))};function CN(e,t){var n;return n=class extends jt(t){static annotations(i){return CN(this.typeParameters,Ha(this.ast,i))}},S(n,"typeParameters",[...e]),n}const Oh=function(){if(Array.isArray(arguments[0])){const n=arguments[0],r=arguments[1],i=arguments[2];return Zbe(n,r,i)}const e=arguments[0],t=arguments[1];return eve(e,t)};class q9 extends jt(Jk){}class tve extends jt(Xye){}class V9 extends jt(Gye){}class ng extends jt(vN){}class VS extends jt(g9){}class nve extends jt(lbe){}class P extends jt(Xk){}class vt extends jt(Zk){}class Ln extends jt(eC){}const rve=e=>yi.make(e.map(t=>t.ast));function K9(e,t=rve(e)){var n;return n=class extends jt(t){static annotations(i){return K9(this.members,Ha(this.ast,i))}},S(n,"members",[...e]),n}function Lu(...e){return SN(e)?K9(e):cn(e)?e[0]:ng}const Lr=e=>Lu(e,V9),Om=e=>Lu(e,q9),e_=e=>Lu(e,V9,q9),ive=(e,t)=>new xN(e.map(n=>Ia(n)?new zu(n.ast,!1):n.ast),t.map(n=>Ia(n)?new PS(n.ast):n.ast),!0);function Bx(e,t,n=ive(e,t)){var r;return r=class extends jt(n){static annotations(a){return Bx(this.elements,this.rest,Ha(this.ast,a))}},S(r,"elements",[...e]),S(r,"rest",[...t]),r}function ave(...e){return Array.isArray(e[0])?Bx(e[0],e.slice(1)):Bx(e,[])}function G9(e,t){var n;return n=class extends Bx([],[e],t){static annotations(i){return G9(this.value,Ha(this.ast,i))}},S(n,"value",e),n}const Gt=e=>G9(e),aC=e=>e?'"?:"':'":"';class Gd extends zu{constructor(n,r,i,a,s){super(n,r,a);S(this,"isReadonly");S(this,"defaultValue");S(this,"_tag","PropertySignatureDeclaration");this.isReadonly=i,this.defaultValue=s}toString(){const n=aC(this.isOptional),r=String(this.type);return`PropertySignature<${n}, ${r}, never, ${n}, ${r}>`}}class Y9 extends zu{constructor(n,r,i,a,s){super(n,r,a);S(this,"isReadonly");S(this,"fromKey");this.isReadonly=i,this.fromKey=s}}class KS extends zu{constructor(n,r,i,a,s){super(n,r,a);S(this,"isReadonly");S(this,"defaultValue");this.isReadonly=i,this.defaultValue=s}}const sve=e=>e===void 0?"never":ji(e)?JSON.stringify(e):String(e);class GS{constructor(t,n,r,i){S(this,"from");S(this,"to");S(this,"decode");S(this,"encode");S(this,"_tag","PropertySignatureTransformation");this.from=t,this.to=n,this.decode=r,this.encode=i}toString(){return`PropertySignature<${aC(this.to.isOptional)}, ${this.to.type}, ${sve(this.from.fromKey)}, ${aC(this.from.isOptional)}, ${this.from.type}>`}}const W9=(e,t)=>{switch(e._tag){case"PropertySignatureDeclaration":return new Gd(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case"PropertySignatureTransformation":return new GS(e.from,new KS(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},J9=Symbol.for("effect/PropertySignature"),TN=e=>Re(e,J9);var aP,sP;sP=Kd,aP=J9;const iO=class iO{constructor(t){S(this,"ast");S(this,sP);S(this,aP,null);S(this,"_TypeToken");S(this,"_Key");S(this,"_EncodedToken");S(this,"_HasDefault");this.ast=t}pipe(){return he(this,arguments)}annotations(t){return new iO(W9(this.ast,$u(t)))}toString(){return String(this.ast)}};let Hx=iO;const qx=e=>new Hx(e);class ly extends Hx{constructor(n,r){super(n);S(this,"from");this.from=r}annotations(n){return new ly(W9(this.ast,$u(n)),this.from)}}const op=e=>new ly(new Gd(e.ast,!1,!0,{},void 0),e),qf=R(2,(e,t)=>{const n=e.ast;switch(n._tag){case"PropertySignatureDeclaration":return qx(new Gd(n.type,n.isOptional,n.isReadonly,n.annotations,t));case"PropertySignatureTransformation":return qx(new GS(n.from,new KS(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),Po=(e,t,n)=>qx(new GS(new Y9(e.ast,!0,!0,{},void 0),new KS(t.ast,!1,!0,{},void 0),r=>ae(n.decode(r)),Oo(n.encode))),uI=(e,t,n)=>qx(new GS(new Y9(e.ast,!0,!0,{},void 0),new KS(t.ast,!0,!0,{},void 0),n.decode,n.encode)),ove=(e,t)=>{const n=t==null?void 0:t.exact,r=t==null?void 0:t.default,i=t==null?void 0:t.nullable,a=(t==null?void 0:t.as)=="Option",s=t!=null&&t.onNoneEncoding?Ta(t.onNoneEncoding):ke;if(n){if(r)return i?qf(Po(Lr(e),ya(e),{decode:Dt({onNone:r,onSome:o=>o===null?r():o}),encode:ae}),r).ast:qf(Po(e,ya(e),{decode:Dt({onNone:r,onSome:ke}),encode:ae}),r).ast;if(a){const o=pI(ya(e));return i?Po(Lr(e),o,{decode:gf(x1),encode:s}).ast:Po(e,o,{decode:ke,encode:ke}).ast}else return i?uI(Lr(e),ya(e),{decode:gf(x1),encode:ke}).ast:new Gd(e.ast,!0,!0,{},void 0)}else{if(r)return i?qf(Po(e_(e),ya(e),{decode:Dt({onNone:r,onSome:o=>o??r()}),encode:ae}),r).ast:qf(Po(Om(e),ya(e),{decode:Dt({onNone:r,onSome:o=>o===void 0?r():o}),encode:ae}),r).ast;if(a){const o=pI(ya(e));return i?Po(e_(e),o,{decode:gf(l=>l!=null),encode:s}).ast:Po(Om(e),o,{decode:gf(ree),encode:s}).ast}else return i?uI(e_(e),Om(ya(e)),{decode:gf(x1),encode:ke}).ast:new Gd(Om(e).ast,!0,!0,{},void 0)}},Ie=e=>{const t=e.ast===Jk||e.ast===vN?Jk:Om(e).ast;return new ly(new Gd(t,!0,!0,{},void 0),e)},lve=R(e=>Ia(e[0]),(e,t)=>new ly(ove(e,t),e)),cve=E9([bN]),uve=(e,t)=>{const n=Reflect.ownKeys(e),r=[];if(n.length>0){const a=[],s=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],f=e[c];if(TN(f)){const u=f.ast;switch(u._tag){case"PropertySignatureDeclaration":{const d=u.type,h=u.isOptional,p=u.annotations;a.push(new sr(c,d,h,!0,cve(u))),s.push(new sr(c,xn(d),h,!0,p)),r.push(new sr(c,d,h,!0,p));break}case"PropertySignatureTransformation":{const d=u.from.fromKey??c;a.push(new sr(d,u.from.type,u.from.isOptional,!0,u.from.annotations)),s.push(new sr(c,u.to.type,u.to.isOptional,!0,u.to.annotations)),o.push(new vbe(d,c,u.decode,u.encode));break}}}else a.push(new sr(c,f.ast,!1,!0)),s.push(new sr(c,xn(f.ast),!1,!0)),r.push(new sr(c,f.ast,!1,!0))}if(cn(o)){const l=[],c=[];for(const f of t){const{indexSignatures:u,propertySignatures:d}=rI(f.key.ast,f.value.ast);d.forEach(h=>{a.push(h),s.push(new sr(h.name,xn(h.type),h.isOptional,h.isReadonly,h.annotations))}),u.forEach(h=>{l.push(h),c.push(new FS(h.parameter,xn(h.type),h.isReadonly))})}return new Dc(new Cl(a,l,{[cd]:"Struct (Encoded side)"}),new Cl(s,c,{[cd]:"Struct (Type side)"}),new tC(o))}}const i=[];for(const a of t){const{indexSignatures:s,propertySignatures:o}=rI(a.key.ast,a.value.ast);o.forEach(l=>r.push(l)),s.forEach(l=>i.push(l))}return new Cl(r,i)},X9=(e,t)=>{const n=Reflect.ownKeys(e);for(const r of n){const i=e[r];if(t[r]===void 0&&TN(i)){const a=i.ast,s=a._tag==="PropertySignatureDeclaration"?a.defaultValue:a.to.defaultValue;s!==void 0&&(t[r]=s())}}return t};function RN(e,t,n=uve(e,t)){var r;return r=class extends jt(n){static annotations(a){return RN(this.fields,this.records,Ha(this.ast,a))}static pick(...a){return ze(Gbe(e,...a))}static omit(...a){return ze(B9(e,...a))}},S(r,"fields",{...e}),S(r,"records",[...t]),S(r,"make",(a,s)=>{const o=X9(e,{...a});return YS(s)?o:qS(r)(o)}),r}function ze(e,...t){return RN(e,t)}const fve=e=>Rs(e).pipe(op,qf(()=>e)),dve=(e,t)=>ze({_tag:fve(e),...t});function Q9(e,t,n){var r;return r=class extends RN({},[{key:e,value:t}],n){static annotations(a){return Q9(e,t,Ha(this.ast,a))}},S(r,"key",e),S(r,"value",t),r}const hve=e=>Q9(e.key,e.value);function Z9(e,t){var n;return n=class extends jt(t){static annotations(i){return Z9(this.from,Ha(this.ast,i))}},S(n,"make",(i,a)=>YS(a)?i:qS(n)(i)),S(n,"from",e),n}const Mh=(e,t)=>n=>{const r=Dt(u9(n.ast),{onNone:()=>[e],onSome:a=>[...a,e]}),i=Nh(n.ast,$u({[X8]:r,...t}));return Z9(n,i)},cm=(e,t,n)=>{if(tI(e)&&tI(t)){const r=[...e.propertySignatures];for(const i of t.propertySignatures){const a=i.name,s=r.findIndex(o=>o.name===a);if(s===-1)r.push(i);else{const{isOptional:o,type:l}=r[s];r[s]=new sr(a,Vx(l,i.type,n.concat(a)),o,!0)}}return new Cl(r,e.indexSignatures.concat(t.indexSignatures))}throw new Error(W8(e,t,n))},mve=Ebe([oy]),um=(e,t)=>t.map(n=>new wN(n,e.filter,mve(e))),Vx=(e,t,n)=>yi.make(qs([e],[t],n)),yc=e=>US(e)?e.types:[e],qs=(e,t,n)=>Qv(e,r=>Qv(t,i=>{switch(i._tag){case"Literal":{if(ji(i.literal)&&Qk(r)||wo(i.literal)&&QD(r)||Td(i.literal)&&ZD(r))return[i];break}case"StringKeyword":{if(i===Xk){if(Qk(r)||ip(r)&&ji(r.literal))return[r];if(ud(r))return um(r,qs(yc(r.from),[i],n))}else if(r===Xk)return[i];break}case"NumberKeyword":{if(i===Zk){if(QD(r)||ip(r)&&wo(r.literal))return[r];if(ud(r))return um(r,qs(yc(r.from),[i],n))}else if(r===Zk)return[i];break}case"BooleanKeyword":{if(i===eC){if(ZD(r)||ip(r)&&Td(r.literal))return[r];if(ud(r))return um(r,qs(yc(r.from),[i],n))}else if(r===eC)return[i];break}case"Union":return qs(yc(r),i.types,n);case"Suspend":return[new tg(()=>Vx(r,i.f(),n))];case"Refinement":return um(i,qs(yc(r),yc(i.from),n));case"TypeLiteral":{switch(r._tag){case"Union":return qs(r.types,[i],n);case"Suspend":return[new tg(()=>Vx(r.f(),i,n))];case"Refinement":return um(r,qs(yc(r.from),[i],n));case"TypeLiteral":return[cm(r,i,n)];case"Transformation":{const a=r.transformation,s=cm(r.from,i,n),o=cm(r.to,xn(i),n);switch(a._tag){case"TypeLiteralTransformation":return[new Dc(s,o,new tC(a.propertySignatureTransformations))];case"ComposeTransformation":return[new Dc(s,o,S9)];case"FinalTransformation":return[new Dc(s,o,new x9((l,c,f,u)=>or(a.decode(l,c,f,u),d=>({...l,...d})),(l,c,f,u)=>or(a.encode(l,c,f,u),d=>({...l,...d}))))]}}}break}case"Transformation":{if(gbe(r)){if(nI(i.transformation)&&nI(r.transformation))return[new Dc(cm(r.from,i.from,n),cm(r.to,i.to,n),new tC(i.transformation.propertySignatureTransformations.concat(r.transformation.propertySignatureTransformations)))]}else return qs([i],[r],n);break}}throw new Error(W8(r,i,n))})),e7=R(2,(e,t)=>jt(Vx(e.ast,t.ast,[]))),Ic=R(e=>Ia(e[1]),(e,t)=>NN(e,t,Cbe(e.ast,t.ast))),pve=e=>jt(new tg(()=>e().ast)),t7=Symbol.for("effect/SchemaId/Refine");function n7(e,t,n){var r,i,a;return a=class extends(i=jt(n),r=t7,i){static annotations(o){return n7(this.from,this.filter,Ha(this.ast,o))}},S(a,r,e),S(a,"from",e),S(a,"filter",t),S(a,"make",(o,l)=>YS(l)?o:qS(a)(o)),a}const fI=(e,t,n)=>{if(Td(e))return e?ne():ae(new on(t,n));if(ji(e))return ae(new on(t,n,e));if(e!==void 0){if("_tag"in e)return ae(e);const r=new on(t,n,e.message);return ae(cn(e.path)?new rr(e.path,n,r):r)}return ne()},gve=(e,t,n)=>{if(_ye(e))return fI(e,t,n);if(cn(e)){const r=rne(e,i=>fI(i,t,n));if(cn(r))return ae(r.length===1?r[0]:new nn(t,n,r))}return ne()};function AN(e,t){return n=>{function r(a,s,o){return gve(e(a,s,o),o,a)}const i=new wN(n.ast,r,$u(t));return n7(n,r,i)}}function NN(e,t,n){var r;return r=class extends jt(n){static annotations(a){return NN(this.from,this.to,Ha(this.ast,a))}},S(r,"from",e),S(r,"to",t),r}const Hl=R(e=>Ia(e[0])&&Ia(e[1]),(e,t,n)=>NN(e,t,new Dc(e.ast,t.ast,new x9(n.decode,n.encode)))),rc=R(e=>Ia(e[0])&&Ia(e[1]),(e,t,n)=>Hl(e,t,{strict:!0,decode:(r,i,a,s)=>kr(n.decode(r,s)),encode:(r,i,a,s)=>kr(n.encode(r,s))})),dI=e=>e instanceof Error?e.message:String(e),yve=e=>Hl(P.annotations({description:"a string to be decoded into JSON"}),VS,{strict:!0,decode:(t,n,r)=>Ux({try:()=>JSON.parse(t,e==null?void 0:e.reviver),catch:i=>new on(r,t,dI(i))}),encode:(t,n,r)=>Ux({try:()=>JSON.stringify(t,e==null?void 0:e.replacer,e==null?void 0:e.space),catch:i=>new on(r,t,dI(i))})}).annotations({title:"parseJson",schemaId:Kye}),ON=(e,t)=>Ia(e)?Ic(ON(t),e):yve(e),bve=Aye,vve=(e,t)=>n=>n.pipe(AN(r=>r>=e,{schemaId:bve,title:`greaterThanOrEqualTo(${e})`,description:"a non-negative number",jsonSchema:{minimum:e},...t})),xve=Nye,r7=(e,t,n)=>r=>r.pipe(AN(i=>i>=e&&i<=t,{schemaId:xve,title:`between(${e}, ${t})`,description:`a number between ${e} and ${t}`,jsonSchema:{minimum:e,maximum:t},...n}));function Sve(e){return Hl(e,vt,{strict:!1,decode:(t,n,r)=>Abe(Nse(t),()=>new on(r,t,`Unable to decode ${JSON.stringify(t)} into a number`)),encode:t=>kr(String(t))})}class lp extends Sve(P.annotations({description:"a string to be decoded into a number"})).annotations({identifier:"NumberFromString"}){}const wve=(e,t)=>{const n=Symbol.keyFor(e);return n===void 0?lo(new on(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):kr(n)},_ve=e=>kr(Symbol.for(e)),i7=(e,t,n,r)=>Nbe(e,{onFailure:i=>new nn(n,r,i),onSuccess:t});class Eve extends Oh(see,{typeConstructor:{_tag:"Uint8Array"},identifier:"Uint8ArrayFromSelf",pretty:()=>t=>`new Uint8Array(${JSON.stringify(Array.from(t))})`,arbitrary:()=>t=>t.uint8Array(),equivalence:()=>V0(xe)}){}const hI=Rye;class go extends Oh(Z4,{typeConstructor:{_tag:"Date"},identifier:"DateFromSelf",schemaId:hI,[hI]:{noInvalidDate:!1},description:"a potentially invalid Date instance",pretty:()=>t=>`new Date(${JSON.stringify(t)})`,arbitrary:()=>t=>t.date({noInvalidDate:!1}),equivalence:()=>lte}){}class ev extends rc(P.annotations({description:"a string to be decoded into a Date"}),go,{strict:!0,decode:t=>new Date(t),encode:t=>a5(t)}).annotations({identifier:"DateFromString"}){}const kve=e=>e._tag==="None"?ne():ae(e.value),Cve=(e,t)=>n=>n.oneof(t,n.record({_tag:n.constant("None")}),n.record({_tag:n.constant("Some"),value:e(n)})).map(kve),Tve=e=>Dt({onNone:()=>"none()",onSome:t=>`some(${e(t)})`}),mI=e=>(t,n,r)=>Ete(t)?Yt(t)?kr(ne()):i7(e(t.value,n),ae,r,t):lo(new on(r,t)),pI=e=>Oh([e],{decode:t=>mI(EN(t)),encode:t=>mI(HS(t))},{typeConstructor:{_tag:"effect/Option"},pretty:Tve,arbitrary:Cve,equivalence:Ote}),Rve=(e,t)=>n=>{const r=n.array(e(n));return(t.depthIdentifier!==void 0?n.oneof(t,n.constant([]),r):r).map(_o)},Ave=e=>t=>`Chunk(${Br(t).map(e).join(", ")})`,gI=e=>(t,n,r)=>K0(t)?G0(t)?kr(Fn()):i7(e(Br(t),n),_o,r,t):lo(new on(r,t)),Nve=e=>Oh([e],{decode:t=>gI(EN(Gt(t))),encode:t=>gI(HS(Gt(t)))},{typeConstructor:{_tag:"effect/Chunk"},description:`Chunk<${Ybe(e)}>`,pretty:Ave,arbitrary:Rve,equivalence:B5});function a7(e){return rc(Gt(e),Nve(ya(e)),{strict:!0,decode:t=>t.length===0?Fn():_o(t),encode:t=>Br(t)})}const Ove=e=>Ia(e)||TN(e),s7=e=>Reflect.ownKeys(e).every(t=>Ove(e[t])),MN=e=>"fields"in e?e.fields:MN(e[t7]),jN=e=>s7(e)?ze(e):Ia(e)?e:ze(MN(e)),DN=e=>s7(e)?e:MN(e),jh=e=>(t,n)=>cp({kind:"Class",identifier:e,schema:jN(t),fields:DN(t),Base:GA,annotations:n}),Mve=e=>qf(op(Rs(e)),()=>e),o7=e=>(t,n,r)=>{class i extends YA{}i.prototype.name=t;const a=DN(n),s=jN(n),o={_tag:Mve(t)},l=tv(o,a),c="message"in l;class f extends cp({kind:"TaggedError",identifier:t,schema:e7(s,ze(o)),fields:l,Base:i,annotations:r,disableToString:!0}){}return S(f,"_tag",t),c||Object.defineProperty(f.prototype,"message",{get(){return`{ ${Reflect.ownKeys(a).map(u=>`${P0(u)}: ${No(this[u])}`).join(", ")} }`},enumerable:!1,configurable:!0}),f},tv=(e,t)=>{const n={...e};for(const r of Reflect.ownKeys(t)){if(r in e)throw new Error(J8(r));n[r]=t[r]}return n};function YS(e){return Td(e)?e:(e==null?void 0:e.disableValidation)??!1}const yI=De("effect/Schema/astCache",()=>new WeakMap),jve=e=>e===void 0?[]:Array.isArray(e)?e:[e],cp=({Base:e,annotations:t,disableToString:n,fields:r,identifier:i,kind:a,schema:s})=>{var w,E;const o=Symbol.for(`effect/Schema/${a}/${i}`),[l,c,f]=jve(t),u=ya(s),d=u.annotations({identifier:i,...l}),h=u.annotations({[cd]:`${i} (Type side)`,...l}),p=s.annotations({[cd]:`${i} (Constructor)`,...l}),b=s.annotations({[cd]:`${i} (Encoded side)`,...f}),x=s.annotations({...f,...l,...c}),g=C=>Re(C,o)&&Dbe(h)(C),v=(E=class extends e{constructor(C={},k=!1){C={...C},a!=="Class"&&delete C._tag,C=X9(r,C),YS(k)||(C=qS(p)(C)),super(C,!0)}static get ast(){let C=yI.get(this);if(C)return C;const k=Oh([s],{decode:()=>(_,A,D)=>_ instanceof this||g(_)?kr(_):lo(new on(D,_)),encode:()=>(_,A)=>_ instanceof this?kr(_):or(HS(h)(_,A),D=>new this(D,!0))},{identifier:i,pretty:_=>A=>`${i}(${_(A)})`,arbitrary:_=>A=>_(A).map(D=>new this(D)),equivalence:ke,[Lx]:d.ast,...l});return C=rc(b,k,{strict:!0,decode:_=>new this(_,!0),encode:ke}).annotations({[Lx]:x.ast,...c}).ast,yI.set(this,C),C}static pipe(){return he(this,arguments)}static annotations(C){return jt(this.ast).annotations(C)}static toString(){return`(${String(b)} <-> ${i})`}static make(...C){return new this(...C)}static extend(C){return(k,_)=>{const A=DN(k),D=jN(k),O=tv(r,A);return cp({kind:a,identifier:C,schema:e7(s,D),fields:O,Base:this,annotations:_})}}static transformOrFail(C){return(k,_,A)=>{const D=tv(r,k);return cp({kind:a,identifier:C,schema:Hl(s,ya(ze(D)),_),fields:D,Base:this,annotations:A})}}static transformOrFailFrom(C){return(k,_,A)=>{const D=tv(r,k);return cp({kind:a,identifier:C,schema:Hl(Wbe(s),ze(D),_),fields:D,Base:this,annotations:A})}}get[(w=Kd,o)](){return o}},S(E,w,iC),S(E,"fields",{...r}),S(E,"identifier",i),E);return n!==!0&&Object.defineProperty(v.prototype,"toString",{value(){return`${i}({ ${Reflect.ownKeys(r).map(C=>`${P0(C)}: ${No(this[C])}`).join(", ")} })`},configurable:!0,writable:!0}),v},bI=dve("symbol",{key:P}).annotations({description:"an object to be decoded into a globally shared symbol"}),Dve=Hl(bI,nve,{strict:!0,decode:e=>_ve(e.key),encode:(e,t,n)=>or(wve(e,n),r=>bI.make({key:r}))});class Ive extends Lu(P,vt,Dve).annotations({identifier:"PropertyKey"}){}class zve extends ze({_tag:op(Rs("Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden")).annotations({description:"The tag identifying the type of parse issue"}),path:op(Gt(Ive)).annotations({description:"The path to the property where the issue occurred"}),message:op(P).annotations({description:"A descriptive message explaining the issue"})}).annotations({identifier:"ArrayFormatterIssue",description:"Represents an issue returned by the ArrayFormatter formatter"}){}const l7=(e,t)=>{class n extends YA{constructor(){super(...arguments);S(this,"_tag",t)}}return n.prototype[e]=e,n.prototype.name=t,n},$ve=Aa,Lve=Rh,Pve=k8,Fve=cN,vI=uN,Uve=_ge,c7=Symbol.for("effect/Subscribable"),u7=e=>Re(e,c7),Bve="effect/SubscriptionRef",Hve=Symbol.for(Bve),qve=R(2,(e,t)=>M(Fle(e.ref,t),iN(wpe(e.pubsub,t)),e.semaphore.withPermits(1))),sC=Hve,xI=qve,Vve="~effect-atom/atom/Result",WS={[Vve]:{E:ke,A:ke},pipe(){return he(this,arguments)},[Ue](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return xe(this.value,e.value);case"Failure":return xe(this.cause,e.cause)}},[Fe](){const e=qt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?Tt(this,e):Tt(this,Be(e)(this._tag==="Success"?de(this.value):de(this.cause)))}},f7=(e,t)=>e._tag==="Success"?pu(e.value):cy(e.cause,{previous:t}),IN=e=>e._tag==="None"?Rl(!0):JS(e.value),SI=e=>e._tag==="Initial",Kve=e=>e._tag!=="Initial",Rl=(e=!1)=>{const t=Object.create(WS);return t._tag="Initial",t.waiting=e,t},bs=e=>e._tag==="Success",pu=(e,t)=>{const n=Object.create(WS);return n._tag="Success",n.value=e,n.waiting=(t==null?void 0:t.waiting)??!1,n.timestamp=(t==null?void 0:t.timestamp)??Date.now(),n},Mm=e=>e._tag==="Failure",Gve=(e,t)=>{const n=Object.create(WS);return n._tag="Failure",n.cause=e,n.previousSuccess=(t==null?void 0:t.previousSuccess)??ne(),n.waiting=(t==null?void 0:t.waiting)??!1,n},cy=(e,t)=>Gve(e,{previousSuccess:Oo(t.previous,n=>bs(n)?ae(n):Mm(n)?n.previousSuccess:ne()),waiting:t.waiting}),Yve=(e,t)=>cy(U6(e),t),JS=(e,t)=>{if(e.waiting)return t!=null&&t.touch?Wve(e):e;const n=Object.assign(Object.create(WS),e);return n.waiting=!0,n},Wve=e=>bs(e)?pu(e.value,{waiting:e.waiting}):e,jm=(e,t)=>e._tag==="Failure"?cy(e.cause,{previous:t,waiting:e.waiting}):e,d7=e=>e._tag==="Success"?ae(e.value):e._tag==="Failure"?ii(e.previousSuccess,t=>t.value):ne(),oC=e=>O5(d7(e),()=>new Ch("Result.getOrThrow: no value found")),Kx=e=>{switch(e._tag){case"Success":return xi(e.value);case"Failure":return Er(e.cause);default:return bx(new Ch)}},Wc=e=>new Jve(e);class Jve{constructor(t){S(this,"result");S(this,"output",ne());this.result=t}when(t,n){if(Yt(this.output)&&t(this.result)){const r=n(this.result);zt(r)&&(this.output=r)}return this}pipe(){return he(this,arguments)}onWaiting(t){return this.when(n=>n.waiting,n=>ae(t(n)))}onInitialOrWaiting(t){return this.when(n=>SI(n)||n.waiting,n=>ae(t(n)))}onInitial(t){return this.when(SI,n=>ae(t(n)))}onSuccess(t){return this.when(bs,n=>ae(t(n.value,n)))}onFailure(t){return this.when(Mm,n=>ae(t(n.cause,n)))}onError(t){return this.onErrorIf(HE,t)}onErrorIf(t,n){return this.when(Mm,r=>Yfe(r.cause).pipe(gf(t),ii(i=>n(i,r))))}onErrorTag(t,n){return this.onErrorIf(r=>Re(r,"_tag")&&(Array.isArray(t)?t.includes(r._tag):r._tag===t),n)}onDefect(t){return this.when(Mm,n=>Jfe(n.cause).pipe(ii(r=>t(r,n))))}orElse(t){return Ut(this.output,t)}orNull(){return Tte(this.output)}render(){if(zt(this.output))return this.output.value;if(Mm(this.result))throw HA(this.result.cause);return null}}const Xve={immediate:!0},Qve=e=>{e()},t_="~effect-atom/atom/Registry",Zve=e=>new exe(e==null?void 0:e.initialValues,e==null?void 0:e.scheduleTask,e==null?void 0:e.timeoutResolution,e==null?void 0:e.defaultIdleTTL),lC="~effect-atom/atom/Atom/Serializable",fm=e=>lC in e?e[lC].key:e;var oP,$c;oP=t_;class exe{constructor(t,n=a=>queueMicrotask(a),r,i){S(this,"scheduleTask");S(this,"defaultIdleTTL");S(this,oP);S(this,"timeoutResolution");S(this,"nodes",new Map);S(this,"preloadedSerializable",new Map);S(this,"timeoutBuckets",new Map);S(this,"nodeTimeoutBucket",new Map);S(this,"disposed",!1);S(this,"refresh",t=>{t.refresh!==void 0?t.refresh(this.refresh):this.invalidateAtom(t)});S(this,"invalidateAtom",t=>{this.ensureNode(t).invalidate()});Nw(this,$c,null);if(this.scheduleTask=n,this.defaultIdleTTL=i,this[t_]=t_,r===void 0&&i!==void 0?this.timeoutResolution=Math.round(i/2):this.timeoutResolution=r??1e3,t!==void 0)for(const[a,s]of t)this.ensureNode(a).setValue(s)}getNodes(){return this.nodes}get(t){return this.ensureNode(t).value()}set(t,n){t.write(this.ensureNode(t).writeContext,n)}setSerializable(t,n){this.preloadedSerializable.set(t,n)}modify(t,n){const r=this.ensureNode(t),i=n(r.value());return t.write(r.writeContext,i[1]),i[0]}update(t,n){const r=this.ensureNode(t);t.write(r.writeContext,n(r.value()))}subscribe(t,n,r){const i=this.ensureNode(t);r!=null&&r.immediate&&n(i.value());const a=i.subscribe(function(){n(i._value)});return()=>{a(),i.canBeRemoved&&this.scheduleNodeRemoval(i)}}mount(t){return this.subscribe(t,Cd,Xve)}atomHasTtl(t){return!t.keepAlive&&t.idleTTL!==0&&(t.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(t){const n=fm(t);let r=this.nodes.get(n);if(r===void 0?(r=this.createNode(t),this.nodes.set(n,r)):this.atomHasTtl(t)&&this.removeNodeTimeout(r),typeof n=="string"&&this.preloadedSerializable.has(n)){const i=this.preloadedSerializable.get(n);this.preloadedSerializable.delete(n);const a=t[lC].decode(i);r.setValue(a)}return r}createNode(t){if(this.disposed)throw new Error(`Cannot access Atom ${t}: registry is disposed`);return t.keepAlive||this.scheduleAtomRemoval(t),new txe(this,t)}scheduleAtomRemoval(t){this.scheduleTask(()=>{const n=this.nodes.get(fm(t));n!==void 0&&n.canBeRemoved&&this.removeNode(n)})}scheduleNodeRemoval(t){this.scheduleTask(()=>{t.canBeRemoved&&this.removeNode(t)})}removeNode(t){this.atomHasTtl(t.atom)?this.setNodeTimeout(t):(this.nodes.delete(fm(t.atom)),t.remove())}setNodeTimeout(t){if(this.nodeTimeoutBucket.has(t))return;let n=t.atom.idleTTL??this.defaultIdleTTL;if(Ry(this,$c)!==null&&(n-=Ry(this,$c),n<=0)){this.nodes.delete(fm(t.atom)),t.remove();return}const r=Math.ceil(n/this.timeoutResolution)*this.timeoutResolution,i=Date.now()+r,a=i-i%this.timeoutResolution+this.timeoutResolution;let s=this.timeoutBuckets.get(a);s===void 0&&(s=[new Set,setTimeout(()=>this.sweepBucket(a),a-Date.now())],this.timeoutBuckets.set(a,s)),s[0].add(t),this.nodeTimeoutBucket.set(t,a)}removeNodeTimeout(t){const n=this.nodeTimeoutBucket.get(t);if(n===void 0)return;this.nodeTimeoutBucket.delete(t),this.scheduleNodeRemoval(t);const[r,i]=this.timeoutBuckets.get(n);r.delete(t),r.size===0&&(clearTimeout(i),this.timeoutBuckets.delete(n))}sweepBucket(t){const n=this.timeoutBuckets.get(t)[0];this.timeoutBuckets.delete(t),n.forEach(r=>{this.nodeTimeoutBucket.delete(r),r.canBeRemoved&&(this.nodes.delete(fm(r.atom)),Ay(this,$c,r.atom.idleTTL??this.defaultIdleTTL),r.remove(),Ay(this,$c,null))})}reset(){this.timeoutBuckets.forEach(([,t])=>clearTimeout(t)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(t=>t.remove()),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}}$c=new WeakMap;var Vf;(function(e){e[e.alive=1]="alive",e[e.initialized=2]="initialized",e[e.waitingForValue=4]="waitingForValue"})(Vf||(Vf={}));var Sa;(function(e){e[e.uninitialized=5]="uninitialized",e[e.stale=7]="stale",e[e.valid=3]="valid",e[e.removed=0]="removed"})(Sa||(Sa={}));let txe=class{constructor(t,n){S(this,"registry");S(this,"atom");S(this,"state",Sa.uninitialized);S(this,"lifetime");S(this,"writeContext");S(this,"parents",[]);S(this,"previousParents");S(this,"children",[]);S(this,"listeners",new Set);S(this,"skipInvalidation",!1);S(this,"_value");this.registry=t,this.atom=n,this.writeContext=new axe(t,this)}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}value(){if(this.state&Vf.waitingForValue){this.lifetime=ixe(this);const t=this.atom.read(this.lifetime);if(this.state&Vf.waitingForValue&&this.setValue(t),this.previousParents){const n=this.previousParents;this.previousParents=void 0;for(let r=0;r<n.length;r++)n[r].removeChild(this),n[r].canBeRemoved&&this.registry.scheduleNodeRemoval(n[r])}}return this._value}valueOption(){return this.state&Vf.initialized?ae(this._value):ne()}setValue(t){if(!(this.state&Vf.initialized)){this.state=Sa.valid,this._value=t,vn.phase===ss.collect?vn.notify.add(this):this.notify();return}this.state=Sa.valid,!xe(this._value,t)&&(this._value=t,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(vn.phase===ss.collect?vn.notify.add(this):this.notify()))}addParent(t){if(this.parents.push(t),this.previousParents!==void 0){const n=this.previousParents.indexOf(t);n!==-1&&(this.previousParents[n]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}t.children.indexOf(this)===-1&&(t.children.push(this),t.skipInvalidation&&(t.skipInvalidation=!1))}removeChild(t){const n=this.children.indexOf(t);n!==-1&&(this.children[n]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===Sa.valid&&(this.state=Sa.stale,this.disposeLifetime()),vn.phase===ss.collect?vn.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!nxe(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;const t=this.children;this.children=[];for(let n=0;n<t.length;n++)t[n].invalidate()}notify(){this.listeners.forEach(Qve),vn.phase===ss.commit&&vn.notify.delete(this)}disposeLifetime(){this.lifetime!==void 0&&(this.lifetime.dispose(),this.lifetime=void 0),this.parents.length!==0&&(this.previousParents=this.parents,this.parents=[])}remove(){if(this.state=Sa.removed,this.listeners.clear(),this.lifetime===void 0||(this.disposeLifetime(),this.previousParents===void 0))return;const t=this.previousParents;this.previousParents=void 0;for(let n=0;n<t.length;n++)t[n].removeChild(this),t[n].canBeRemoved&&this.registry.removeNode(t[n])}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}};function nxe(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let i=0,a=t.length;i<a;i++){const s=t[i];if(!s.atom.lazy||s.listeners.size>0)return!0;s.children.length>0&&(n===void 0?n=[s.children]:n.push(s.children))}t=n==null?void 0:n[r++]}return!1}const ir=e=>new Error(`Cannot use context of disposed Atom: ${e}`),rxe={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)throw ir(this.node.atom);this.finalizers??(this.finalizers=[]),this.finalizers.push(e)},get(e){if(this.disposed)throw ir(this.node.atom);const t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed)throw ir(this.node.atom);if(this.isFn)return this.resultOnce(e,t);const n=this.get(e);if(t!=null&&t.suspendOnWaiting&&n.waiting)return I1;switch(n._tag){case"Initial":return I1;case"Failure":return Er(n.cause);case"Success":return Vt(n.value)}},resultOnce(e,t){if(this.disposed)throw ir(this.node.atom);return Ax(n=>{const r=this.once(e);if(r._tag!=="Initial"&&!(t!=null&&t.suspendOnWaiting&&r.waiting))return n(Kx(r));const i=this.node.registry.subscribe(e,a=>{a._tag==="Initial"||t!=null&&t.suspendOnWaiting&&a.waiting||(i(),n(Kx(a)))},{immediate:!1});return Nt(i)})},setResult(e,t){if(this.disposed)throw ir(this.node.atom);return this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0})},some(e){if(this.disposed)throw ir(this.node.atom);if(this.isFn)return this.someOnce(e);const t=this.get(e);return t._tag==="None"?I1:Vt(t.value)},someOnce(e){if(this.disposed)throw ir(this.node.atom);return Ax(t=>{const n=this.once(e);if(zt(n))return t(Vt(n.value));const r=this.node.registry.subscribe(e,i=>{Yt(i)||(r(),t(Vt(i.value)))},{immediate:!1});return Nt(r)})},once(e){if(this.disposed)throw ir(this.node.atom);return this.node.registry.get(e)},self(){if(this.disposed)throw ir(this.node.atom);return this.node.valueOption()},refresh(e){if(this.disposed)throw ir(this.node.atom);this.node.registry.refresh(e)},refreshSelf(){if(this.disposed)throw ir(this.node.atom);this.node.invalidate()},mount(e){if(this.disposed)throw ir(this.node.atom);this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){if(this.disposed)throw ir(this.node.atom);this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){if(this.disposed)throw ir(this.node.atom);this.node.setValue(e)},set(e,t){if(this.disposed)throw ir(this.node.atom);this.node.registry.set(e,t)},stream(e,t){if(this.disposed)throw ir(this.node.atom);return M(Mx(LH((t==null?void 0:t.bufferSize)??16),zx),CH(n=>Mx(Nt(()=>this.node.registry.subscribe(e,r=>{Cpe(n,r)},{immediate:(t==null?void 0:t.withoutInitialValue)!==!0})),r=>Nt(r))),bt(n=>fye(n)),U8)},streamResult(e,t){return M(this.stream(e,t),cye(Kve),uye(n=>n._tag==="Success"?mye(n.value):lye(n.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;const e=this.finalizers;this.finalizers=void 0;for(let t=e.length-1;t>=0;t--)e[t]()}},ixe=e=>{function t(n){if(t.disposed)throw ir(n);if(t.isFn)return e.registry.get(n);const r=e.registry.ensureNode(n),i=r.value();return e.addParent(r),i}return Object.setPrototypeOf(t,rxe),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t};class axe{constructor(t,n){S(this,"registry");S(this,"node");this.registry=t,this.node=n}get(t){return this.registry.get(t)}set(t,n){return this.registry.set(t,n)}setSelf(t){return this.node.setValue(t)}refreshSelf(){return this.node.invalidate()}}var ss;(function(e){e[e.disabled=0]="disabled",e[e.collect=1]="collect",e[e.commit=2]="commit"})(ss||(ss={}));const vn=De("@effect-atom/atom/Registry/batchState",()=>({phase:ss.disabled,depth:0,stale:[],notify:new Set}));function sxe(e){vn.phase=ss.collect,vn.depth++;try{if(e(),vn.depth===1){for(let t=0;t<vn.stale.length;t++)h7(vn.stale[t]);vn.phase=ss.commit;for(const t of vn.notify)t.notify();vn.notify.clear()}}finally{vn.depth--,vn.depth===0&&(vn.phase=ss.disabled,vn.stale=[])}}function h7(e){if(e.state!==Sa.valid){for(let t=0;t<e.parents.length;t++){const n=e.parents[t];n.state!==Sa.valid&&h7(n)}e.state!==Sa.valid&&e.value()}}const oxe=e=>{const t=e;switch(t._tag){case"Failure":case"Success":return t;case"Left":return bx(t.left);case"Right":return xi(t.right);case"Some":return xi(t.value);case"None":return bx(new Ch)}},zN=e=>{const t=jS(e);return(n,r,i=!1)=>{const a=oxe(n);if(a){r(a);return}const s=new AA,o=t(n,{scheduler:s});s.flush();const l=o.unsafePoll();if(l){r(l);return}o.addObserver(r);function c(){o.removeObserver(r),i||o.unsafeInterruptAsFork(Ti)}return c}},lxe="~effect-atom/atom/Registry",cxe=e=>Re(e,lxe),uxe=Zve;class m7 extends AR("@effect/atom/Registry/CurrentRegistry")(){}const fxe=R(e=>cxe(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.suspendOnWaiting)??!1;return Ax(i=>{const a=e.get(t);if(a._tag!=="Initial"&&!(r&&a.waiting))return i(Kx(a));const s=e.subscribe(t,o=>{o._tag!=="Initial"&&!(r&&o.waiting)&&(i(Kx(o)),s())});return Nt(s)})}),cC="~effect-atom/atom/Atom",uC="~effect-atom/atom/Atom/Writable",p7=R(2,(e,t)=>{const n=sa(t),r=mU(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?rx(n):void 0})}),rg=p7(0),$N={[cC]:cC,pipe(){return he(this,arguments)},toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}},toString(){return Mt(this)},[ut](){return this.toJSON()}},dxe={...$N,atom(e,t){const n=g7(e,t);return os(r=>{const i=r.self(),a=r(this);return a._tag!=="Success"?jm(a,i):n(r,a.value)})},fn(e,t){return arguments.length===0?(n,r)=>wI(this,n,r):wI(this,e,t)},pull(e,t){const n=rg(Gx(0)),r=os(i=>{const a=i.self(),s=i(this);return s._tag!=="Success"?jm(s,a):up(i,_xe(i,n,e,t),Rl(!0),s.value)});return Exe(n,r)},subscriptionRef(e){return bxe(rg(os(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return jm(r,n);const i=typeof e=="function"?e(t):e;return sC in i?i:up(t,i,Rl(!0),r.value)})),(t,n)=>{const r=oC(t(this));return kI(t,n,r)})},subscribable(e){return vxe(os(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return jm(r,n);const i=typeof e=="function"?e(t):e;return u7(i)?i:up(t,i,Rl(!0),r.value)}),(t,n)=>{const r=oC(t(this));return kI(t,n,r)})}},wI=(e,t,n)=>{const[r,i,a]=Sxe(n!=null&&n.reactivityKeys?(s,o)=>{const l=t(s,o);return tc(l)?B8(l,n.reactivityKeys):P8(l,bye(n.reactivityKeys))}:t,n);return uy(s=>{s.get(a);const o=s.self(),l=s.get(e);return l._tag!=="Success"?jm(l,o):r(s,l.value)},i)},hxe={...$N,[uC]:uC},mxe=e=>uC in e,os=(e,t)=>{const n=Object.create($N);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},uy=(e,t,n)=>{const r=Object.create(hxe);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function pxe(e,t){e.setSelf(t)}const Dh=(e,t)=>{const n=g7(e,t);return cC in n?n:os(n)},_I=e=>_te in e||mte in e,g7=(e,t)=>{if(typeof e=="function"&&!tc(e)&&!(K1 in e)){const n=e;return function(r,i){const a=n(r);if(Oa(a)){if(_I(a))return a;if(Pk in a)return fC(r,a,t,i);if(K1 in a)return EI(r,a,t,i)}return a}}else if(Oa(e)){if(_I(e))return Gx(e);if(Pk in e)return function(n,r){return fC(n,e,t,r)};if(K1 in e)return function(n,r){return EI(n,e,t,r)}}return Gx(e)},Gx=e=>uy(function(t){return e},pxe),fC=(e,t,n,r)=>{const i=(n==null?void 0:n.initialValue)!==void 0?pu(n.initialValue):Rl();return up(e,t,i,r,n==null?void 0:n.uninterruptible)};function up(e,t,n,r=DS,i=!1){const a=e.self(),s=na(W6());e.addFinalizer(()=>{rN(Rx(s,MA))});const o=new Map(r.context.unsafeMap);o.set(Rde.key,s),o.set(m7.key,e.registry);const l=aN({context:nte(o),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags});let c,f=!1;const u=zN(l)(t,function(d){c=f7(d,a),f&&e.setSelf(c)},i);return f=!0,u!==void 0&&e.addFinalizer(u),c!==void 0?c:a._tag==="Some"?IN(a):JS(n)}const gxe=e=>{let t=G1;function n(i){const a=Object.create(dxe);a.keepAlive=!1,a.lazy=!0,a.refresh=void 0,a.factory=n;const s=Pu(os(typeof i=="function"?o=>L1(i(o),t):()=>L1(i,t)));return a.layer=s,a.read=function(l){const c=l(s),f=Te(Te(OS,u=>jD(c,e.memoMap,u)),u=>jx(ny(),u));return fC(l,f,{uninterruptible:!0})},a}n.memoMap=e.memoMap,n.addGlobalLayer=i=>{t=L1(t,OH(i,G1))};const r=rg(Dh(xme(i=>jD(G1,e.memoMap,i)).pipe(bt(mo(sy)))));return n.withReactivity=i=>a=>kxe(a,s=>{const o=oC(s(r));return s.addFinalizer(o.unsafeRegister(i,()=>{s.refresh(a)})),s.subscribe(a,l=>s.setSelf(l)),s.once(a)}),n},yxe=De("@effect-atom/atom/Atom/defaultMemoMap",()=>na(Vme)),LN=De("@effect-atom/atom/Atom/defaultContext",()=>gxe({memoMap:yxe}));LN.withReactivity;const EI=(e,t,n,r)=>{const i=(n==null?void 0:n.initialValue)!==void 0?pu(n.initialValue):Rl();return PN(e,t,i,r)};function PN(e,t,n,r=DS){const i=e.self(),a=Lve({onInput(l){return Fve(()=>{const c=dne(l);return c._tag==="Some"&&e.setSelf(pu(c.value,{waiting:!0})),a})},onFailure(l){return vI(()=>{e.setSelf(cy(l,{previous:e.self()}))})},onDone(l){return vI(()=>{M(e.self(),Oo(d7),Dt({onNone:()=>e.setSelf(Yve(new Ch,{previous:e.self()})),onSome:c=>e.setSelf(pu(c))}))})}}),s=aN({context:Xi(r.context,m7,e.registry),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags}),o=zN(s)(Pve($ve(F8(t),a)),Cd,!1);return o!==void 0&&e.addFinalizer(o),i._tag==="Some"?IN(i):JS(n)}const kI=(e,t,n=DS)=>c7 in t?(e.addFinalizer(t.changes.pipe(hye(r=>(e.setSelf(r),lt)),Ime(n))),Dme(n)(t.get)):t._tag!=="Success"?t:PN(e,t.value.changes,Rl(!0),n),bxe=(e,t)=>{function n(r,i){const a=r.get(e);sC in a?na(xI(a,i)):bs(a)&&na(xI(a.value,i))}return uy(r=>{const i=r(e);return sC in i||bs(i)?t(r,i):i},n)},vxe=(e,t)=>os(n=>{const r=n(e);return u7(r)||bs(r)?t(n,r):r}),xxe=Symbol.for("@effect-atom/atom/Atom/Reset"),n_=Symbol.for("@effect-atom/atom/Atom/Interrupt");function Sxe(e,t){const n=rg(Gx([0,void 0])),r=(t==null?void 0:t.initialValue)!==void 0?pu(t.initialValue):Rl(),i=t!=null&&t.concurrent?rg(os(o=>{const l=new Set;return o.addFinalizer(()=>l.forEach(c=>c.unsafeInterruptAsFork(Ti))),l})):void 0;function a(o,l){const c=i?o(i):void 0;o.isFn=!0;const[f,u]=o.get(n);if(f===0)return r;if(u===n_)return cy(B6(Ti),{previous:o.self()});let d=e(u,o);if(Pk in d){if(c){const h=d;d=Te(ny(),p=>{const b=jS(p,h);c.add(b);const x=Array.from(c);return b.addObserver(()=>c.delete(b)),wxe(x)})}return up(o,d,r,l,!1)}return PN(o,d,r,l)}function s(o,l){Cxe(()=>{l===xxe?o.set(n,[0,void 0]):l===n_?o.set(n,[o.get(n)[0]+1,n_]):o.set(n,[o.get(n)[0]+1,l]),o.refreshSelf()})}return[a,s,n]}const wxe=e=>Ax(t=>{let n=0,r,i;function a(o,l=!1){o._tag==="Failure"?r=r?Hfe(o.cause,r):o.cause:r||(i=o),n++,l||s()}function s(){for(;n<e.length;){const o=e[n],l=o.unsafePoll();if(!l)return o.addObserver(a);a(l,!0)}t(r?Er(r):i||Er(Bfe))}return s(),Nt(()=>{n<e.length&&e[n].removeObserver(a)})}),_xe=(e,t,n,r)=>Te(Uve(F8(typeof n=="function"?n(e):n)),i=>{const a=Tme(1),s=Ate(Yde()),o=s.currentContext;let l=Fn();const c=Te(kme(fn(()=>i),MH,o),ri({onLeft:()=>{const h=Br(l);return ed(h)?Vt({done:!0,items:h}):Ts(new Ch("Atom.pull: no items"))},onRight(h){let p;r!=null&&r.disableAccumulation?p=h:(p=kn(l,h),l=p);const b=Br(p);return ed(b)?Vt({done:!1,items:b}):c}})),f=a.withPermits(1)(c),u=zN(aN({context:o,fiberRefs:s.getFiberRefs(),runtimeFlags:DS.runtimeFlags})),d=new Set;return e.addFinalizer(()=>{for(const h of d)h()}),e.once(t),e.subscribe(t,()=>{e.setSelf(IN(e.self()));let h;h=u(f,p=>{h&&d.delete(h);const b=f7(p,e.self()),x=d.size>0;e.setSelf(x?JS(b):b)}),h&&d.add(h)}),c}),Exe=(e,t)=>uy(t.read,function(n,r){n.set(e,n.get(e)+1)}),CI=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const t=kk();return function(n){const r=Js(t,n);if(r._tag==="Some")return r.value;const i=e(n);return Tc(t,n,i),i}}:e=>{const t=kk(),n=new FinalizationRegistry(r=>{pue(t,r)});return function(r){const i=Js(t,r).pipe(M5(s=>s.deref()));if(i._tag==="Some")return i.value;const a=e(r);return Tc(t,r,new WeakRef(a)),n.register(a,r),a}},Pu=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),kxe=R(2,(e,t)=>mxe(e)?uy(t,function(n,r){n.set(e,r)},e.refresh??function(n){n(e)}):os(t,e.refresh??function(n){n(e)})),Cxe=sxe,TI="~effect-atom/atom/Atom/ServerValue",Txe=R(2,(e,t)=>TI in e?e[TI](n=>t.get(n)):t.get(e)),nv=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipart"),rv=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipartStream"),fp=Symbol.for("@effect/platform/HttpApiSchema/AnnotationStatus"),iv=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEmptyDecodeable"),av=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEncoding"),sv=Symbol.for("@effect/platform/HttpApiSchema/AnnotationParam"),y7=e=>{const t={};return fp in e&&(t[fp]=e[fp]),iv in e&&(t[iv]=e[iv]),av in e&&(t[av]=e[av]),sv in e&&(t[sv]=e[sv]),nv in e&&(t[nv]=e[nv]),rv in e&&(t[rv]=e[rv]),t},Rxe=e=>e._tag==="Transformation"?{...e.to.annotations,...e.annotations}:e.annotations,fy=(e,t)=>Rxe(e)[t],b7=(e,t)=>fy(e,fp)??t,Axe=e=>fy(e,iv)??!1,Nxe=e=>fy(e,nv),Oxe=e=>fy(e,rv),Mxe={kind:"Json",contentType:"application/json"},XS=(e,t=Mxe)=>fy(e,av)??t,jxe=e=>{var n;return(n=(e._tag==="PropertySignatureTransformation"?e.to.annotations:e.annotations)[sv])==null?void 0:n.name},Yd=e=>{const t=B9(e,"status");return e.status!==void 0&&(t[fp]=e.status),t},dC=e=>{switch(e._tag){case"VoidKeyword":return!0;case"Transformation":return dC(e.from);case"Suspend":return dC(e.f());default:return!1}},Dxe=e=>b7(e,dC(e)?204:200),r_=e=>b7(e,500),hC=e=>{function t(r){if(US(r))for(const i of r.types)t(i);else n.push(r)}const n=[];return t(e),n},v7=(e,t)=>yi.make(Array.from(new Set([...hC(e),...hC(t)]))),Al=(e,t)=>jt(v7(e.ast,t.ast)),Ixe=e=>tve.annotations(Yd({status:e})),mC=Ixe(204);class zxe extends zve.annotations({identifier:"Issue",description:"Represents an error encountered while parsing a value to match the schema"}){}class Yx extends o7()("HttpApiDecodeError",{issues:Gt(zxe),message:P},Yd({status:400,description:"The request did not match the expected schema"})){static fromParseError(t){return Zb.formatError(t).pipe(Dx(sp.formatError(t)),bt(([n,r])=>new Yx({issues:n,message:r})))}static refailParseError(t){return Te(Yx.fromParseError(t),Ts)}}const RI=Symbol.for("@effect/platform/HttpApi"),$xe={[RI]:RI,pipe(){return he(this,arguments)},add(e){return Ho({identifier:this.identifier,groups:Pte(this.groups,e.identifier,e),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addHttpApi(e){const t={...this.groups};for(const n in e.groups){const r=e.groups[n].annotateContext(gs());r.annotations=oi(e.annotations,r.annotations),r.middlewares=new Set([...e.middlewares,...r.middlewares]),t[n]=r}return Ho({identifier:this.identifier,groups:t,errorSchema:Al(this.errorSchema,e.errorSchema),annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Ho({identifier:this.identifier,groups:this.groups,errorSchema:Al(this.errorSchema,t!=null&&t.status?e.annotations(Yd({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Ho({identifier:this.identifier,groups:Pf(this.groups,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Ho({identifier:this.identifier,groups:this.groups,errorSchema:Al(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Ho({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:Xi(this.annotations,e,t),middlewares:this.middlewares})},annotateContext(e){return Ho({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:oi(this.annotations,e),middlewares:this.middlewares})}},Ho=e=>{function t(){}return Object.setPrototypeOf(t,$xe),t.groups=e.groups,t.errorSchema=e.errorSchema,t.annotations=e.annotations,t.middlewares=e.middlewares,t},Lxe=e=>Ho({groups:new Map,errorSchema:Yx,annotations:gs(),middlewares:new Set}),Pxe=(e,t)=>{const n=sb(e.errorSchema.ast,new Map,r_),r=Object.values(e.groups);for(const i of r){const a=sb(i.errorSchema.ast,n,r_),s=oi(e.annotations,i.annotations);t.onGroup({group:i,mergedAnnotations:s});const o=Object.values(i.endpoints);for(const l of o){if(t.predicate&&!t.predicate({endpoint:l,group:i}))continue;const c=sb(l.errorSchema.ast,a,r_);t.onEndpoint({group:i,endpoint:l,middleware:new Set([...i.middlewares,...l.middlewares]),mergedAnnotations:oi(s,l.annotations),payloads:l.payloadSchema._tag==="Some"?Uxe(l.payloadSchema.value.ast):Fxe,successes:sb(l.successSchema.ast,new Map,Dxe),errors:c})}}},Fxe=new Map,sb=(e,t,n)=>{const r=new Map(t);function i(a){if(ebe(a))return;const s=y7(e.annotations);Lte(s)||(a=Nh(a,{...s,...a.annotations}));const o=n(a),l=Axe(a),c=r.get(o);r.set(o,{description:(c?c.description:ne()).pipe(Ta(()=>Bxe(a))),ast:(c?c.ast:ne()).pipe(ii(f=>v7(f,a)),Ta(()=>!l&&Qye(Fx(a))?ne():ae(a)))})}return hC(e).forEach(i),r},Uxe=e=>{const t=new Map;function n(r){if(r._tag==="NeverKeyword")return;r=Nh(r,{...y7(e.annotations),...r.annotations});const i=XS(r),a=Nxe(r)||Oxe(r)?"multipart/form-data":i.contentType,s=t.get(a);s===void 0?t.set(a,{encoding:i,ast:r}):s.ast=yi.make([s.ast,r])}if(e._tag==="Union")for(const r of e.types)n(r);else n(e);return t},Bxe=e=>{const t="to"in e?{...e.to.annotations,...e.annotations}:e.annotations;return mh(t[Iu]??t[oy])},Fu=e=>{const t=x7(e),n=[];for(let r=0;r<t.length;r++)if(Array.isArray(t[r][0])){const[i,a]=t[r];n.push([`${i[0]}[${i.slice(1).join("][")}]`,a])}else n.push(t[r]);return n},x7=e=>{const t=Symbol.iterator in e?yt(e):Object.entries(e),n=[];for(const[r,i]of t)if(Array.isArray(i))for(let a=0;a<i.length;a++)i[a]!==void 0&&n.push([r,String(i[a])]);else if(typeof i=="object"){const a=x7(i);for(const[s,o]of a)n.push([[r,...typeof s=="string"?[s]:s],o])}else i!==void 0&&n.push([r,String(i)]);return n},S7=Gt(ave(P,P)).annotations({identifier:"UrlParams"}),Hxe=[],qxe=R(2,(e,t)=>{const n=Fu(t),r=new Set;for(let i=0;i<n.length;i++)r.add(n[i][0]);for(let i=0;i<e.length;i++)r.has(e[i][0])||n.push(e[i]);return n}),Vxe=R(2,(e,t)=>jR(e,Fu(t))),Kxe=(e,t,n)=>{try{const r=new URL(e,Gxe());for(let i=0;i<t.length;i++){const[a,s]=t[i];s!==void 0&&r.searchParams.append(a,s)}return n._tag==="Some"&&(r.hash=n.value),Me(r)}catch(r){return je(r)}},w7=e=>new URLSearchParams(e).toString(),Gxe=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Yxe=e=>{const t=Object.create(null);for(const[n,r]of e){const i=t[n];i===void 0?t[n]=r:typeof i=="string"?t[n]=[i,r]:i.push(r)}return{...t}},Wxe=rc(P,S7,{decode(e){return Fu(new URLSearchParams(e))},encode(e){return w7(e)}}),Jxe=e=>rc(S7,e,{decode(t){return Yxe(t)},encode(t){return Fu(t)}}),Xxe=e=>Ic(Wxe,Jxe(e)),ov=Symbol.for("@effect/platform/HttpBody");var lP;class FN{constructor(){S(this,lP);this[ov]=ov}[(lP=ov,ut)](){return this.toJSON()}toString(){return Mt(this)}}class Qxe extends FN{constructor(){super(...arguments);S(this,"_tag","Empty")}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Empty"}}}const Zxe=new Qxe;class e0e extends FN{constructor(n,r){super();S(this,"body");S(this,"contentType");S(this,"_tag","Uint8Array");this.body=n,this.contentType=r}get contentLength(){return this.body.length}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}const _7=(e,t)=>new e0e(e,t??"application/octet-stream"),t0e=new TextEncoder,E7=(e,t)=>_7(t0e.encode(e),t??"text/plain"),n0e=(e,t)=>E7(w7(e),t??"application/x-www-form-urlencoded");class r0e extends FN{constructor(n){super();S(this,"formData");S(this,"_tag","FormData");this.formData=n}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"FormData",formData:this.formData}}}const i0e=e=>new r0e(e),a0e=ov,s0e=e=>Re(e,a0e),o0e=_7,AI=E7,l0e=n0e,NI=Symbol.for("@effect/platform/Cookies"),OI=Symbol.for("@effect/platform/Cookies/Cookie"),c0e={[NI]:NI,...F0,toJSON(){return{_id:"@effect/platform/Cookies",cookies:Pf(this.cookies,e=>e.toJSON())}},pipe(){return he(this,arguments)}},u0e=e=>{const t=Object.create(c0e);return t.cookies=e,t},f0e=e=>{const t={};for(const n of e)t[n.name]=n;return u0e(t)},d0e=e=>{const t=typeof e=="string"?[e]:e,n=[];for(const r of t){const i=h0e(r.trim());zt(i)&&n.push(i.value)}return f0e(n)};function h0e(e){const t=e.split(";").map(o=>o.trim()).filter(o=>o!=="");if(t.length===0)return ne();const n=t[0].indexOf("=");if(n===-1)return ne();const r=t[0].slice(0,n);if(!m0e.test(r))return ne();const i=t[0].slice(n+1),a=p0e(i);if(t.length===1)return ae(Object.assign(Object.create(MI),{name:r,value:a,valueEncoded:i}));const s={};for(let o=1;o<t.length;o++){const l=t[o],c=l.indexOf("="),f=c===-1?l:l.slice(0,c).trim(),u=c===-1?void 0:l.slice(c+1).trim();switch(f.toLowerCase()){case"domain":{if(u===void 0)break;const d=u.trim().replace(/^\./,"");d&&(s.domain=d);break}case"expires":{if(u===void 0)break;const d=new Date(u);isNaN(d.getTime())||(s.expires=d);break}case"max-age":{if(u===void 0)break;const d=parseInt(u,10);isNaN(d)||(s.maxAge=pU(d));break}case"path":{if(u===void 0)break;u[0]==="/"&&(s.path=u);break}case"priority":{if(u===void 0)break;switch(u.toLowerCase()){case"low":s.priority="low";break;case"medium":s.priority="medium";break;case"high":s.priority="high";break}break}case"httponly":{s.httpOnly=!0;break}case"secure":{s.secure=!0;break}case"partitioned":{s.partitioned=!0;break}case"samesite":{if(u===void 0)break;switch(u.toLowerCase()){case"lax":s.sameSite="lax";break;case"strict":s.sameSite="strict";break;case"none":s.sameSite="none";break}break}}}return ae(Object.assign(Object.create(MI),{name:r,value:a,valueEncoded:i,options:Object.keys(s).length>0?s:void 0}))}const m0e=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,MI={[OI]:OI,...F0,toJSON(){return{_id:"@effect/platform/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}},p0e=e=>{try{return decodeURIComponent(e)}catch{return e}},jI=Symbol.for("@effect/platform/Headers"),ig=Object.assign(Object.create(null),{[jI]:jI,[U0](e){return gC(this,jB(e,C7))}}),QS=e=>Object.assign(Object.create(ig),e),k7=Object.create(ig),UN=e=>{if(e===void 0)return k7;if(Symbol.iterator in e){const n=Object.create(ig);for(const[r,i]of e)n[r.toLowerCase()]=i;return n}const t=Object.create(ig);for(const[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(", "):r!==void 0&&(t[n.toLowerCase()]=r);return t},g0e=e=>Object.setPrototypeOf(e,ig),pC=R(3,(e,t,n)=>{const r=QS(e);return r[t.toLowerCase()]=n,r}),y0e=R(2,(e,t)=>QS({...e,...UN(t)})),b0e=R(2,(e,t)=>{const n=QS(e);return Object.assign(n,t),n}),v0e=R(2,(e,t)=>{const n=QS(e),r=i=>{if(typeof i=="string"){const a=i.toLowerCase();a in e&&delete n[a]}else for(const a in e)i.test(a)&&delete n[a]};if(Array.isArray(t))for(let i=0;i<t.length;i++)r(t[i]);else r(t);return n}),gC=R(2,(e,t)=>{const n={...e},r=i=>{if(typeof i=="string"){const a=i.toLowerCase();a in e&&(n[a]=lI(e[a]))}else for(const a in e)i.test(a)&&(n[a]=lI(e[a]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)r(t[i]);else r(t);return n}),C7=De("@effect/platform/Headers/currentRedactedNames",()=>sN(["authorization","cookie","set-cookie","x-api-key"])),x0e=Symbol.for("@effect/platform/HttpClientError"),T7=x0e;class R7 extends l7(T7,"RequestError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return this.description?`${this.reason}: ${this.description} (${this.methodAndUrl})`:`${this.reason} error (${this.methodAndUrl})`}}class Ks extends l7(T7,"ResponseError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){const t=`${this.response.status} ${this.methodAndUrl}`;return this.description?`${this.reason}: ${this.description} (${t})`:`${this.reason} error (${t})`}}const dp=Symbol.for("@effect/platform/HttpIncomingMessage"),S0e=(e,t)=>{const n=e.headers["content-type"]??"";let r;if(n.includes("application/json"))try{r=na(e.json)}catch{}else if(n.includes("text/")||n.includes("urlencoded"))try{r=na(e.text)}catch{}const i={...t,headers:SR(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(i.body=r),i},w0e=e=>g0e({b3:`${e.traceId}-${e.spanId}-${e.sampled?"1":"0"}${e.parent._tag==="Some"?`-${e.parent.value.spanId}`:""}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?"01":"00"}`}),DI=Symbol.for("@effect/platform/HttpClientRequest"),_0e={[DI]:DI,...F0,toJSON(){return{_id:"@effect/platform/HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:SR(this.headers),body:this.body.toJSON()}},pipe(){return he(this,arguments)}};function za(e,t,n,r,i,a){const s=Object.create(_0e);return s.method=e,s.url=t,s.urlParams=n,s.hash=r,s.headers=i,s.body=a,s}const E0e=za("GET","",Hxe,ne(),k7,Zxe),ic=e=>(t,n)=>M0e(E0e,{method:e,url:t,...n??void 0}),k0e=ic("GET"),C0e=ic("POST"),T0e=ic("PUT"),R0e=ic("PATCH"),A0e=ic("DELETE"),N0e=ic("HEAD"),O0e=ic("OPTIONS"),M0e=R(2,(e,t)=>{let n=e;return t.method&&(n=I0e(n,t.method)),t.url&&(n=N7(n,t.url)),t.headers&&(n=BN(n,t.headers)),t.urlParams&&(n=O7(n,t.urlParams)),t.hash&&(n=L0e(n,t.hash)),t.body&&(n=HN(n,t.body)),t.accept&&(n=A7(n,t.accept)),t.acceptJson&&(n=D0e(n)),n}),j0e=R(3,(e,t,n)=>za(e.method,e.url,e.urlParams,e.hash,pC(e.headers,t,n),e.body)),BN=R(2,(e,t)=>za(e.method,e.url,e.urlParams,e.hash,y0e(e.headers,t),e.body)),A7=R(2,(e,t)=>j0e(e,"Accept",t)),D0e=A7("application/json"),I0e=R(2,(e,t)=>za(t,e.url,e.urlParams,e.hash,e.headers,e.body)),N7=R(2,(e,t)=>{if(typeof t=="string")return za(e.method,t,e.urlParams,e.hash,e.headers,e.body);const n=new URL(t.toString()),r=Fu(n.searchParams),i=n.hash?ae(n.hash.slice(1)):ne();return n.search="",n.hash="",za(e.method,n.toString(),r,i,e.headers,e.body)}),z0e=R(2,(e,t)=>za(e.method,t.endsWith("/")&&e.url.startsWith("/")?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),$0e=R(2,(e,t)=>za(e.method,e.url,Vxe(e.urlParams,t),e.hash,e.headers,e.body)),O7=R(2,(e,t)=>za(e.method,e.url,qxe(e.urlParams,t),e.hash,e.headers,e.body)),L0e=R(2,(e,t)=>za(e.method,e.url,e.urlParams,ae(t),e.headers,e.body)),HN=R(2,(e,t)=>{let n=e.headers;if(t._tag==="Empty"||t._tag==="FormData")n=v0e(n,["Content-type","Content-length"]);else{const r=t.contentType;r&&(n=pC(n,"content-type",r));const i=t.contentLength;i&&(n=pC(n,"content-length",i.toString()))}return za(e.method,e.url,e.urlParams,e.hash,n,t)}),P0e=R(2,(e,t)=>HN(e,i0e(t))),hp=Symbol.for("@effect/platform/HttpClientResponse"),F0e=(e,t)=>new U0e(e,t);var cP,uP,fP;class U0e extends(fP=_ee,uP=dp,cP=hp,fP){constructor(n,r){super();S(this,"request");S(this,"source");S(this,uP);S(this,cP);S(this,"cachedCookies");S(this,"textBody");S(this,"formDataBody");S(this,"arrayBufferBody");this.request=n,this.source=r,this[dp]=dp,this[hp]=hp}toJSON(){return S0e(this,{_id:"@effect/platform/HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return UN(this.source.headers)}get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=d0e(this.source.headers.getSetCookie())}get remoteAddress(){return ne()}get stream(){return this.source.body?dye(()=>this.source.body,n=>new Ks({request:this.request,response:this,reason:"Decode",cause:n})):oye(new Ks({request:this.request,response:this,reason:"EmptyBody",description:"can not create stream from empty body"}))}get json(){return gme(this.text,{try:n=>n===""?null:JSON.parse(n),catch:n=>new Ks({request:this.request,response:this,reason:"Decode",cause:n})})}get text(){return this.textBody??(this.textBody=rp({try:()=>this.source.text(),catch:n=>new Ks({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(D1,na))}get urlParamsBody(){return Te(this.text,n=>pme({try:()=>Fu(new URLSearchParams(n)),catch:r=>new Ks({request:this.request,response:this,reason:"Decode",cause:r})}))}get formData(){return this.formDataBody??(this.formDataBody=rp({try:()=>this.source.formData(),catch:n=>new Ks({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(D1,na))}get arrayBuffer(){return this.arrayBufferBody??(this.arrayBufferBody=rp({try:()=>this.source.arrayBuffer(),catch:n=>new Ks({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(D1,na))}}const B0e=R(2,(e,t)=>{const n=e.status;return t[n]?t[n](e):n>=200&&n<300&&t["2xx"]?t["2xx"](e):n>=300&&n<400&&t["3xx"]?t["3xx"](e):n>=400&&n<500&&t["4xx"]?t["4xx"](e):n>=500&&n<600&&t["5xx"]?t["5xx"](e):t.orElse(e)}),H0e=e=>`http.request.header.${e}`,q0e="http.request.method",V0e=e=>`http.response.header.${e}`,K0e="http.response.status_code",G0e="server.address",Y0e="server.port",W0e="url.full",J0e="url.path",X0e="url.scheme",Q0e="url.query",II=Symbol.for("@effect/platform/HttpClient"),qN=Zl("@effect/platform/HttpClient"),Z0e=De(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"),()=>sN(vl)),eSe=De(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"),()=>sN(!0)),tSe=hh()("@effect/platform/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>`http.client ${e.method}`}),nSe={[II]:II,pipe(){return he(this,arguments)},...F0,toJSON(){return{_id:"@effect/platform/HttpClient"}},get(e,t){return this.execute(k0e(e,t))},head(e,t){return this.execute(N0e(e,t))},post(e,t){return this.execute(C0e(e,t))},put(e,t){return this.execute(T0e(e,t))},patch(e,t){return this.execute(R0e(e,t))},del(e,t){return this.execute(A0e(e,t))},options(e,t){return this.execute(O0e(e,t))}},VN=(e,t)=>{const n=Object.create(nSe);return n.preprocess=t,n.postprocess=e,n.execute=function(r){return e(t(r))},n},Wx=De("@effect/platform/HttpClient/responseRegistry",()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){const t=new FinalizationRegistry(n=>{n.abort()});return{register(n,r){t.register(n,r,n)},unregister(n){t.unregister(n)}}}const e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){const n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}}),rSe=De("@effect/platform/HttpClient/scopedRequests",()=>new WeakMap),iSe=e=>VN(t=>Te(t,n=>Nx(r=>{const i=rSe.get(n),a=i??new AbortController,s=Kxe(n.url,n.urlParams,n.hash);if(s._tag==="Left")return Ts(new R7({request:n,reason:"InvalidUrl",cause:s.left}));const o=s.right;if(!r.getFiberRef(Kme)||r.getFiberRef(Z0e)(n)){const f=e(n,o,a.signal,r);return i?f:Ox(u=>Ea(u(f),{onSuccess(d){return Wx.register(d,a),Vt(new zI(d,a))},onFailure(d){return Ex(d)&&a.abort(),Ra(d)}}))}const c=mo(r.currentContext,tSe);return Mme(c(n),{kind:"client",captureStackTrace:!1},f=>{f.attribute(q0e,n.method),f.attribute(G0e,o.origin),o.port!==""&&f.attribute(Y0e,+o.port),f.attribute(W0e,o.toString()),f.attribute(J0e,o.pathname),f.attribute(X0e,o.protocol.slice(0,-1));const u=o.search.slice(1);u!==""&&f.attribute(Q0e,u);const d=r.getFiberRef(C7),h=gC(n.headers,d);for(const p in h)f.attribute(H0e(p),String(h[p]));return n=r.getFiberRef(eSe)?BN(n,w0e(f)):n,Ox(p=>p(e(n,o,a.signal,r)).pipe(jme(f),Ea({onSuccess:b=>{f.attribute(K0e,b.status);const x=gC(b.headers,d);for(const g in x)f.attribute(V0e(g),String(x[g]));return i?Vt(b):(Wx.register(b,a),Vt(new zI(b,a)))},onFailure(b){return!i&&Ex(b)&&a.abort(),Ra(b)}})))})})),Vt);var dP,hP;class zI{constructor(t,n){S(this,"original");S(this,"controller");S(this,hP,hp);S(this,dP,dp);this.original=t,this.controller=n}applyInterrupt(t){return fn(()=>(Wx.unregister(this.original),yme(t,()=>Nt(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return pye(()=>(Wx.unregister(this.original),P8(this.original.stream,Nt(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[(hP=hp,dP=dp,ut)](){return this.original[ut]()}}const{del:NLe,execute:OLe,get:MLe,head:jLe,options:DLe,patch:ILe,post:zLe,put:$Le}=_me(qN),aSe=R(2,(e,t)=>{const n=e;return VN(r=>t(n.postprocess(r)),n.preprocess)}),sSe=R(2,(e,t)=>{const n=e;return VN(n.postprocess,r=>bt(n.preprocess(r),t))}),oSe=e=>qme(qN,Te(wH(),t=>bt(e,n=>aSe(n,_H(r=>oi(t,r)))))),lSe=qN,cSe=sSe,uSe=ic,fSe=BN,dSe=N7,hSe=z0e,mSe=O7,pSe=$0e,gSe=HN,ySe=P0e,bSe=B0e,$I=e=>e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS",vSe=(e,t)=>sd(function*(){const n=yield*wH(),r=t.httpClient.pipe((t==null?void 0:t.baseUrl)===void 0?ke:cSe(hSe(t.baseUrl.toString())));Pxe(e,{predicate:t==null?void 0:t.predicate,onGroup(i){var a;(a=t.onGroup)==null||a.call(t,i)},onEndpoint(i){const{endpoint:a,errors:s,successes:o}=i,l=_Se(a.path),c={orElse:TSe},f=bSe(c);s.forEach(({ast:x},g)=>{if(x._tag==="None"){c[g]=RSe;return}const v=LI(x.value);c[g]=w=>Te(v(w),Ts)}),o.forEach(({ast:x},g)=>{c[g]=x._tag==="None"?ASe:LI(x.value)});const u=a.pathSchema.pipe(ii(lm)),d=a.payloadSchema.pipe(ii(x=>$I(a.method)?lm(OSe(x)):lm(x))),h=a.headersSchema.pipe(ii(lm)),p=a.urlParamsSchema.pipe(ii(lm)),b=RH(function*(x){let g=uSe(a.method)(a.path);if(x&&x.path){const E=u._tag==="Some"?yield*u.value(x.path):x.path;g=dSe(g,l(E))}if(x&&x.payload instanceof FormData)g=ySe(g,x.payload);else if(d._tag==="Some")if($I(a.method)){const E=yield*d.value(x.payload);g=gSe(g,E)}else{const E=yield*d.value(x.payload);g=mSe(g,E)}h._tag==="Some"&&(g=fSe(g,yield*h.value(x.headers))),p._tag==="Some"&&(g=pSe(g,yield*p.value(x.urlParams)));const v=yield*r.execute(g),w=yield*t.transformResponse===void 0?f(v):t.transformResponse(f(v));return(x==null?void 0:x.withResponse)===!0?[w,v]:w},_H(x=>oi(n,x)));t.onEndpoint({...i,endpointFn:b})}})}),xSe=(e,t)=>Te(lSe,n=>SSe(e,{...t,httpClient:t!=null&&t.transformClient?t.transformClient(n):n})),SSe=(e,t)=>{const n={};return vSe(e,{...t,onGroup({group:r}){r.topLevel||(n[r.identifier]={})},onEndpoint({endpoint:r,endpointFn:i,group:a}){(a.topLevel?n:n[a.identifier])[r.name]=i}}).pipe(bt(()=>n))},wSe=/:(\w+)\??/g,_Se=e=>{const t=e.split(wSe),n=t.length;return n===1?r=>e:r=>{let i=t[0];for(let a=1;a<n;a++)a%2===0?i+=t[a]:i+=r[t[a]];return i}},LI=e=>{const t=XS(e),n=Xbe(M7(e,t));return r=>Te(r.arrayBuffer,n)},ESe=rc(VS,Eve,{decode(e){return new Uint8Array(e)},encode(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}}),yC=rc(VS,P,{decode(e){return new TextDecoder().decode(e)},encode(e){const t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}),kSe=Hl(P,VS,{strict:!0,decode:(e,t,n)=>e===""?kr(void 0):Ux({try:()=>JSON.parse(e),catch:()=>new on(n,e,"Could not parse JSON")}),encode:(e,t,n)=>e===void 0?kr(""):Ux({try:()=>JSON.stringify(e),catch:()=>new on(n,e,"Could not encode as JSON")})}),CSe=Ic(yC,kSe),M7=(e,t)=>{if(e._tag==="Union")return Lu(...e.types.map(r=>M7(r,XS(r,t))));const n=jt(e);switch(t.kind){case"Json":return Ic(CSe,n);case"UrlParams":return Ic(yC,Xxe(n));case"Uint8Array":return Ic(ESe,n);case"Text":return Ic(yC,n)}},TSe=e=>Ts(new Ks({reason:"Decode",request:e.request,response:e})),RSe=e=>Ts(new Ks({reason:"StatusCode",request:e.request,response:e})),ASe=e=>lt,NSe=Oh(s0e),OSe=e=>{const t=e.ast._tag==="Union"?e.ast.types:[e.ast];return Lu(...t.map(MSe))},i_=De("@effect/platform/HttpApiClient/bodyFromPayloadCache",()=>new WeakMap),MSe=e=>{if(i_.has(e))return i_.get(e);const t=jt(e),n=XS(e),r=Hl(NSe,t,{decode(i,a,s){return lo(new nC(s,i,"encode only schema"))},encode(i,a,s){switch(n.kind){case"Json":try{return kr(AI(JSON.stringify(i),n.contentType))}catch{return lo(new on(s,i,"Could not encode as JSON"))}case"Text":return typeof i!="string"?lo(new on(s,i,"Expected a string")):kr(AI(i,n.contentType));case"UrlParams":return kr(l0e(Fu(i)));case"Uint8Array":return i instanceof Uint8Array?kr(o0e(i,n.contentType)):lo(new on(s,i,"Expected a Uint8Array"))}}});return i_.set(e,r),r},jSe=e=>{if(Array.isArray(e))return ED(e);const t=Object.create(_he.prototype);for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=ED(r))}return t},DSe=()=>(e,t)=>{const n=AR(e)();n.layer=NH(n,xSe(t.api,t)).pipe(OH(t.httpClient));const r=t.runtime??LN;n.runtime=r(n.layer);const i=CI(({endpoint:s,group:o,withResponse:l})=>n.runtime.fn()(RH(function*(c){const u=(yield*n)[o][s]({...c,withResponse:l});return yield*c.reactivityKeys?B8(u,c.reactivityKeys):u})));n.mutation=(s,o,l)=>i(new ISe({group:s,endpoint:o,withResponse:(l==null?void 0:l.withResponse)??!1}));const a=CI(s=>{let o=n.runtime.atom(Te(n,l=>l[s.group][s.endpoint](s)));return s.timeToLive&&(o=mU(s.timeToLive)?p7(o,s.timeToLive):Pu(o)),s.reactivityKeys?n.runtime.factory.withReactivity(s.reactivityKeys)(o):o});return n.query=(s,o,l)=>a(new zSe({group:s,endpoint:o,path:l.path&&Em(l.path),urlParams:l.urlParams&&Em(l.urlParams),payload:l.payload&&Em(l.payload),headers:l.headers&&Em(l.headers),withResponse:l.withResponse??!1,reactivityKeys:l.reactivityKeys?jSe(l.reactivityKeys):void 0,timeToLive:l.timeToLive?sa(l.timeToLive):void 0})),n};class ISe extends GA{[Ue](t){return this.group===t.group&&this.endpoint===t.endpoint&&this.withResponse===t.withResponse}[Fe](){return M(qt(`${this.group}/${this.endpoint}/${this.withResponse}`),Tt(this))}}class zSe extends GA{[Ue](t){return this.group===t.group&&this.endpoint===t.endpoint&&xe(this.path,t.path)&&xe(this.urlParams,t.urlParams)&&xe(this.payload,t.payload)&&xe(this.headers,t.headers)&&xe(this.withResponse,t.withResponse)&&xe(this.reactivityKeys,t.reactivityKeys)&&xe(this.timeToLive,t.timeToLive)}[Fe](){return M(qt(`${this.group}/${this.endpoint}`),Be(de(this.path)),Be(de(this.urlParams)),Be(de(this.payload)),Be(de(this.headers)),Be(de(this.withResponse)),Be(de(this.reactivityKeys)),Be(de(this.timeToLive)),Tt(this))}}const $Se=Symbol.for("@effect/matcher/Matcher"),LSe={[$Se]:{_input:ke,_filters:ke,_remaining:ke,_result:ke,_provided:ke,_return:ke},_tag:"ValueMatcher",add(e){return this.value._tag==="Right"?this:e._tag==="When"&&e.guard(this.provided)===!0?bC(this.provided,Me(e.evaluate(this.provided))):e._tag==="Not"&&e.guard(this.provided)===!1?bC(this.provided,Me(e.evaluate(this.provided))):this},pipe(){return he(this,arguments)}};function bC(e,t){const n=Object.create(LSe);return n.provided=e,n.value=t,n}const PSe=(e,t)=>({_tag:"When",guard:e,evaluate:t}),vC=e=>{if(typeof e=="function")return e;if(Array.isArray(e)){const t=e.map(vC),n=t.length;return r=>{if(!Array.isArray(r))return!1;for(let i=0;i<n;i++)if(t[i](r[i])===!1)return!1;return!0}}else if(e!==null&&typeof e=="object"){const t=Object.entries(e).map(([r,i])=>[r,vC(i)]),n=t.length;return r=>{if(typeof r!="object"||r===null)return!1;for(let i=0;i<n;i++){const[a,s]=t[i];if(!(a in r)||s(r[a])===!1)return!1}return!0}}return t=>t===e},FSe=e=>bC(e,je(e)),USe=(e,t)=>n=>n.add(PSe(vC(e),t)),BSe=e=>t=>{const n=HSe(t);return k5(n)?n._tag==="Right"?n.right:e(n.left):r=>{const i=n(r);return i._tag==="Right"?i.right:e(i.left)}},HSe=e=>{if(e._tag==="ValueMatcher")return e.value;const t=e.cases.length;if(t===1){const n=e.cases[0];return r=>n._tag==="When"&&n.guard(r)===!0||n._tag==="Not"&&n.guard(r)===!1?Me(n.evaluate(r)):je(r)}return n=>{for(let r=0;r<t;r++){const i=e.cases[r];if(i._tag==="When"&&i.guard(n)===!0)return Me(i.evaluate(n));if(i._tag==="Not"&&i.guard(n)===!1)return Me(i.evaluate(n))}return je(n)}},j7=FSe,mp=USe,D7=BSe;function qSe(e){B_.unstable_scheduleCallback(B_.unstable_LowPriority,e)}const KN=y.createContext(uxe({scheduleTask:qSe,defaultIdleTTL:400})),PI=De("@effect-atom/atom-react/storeRegistry",()=>new WeakMap);function VSe(e,t){let n=PI.get(e);n===void 0&&(n=new WeakMap,PI.set(e,n));const r=n.get(t);if(r!==void 0)return r;const i={subscribe(a){return e.subscribe(t,a)},snapshot(){return e.get(t)},getServerSnapshot(){return Txe(t,e)}};return n.set(t,i),i}function I7(e,t){const n=VSe(e,t);return y.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}const Zn=(e,t)=>{const n=y.useContext(KN);return I7(n,e)};function KSe(e,t){y.useEffect(()=>e.mount(t),[t,e])}function z7(e,t,n){return(n==null?void 0:n.mode)==="promise"||(n==null?void 0:n.mode)==="promiseExit"?y.useCallback(r=>{e.set(t,r);const i=Ome(fxe(e,t,{suspendOnWaiting:!0}));return n.mode==="promise"?i.then(GSe):i},[e,t,n.mode]):y.useCallback(r=>{e.set(t,typeof r=="function"?r(e.get(t)):r)},[e,t])}const GSe=e=>{if(u6(e))return e.value;throw HA(e.cause)},Ct=(e,t)=>{const n=y.useContext(KN);return KSe(n,e),z7(n,e,t)},YSe=(e,t)=>{const n=y.useContext(KN);return[I7(n,e),z7(n,e,t)]};function WSe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const JSe=e=>{switch(e){case"success":return ZSe;case"info":return twe;case"warning":return ewe;case"error":return nwe;default:return null}},XSe=Array(12).fill(0),QSe=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},XSe.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ZSe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ewe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),twe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nwe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rwe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),iwe=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let xC=1;class awe{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:xC++,s=this.toasts.find(l=>l.id===a),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),s?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:r}),{...l,...t,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...i,dismissible:o,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,s;const o=i.then(async c=>{if(s=["resolve",c],ee.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(owe(c)&&!c.ok){a=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,d=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,p=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...p})}else if(c instanceof Error){a=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,p=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...p})}else if(n.success!==void 0){a=!1;const u=typeof n.success=="function"?await n.success(c):n.success,d=typeof n.description=="function"?await n.description(c):n.description,p=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:d,...p})}}).catch(async c=>{if(s=["reject",c],n.error!==void 0){a=!1;const f=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,h=typeof f=="object"&&!ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:u,...h})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,f)=>o.then(()=>s[0]==="reject"?f(s[1]):c(s[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||xC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ti=new awe,swe=(e,t)=>{const n=(t==null?void 0:t.id)||xC++;return ti.addToast({title:e,...t,id:n}),n},owe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lwe=swe,cwe=()=>ti.toasts,uwe=()=>ti.getActiveToasts(),fwe=Object.assign(lwe,{success:ti.success,info:ti.info,warning:ti.warning,error:ti.error,custom:ti.custom,message:ti.message,promise:ti.promise,dismiss:ti.dismiss,loading:ti.loading},{getHistory:cwe,getToasts:uwe});WSe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ob(e){return e.label!==void 0}const dwe=3,hwe="24px",mwe="16px",FI=4e3,pwe=356,gwe=14,ywe=45,bwe=200;function Ga(...e){return e.filter(Boolean).join(" ")}function vwe(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xwe=e=>{var t,n,r,i,a,s,o,l,c;const{invert:f,toast:u,unstyled:d,interacting:h,setHeights:p,visibleToasts:b,heights:x,index:g,toasts:v,expanded:w,removeToast:E,defaultRichColors:C,closeButton:k,style:_,cancelButtonStyle:A,actionButtonStyle:D,className:O="",descriptionClassName:L="",duration:B,position:X,gap:W,expandByDefault:U,classNames:I,icons:F,closeButtonAriaLabel:z="Close toast"}=e,[V,N]=ee.useState(null),[ue,q]=ee.useState(null),[T,K]=ee.useState(!1),[G,oe]=ee.useState(!1),[Q,se]=ee.useState(!1),[ye,Ae]=ee.useState(!1),[He,ve]=ee.useState(!1),[Jt,Nn]=ee.useState(0),[Ii,On]=ee.useState(0),yr=ee.useRef(u.duration||B||FI),zo=ee.useRef(null),pn=ee.useRef(null),Gu=g===0,Bh=g+1<=b,er=u.type,Va=u.dismissible!==!1,ua=u.className||"",Ms=u.descriptionClassName||"",Y=ee.useMemo(()=>x.findIndex(qe=>qe.toastId===u.id)||0,[x,u.id]),le=ee.useMemo(()=>{var qe;return(qe=u.closeButton)!=null?qe:k},[u.closeButton,k]),we=ee.useMemo(()=>u.duration||B||FI,[u.duration,B]),$e=ee.useRef(0),nt=ee.useRef(0),br=ee.useRef(0),Hn=ee.useRef(null),[fi,tr]=X.split("-"),fa=ee.useMemo(()=>x.reduce((qe,gn,jn)=>jn>=Y?qe:qe+gn.height,0),[x,Y]),Mn=iwe(),da=u.invert||f,Or=er==="loading";nt.current=ee.useMemo(()=>Y*W+fa,[Y,fa]),ee.useEffect(()=>{yr.current=we},[we]),ee.useEffect(()=>{K(!0)},[]),ee.useEffect(()=>{const qe=pn.current;if(qe){const gn=qe.getBoundingClientRect().height;return On(gn),p(jn=>[{toastId:u.id,height:gn,position:u.position},...jn]),()=>p(jn=>jn.filter(qn=>qn.toastId!==u.id))}},[p,u.id]),ee.useLayoutEffect(()=>{if(!T)return;const qe=pn.current,gn=qe.style.height;qe.style.height="auto";const jn=qe.getBoundingClientRect().height;qe.style.height=gn,On(jn),p(qn=>qn.find(yn=>yn.toastId===u.id)?qn.map(yn=>yn.toastId===u.id?{...yn,height:jn}:yn):[{toastId:u.id,height:jn,position:u.position},...qn])},[T,u.title,u.description,p,u.id,u.jsx,u.action,u.cancel]);const ha=ee.useCallback(()=>{oe(!0),Nn(nt.current),p(qe=>qe.filter(gn=>gn.toastId!==u.id)),setTimeout(()=>{E(u)},bwe)},[u,E,p,nt]);ee.useEffect(()=>{if(u.promise&&er==="loading"||u.duration===1/0||u.type==="loading")return;let qe;return w||h||Mn?(()=>{if(br.current<$e.current){const qn=new Date().getTime()-$e.current;yr.current=yr.current-qn}br.current=new Date().getTime()})():(()=>{yr.current!==1/0&&($e.current=new Date().getTime(),qe=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ha()},yr.current))})(),()=>clearTimeout(qe)},[w,h,u,er,Mn,ha]),ee.useEffect(()=>{u.delete&&(ha(),u.onDismiss==null||u.onDismiss.call(u,u))},[ha,u.delete]);function Yu(){var qe;if(F!=null&&F.loading){var gn;return ee.createElement("div",{className:Ga(I==null?void 0:I.loader,u==null||(gn=u.classNames)==null?void 0:gn.loader,"sonner-loader"),"data-visible":er==="loading"},F.loading)}return ee.createElement(QSe,{className:Ga(I==null?void 0:I.loader,u==null||(qe=u.classNames)==null?void 0:qe.loader),visible:er==="loading"})}const _y=u.icon||(F==null?void 0:F[er])||JSe(er);var Wu,Ey;return ee.createElement("li",{tabIndex:0,ref:pn,className:Ga(O,ua,I==null?void 0:I.toast,u==null||(t=u.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[er],u==null||(n=u.classNames)==null?void 0:n[er]),"data-sonner-toast":"","data-rich-colors":(Wu=u.richColors)!=null?Wu:C,"data-styled":!(u.jsx||u.unstyled||d),"data-mounted":T,"data-promise":!!u.promise,"data-swiped":He,"data-removed":G,"data-visible":Bh,"data-y-position":fi,"data-x-position":tr,"data-index":g,"data-front":Gu,"data-swiping":Q,"data-dismissible":Va,"data-type":er,"data-invert":da,"data-swipe-out":ye,"data-swipe-direction":ue,"data-expanded":!!(w||U&&T),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":v.length-g,"--offset":`${G?Jt:nt.current}px`,"--initial-height":U?"auto":`${Ii}px`,..._,...u.style},onDragEnd:()=>{se(!1),N(null),Hn.current=null},onPointerDown:qe=>{qe.button!==2&&(Or||!Va||(zo.current=new Date,Nn(nt.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(se(!0),Hn.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,gn,jn;if(ye||!Va)return;Hn.current=null;const qn=Number(((qe=pn.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),js=Number(((gn=pn.current)==null?void 0:gn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yn=new Date().getTime()-((jn=zo.current)==null?void 0:jn.getTime()),Wr=V==="x"?qn:js,Ju=Math.abs(Wr)/yn;if(Math.abs(Wr)>=ywe||Ju>.11){Nn(nt.current),u.onDismiss==null||u.onDismiss.call(u,u),q(V==="x"?qn>0?"right":"left":js>0?"down":"up"),ha(),Ae(!0);return}else{var j,$;(j=pn.current)==null||j.style.setProperty("--swipe-amount-x","0px"),($=pn.current)==null||$.style.setProperty("--swipe-amount-y","0px")}ve(!1),se(!1),N(null)},onPointerMove:qe=>{var gn,jn,qn;if(!Hn.current||!Va||((gn=window.getSelection())==null?void 0:gn.toString().length)>0)return;const yn=qe.clientY-Hn.current.y,Wr=qe.clientX-Hn.current.x;var Ju;const j=(Ju=e.swipeDirections)!=null?Ju:vwe(X);!V&&(Math.abs(Wr)>1||Math.abs(yn)>1)&&N(Math.abs(Wr)>Math.abs(yn)?"x":"y");let $={x:0,y:0};const H=Z=>1/(1.5+Math.abs(Z)/20);if(V==="y"){if(j.includes("top")||j.includes("bottom"))if(j.includes("top")&&yn<0||j.includes("bottom")&&yn>0)$.y=yn;else{const Z=yn*H(yn);$.y=Math.abs(Z)<Math.abs(yn)?Z:yn}}else if(V==="x"&&(j.includes("left")||j.includes("right")))if(j.includes("left")&&Wr<0||j.includes("right")&&Wr>0)$.x=Wr;else{const Z=Wr*H(Wr);$.x=Math.abs(Z)<Math.abs(Wr)?Z:Wr}(Math.abs($.x)>0||Math.abs($.y)>0)&&ve(!0),(jn=pn.current)==null||jn.style.setProperty("--swipe-amount-x",`${$.x}px`),(qn=pn.current)==null||qn.style.setProperty("--swipe-amount-y",`${$.y}px`)}},le&&!u.jsx&&er!=="loading"?ee.createElement("button",{"aria-label":z,"data-disabled":Or,"data-close-button":!0,onClick:Or||!Va?()=>{}:()=>{ha(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Ga(I==null?void 0:I.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Ey=F==null?void 0:F.close)!=null?Ey:rwe):null,(er||u.icon||u.promise)&&u.icon!==null&&((F==null?void 0:F[er])!==null||u.icon)?ee.createElement("div",{"data-icon":"",className:Ga(I==null?void 0:I.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||Yu():null,u.type!=="loading"?_y:null):null,ee.createElement("div",{"data-content":"",className:Ga(I==null?void 0:I.content,u==null||(a=u.classNames)==null?void 0:a.content)},ee.createElement("div",{"data-title":"",className:Ga(I==null?void 0:I.title,u==null||(s=u.classNames)==null?void 0:s.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?ee.createElement("div",{"data-description":"",className:Ga(L,Ms,I==null?void 0:I.description,u==null||(o=u.classNames)==null?void 0:o.description)},typeof u.description=="function"?u.description():u.description):null),ee.isValidElement(u.cancel)?u.cancel:u.cancel&&ob(u.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:qe=>{ob(u.cancel)&&Va&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,qe),ha())},className:Ga(I==null?void 0:I.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ee.isValidElement(u.action)?u.action:u.action&&ob(u.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||D,onClick:qe=>{ob(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,qe),!qe.defaultPrevented&&ha())},className:Ga(I==null?void 0:I.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function UI(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Swe(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,s=a?"--mobile-offset":"--offset",o=a?mwe:hwe;function l(c){["top","right","bottom","left"].forEach(f=>{n[`${s}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=o:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(o)}),n}const wwe=ee.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:l,className:c,offset:f,mobileOffset:u,theme:d="light",richColors:h,duration:p,style:b,visibleToasts:x=dwe,toastOptions:g,dir:v=UI(),gap:w=gwe,icons:E,containerAriaLabel:C="Notifications"}=t,[k,_]=ee.useState([]),A=ee.useMemo(()=>r?k.filter(T=>T.toasterId===r):k.filter(T=>!T.toasterId),[k,r]),D=ee.useMemo(()=>Array.from(new Set([a].concat(A.filter(T=>T.position).map(T=>T.position)))),[A,a]),[O,L]=ee.useState([]),[B,X]=ee.useState(!1),[W,U]=ee.useState(!1),[I,F]=ee.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ee.useRef(null),V=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=ee.useRef(null),ue=ee.useRef(!1),q=ee.useCallback(T=>{_(K=>{var G;return(G=K.find(oe=>oe.id===T.id))!=null&&G.delete||ti.dismiss(T.id),K.filter(({id:oe})=>oe!==T.id)})},[]);return ee.useEffect(()=>ti.subscribe(T=>{if(T.dismiss){requestAnimationFrame(()=>{_(K=>K.map(G=>G.id===T.id?{...G,delete:!0}:G))});return}setTimeout(()=>{AP.flushSync(()=>{_(K=>{const G=K.findIndex(oe=>oe.id===T.id);return G!==-1?[...K.slice(0,G),{...K[G],...T},...K.slice(G+1)]:[T,...K]})})})}),[k]),ee.useEffect(()=>{if(d!=="system"){F(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:K})=>{F(K?"dark":"light")})}catch{T.addListener(({matches:G})=>{try{F(G?"dark":"light")}catch(oe){console.error(oe)}})}},[d]),ee.useEffect(()=>{k.length<=1&&X(!1)},[k]),ee.useEffect(()=>{const T=K=>{var G;if(s.every(se=>K[se]||K.code===se)){var Q;X(!0),(Q=z.current)==null||Q.focus()}K.code==="Escape"&&(document.activeElement===z.current||(G=z.current)!=null&&G.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[s]),ee.useEffect(()=>{if(z.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,ue.current=!1)}},[z.current]),ee.createElement("section",{ref:n,"aria-label":`${C} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((T,K)=>{var G;const[oe,Q]=T.split("-");return A.length?ee.createElement("ol",{key:T,dir:v==="auto"?UI():v,tabIndex:-1,ref:z,className:c,"data-sonner-toaster":!0,"data-sonner-theme":I,"data-y-position":oe,"data-x-position":Q,style:{"--front-toast-height":`${((G=O[0])==null?void 0:G.height)||0}px`,"--width":`${pwe}px`,"--gap":`${w}px`,...b,...Swe(f,u)},onBlur:se=>{ue.current&&!se.currentTarget.contains(se.relatedTarget)&&(ue.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||ue.current||(ue.current=!0,N.current=se.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{W||X(!1)},onDragEnd:()=>X(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},A.filter(se=>!se.position&&K===0||se.position===T).map((se,ye)=>{var Ae,He;return ee.createElement(xwe,{key:se.id,icons:E,index:ye,toast:se,defaultRichColors:h,duration:(Ae=g==null?void 0:g.duration)!=null?Ae:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:i,visibleToasts:x,closeButton:(He=g==null?void 0:g.closeButton)!=null?He:l,interacting:W,position:T,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:q,toasts:A.filter(ve=>ve.position==se.position),heights:O.filter(ve=>ve.position==se.position),setHeights:L,expandByDefault:o,gap:w,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),_we="@effect/platform/FetchHttpClient/Fetch",Ewe="@effect/platform/FetchHttpClient/FetchOptions",kwe=iSe((e,t,n,r)=>{const i=r.getFiberRef(MH),a=i.unsafeMap.get(_we)??globalThis.fetch,s=i.unsafeMap.get(Ewe)??{},o=s.headers?b0e(UN(s.headers),e.headers):e.headers,l=c=>bt(rp({try:()=>a(t,{...s,method:e.method,headers:o,body:c,duplex:e.body._tag==="Stream"?"half":void 0,signal:n}),catch:f=>new R7({request:e,reason:"Transport",cause:f})}),f=>F0e(e,f));switch(e.body._tag){case"Raw":case"Uint8Array":return l(e.body.body);case"FormData":return l(e.body.formData);case"Stream":return Te(gye(e.body.stream),l)}return l(void 0)}),Cwe=oSe(Vt(kwe)),Twe=Cwe,Rwe=e=>e.endsWith("/")?e.slice(0,-1):e,Awe=R(2,(e,t)=>(t=Rwe(t),e==="/"?t:t+e)),Nwe=Awe,BI=Symbol.for("@effect/platform/HttpApiEndpoint"),Owe={[BI]:BI,pipe(){return he(this,arguments)},addSuccess(e,t){return e=t!=null&&t.status?e.annotations(Yd({status:t.status})):e,Pi({...this,successSchema:this.successSchema===mC?e:Al(this.successSchema,e)})},addError(e,t){return Pi({...this,errorSchema:Al(this.errorSchema,t!=null&&t.status?e.annotations(Yd({status:t.status})):e)})},setPayload(e){return Pi({...this,payloadSchema:ae(e)})},setPath(e){return Pi({...this,pathSchema:ae(e)})},setUrlParams(e){return Pi({...this,urlParamsSchema:ae(e)})},setHeaders(e){return Pi({...this,headersSchema:ae(e)})},prefix(e){return Pi({...this,path:Nwe(this.path,e)})},middleware(e){return Pi({...this,errorSchema:Al(this.errorSchema,e.failure),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Pi({...this,annotations:Xi(this.annotations,e,t)})},annotateContext(e){return Pi({...this,annotations:oi(this.annotations,e)})}},Pi=e=>Object.assign(Object.create(Owe),e),GN=e=>(t,...n)=>n.length===1?Pi({name:t,path:n[0],method:e,pathSchema:ne(),urlParamsSchema:ne(),payloadSchema:ne(),headersSchema:ne(),successSchema:mC,errorSchema:ng,annotations:gs(),middlewares:new Set}):(r,...i)=>{let a=r[0].replace(":","::"),s=ne();if(i.length>0){const o={};for(let l=0;l<i.length;l++){const c=i[l],f=jxe(c.ast)??String(l),u=c.ast._tag==="PropertySignatureTransformation"&&c.ast.from.isOptional||c.ast._tag==="PropertySignatureDeclaration"&&c.ast.isOptional;o[f]=c,a+=`:${f}${u?"?":""}${r[l+1].replace(":","::")}`}s=ae(ze(o))}return Pi({name:t,path:a,method:e,pathSchema:s,urlParamsSchema:ne(),payloadSchema:ne(),headersSchema:ne(),successSchema:mC,errorSchema:ng,annotations:gs(),middlewares:new Set})},wi=GN("GET"),hr=GN("POST"),Mwe=GN("DELETE"),HI=Symbol.for("@effect/platform/HttpApiGroup"),jwe={[HI]:HI,add(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:{...this.endpoints,[e.name]:e},errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Al(this.errorSchema,t!=null&&t.status?e.annotations(Yd({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Pf(this.endpoints,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Al(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},middlewareEndpoints(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Pf(this.endpoints,t=>t.middleware(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateContext(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:oi(this.annotations,e),middlewares:this.middlewares})},annotate(e,t){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:Xi(this.annotations,e,t),middlewares:this.middlewares})},annotateEndpointsContext(e){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Pf(this.endpoints,t=>t.annotateContext(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateEndpoints(e,t){return Wa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Pf(this.endpoints,n=>n.annotate(e,t)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},pipe(){return he(this,arguments)}},Wa=e=>{function t(){}return Object.setPrototypeOf(t,jwe),Object.assign(t,e)},Uu=(e,t)=>Wa({identifier:e,topLevel:!1,endpoints:$te(),errorSchema:ng,annotations:gs(),middlewares:new Set}),ql=P.pipe(Mh("PullRequestId")),$7=P.pipe(Mh("RepositoryName")),dy=P.pipe(Mh("AwsProfileName")),Dwe=P.pipe(Mh("AwsRegion")),qI=P.pipe(Mh("CommentId")),Nl=P.pipe(Mh("SandboxId")),L7=Rs("OPEN","CLOSED","MERGED"),Iwe=Rs("error","info","warning","success"),zwe=Rs("idle","loading","error"),P7=Rs("creating","cloning","starting","running","stopping","stopped","error");class Jx extends jh("Account")({profile:dy,region:Dwe,awsAccountId:Ie(P)}){}class $we extends jh("PullRequest")({id:ql,title:P,description:Ie(P),author:P,repositoryName:$7,creationDate:go,lastModifiedDate:go,link:P,account:Jx,status:L7,sourceBranch:P,destinationBranch:P,isMergeable:Ln,isApproved:Ln,commentCount:Ie(vt),healthScore:Ie(vt),fetchedAt:Ie(go)}){get consoleUrl(){return`https://${this.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${this.repositoryName}/pull-requests/${this.id}?region=${this.account.region}`}}class LLe extends jh("Sandbox")({id:Nl,pullRequestId:ql,awsAccountId:P,repositoryName:$7,sourceBranch:P,containerId:Ie(P),port:Ie(vt),workspacePath:P,status:P7,error:Ie(P),createdAt:go,lastActivityAt:go}){}class PLe extends jh("PRComment")({id:qI,content:P,author:P,creationDate:go,inReplyTo:Ie(qI),deleted:Ln,filePath:Ie(P),lineNumber:Ie(vt)}){}const Lwe=ze({id:P,content:P,author:P,creationDate:P,inReplyTo:Ie(P),deleted:Ln,filePath:Ie(P),lineNumber:Ie(vt)}),F7=ze({root:Lwe,replies:Gt(pve(()=>F7))}),Pwe=ze({filePath:Ie(P),beforeCommitId:Ie(P),afterCommitId:Ie(P),comments:Gt(F7)}),Fwe=Rs("new_comment","comment_edited","comment_deleted","approval_changed","merge_changed","title_changed","description_changed","pr_merged","pr_closed","pr_reopened");class FLe extends jh("PersistentNotification")({id:vt,pullRequestId:ql,awsAccountId:P,type:Fwe,message:P,createdAt:go,read:Ln}){}Ehe();class ULe extends jh("NotificationItem")({type:Iwe,title:P,message:P,timestamp:go,profile:lve(P,{exact:!0})}){}class En extends o7()("ApiError",{message:P}){}const Uwe=ze({id:P,awsAccountId:P,accountProfile:P,accountRegion:P,title:P,description:Lr(P),author:P,repositoryName:P,creationDate:P,lastModifiedDate:P,status:P,sourceBranch:P,destinationBranch:P,isMergeable:vt,isApproved:vt,commentCount:Lr(vt),link:P,fetchedAt:P}),Bwe=ze({id:vt,pullRequestId:P,awsAccountId:P,type:P,title:P,profile:P,message:P,createdAt:P,read:vt});class Hwe extends Uu("prs").add(wi("list","/").addSuccess(a7($we))).add(hr("refresh","/refresh").addSuccess(P)).add(wi("search","/search").setUrlParams(ze({q:P,limit:Ie(lp.pipe(r7(1,50))),offset:Ie(lp.pipe(vve(0)))})).addSuccess(ze({items:Gt(Uwe),total:vt,hasMore:Ln})).addError(En)).add(hr("refreshSingle","/:awsAccountId/:prId/refresh").setPath(ze({awsAccountId:P,prId:ql})).addSuccess(P).addError(En)).add(hr("create","/").setPayload(ze({repositoryName:P,title:P,description:Ie(P),sourceBranch:P,destinationBranch:P,account:Jx})).addSuccess(P).addError(En)).add(hr("open","/open").setPayload(ze({profile:P,link:P.pipe(AN(t=>/^https:\/\/[\w-]+\.console\.aws\.amazon\.com\//.test(t)))})).addSuccess(P).addError(En)).add(hr("comments","/comments").setPayload(ze({pullRequestId:P,repositoryName:P,account:Jx})).addSuccess(Gt(Pwe)).addError(En)).prefix("/api/prs"){}class qwe extends Uu("events").add(wi("stream","/").addSuccess(P)).prefix("/api/events"){}const Vwe=ze({hostPath:P,containerPath:P,readonly:Ln}),U7=ze({image:P,extensions:Gt(P),setupCommands:Gt(P),env:hve({key:P,value:P}),enableClaudeCode:Ln,volumeMounts:Gt(Vwe),cloneDepth:vt}),B7=ze({accounts:Gt(ze({profile:P,regions:Gt(P),enabled:Ln})),autoDetect:Ln,autoRefresh:Ln,refreshIntervalSeconds:vt,currentUser:Ie(P),sandbox:Ie(U7)}),Kwe=ze({path:P,exists:Ln,modifiedAt:Ie(P)}),Gwe=ze({path:P,sizeBytes:vt,exists:Ln,modifiedAt:Ie(P)}),Ywe=ze({status:Rs("valid","missing","corrupted"),path:P,errors:Gt(P)}),Wwe=ze({accounts:Gt(ze({profile:P,regions:Gt(P),enabled:Ln})),autoDetect:Ln,autoRefresh:Ln,refreshIntervalSeconds:vt,sandbox:Ie(U7)}),Jwe=ze({backupPath:Ie(P),config:B7});class Xwe extends Uu("config").add(wi("list","/").addSuccess(B7)).add(wi("path","/path").addSuccess(Kwe).addError(En)).add(wi("database","/database").addSuccess(Gwe).addError(En)).add(wi("validate","/validate").addSuccess(Ywe).addError(En)).add(hr("save","/save").setPayload(Wwe).addSuccess(P).addError(En)).add(hr("reset","/reset").addSuccess(Jwe).addError(En)).prefix("/api/config"){}class Qwe extends Uu("accounts").add(wi("list","/").addSuccess(a7(Jx))).prefix("/api/accounts"){}const VI=ze({awsAccountId:P,pullRequestId:ql}),Zwe=ze({awsAccountId:P,pullRequestId:P});class e1e extends Uu("subscriptions").add(hr("subscribe","/subscribe").setPayload(VI).addSuccess(P).addError(En)).add(hr("unsubscribe","/unsubscribe").setPayload(VI).addSuccess(P).addError(En)).add(wi("list","/").addSuccess(Gt(Zwe))).prefix("/api/subscriptions"){}const t1e=ze({items:Gt(Bwe),nextCursor:Ie(vt)});class n1e extends Uu("notifications").add(wi("list","/").setUrlParams(ze({limit:Ie(lp.pipe(r7(1,100))),cursor:Ie(lp),filter:Ie(Rs("system","prs")),unreadOnly:Ie(lp)})).addSuccess(t1e)).add(wi("count","/count").addSuccess(ze({unread:vt}))).add(hr("markRead","/read").setPayload(ze({id:vt})).addSuccess(P)).add(hr("markUnread","/unread").setPayload(ze({id:vt})).addSuccess(P)).add(hr("markAllRead","/read-all").addSuccess(P)).add(hr("ssoLogin","/sso-login").setPayload(ze({profile:dy})).addSuccess(P).addError(En)).add(hr("ssoLogout","/sso-logout").addSuccess(P).addError(En)).prefix("/api/notifications"){}const a_=ze({id:P,pullRequestId:P,awsAccountId:P,repositoryName:P,sourceBranch:P,containerId:Lr(P),port:Lr(vt),status:P7,statusDetail:Lr(P),logs:Lr(P),error:Lr(P),createdAt:P,lastActivityAt:P}),r1e=ze({pullRequestId:ql,awsAccountId:P,repositoryName:P,sourceBranch:P,profile:dy,region:P}),lb=ze({sandboxId:Nl});class i1e extends Uu("sandbox").add(hr("create","/").setPayload(r1e).addSuccess(a_).addError(En)).add(wi("list","/").addSuccess(Gt(a_)).addError(En)).add(wi("get","/:sandboxId").setPath(lb).addSuccess(a_).addError(En)).add(hr("stop","/:sandboxId/stop").setPath(lb).addSuccess(P).addError(En)).add(hr("restart","/:sandboxId/restart").setPath(lb).addSuccess(P).addError(En)).add(Mwe("delete","/:sandboxId").setPath(lb).addSuccess(P).addError(En)).prefix("/api/sandbox"){}class a1e extends Lxe().add(Hwe).add(qwe).add(Xwe).add(Qwe).add(n1e).add(e1e).add(i1e){}class xt extends DSe()("ApiClient",{api:a1e,baseUrl:"/",httpClient:Twe}){}LN(xt.layer);const s1e={pullRequests:[],accounts:[],status:"idle"};xt.query("prs","list",{reactivityKeys:["prs"],timeToLive:"30 seconds"});const YN=xt.query("config","list",{reactivityKeys:["config"],timeToLive:"30 seconds"});xt.query("accounts","list",{reactivityKeys:["accounts"],timeToLive:"60 seconds"});const H7=xt.mutation("prs","refresh"),o1e=xt.mutation("prs","open"),KI=xt.mutation("prs","comments"),l1e=xt.query("config","path",{reactivityKeys:["config"],timeToLive:"60 seconds"}),c1e=xt.query("config","database",{reactivityKeys:["config"],timeToLive:"60 seconds"}),u1e=xt.query("config","validate",{reactivityKeys:["config"],timeToLive:"60 seconds"}),WN=xt.mutation("config","save"),f1e=xt.mutation("config","reset"),JN=xt.mutation("notifications","ssoLogin"),XN=xt.mutation("notifications","ssoLogout"),d1e=xt.query("subscriptions","list",{reactivityKeys:["subscriptions"],timeToLive:"5 seconds"}),h1e=xt.mutation("subscriptions","subscribe"),m1e=xt.mutation("subscriptions","unsubscribe");xt.query("notifications","list",{urlParams:{},reactivityKeys:["notifications"],timeToLive:"10 seconds"});xt.query("notifications","count",{reactivityKeys:["notifications"],timeToLive:"10 seconds"});const p1e=xt.mutation("notifications","list"),g1e=xt.mutation("notifications","markRead"),y1e=xt.mutation("notifications","markUnread"),b1e=xt.mutation("notifications","markAllRead");xt.query("sandbox","list",{reactivityKeys:["sandbox"],timeToLive:"5 seconds"});const v1e=xt.mutation("sandbox","create"),q7=xt.mutation("sandbox","stop"),V7=xt.mutation("sandbox","restart"),K7=xt.mutation("sandbox","delete");xt.mutation("prs","search");const x1e=xt.mutation("prs","refreshSingle"),As=Dh(s1e).pipe(Pu),S1e=ze({id:P,title:P,description:Ie(P),author:P,repositoryName:P,creationDate:ev,lastModifiedDate:ev,link:P,account:ze({profile:P,region:P,awsAccountId:Ie(P)}),status:L7,sourceBranch:P,destinationBranch:P,isMergeable:Ln,isApproved:Ln,commentCount:Ie(vt),healthScore:Ie(vt),fetchedAt:Ie(ev)}),w1e=ze({id:vt,pullRequestId:P,awsAccountId:P,type:P,title:P,profile:P,message:P,createdAt:P,read:vt}),_1e=ze({id:P,pullRequestId:P,awsAccountId:P,repositoryName:P,sourceBranch:P,containerId:Lr(P),port:Lr(vt),status:P,statusDetail:Lr(P),logs:Lr(P),error:Lr(P),createdAt:P,lastActivityAt:P}),E1e=ze({pullRequests:Gt(S1e),accounts:Gt(ze({profile:P,region:P,enabled:Ln})),status:zwe,statusDetail:Ie(P),error:Ie(P),lastUpdated:Ie(ev),currentUser:Ie(P),unreadNotificationCount:Ie(vt),notifications:Ie(ze({items:Gt(w1e),nextCursor:Ie(vt)})),sandboxes:Ie(Gt(_1e))}),k1e=O9(ON(E1e));function C1e(e,t){const n=y.useRef(e);n.current=e;const r=y.useRef(t);r.current=t;const[i,a]=y.useState("disconnected"),s=y.useRef(0);return y.useEffect(()=>{let o=null,l=0,c=null;const f=()=>{o=new EventSource("/api/events/"),o.onopen=()=>{l=0,a("connected")},o.onmessage=u=>{var d;try{const h=k1e(u.data),p=((d=h.notifications)==null?void 0:d.items)??[];if(s.current>0)for(const b of p)b.id>s.current&&fwe(b.title||"New notification",{description:b.message,action:{label:"View",onClick:()=>{var x;return(x=r.current)==null?void 0:x.call(r)}}});if(p.length>0){const b=Math.max(...p.map(x=>x.id));b>s.current&&(s.current=b)}n.current(h)}catch{}},o.onerror=()=>{if(o==null||o.close(),l>=50){a("disconnected");return}a("reconnecting");const u=Math.min(1e3*2**l,3e4);c=setTimeout(()=>{l++,f()},u)}};return f(),()=>{o==null||o.close(),c&&clearTimeout(c)}},[]),i}/**
88
+ * @license lucide-react v0.563.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const G7=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
93
+ * @license lucide-react v0.563.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const T1e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
98
+ * @license lucide-react v0.563.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const R1e=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
103
+ * @license lucide-react v0.563.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const GI=e=>{const t=R1e(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
108
+ * @license lucide-react v0.563.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */var A1e={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"};/**
113
+ * @license lucide-react v0.563.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const N1e=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
118
+ * @license lucide-react v0.563.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const O1e=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},l)=>y.createElement("svg",{ref:l,...A1e,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:G7("lucide",i),...!a&&!N1e(o)&&{"aria-hidden":"true"},...o},[...s.map(([c,f])=>y.createElement(c,f)),...Array.isArray(a)?a:[a]]));/**
123
+ * @license lucide-react v0.563.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const We=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(O1e,{ref:a,iconNode:t,className:G7(`lucide-${T1e(GI(e))}`,`lucide-${e}`,r),...i}));return n.displayName=GI(e),n};/**
128
+ * @license lucide-react v0.563.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const M1e=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QN=We("arrow-left",M1e);/**
133
+ * @license lucide-react v0.563.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const j1e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],D1e=We("arrow-right",j1e);/**
138
+ * @license lucide-react v0.563.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const I1e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],z1e=We("bell-off",I1e);/**
143
+ * @license lucide-react v0.563.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const $1e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ZN=We("bell",$1e);/**
148
+ * @license lucide-react v0.563.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const L1e=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],ag=We("box",L1e);/**
153
+ * @license lucide-react v0.563.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const P1e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ZS=We("check",P1e);/**
158
+ * @license lucide-react v0.563.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const F1e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e2=We("chevron-down",F1e);/**
163
+ * @license lucide-react v0.563.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const U1e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],B1e=We("chevron-right",U1e);/**
168
+ * @license lucide-react v0.563.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const H1e=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],q1e=We("chevron-up",H1e);/**
173
+ * @license lucide-react v0.563.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const V1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],K1e=We("circle-alert",V1e);/**
178
+ * @license lucide-react v0.563.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const G1e=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Y7=We("circle-check-big",G1e);/**
183
+ * @license lucide-react v0.563.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const Y1e=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],W7=We("code",Y1e);/**
188
+ * @license lucide-react v0.563.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const W1e=[["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"}]],J7=We("copy",W1e);/**
193
+ * @license lucide-react v0.563.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const J1e=[["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"}]],X1e=We("external-link",J1e);/**
198
+ * @license lucide-react v0.563.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Q1e=[["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"}]],Z1e=We("file",Q1e);/**
203
+ * @license lucide-react v0.563.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const e_e=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],t_e=We("flame",e_e);/**
208
+ * @license lucide-react v0.563.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const n_e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],YI=We("funnel",n_e);/**
213
+ * @license lucide-react v0.563.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const r_e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t2=We("info",r_e);/**
218
+ * @license lucide-react v0.563.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const i_e=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],gu=We("loader",i_e);/**
223
+ * @license lucide-react v0.563.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const a_e=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],X7=We("log-in",a_e);/**
228
+ * @license lucide-react v0.563.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const s_e=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Q7=We("log-out",s_e);/**
233
+ * @license lucide-react v0.563.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const o_e=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],l_e=We("mail-open",o_e);/**
238
+ * @license lucide-react v0.563.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const c_e=[["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"}]],u_e=We("mail",c_e);/**
243
+ * @license lucide-react v0.563.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const f_e=[["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"}]],d_e=We("message-square",f_e);/**
248
+ * @license lucide-react v0.563.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const h_e=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],m_e=We("monitor",h_e);/**
253
+ * @license lucide-react v0.563.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const p_e=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Z7=We("moon",p_e);/**
258
+ * @license lucide-react v0.563.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const g_e=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],y_e=We("palette",g_e);/**
263
+ * @license lucide-react v0.563.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const b_e=[["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"}]],eq=We("play",b_e);/**
268
+ * @license lucide-react v0.563.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const v_e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zc=We("plus",v_e);/**
273
+ * @license lucide-react v0.563.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const x_e=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hy=We("refresh-cw",x_e);/**
278
+ * @license lucide-react v0.563.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const S_e=[["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"}]],w_e=We("rotate-ccw",S_e);/**
283
+ * @license lucide-react v0.563.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const __e=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],tq=We("scroll-text",__e);/**
288
+ * @license lucide-react v0.563.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const E_e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],n2=We("search",E_e);/**
293
+ * @license lucide-react v0.563.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const k_e=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],C_e=We("server",k_e);/**
298
+ * @license lucide-react v0.563.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const T_e=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sf=We("settings",T_e);/**
303
+ * @license lucide-react v0.563.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const R_e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nq=We("square",R_e);/**
308
+ * @license lucide-react v0.563.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const A_e=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],rq=We("sun",A_e);/**
313
+ * @license lucide-react v0.563.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const N_e=[["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"}]],iq=We("trash-2",N_e);/**
318
+ * @license lucide-react v0.563.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const O_e=[["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"}]],s_=We("trash",O_e);/**
323
+ * @license lucide-react v0.563.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const M_e=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],j_e=We("triangle-alert",M_e);/**
328
+ * @license lucide-react v0.563.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const D_e=[["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"}]],r2=We("user",D_e);/**
333
+ * @license lucide-react v0.563.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const I_e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],i2=We("x",I_e);Dh("").pipe(Pu);Dh({type:"all"}).pipe(Pu);const WI=Dh(!1).pipe(Pu),aq=["accounts","refresh","sandbox","theme","config","about"];Dh("accounts").pipe(Pu);var JI=1,z_e=.9,$_e=.8,L_e=.17,o_=.1,l_=.999,P_e=.9999,F_e=.99,U_e=/[\\\/_+.#"@\[\(\{&]/,B_e=/[\\\/_+.#"@\[\(\{&]/g,H_e=/[\s-]/,sq=/[\s-]/g;function SC(e,t,n,r,i,a,s){if(a===t.length)return i===e.length?JI:F_e;var o=`${i},${a}`;if(s[o]!==void 0)return s[o];for(var l=r.charAt(a),c=n.indexOf(l,i),f=0,u,d,h,p;c>=0;)u=SC(e,t,n,r,c+1,a+1,s),u>f&&(c===i?u*=JI:U_e.test(e.charAt(c-1))?(u*=$_e,h=e.slice(i,c-1).match(B_e),h&&i>0&&(u*=Math.pow(l_,h.length))):H_e.test(e.charAt(c-1))?(u*=z_e,p=e.slice(i,c-1).match(sq),p&&i>0&&(u*=Math.pow(l_,p.length))):(u*=L_e,i>0&&(u*=Math.pow(l_,c-i))),e.charAt(c)!==t.charAt(a)&&(u*=P_e)),(u<o_&&n.charAt(c-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(c-1)!==r.charAt(a))&&(d=SC(e,t,n,r,c+1,a+2,s),d*o_>u&&(u=d*o_)),u>f&&(f=u),c=n.indexOf(l,c+1);return s[o]=f,f}function XI(e){return e.toLowerCase().replace(sq," ")}function q_e(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,SC(e,t,XI(e),XI(t),0,0,{})}function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function QI(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vs(...e){return t=>{let n=!1;const r=e.map(i=>{const a=QI(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():QI(e[i],null)}}}}function Lt(...e){return y.useCallback(vs(...e),e)}function V_e(e,t){const n=y.createContext(t),r=a=>{const{children:s,...o}=a,l=y.useMemo(()=>o,Object.values(o));return m.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(a){const s=y.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function ac(e,t=[]){let n=[];function r(a,s){const o=y.createContext(s),l=n.length;n=[...n,s];const c=u=>{var g;const{scope:d,children:h,...p}=u,b=((g=d==null?void 0:d[e])==null?void 0:g[l])||o,x=y.useMemo(()=>p,Object.values(p));return m.jsx(b.Provider,{value:x,children:h})};c.displayName=a+"Provider";function f(u,d){var b;const h=((b=d==null?void 0:d[e])==null?void 0:b[l])||o,p=y.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,f]}const i=()=>{const a=n.map(s=>y.createContext(s));return function(o){const l=(o==null?void 0:o[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,K_e(i,...t)]}function K_e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:c})=>{const u=l(a)[`__scope${c}`];return{...o,...u}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ar=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},G_e=h0[" useId ".trim().toString()]||(()=>{}),Y_e=0;function Hr(e){const[t,n]=y.useState(G_e());return Ar(()=>{n(r=>r??String(Y_e++))},[e]),e||(t?`radix-${t}`:"")}var W_e=h0[" useInsertionEffect ".trim().toString()]||Ar;function Vl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,s]=J_e({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const f=y.useRef(e!==void 0);y.useEffect(()=>{const u=f.current;u!==o&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${o?"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.`),f.current=o},[o,r])}const c=y.useCallback(f=>{var u;if(o){const d=X_e(f)?f(e):f;d!==e&&((u=s.current)==null||u.call(s,d))}else a(f)},[o,e,a,s]);return[l,c]}function J_e({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return W_e(()=>{a.current=t},[t]),y.useEffect(()=>{var s;i.current!==n&&((s=a.current)==null||s.call(a,n),i.current=n)},[n,i]),[n,r,a]}function X_e(e){return typeof e=="function"}function yu(e){const t=Q_e(e),n=y.forwardRef((r,i)=>{const{children:a,...s}=r,o=y.Children.toArray(a),l=o.find(eEe);if(l){const c=l.props.children,f=o.map(u=>u===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:u);return m.jsx(t,{...s,ref:i,children:y.isValidElement(c)?y.cloneElement(c,void 0,f):null})}return m.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var oq=yu("Slot");function Q_e(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const s=nEe(i),o=tEe(a,i.props);return i.type!==y.Fragment&&(o.ref=r?vs(r,s):s),y.cloneElement(i,o)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z_e=Symbol("radix.slottable");function eEe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z_e}function tEe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function nEe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=rEe.reduce((e,t)=>{const n=yu(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lq(e,t){e&&eh.flushSync(()=>e.dispatchEvent(t))}function xs(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function iEe(e,t=globalThis==null?void 0:globalThis.document){const n=xs(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var aEe="DismissableLayer",wC="dismissableLayer.update",sEe="dismissableLayer.pointerDownOutside",oEe="dismissableLayer.focusOutside",ZI,cq=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ew=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...l}=e,c=y.useContext(cq),[f,u]=y.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=Lt(t,_=>u(_)),b=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=b.indexOf(x),v=f?b.indexOf(f):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,E=v>=g,C=uEe(_=>{const A=_.target,D=[...c.branches].some(O=>O.contains(A));!E||D||(i==null||i(_),s==null||s(_),_.defaultPrevented||o==null||o())},d),k=fEe(_=>{const A=_.target;[...c.branches].some(O=>O.contains(A))||(a==null||a(_),s==null||s(_),_.defaultPrevented||o==null||o())},d);return iEe(_=>{v===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},d),y.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ZI=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),ez(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=ZI)}},[f,d,n,c]),y.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),ez())},[f,c]),y.useEffect(()=>{const _=()=>h({});return document.addEventListener(wC,_),()=>document.removeEventListener(wC,_)},[]),m.jsx(tt.div,{...l,ref:p,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,C.onPointerDownCapture)})});ew.displayName=aEe;var lEe="DismissableLayerBranch",cEe=y.forwardRef((e,t)=>{const n=y.useContext(cq),r=y.useRef(null),i=Lt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(tt.div,{...e,ref:i})});cEe.displayName=lEe;function uEe(e,t=globalThis==null?void 0:globalThis.document){const n=xs(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let l=function(){uq(sEe,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fEe(e,t=globalThis==null?void 0:globalThis.document){const n=xs(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&uq(oEe,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ez(){const e=new CustomEvent(wC);document.dispatchEvent(e)}function uq(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?lq(i,a):i.dispatchEvent(a)}var c_="focusScope.autoFocusOnMount",u_="focusScope.autoFocusOnUnmount",tz={bubbles:!1,cancelable:!0},dEe="FocusScope",tw=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,l]=y.useState(null),c=xs(i),f=xs(a),u=y.useRef(null),d=Lt(t,b=>l(b)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(w){if(h.paused||!o)return;const E=w.target;o.contains(E)?u.current=E:qo(u.current,{select:!0})},x=function(w){if(h.paused||!o)return;const E=w.relatedTarget;E!==null&&(o.contains(E)||qo(u.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qo(o)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),v.disconnect()}}},[r,o,h.paused]),y.useEffect(()=>{if(o){rz.add(h);const b=document.activeElement;if(!o.contains(b)){const g=new CustomEvent(c_,tz);o.addEventListener(c_,c),o.dispatchEvent(g),g.defaultPrevented||(hEe(bEe(fq(o)),{select:!0}),document.activeElement===b&&qo(o))}return()=>{o.removeEventListener(c_,c),setTimeout(()=>{const g=new CustomEvent(u_,tz);o.addEventListener(u_,f),o.dispatchEvent(g),g.defaultPrevented||qo(b??document.body,{select:!0}),o.removeEventListener(u_,f),rz.remove(h)},0)}}},[o,c,f,h]);const p=y.useCallback(b=>{if(!n&&!r||h.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,g=document.activeElement;if(x&&g){const v=b.currentTarget,[w,E]=mEe(v);w&&E?!b.shiftKey&&g===E?(b.preventDefault(),n&&qo(w,{select:!0})):b.shiftKey&&g===w&&(b.preventDefault(),n&&qo(E,{select:!0})):g===v&&b.preventDefault()}},[n,r,h.paused]);return m.jsx(tt.div,{tabIndex:-1,...s,ref:d,onKeyDown:p})});tw.displayName=dEe;function hEe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qo(r,{select:t}),document.activeElement!==n)return}function mEe(e){const t=fq(e),n=nz(t,e),r=nz(t.reverse(),e);return[n,r]}function fq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nz(e,t){for(const n of e)if(!pEe(n,{upTo:t}))return n}function pEe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gEe(e){return e instanceof HTMLInputElement&&"select"in e}function qo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gEe(e)&&t&&e.select()}}var rz=yEe();function yEe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=iz(e,t),e.unshift(t)},remove(t){var n;e=iz(e,t),(n=e[0])==null||n.resume()}}}function iz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bEe(e){return e.filter(t=>t.tagName!=="A")}var vEe="Portal",nw=y.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,a]=y.useState(!1);Ar(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?AP.createPortal(m.jsx(tt.div,{...r,ref:t}),s):null});nw.displayName=vEe;function xEe(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var sc=e=>{const{present:t,children:n}=e,r=SEe(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Lt(r.ref,wEe(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};sc.displayName="Presence";function SEe(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),s=e?"mounted":"unmounted",[o,l]=xEe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=cb(r.current);a.current=o==="mounted"?c:"none"},[o]),Ar(()=>{const c=r.current,f=i.current;if(f!==e){const d=a.current,h=cb(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Ar(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=h=>{const b=cb(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},d=h=>{h.target===t&&(a.current=cb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function cb(e){return(e==null?void 0:e.animationName)||"none"}function wEe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var f_=0;function a2(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??az()),document.body.insertAdjacentElement("beforeend",e[1]??az()),f_++,()=>{f_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),f_--}},[])}function az(){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 Za=function(){return Za=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Za.apply(this,arguments)};function dq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function _Ee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var lv="right-scroll-bar-position",cv="width-before-scroll-bar",EEe="with-scroll-bars-hidden",kEe="--removed-body-scroll-bar-size";function d_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CEe(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var TEe=typeof window<"u"?y.useLayoutEffect:y.useEffect,sz=new WeakMap;function REe(e,t){var n=CEe(null,function(r){return e.forEach(function(i){return d_(i,r)})});return TEe(function(){var r=sz.get(n);if(r){var i=new Set(r),a=new Set(e),s=n.current;i.forEach(function(o){a.has(o)||d_(o,null)}),a.forEach(function(o){i.has(o)||d_(o,s)})}sz.set(n,e)},[e]),n}function AEe(e){return e}function NEe(e,t){t===void 0&&(t=AEe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var l=function(){var f=s;s=[],f.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function OEe(e){e===void 0&&(e={});var t=NEe(null);return t.options=Za({async:!0,ssr:!1},e),t}var hq=function(e){var t=e.sideCar,n=dq(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Za({},n))};hq.isSideCarExport=!0;function MEe(e,t){return e.useMedium(t),hq}var mq=OEe(),h_=function(){},rw=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:h_,onWheelCapture:h_,onTouchMoveCapture:h_}),i=r[0],a=r[1],s=e.forwardProps,o=e.children,l=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,d=e.sideCar,h=e.noRelative,p=e.noIsolation,b=e.inert,x=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,w=e.gapMode,E=dq(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=d,k=REe([n,t]),_=Za(Za({},E),i);return y.createElement(y.Fragment,null,f&&y.createElement(C,{sideCar:mq,removeScrollBar:c,shards:u,noRelative:h,noIsolation:p,inert:b,setCallbacks:a,allowPinchZoom:!!x,lockRef:n,gapMode:w}),s?y.cloneElement(y.Children.only(o),Za(Za({},_),{ref:k})):y.createElement(v,Za({},_,{className:l,ref:k}),o))});rw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rw.classNames={fullWidth:cv,zeroRight:lv};var jEe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function DEe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jEe();return t&&e.setAttribute("nonce",t),e}function IEe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zEe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $Ee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=DEe())&&(IEe(t,n),zEe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LEe=function(){var e=$Ee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pq=function(){var e=LEe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},PEe={left:0,top:0,right:0,gap:0},m_=function(e){return parseInt(e||"",10)||0},FEe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[m_(n),m_(r),m_(i)]},UEe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PEe;var t=FEe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},BEe=pq(),fd="data-scroll-locked",HEe=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return n===void 0&&(n="margin"),`
338
+ .`.concat(EEe,` {
339
+ overflow: hidden `).concat(r,`;
340
+ padding-right: `).concat(o,"px ").concat(r,`;
341
+ }
342
+ body[`).concat(fd,`] {
343
+ overflow: hidden `).concat(r,`;
344
+ overscroll-behavior: contain;
345
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
346
+ padding-left: `.concat(i,`px;
347
+ padding-top: `).concat(a,`px;
348
+ padding-right: `).concat(s,`px;
349
+ margin-left:0;
350
+ margin-top:0;
351
+ margin-right: `).concat(o,"px ").concat(r,`;
352
+ `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
353
+ }
354
+
355
+ .`).concat(lv,` {
356
+ right: `).concat(o,"px ").concat(r,`;
357
+ }
358
+
359
+ .`).concat(cv,` {
360
+ margin-right: `).concat(o,"px ").concat(r,`;
361
+ }
362
+
363
+ .`).concat(lv," .").concat(lv,` {
364
+ right: 0 `).concat(r,`;
365
+ }
366
+
367
+ .`).concat(cv," .").concat(cv,` {
368
+ margin-right: 0 `).concat(r,`;
369
+ }
370
+
371
+ body[`).concat(fd,`] {
372
+ `).concat(kEe,": ").concat(o,`px;
373
+ }
374
+ `)},oz=function(){var e=parseInt(document.body.getAttribute(fd)||"0",10);return isFinite(e)?e:0},qEe=function(){y.useEffect(function(){return document.body.setAttribute(fd,(oz()+1).toString()),function(){var e=oz()-1;e<=0?document.body.removeAttribute(fd):document.body.setAttribute(fd,e.toString())}},[])},VEe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;qEe();var a=y.useMemo(function(){return UEe(i)},[i]);return y.createElement(BEe,{styles:HEe(a,!t,i,n?"":"!important")})},_C=!1;if(typeof window<"u")try{var ub=Object.defineProperty({},"passive",{get:function(){return _C=!0,!0}});window.addEventListener("test",ub,ub),window.removeEventListener("test",ub,ub)}catch{_C=!1}var of=_C?{passive:!1}:!1,KEe=function(e){return e.tagName==="TEXTAREA"},gq=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!KEe(e)&&n[t]==="visible")},GEe=function(e){return gq(e,"overflowY")},YEe=function(e){return gq(e,"overflowX")},lz=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=yq(e,r);if(i){var a=bq(e,r),s=a[1],o=a[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WEe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},JEe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yq=function(e,t){return e==="v"?GEe(t):YEe(t)},bq=function(e,t){return e==="v"?WEe(t):JEe(t)},XEe=function(e,t){return e==="h"&&t==="rtl"?-1:1},QEe=function(e,t,n,r,i){var a=XEe(e,window.getComputedStyle(t).direction),s=a*r,o=n.target,l=t.contains(o),c=!1,f=s>0,u=0,d=0;do{if(!o)break;var h=bq(e,o),p=h[0],b=h[1],x=h[2],g=b-x-a*p;(p||g)&&yq(e,o)&&(u+=g,d+=p);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(f&&Math.abs(u)<1||!f&&Math.abs(d)<1)&&(c=!0),c},fb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cz=function(e){return[e.deltaX,e.deltaY]},uz=function(e){return e&&"current"in e?e.current:e},ZEe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eke=function(e){return`
375
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
376
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
377
+ `)},tke=0,lf=[];function nke(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(tke++)[0],a=y.useState(pq)[0],s=y.useRef(e);y.useEffect(function(){s.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=_Ee([e.lockRef.current],(e.shards||[]).map(uz),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=y.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var g=fb(b),v=n.current,w="deltaX"in b?b.deltaX:v[0]-g[0],E="deltaY"in b?b.deltaY:v[1]-g[1],C,k=b.target,_=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in b&&_==="h"&&k.type==="range")return!1;var A=window.getSelection(),D=A&&A.anchorNode,O=D?D===k||D.contains(k):!1;if(O)return!1;var L=lz(_,k);if(!L)return!0;if(L?C=_:(C=_==="v"?"h":"v",L=lz(_,k)),!L)return!1;if(!r.current&&"changedTouches"in b&&(w||E)&&(r.current=C),!C)return!0;var B=r.current||C;return QEe(B,x,b,B==="h"?w:E)},[]),l=y.useCallback(function(b){var x=b;if(!(!lf.length||lf[lf.length-1]!==a)){var g="deltaY"in x?cz(x):fb(x),v=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&ZEe(C.delta,g)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(uz).filter(Boolean).filter(function(C){return C.contains(x.target)}),E=w.length>0?o(x,w[0]):!s.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),c=y.useCallback(function(b,x,g,v){var w={name:b,delta:x,target:g,should:v,shadowParent:rke(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=y.useCallback(function(b){n.current=fb(b),r.current=void 0},[]),u=y.useCallback(function(b){c(b.type,cz(b),b.target,o(b,e.lockRef.current))},[]),d=y.useCallback(function(b){c(b.type,fb(b),b.target,o(b,e.lockRef.current))},[]);y.useEffect(function(){return lf.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",l,of),document.addEventListener("touchmove",l,of),document.addEventListener("touchstart",f,of),function(){lf=lf.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,of),document.removeEventListener("touchmove",l,of),document.removeEventListener("touchstart",f,of)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(a,{styles:eke(i)}):null,h?y.createElement(VEe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rke(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ike=MEe(mq,nke);var iw=y.forwardRef(function(e,t){return y.createElement(rw,Za({},e,{ref:t,sideCar:ike}))});iw.classNames=rw.classNames;var ake=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cf=new WeakMap,db=new WeakMap,hb={},p_=0,vq=function(e){return e&&(e.host||vq(e.parentNode))},ske=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vq(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oke=function(e,t,n,r){var i=ske(t,Array.isArray(e)?e:[e]);hb[n]||(hb[n]=new WeakMap);var a=hb[n],s=[],o=new Set,l=new Set(i),c=function(u){!u||o.has(u)||(o.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(d){if(o.has(d))f(d);else try{var h=d.getAttribute(r),p=h!==null&&h!=="false",b=(cf.get(d)||0)+1,x=(a.get(d)||0)+1;cf.set(d,b),a.set(d,x),s.push(d),b===1&&p&&db.set(d,!0),x===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(t),o.clear(),p_++,function(){s.forEach(function(u){var d=cf.get(u)-1,h=a.get(u)-1;cf.set(u,d),a.set(u,h),d||(db.has(u)||u.removeAttribute(r),db.delete(u)),h||u.removeAttribute(n)}),p_--,p_||(cf=new WeakMap,cf=new WeakMap,db=new WeakMap,hb={})}},s2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=ake(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),oke(r,i,n,"aria-hidden")):function(){return null}},aw="Dialog",[xq]=ac(aw),[lke,qa]=xq(aw),Sq=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,o=y.useRef(null),l=y.useRef(null),[c,f]=Vl({prop:r,defaultProp:i??!1,onChange:a,caller:aw});return m.jsx(lke,{scope:t,triggerRef:o,contentRef:l,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:c,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(u=>!u),[f]),modal:s,children:n})};Sq.displayName=aw;var wq="DialogTrigger",cke=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qa(wq,n),a=Lt(t,i.triggerRef);return m.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":c2(i.open),...r,ref:a,onClick:Se(e.onClick,i.onOpenToggle)})});cke.displayName=wq;var o2="DialogPortal",[uke,_q]=xq(o2,{forceMount:void 0}),Eq=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=qa(o2,t);return m.jsx(uke,{scope:t,forceMount:n,children:y.Children.map(r,s=>m.jsx(sc,{present:n||a.open,children:m.jsx(nw,{asChild:!0,container:i,children:s})}))})};Eq.displayName=o2;var Xx="DialogOverlay",kq=y.forwardRef((e,t)=>{const n=_q(Xx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qa(Xx,e.__scopeDialog);return a.modal?m.jsx(sc,{present:r||a.open,children:m.jsx(dke,{...i,ref:t})}):null});kq.displayName=Xx;var fke=yu("DialogOverlay.RemoveScroll"),dke=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qa(Xx,n);return m.jsx(iw,{as:fke,allowPinchZoom:!0,shards:[i.contentRef],children:m.jsx(tt.div,{"data-state":c2(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),bu="DialogContent",Cq=y.forwardRef((e,t)=>{const n=_q(bu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qa(bu,e.__scopeDialog);return m.jsx(sc,{present:r||a.open,children:a.modal?m.jsx(hke,{...i,ref:t}):m.jsx(mke,{...i,ref:t})})});Cq.displayName=bu;var hke=y.forwardRef((e,t)=>{const n=qa(bu,e.__scopeDialog),r=y.useRef(null),i=Lt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return s2(a)},[]),m.jsx(Tq,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,o=s.button===0&&s.ctrlKey===!0;(s.button===2||o)&&a.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,a=>a.preventDefault())})}),mke=y.forwardRef((e,t)=>{const n=qa(bu,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return m.jsx(Tq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),Tq=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,o=qa(bu,n),l=y.useRef(null),c=Lt(t,l);return a2(),m.jsxs(m.Fragment,{children:[m.jsx(tw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(ew,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":c2(o.open),...s,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(pke,{titleId:o.titleId}),m.jsx(yke,{contentRef:l,descriptionId:o.descriptionId})]})]})}),l2="DialogTitle",Rq=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qa(l2,n);return m.jsx(tt.h2,{id:i.titleId,...r,ref:t})});Rq.displayName=l2;var Aq="DialogDescription",Nq=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qa(Aq,n);return m.jsx(tt.p,{id:i.descriptionId,...r,ref:t})});Nq.displayName=Aq;var Oq="DialogClose",Mq=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qa(Oq,n);return m.jsx(tt.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>i.onOpenChange(!1))})});Mq.displayName=Oq;function c2(e){return e?"open":"closed"}var jq="DialogTitleWarning",[BLe,Dq]=V_e(jq,{contentName:bu,titleName:l2,docsSlug:"dialog"}),pke=({titleId:e})=>{const t=Dq(jq),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
378
+
379
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
380
+
381
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gke="DialogDescriptionWarning",yke=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dq(gke).contentName}}.`;return y.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Iq=Sq,zq=Eq,$q=kq,Lq=Cq,bke=Rq,vke=Nq,xke=Mq,Ske=Symbol.for("react.lazy"),Qx=h0[" use ".trim().toString()];function wke(e){return typeof e=="object"&&e!==null&&"then"in e}function Pq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ske&&"_payload"in e&&wke(e._payload)}function _ke(e){const t=Eke(e),n=y.forwardRef((r,i)=>{let{children:a,...s}=r;Pq(a)&&typeof Qx=="function"&&(a=Qx(a._payload));const o=y.Children.toArray(a),l=o.find(Cke);if(l){const c=l.props.children,f=o.map(u=>u===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:u);return m.jsx(t,{...s,ref:i,children:y.isValidElement(c)?y.cloneElement(c,void 0,f):null})}return m.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Eke(e){const t=y.forwardRef((n,r)=>{let{children:i,...a}=n;if(Pq(i)&&typeof Qx=="function"&&(i=Qx(i._payload)),y.isValidElement(i)){const s=Rke(i),o=Tke(a,i.props);return i.type!==y.Fragment&&(o.ref=r?vs(r,s):s),y.cloneElement(i,o)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kke=Symbol("radix.slottable");function Cke(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kke}function Tke(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Rke(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ake=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oc=Ake.reduce((e,t)=>{const n=_ke(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),dm='[cmdk-group=""]',g_='[cmdk-group-items=""]',Nke='[cmdk-group-heading=""]',Fq='[cmdk-item=""]',fz=`${Fq}:not([aria-disabled="true"])`,EC="cmdk-item-select",wf="data-value",Oke=(e,t,n)=>q_e(e,t,n),Uq=y.createContext(void 0),my=()=>y.useContext(Uq),Bq=y.createContext(void 0),u2=()=>y.useContext(Bq),Hq=y.createContext(void 0),qq=y.forwardRef((e,t)=>{let n=_f(()=>{var q,T;return{search:"",value:(T=(q=e.value)!=null?q:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=_f(()=>new Set),i=_f(()=>new Map),a=_f(()=>new Map),s=_f(()=>new Set),o=Vq(e),{label:l,children:c,value:f,onValueChange:u,filter:d,shouldFilter:h,loop:p,disablePointerSelection:b=!1,vimBindings:x=!0,...g}=e,v=Hr(),w=Hr(),E=Hr(),C=y.useRef(null),k=Bke();vu(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,_.emit()}},[f]),vu(()=>{k(6,X)},[]);let _=y.useMemo(()=>({subscribe:q=>(s.current.add(q),()=>s.current.delete(q)),snapshot:()=>n.current,setState:(q,T,K)=>{var G,oe,Q,se;if(!Object.is(n.current[q],T)){if(n.current[q]=T,q==="search")B(),O(),k(1,L);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(E);ye?ye.focus():(G=document.getElementById(v))==null||G.focus()}if(k(7,()=>{var ye;n.current.selectedItemId=(ye=W())==null?void 0:ye.id,_.emit()}),K||k(5,X),((oe=o.current)==null?void 0:oe.value)!==void 0){let ye=T??"";(se=(Q=o.current).onValueChange)==null||se.call(Q,ye);return}}_.emit()}},emit:()=>{s.current.forEach(q=>q())}}),[]),A=y.useMemo(()=>({value:(q,T,K)=>{var G;T!==((G=a.current.get(q))==null?void 0:G.value)&&(a.current.set(q,{value:T,keywords:K}),n.current.filtered.items.set(q,D(T,K)),k(2,()=>{O(),_.emit()}))},item:(q,T)=>(r.current.add(q),T&&(i.current.has(T)?i.current.get(T).add(q):i.current.set(T,new Set([q]))),k(3,()=>{B(),O(),n.current.value||L(),_.emit()}),()=>{a.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let K=W();k(4,()=>{B(),(K==null?void 0:K.getAttribute("id"))===q&&L(),_.emit()})}),group:q=>(i.current.has(q)||i.current.set(q,new Set),()=>{a.current.delete(q),i.current.delete(q)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:E,labelId:w,listInnerRef:C}),[]);function D(q,T){var K,G;let oe=(G=(K=o.current)==null?void 0:K.filter)!=null?G:Oke;return q?oe(q,n.current.search,T):0}function O(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(G=>{let oe=i.current.get(G),Q=0;oe.forEach(se=>{let ye=q.get(se);Q=Math.max(ye,Q)}),T.push([G,Q])});let K=C.current;U().sort((G,oe)=>{var Q,se;let ye=G.getAttribute("id"),Ae=oe.getAttribute("id");return((Q=q.get(Ae))!=null?Q:0)-((se=q.get(ye))!=null?se:0)}).forEach(G=>{let oe=G.closest(g_);oe?oe.appendChild(G.parentElement===oe?G:G.closest(`${g_} > *`)):K.appendChild(G.parentElement===K?G:G.closest(`${g_} > *`))}),T.sort((G,oe)=>oe[1]-G[1]).forEach(G=>{var oe;let Q=(oe=C.current)==null?void 0:oe.querySelector(`${dm}[${wf}="${encodeURIComponent(G[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function L(){let q=U().find(K=>K.getAttribute("aria-disabled")!=="true"),T=q==null?void 0:q.getAttribute(wf);_.setState("value",T||void 0)}function B(){var q,T,K,G;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let Q of r.current){let se=(T=(q=a.current.get(Q))==null?void 0:q.value)!=null?T:"",ye=(G=(K=a.current.get(Q))==null?void 0:K.keywords)!=null?G:[],Ae=D(se,ye);n.current.filtered.items.set(Q,Ae),Ae>0&&oe++}for(let[Q,se]of i.current)for(let ye of se)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=oe}function X(){var q,T,K;let G=W();G&&(((q=G.parentElement)==null?void 0:q.firstChild)===G&&((K=(T=G.closest(dm))==null?void 0:T.querySelector(Nke))==null||K.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function W(){var q;return(q=C.current)==null?void 0:q.querySelector(`${Fq}[aria-selected="true"]`)}function U(){var q;return Array.from(((q=C.current)==null?void 0:q.querySelectorAll(fz))||[])}function I(q){let T=U()[q];T&&_.setState("value",T.getAttribute(wf))}function F(q){var T;let K=W(),G=U(),oe=G.findIndex(se=>se===K),Q=G[oe+q];(T=o.current)!=null&&T.loop&&(Q=oe+q<0?G[G.length-1]:oe+q===G.length?G[0]:G[oe+q]),Q&&_.setState("value",Q.getAttribute(wf))}function z(q){let T=W(),K=T==null?void 0:T.closest(dm),G;for(;K&&!G;)K=q>0?Fke(K,dm):Uke(K,dm),G=K==null?void 0:K.querySelector(fz);G?_.setState("value",G.getAttribute(wf)):F(q)}let V=()=>I(U().length-1),N=q=>{q.preventDefault(),q.metaKey?V():q.altKey?z(1):F(1)},ue=q=>{q.preventDefault(),q.metaKey?I(0):q.altKey?z(-1):F(-1)};return y.createElement(oc.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:q=>{var T;(T=g.onKeyDown)==null||T.call(g,q);let K=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||K))switch(q.key){case"n":case"j":{x&&q.ctrlKey&&N(q);break}case"ArrowDown":{N(q);break}case"p":case"k":{x&&q.ctrlKey&&ue(q);break}case"ArrowUp":{ue(q);break}case"Home":{q.preventDefault(),I(0);break}case"End":{q.preventDefault(),V();break}case"Enter":{q.preventDefault();let G=W();if(G){let oe=new Event(EC);G.dispatchEvent(oe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:qke},l),sw(e,q=>y.createElement(Bq.Provider,{value:_},y.createElement(Uq.Provider,{value:A},q))))}),Mke=y.forwardRef((e,t)=>{var n,r;let i=Hr(),a=y.useRef(null),s=y.useContext(Hq),o=my(),l=Vq(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;vu(()=>{if(!c)return o.item(i,s==null?void 0:s.id)},[c]);let f=Kq(i,a,[e.value,e.children,a],e.keywords),u=u2(),d=Kl(k=>k.value&&k.value===f.current),h=Kl(k=>c||o.filter()===!1?!0:k.search?k.filtered.items.get(i)>0:!0);y.useEffect(()=>{let k=a.current;if(!(!k||e.disabled))return k.addEventListener(EC,p),()=>k.removeEventListener(EC,p)},[h,e.onSelect,e.disabled]);function p(){var k,_;b(),(_=(k=l.current).onSelect)==null||_.call(k,f.current)}function b(){u.setState("value",f.current,!0)}if(!h)return null;let{disabled:x,value:g,onSelect:v,forceMount:w,keywords:E,...C}=e;return y.createElement(oc.div,{ref:vs(a,t),...C,id:i,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!d,"data-disabled":!!x,"data-selected":!!d,onPointerMove:x||o.getDisablePointerSelection()?void 0:b,onClick:x?void 0:p},e.children)}),jke=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,s=Hr(),o=y.useRef(null),l=y.useRef(null),c=Hr(),f=my(),u=Kl(h=>i||f.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);vu(()=>f.group(s),[]),Kq(s,o,[e.value,e.heading,l]);let d=y.useMemo(()=>({id:s,forceMount:i}),[i]);return y.createElement(oc.div,{ref:vs(o,t),...a,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&y.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),sw(e,h=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},y.createElement(Hq.Provider,{value:d},h))))}),Dke=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Kl(s=>!s.search);return!n&&!a?null:y.createElement(oc.div,{ref:vs(i,t),...r,"cmdk-separator":"",role:"separator"})}),Ike=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=u2(),s=Kl(c=>c.search),o=Kl(c=>c.selectedItemId),l=my();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(oc.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:i?e.value:s,onChange:c=>{i||a.setState("search",c.target.value),n==null||n(c.target.value)}})}),zke=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),s=y.useRef(null),o=Kl(c=>c.selectedItemId),l=my();return y.useEffect(()=>{if(s.current&&a.current){let c=s.current,f=a.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let h=c.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(c),()=>{cancelAnimationFrame(u),d.unobserve(c)}}},[]),y.createElement(oc.div,{ref:vs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},sw(e,c=>y.createElement("div",{ref:vs(s,l.listInnerRef),"cmdk-list-sizer":""},c)))}),$ke=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:s,...o}=e;return y.createElement(Iq,{open:n,onOpenChange:r},y.createElement(zq,{container:s},y.createElement($q,{"cmdk-overlay":"",className:i}),y.createElement(Lq,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(qq,{ref:t,...o}))))}),Lke=y.forwardRef((e,t)=>Kl(n=>n.filtered.count===0)?y.createElement(oc.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Pke=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(oc.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sw(e,s=>y.createElement("div",{"aria-hidden":!0},s)))}),Bu=Object.assign(qq,{List:zke,Item:Mke,Input:Ike,Group:jke,Separator:Dke,Dialog:$ke,Empty:Lke,Loading:Pke});function Fke(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Uke(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Vq(e){let t=y.useRef(e);return vu(()=>{t.current=e}),t}var vu=typeof window>"u"?y.useEffect:y.useLayoutEffect;function _f(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Kl(e){let t=u2(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function Kq(e,t,n,r=[]){let i=y.useRef(),a=my();return vu(()=>{var s;let o=(()=>{var c;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());a.value(e,o,l),(s=t.current)==null||s.setAttribute(wf,o),i.current=o}),i}var Bke=()=>{let[e,t]=y.useState(),n=_f(()=>new Map);return vu(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Hke(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function sw({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(Hke(t),{ref:t.ref},n(t.props.children)):n(t)}var qke={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},Gq=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"}),Vke="VisuallyHidden",Kke=y.forwardRef((e,t)=>m.jsx(tt.span,{...e,ref:t,style:{...Gq,...e.style}}));Kke.displayName=Vke;function f2(e){const t=e+"CollectionProvider",[n,r]=ac(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{const{scope:x,children:g}=b,v=ee.useRef(null),w=ee.useRef(new Map).current;return m.jsx(i,{scope:x,itemMap:w,collectionRef:v,children:g})};s.displayName=t;const o=e+"CollectionSlot",l=yu(o),c=ee.forwardRef((b,x)=>{const{scope:g,children:v}=b,w=a(o,g),E=Lt(x,w.collectionRef);return m.jsx(l,{ref:E,children:v})});c.displayName=o;const f=e+"CollectionItemSlot",u="data-radix-collection-item",d=yu(f),h=ee.forwardRef((b,x)=>{const{scope:g,children:v,...w}=b,E=ee.useRef(null),C=Lt(x,E),k=a(f,g);return ee.useEffect(()=>(k.itemMap.set(E,{ref:E,...w}),()=>void k.itemMap.delete(E))),m.jsx(d,{[u]:"",ref:C,children:v})});h.displayName=f;function p(b){const x=a(e+"CollectionConsumer",b);return ee.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((k,_)=>w.indexOf(k.ref.current)-w.indexOf(_.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:c,ItemSlot:h},p,r]}var Gke=y.createContext(void 0);function ow(e){const t=y.useContext(Gke);return e||t||"ltr"}function Yke(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Wke(e){const[t,n]=y.useState(void 0);return Ar(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,o=c.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Jke=["top","right","bottom","left"],Gl=Math.min,bi=Math.max,Zx=Math.round,mb=Math.floor,ms=e=>({x:e,y:e}),Xke={left:"right",right:"left",bottom:"top",top:"bottom"},Qke={start:"end",end:"start"};function kC(e,t,n){return bi(e,Gl(t,n))}function Co(e,t){return typeof e=="function"?e(t):e}function To(e){return e.split("-")[0]}function Ih(e){return e.split("-")[1]}function d2(e){return e==="x"?"y":"x"}function h2(e){return e==="y"?"height":"width"}const Zke=new Set(["top","bottom"]);function ls(e){return Zke.has(To(e))?"y":"x"}function m2(e){return d2(ls(e))}function eCe(e,t,n){n===void 0&&(n=!1);const r=Ih(e),i=m2(e),a=h2(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=e0(s)),[s,e0(s)]}function tCe(e){const t=e0(e);return[CC(e),t,CC(t)]}function CC(e){return e.replace(/start|end/g,t=>Qke[t])}const dz=["left","right"],hz=["right","left"],nCe=["top","bottom"],rCe=["bottom","top"];function iCe(e,t,n){switch(e){case"top":case"bottom":return n?t?hz:dz:t?dz:hz;case"left":case"right":return t?nCe:rCe;default:return[]}}function aCe(e,t,n,r){const i=Ih(e);let a=iCe(To(e),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(CC)))),a}function e0(e){return e.replace(/left|right|bottom|top/g,t=>Xke[t])}function sCe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yq(e){return typeof e!="number"?sCe(e):{top:e,right:e,bottom:e,left:e}}function t0(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function mz(e,t,n){let{reference:r,floating:i}=e;const a=ls(t),s=m2(t),o=h2(s),l=To(t),c=a==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,d=r[o]/2-i[o]/2;let h;switch(l){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-i.width,y:u};break;default:h={x:r.x,y:r.y}}switch(Ih(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}async function oCe(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=Co(t,e),p=Yq(h),x=o[d?u==="floating"?"reference":"floating":u],g=t0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:f,strategy:l})),v=u==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),E=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},C=t0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:w,strategy:l}):v);return{top:(g.top-C.top+p.top)/E.y,bottom:(C.bottom-g.bottom+p.bottom)/E.y,left:(g.left-C.left+p.left)/E.x,right:(C.right-g.right+p.right)/E.x}}const lCe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=mz(c,r,l),d=r,h={},p=0;for(let x=0;x<o.length;x++){var b;const{name:g,fn:v}=o[x],{x:w,y:E,data:C,reset:k}=await v({x:f,y:u,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:c,platform:{...s,detectOverflow:(b=s.detectOverflow)!=null?b:oCe},elements:{reference:e,floating:t}});f=w??f,u=E??u,h={...h,[g]:{...h[g],...C}},k&&p<=50&&(p++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:u}=mz(c,d,l)),x=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}},cCe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=t,{element:c,padding:f=0}=Co(e,t)||{};if(c==null)return{};const u=Yq(f),d={x:n,y:r},h=m2(i),p=h2(h),b=await s.getDimensions(c),x=h==="y",g=x?"top":"left",v=x?"bottom":"right",w=x?"clientHeight":"clientWidth",E=a.reference[p]+a.reference[h]-d[h]-a.floating[p],C=d[h]-a.reference[h],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let _=k?k[w]:0;(!_||!await(s.isElement==null?void 0:s.isElement(k)))&&(_=o.floating[w]||a.floating[p]);const A=E/2-C/2,D=_/2-b[p]/2-1,O=Gl(u[g],D),L=Gl(u[v],D),B=O,X=_-b[p]-L,W=_/2-b[p]/2+A,U=kC(B,W,X),I=!l.arrow&&Ih(i)!=null&&W!==U&&a.reference[p]/2-(W<B?O:L)-b[p]/2<0,F=I?W<B?W-B:W-X:0;return{[h]:d[h]+F,data:{[h]:U,centerOffset:W-U-F,...I&&{alignmentOffset:F}},reset:I}}}),uCe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...x}=Co(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=To(i),v=ls(o),w=To(o)===o,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=d||(w||!b?[e0(o)]:tCe(o)),k=p!=="none";!d&&k&&C.push(...aCe(o,b,p,E));const _=[o,...C],A=await l.detectOverflow(t,x),D=[];let O=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&D.push(A[g]),u){const W=eCe(i,s,E);D.push(A[W[0]],A[W[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(W=>W<=0)){var L,B;const W=(((L=a.flip)==null?void 0:L.index)||0)+1,U=_[W];if(U&&(!(u==="alignment"?v!==ls(U):!1)||O.every(z=>ls(z.placement)===v?z.overflows[0]>0:!0)))return{data:{index:W,overflows:O},reset:{placement:U}};let I=(B=O.filter(F=>F.overflows[0]<=0).sort((F,z)=>F.overflows[1]-z.overflows[1])[0])==null?void 0:B.placement;if(!I)switch(h){case"bestFit":{var X;const F=(X=O.filter(z=>{if(k){const V=ls(z.placement);return V===v||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,N)=>V+N,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:X[0];F&&(I=F);break}case"initialPlacement":I=o;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function pz(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gz(e){return Jke.some(t=>e[t]>=0)}const fCe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=Co(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...a,elementContext:"reference"}),o=pz(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:gz(o)}}}case"escaped":{const s=await r.detectOverflow(t,{...a,altBoundary:!0}),o=pz(s,n.floating);return{data:{escapedOffsets:o,escaped:gz(o)}}}default:return{}}}}},Wq=new Set(["left","top"]);async function dCe(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=To(n),o=Ih(n),l=ls(n)==="y",c=Wq.has(s)?-1:1,f=a&&l?-1:1,u=Co(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&typeof p=="number"&&(h=o==="end"?p*-1:p),l?{x:h*f,y:d*c}:{x:d*c,y:h*f}}const hCe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=t,l=await dCe(t,e);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},mCe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...c}=Co(e,t),f={x:n,y:r},u=await a.detectOverflow(t,c),d=ls(To(i)),h=d2(d);let p=f[h],b=f[d];if(s){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",w=p+u[g],E=p-u[v];p=kC(w,p,E)}if(o){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=b+u[g],E=b-u[v];b=kC(w,b,E)}const x=l.fn({...t,[h]:p,[d]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:s,[d]:o}}}}}},pCe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Co(e,t),f={x:n,y:r},u=ls(i),d=d2(u);let h=f[d],p=f[u];const b=Co(o,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const w=d==="y"?"height":"width",E=a.reference[d]-a.floating[w]+x.mainAxis,C=a.reference[d]+a.reference[w]-x.mainAxis;h<E?h=E:h>C&&(h=C)}if(c){var g,v;const w=d==="y"?"width":"height",E=Wq.has(To(i)),C=a.reference[u]-a.floating[w]+(E&&((g=s.offset)==null?void 0:g[u])||0)+(E?0:x.crossAxis),k=a.reference[u]+a.reference[w]+(E?0:((v=s.offset)==null?void 0:v[u])||0)-(E?x.crossAxis:0);p<C?p=C:p>k&&(p=k)}return{[d]:h,[u]:p}}}},gCe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:s,elements:o}=t,{apply:l=()=>{},...c}=Co(e,t),f=await s.detectOverflow(t,c),u=To(i),d=Ih(i),h=ls(i)==="y",{width:p,height:b}=a.floating;let x,g;u==="top"||u==="bottom"?(x=u,g=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,x=d==="end"?"top":"bottom");const v=b-f.top-f.bottom,w=p-f.left-f.right,E=Gl(b-f[x],v),C=Gl(p-f[g],w),k=!t.middlewareData.shift;let _=E,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=v),k&&!d){const O=bi(f.left,0),L=bi(f.right,0),B=bi(f.top,0),X=bi(f.bottom,0);h?A=p-2*(O!==0||L!==0?O+L:bi(f.left,f.right)):_=b-2*(B!==0||X!==0?B+X:bi(f.top,f.bottom))}await l({...t,availableWidth:A,availableHeight:_});const D=await s.getDimensions(o.floating);return p!==D.width||b!==D.height?{reset:{rects:!0}}:{}}}};function lw(){return typeof window<"u"}function zh(e){return Jq(e)?(e.nodeName||"").toLowerCase():"#document"}function Ai(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ns(e){var t;return(t=(Jq(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jq(e){return lw()?e instanceof Node||e instanceof Ai(e).Node:!1}function $a(e){return lw()?e instanceof Element||e instanceof Ai(e).Element:!1}function Ss(e){return lw()?e instanceof HTMLElement||e instanceof Ai(e).HTMLElement:!1}function yz(e){return!lw()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ai(e).ShadowRoot}const yCe=new Set(["inline","contents"]);function py(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=La(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!yCe.has(i)}const bCe=new Set(["table","td","th"]);function vCe(e){return bCe.has(zh(e))}const xCe=[":popover-open",":modal"];function cw(e){return xCe.some(t=>{try{return e.matches(t)}catch{return!1}})}const SCe=["transform","translate","scale","rotate","perspective"],wCe=["transform","translate","scale","rotate","perspective","filter"],_Ce=["paint","layout","strict","content"];function p2(e){const t=g2(),n=$a(e)?La(e):e;return SCe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||wCe.some(r=>(n.willChange||"").includes(r))||_Ce.some(r=>(n.contain||"").includes(r))}function ECe(e){let t=Yl(e);for(;Ss(t)&&!Wd(t);){if(p2(t))return t;if(cw(t))return null;t=Yl(t)}return null}function g2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kCe=new Set(["html","body","#document"]);function Wd(e){return kCe.has(zh(e))}function La(e){return Ai(e).getComputedStyle(e)}function uw(e){return $a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yl(e){if(zh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yz(e)&&e.host||Ns(e);return yz(t)?t.host:t}function Xq(e){const t=Yl(e);return Wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ss(t)&&py(t)?t:Xq(t)}function sg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Xq(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),s=Ai(i);if(a){const o=TC(s);return t.concat(s,s.visualViewport||[],py(i)?i:[],o&&n?sg(o):[])}return t.concat(i,sg(i,[],n))}function TC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qq(e){const t=La(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ss(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,o=Zx(n)!==a||Zx(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function y2(e){return $a(e)?e:e.contextElement}function dd(e){const t=y2(e);if(!Ss(t))return ms(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qq(t);let s=(a?Zx(n.width):n.width)/r,o=(a?Zx(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const CCe=ms(0);function Zq(e){const t=Ai(e);return!g2()||!t.visualViewport?CCe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TCe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ai(e)?!1:t}function xu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=y2(e);let s=ms(1);t&&(r?$a(r)&&(s=dd(r)):s=dd(e));const o=TCe(a,n,r)?Zq(a):ms(0);let l=(i.left+o.x)/s.x,c=(i.top+o.y)/s.y,f=i.width/s.x,u=i.height/s.y;if(a){const d=Ai(a),h=r&&$a(r)?Ai(r):r;let p=d,b=TC(p);for(;b&&r&&h!==p;){const x=dd(b),g=b.getBoundingClientRect(),v=La(b),w=g.left+(b.clientLeft+parseFloat(v.paddingLeft))*x.x,E=g.top+(b.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,c*=x.y,f*=x.x,u*=x.y,l+=w,c+=E,p=Ai(b),b=TC(p)}}return t0({width:f,height:u,x:l,y:c})}function fw(e,t){const n=uw(e).scrollLeft;return t?t.left+n:xu(Ns(e)).left+n}function eV(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fw(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function RCe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",s=Ns(r),o=t?cw(t.floating):!1;if(r===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=ms(1);const f=ms(0),u=Ss(r);if((u||!u&&!a)&&((zh(r)!=="body"||py(s))&&(l=uw(r)),Ss(r))){const h=xu(r);c=dd(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const d=s&&!u&&!a?eV(s,l):ms(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-l.scrollTop*c.y+f.y+d.y}}function ACe(e){return Array.from(e.getClientRects())}function NCe(e){const t=Ns(e),n=uw(e),r=e.ownerDocument.body,i=bi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=bi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+fw(e);const o=-n.scrollTop;return La(r).direction==="rtl"&&(s+=bi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}const bz=25;function OCe(e,t){const n=Ai(e),r=Ns(e),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;const f=g2();(!f||f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}const c=fw(r);if(c<=0){const f=r.ownerDocument,u=f.body,d=getComputedStyle(u),h=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(r.clientWidth-u.clientWidth-h);p<=bz&&(a-=p)}else c<=bz&&(a+=c);return{width:a,height:s,x:o,y:l}}const MCe=new Set(["absolute","fixed"]);function jCe(e,t){const n=xu(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ss(e)?dd(e):ms(1),s=e.clientWidth*a.x,o=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:s,height:o,x:l,y:c}}function vz(e,t,n){let r;if(t==="viewport")r=OCe(e,n);else if(t==="document")r=NCe(Ns(e));else if($a(t))r=jCe(t,n);else{const i=Zq(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return t0(r)}function tV(e,t){const n=Yl(e);return n===t||!$a(n)||Wd(n)?!1:La(n).position==="fixed"||tV(n,t)}function DCe(e,t){const n=t.get(e);if(n)return n;let r=sg(e,[],!1).filter(o=>$a(o)&&zh(o)!=="body"),i=null;const a=La(e).position==="fixed";let s=a?Yl(e):e;for(;$a(s)&&!Wd(s);){const o=La(s),l=p2(s);!l&&o.position==="fixed"&&(i=null),(a?!l&&!i:!l&&o.position==="static"&&!!i&&MCe.has(i.position)||py(s)&&!l&&tV(e,s))?r=r.filter(f=>f!==s):i=o,s=Yl(s)}return t.set(e,r),r}function ICe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?cw(t)?[]:DCe(t,this._c):[].concat(n),r],o=s[0],l=s.reduce((c,f)=>{const u=vz(t,f,i);return c.top=bi(u.top,c.top),c.right=Gl(u.right,c.right),c.bottom=Gl(u.bottom,c.bottom),c.left=bi(u.left,c.left),c},vz(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zCe(e){const{width:t,height:n}=Qq(e);return{width:t,height:n}}function $Ce(e,t,n){const r=Ss(t),i=Ns(t),a=n==="fixed",s=xu(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const l=ms(0);function c(){l.x=fw(i)}if(r||!r&&!a)if((zh(t)!=="body"||py(i))&&(o=uw(t)),r){const h=xu(t,!0,a,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();a&&!r&&i&&c();const f=i&&!r&&!a?eV(i,o):ms(0),u=s.left+o.scrollLeft-l.x-f.x,d=s.top+o.scrollTop-l.y-f.y;return{x:u,y:d,width:s.width,height:s.height}}function y_(e){return La(e).position==="static"}function xz(e,t){if(!Ss(e)||La(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ns(e)===n&&(n=n.ownerDocument.body),n}function nV(e,t){const n=Ai(e);if(cw(e))return n;if(!Ss(e)){let i=Yl(e);for(;i&&!Wd(i);){if($a(i)&&!y_(i))return i;i=Yl(i)}return n}let r=xz(e,t);for(;r&&vCe(r)&&y_(r);)r=xz(r,t);return r&&Wd(r)&&y_(r)&&!p2(r)?n:r||ECe(e)||n}const LCe=async function(e){const t=this.getOffsetParent||nV,n=this.getDimensions,r=await n(e.floating);return{reference:$Ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function PCe(e){return La(e).direction==="rtl"}const FCe={convertOffsetParentRelativeRectToViewportRelativeRect:RCe,getDocumentElement:Ns,getClippingRect:ICe,getOffsetParent:nV,getElementRects:LCe,getClientRects:ACe,getDimensions:zCe,getScale:dd,isElement:$a,isRTL:PCe};function rV(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UCe(e,t){let n=null,r;const i=Ns(e);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:h}=c;if(o||t(),!d||!h)return;const p=mb(u),b=mb(i.clientWidth-(f+d)),x=mb(i.clientHeight-(u+h)),g=mb(f),w={rootMargin:-p+"px "+-b+"px "+-x+"px "+-g+"px",threshold:bi(0,Gl(1,l))||1};let E=!0;function C(k){const _=k[0].intersectionRatio;if(_!==l){if(!E)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!rV(c,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(C,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),a}function BCe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=y2(e),f=i||a?[...c?sg(c):[],...sg(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const u=c&&o?UCe(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,b=l?xu(e):null;l&&x();function x(){const g=xu(e);b&&!rV(b,g)&&n(),b=g,p=requestAnimationFrame(x)}return n(),()=>{var g;f.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),u==null||u(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const HCe=hCe,qCe=mCe,VCe=uCe,KCe=gCe,GCe=fCe,Sz=cCe,YCe=pCe,WCe=(e,t,n)=>{const r=new Map,i={platform:FCe,...n},a={...i.platform,_c:r};return lCe(e,t,{...i,platform:a})};var JCe=typeof document<"u",XCe=function(){},uv=JCe?y.useLayoutEffect:XCe;function n0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!n0(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!n0(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function iV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wz(e,t){const n=iV(e);return Math.round(t*n)/n}function b_(e){const t=y.useRef(e);return uv(()=>{t.current=e}),t}function QCe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:c}=e,[f,u]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=y.useState(r);n0(d,r)||h(r);const[p,b]=y.useState(null),[x,g]=y.useState(null),v=y.useCallback(z=>{z!==k.current&&(k.current=z,b(z))},[]),w=y.useCallback(z=>{z!==_.current&&(_.current=z,g(z))},[]),E=a||p,C=s||x,k=y.useRef(null),_=y.useRef(null),A=y.useRef(f),D=l!=null,O=b_(l),L=b_(i),B=b_(c),X=y.useCallback(()=>{if(!k.current||!_.current)return;const z={placement:t,strategy:n,middleware:d};L.current&&(z.platform=L.current),WCe(k.current,_.current,z).then(V=>{const N={...V,isPositioned:B.current!==!1};W.current&&!n0(A.current,N)&&(A.current=N,eh.flushSync(()=>{u(N)}))})},[d,t,n,L,B]);uv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(z=>({...z,isPositioned:!1})))},[c]);const W=y.useRef(!1);uv(()=>(W.current=!0,()=>{W.current=!1}),[]),uv(()=>{if(E&&(k.current=E),C&&(_.current=C),E&&C){if(O.current)return O.current(E,C,X);X()}},[E,C,X,O,D]);const U=y.useMemo(()=>({reference:k,floating:_,setReference:v,setFloating:w}),[v,w]),I=y.useMemo(()=>({reference:E,floating:C}),[E,C]),F=y.useMemo(()=>{const z={position:n,left:0,top:0};if(!I.floating)return z;const V=wz(I.floating,f.x),N=wz(I.floating,f.y);return o?{...z,transform:"translate("+V+"px, "+N+"px)",...iV(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:N}},[n,o,I.floating,f.x,f.y]);return y.useMemo(()=>({...f,update:X,refs:U,elements:I,floatingStyles:F}),[f,X,U,I,F])}const ZCe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sz({element:r.current,padding:i}).fn(n):{}:r?Sz({element:r,padding:i}).fn(n):{}}}},eTe=(e,t)=>({...HCe(e),options:[e,t]}),tTe=(e,t)=>({...qCe(e),options:[e,t]}),nTe=(e,t)=>({...YCe(e),options:[e,t]}),rTe=(e,t)=>({...VCe(e),options:[e,t]}),iTe=(e,t)=>({...KCe(e),options:[e,t]}),aTe=(e,t)=>({...GCe(e),options:[e,t]}),sTe=(e,t)=>({...ZCe(e),options:[e,t]});var oTe="Arrow",aV=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return m.jsx(tt.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});aV.displayName=oTe;var lTe=aV,b2="Popper",[sV,dw]=ac(b2),[cTe,oV]=sV(b2),lV=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return m.jsx(cTe,{scope:t,anchor:r,onAnchorChange:i,children:n})};lV.displayName=b2;var cV="PopperAnchor",uV=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=oV(cV,n),s=y.useRef(null),o=Lt(t,s),l=y.useRef(null);return y.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||s.current,c!==l.current&&a.onAnchorChange(l.current)}),r?null:m.jsx(tt.div,{...i,ref:o})});uV.displayName=cV;var v2="PopperContent",[uTe,fTe]=sV(v2),fV=y.forwardRef((e,t)=>{var Q,se,ye,Ae,He,ve;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:p,...b}=e,x=oV(v2,n),[g,v]=y.useState(null),w=Lt(t,Jt=>v(Jt)),[E,C]=y.useState(null),k=Wke(E),_=(k==null?void 0:k.width)??0,A=(k==null?void 0:k.height)??0,D=r+(a!=="center"?"-"+a:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},L=Array.isArray(c)?c:[c],B=L.length>0,X={padding:O,boundary:L.filter(hTe),altBoundary:B},{refs:W,floatingStyles:U,placement:I,isPositioned:F,middlewareData:z}=QCe({strategy:"fixed",placement:D,whileElementsMounted:(...Jt)=>BCe(...Jt,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[eTe({mainAxis:i+A,alignmentAxis:s}),l&&tTe({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?nTe():void 0,...X}),l&&rTe({...X}),iTe({...X,apply:({elements:Jt,rects:Nn,availableWidth:Ii,availableHeight:On})=>{const{width:yr,height:zo}=Nn.reference,pn=Jt.floating.style;pn.setProperty("--radix-popper-available-width",`${Ii}px`),pn.setProperty("--radix-popper-available-height",`${On}px`),pn.setProperty("--radix-popper-anchor-width",`${yr}px`),pn.setProperty("--radix-popper-anchor-height",`${zo}px`)}}),E&&sTe({element:E,padding:o}),mTe({arrowWidth:_,arrowHeight:A}),d&&aTe({strategy:"referenceHidden",...X})]}),[V,N]=mV(I),ue=xs(p);Ar(()=>{F&&(ue==null||ue())},[F,ue]);const q=(Q=z.arrow)==null?void 0:Q.x,T=(se=z.arrow)==null?void 0:se.y,K=((ye=z.arrow)==null?void 0:ye.centerOffset)!==0,[G,oe]=y.useState();return Ar(()=>{g&&oe(window.getComputedStyle(g).zIndex)},[g]),m.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:F?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ae=z.transformOrigin)==null?void 0:Ae.x,(He=z.transformOrigin)==null?void 0:He.y].join(" "),...((ve=z.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(uTe,{scope:n,placedSide:V,onArrowChange:C,arrowX:q,arrowY:T,shouldHideArrow:K,children:m.jsx(tt.div,{"data-side":V,"data-align":N,...b,ref:w,style:{...b.style,animation:F?void 0:"none"}})})})});fV.displayName=v2;var dV="PopperArrow",dTe={top:"bottom",right:"left",bottom:"top",left:"right"},hV=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=fTe(dV,r),s=dTe[a.placedSide];return m.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:m.jsx(lTe,{...i,ref:n,style:{...i.style,display:"block"}})})});hV.displayName=dV;function hTe(e){return e!==null}var mTe=e=>({name:"transformOrigin",options:e,fn(t){var x,g,v;const{placement:n,rects:r,middlewareData:i}=t,s=((x=i.arrow)==null?void 0:x.centerOffset)!==0,o=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,f]=mV(n),u={start:"0%",center:"50%",end:"100%"}[f],d=(((g=i.arrow)==null?void 0:g.x)??0)+o/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let p="",b="";return c==="bottom"?(p=s?u:`${d}px`,b=`${-l}px`):c==="top"?(p=s?u:`${d}px`,b=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,b=s?u:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,b=s?u:`${h}px`),{data:{x:p,y:b}}}});function mV(e){const[t,n="center"]=e.split("-");return[t,n]}var pV=lV,gV=uV,yV=fV,bV=hV,v_="rovingFocusGroup.onEntryFocus",pTe={bubbles:!1,cancelable:!0},gy="RovingFocusGroup",[RC,vV,gTe]=f2(gy),[yTe,hw]=ac(gy,[gTe]),[bTe,vTe]=yTe(gy),xV=y.forwardRef((e,t)=>m.jsx(RC.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(RC.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(xTe,{...e,ref:t})})}));xV.displayName=gy;var xTe=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,d=y.useRef(null),h=Lt(t,d),p=ow(a),[b,x]=Vl({prop:s,defaultProp:o??null,onChange:l,caller:gy}),[g,v]=y.useState(!1),w=xs(c),E=vV(n),C=y.useRef(!1),[k,_]=y.useState(0);return y.useEffect(()=>{const A=d.current;if(A)return A.addEventListener(v_,w),()=>A.removeEventListener(v_,w)},[w]),m.jsx(bTe,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:b,onItemFocus:y.useCallback(A=>x(A),[x]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>_(A=>A+1),[]),onFocusableItemRemove:y.useCallback(()=>_(A=>A-1),[]),children:m.jsx(tt.div,{tabIndex:g||k===0?-1:0,"data-orientation":r,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{C.current=!0}),onFocus:Se(e.onFocus,A=>{const D=!C.current;if(A.target===A.currentTarget&&D&&!g){const O=new CustomEvent(v_,pTe);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=E().filter(I=>I.focusable),B=L.find(I=>I.active),X=L.find(I=>I.id===b),U=[B,X,...L].filter(Boolean).map(I=>I.ref.current);_V(U,f)}}C.current=!1}),onBlur:Se(e.onBlur,()=>v(!1))})})}),SV="RovingFocusGroupItem",wV=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...o}=e,l=Hr(),c=a||l,f=vTe(SV,n),u=f.currentTabStopId===c,d=vV(n),{onFocusableItemAdd:h,onFocusableItemRemove:p,currentTabStopId:b}=f;return y.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.jsx(RC.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:m.jsx(tt.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:Se(e.onMouseDown,x=>{r?f.onItemFocus(c):x.preventDefault()}),onFocus:Se(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Se(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=_Te(x,f.orientation,f.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=d().filter(E=>E.focusable).map(E=>E.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const E=w.indexOf(x.currentTarget);w=f.loop?ETe(w,E+1):w.slice(E+1)}setTimeout(()=>_V(w))}}),children:typeof s=="function"?s({isCurrentTabStop:u,hasTabStop:b!=null}):s})})});wV.displayName=SV;var STe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Te(e,t,n){const r=wTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return STe[r]}function _V(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ETe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EV=xV,kV=wV,AC=["Enter"," "],kTe=["ArrowDown","PageUp","Home"],CV=["ArrowUp","PageDown","End"],CTe=[...kTe,...CV],TTe={ltr:[...AC,"ArrowRight"],rtl:[...AC,"ArrowLeft"]},RTe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yy="Menu",[og,ATe,NTe]=f2(yy),[Hu,TV]=ac(yy,[NTe,dw,hw]),mw=dw(),RV=hw(),[OTe,qu]=Hu(yy),[MTe,by]=Hu(yy),AV=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,o=mw(t),[l,c]=y.useState(null),f=y.useRef(!1),u=xs(a),d=ow(i);return y.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),m.jsx(pV,{...o,children:m.jsx(OTe,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:m.jsx(MTe,{scope:t,onClose:y.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:d,modal:s,children:r})})})};AV.displayName=yy;var jTe="MenuAnchor",x2=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=mw(n);return m.jsx(gV,{...i,...r,ref:t})});x2.displayName=jTe;var S2="MenuPortal",[DTe,NV]=Hu(S2,{forceMount:void 0}),OV=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=qu(S2,t);return m.jsx(DTe,{scope:t,forceMount:n,children:m.jsx(sc,{present:n||a.open,children:m.jsx(nw,{asChild:!0,container:i,children:r})})})};OV.displayName=S2;var ra="MenuContent",[ITe,w2]=Hu(ra),MV=y.forwardRef((e,t)=>{const n=NV(ra,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=qu(ra,e.__scopeMenu),s=by(ra,e.__scopeMenu);return m.jsx(og.Provider,{scope:e.__scopeMenu,children:m.jsx(sc,{present:r||a.open,children:m.jsx(og.Slot,{scope:e.__scopeMenu,children:s.modal?m.jsx(zTe,{...i,ref:t}):m.jsx($Te,{...i,ref:t})})})})}),zTe=y.forwardRef((e,t)=>{const n=qu(ra,e.__scopeMenu),r=y.useRef(null),i=Lt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return s2(a)},[]),m.jsx(_2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$Te=y.forwardRef((e,t)=>{const n=qu(ra,e.__scopeMenu);return m.jsx(_2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LTe=yu("MenuContent.ScrollLock"),_2=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:h,disableOutsideScroll:p,...b}=e,x=qu(ra,n),g=by(ra,n),v=mw(n),w=RV(n),E=ATe(n),[C,k]=y.useState(null),_=y.useRef(null),A=Lt(t,_,x.onContentChange),D=y.useRef(0),O=y.useRef(""),L=y.useRef(0),B=y.useRef(null),X=y.useRef("right"),W=y.useRef(0),U=p?iw:y.Fragment,I=p?{as:LTe,allowPinchZoom:!0}:void 0,F=V=>{var Q,se;const N=O.current+V,ue=E().filter(ye=>!ye.disabled),q=document.activeElement,T=(Q=ue.find(ye=>ye.ref.current===q))==null?void 0:Q.textValue,K=ue.map(ye=>ye.textValue),G=JTe(K,N,T),oe=(se=ue.find(ye=>ye.textValue===G))==null?void 0:se.ref.current;(function ye(Ae){O.current=Ae,window.clearTimeout(D.current),Ae!==""&&(D.current=window.setTimeout(()=>ye(""),1e3))})(N),oe&&setTimeout(()=>oe.focus())};y.useEffect(()=>()=>window.clearTimeout(D.current),[]),a2();const z=y.useCallback(V=>{var ue,q;return X.current===((ue=B.current)==null?void 0:ue.side)&&QTe(V,(q=B.current)==null?void 0:q.area)},[]);return m.jsx(ITe,{scope:n,searchRef:O,onItemEnter:y.useCallback(V=>{z(V)&&V.preventDefault()},[z]),onItemLeave:y.useCallback(V=>{var N;z(V)||((N=_.current)==null||N.focus(),k(null))},[z]),onTriggerLeave:y.useCallback(V=>{z(V)&&V.preventDefault()},[z]),pointerGraceTimerRef:L,onPointerGraceIntentChange:y.useCallback(V=>{B.current=V},[]),children:m.jsx(U,{...I,children:m.jsx(tw,{asChild:!0,trapped:i,onMountAutoFocus:Se(a,V=>{var N;V.preventDefault(),(N=_.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:m.jsx(ew,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:h,children:m.jsx(EV,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,V=>{g.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(yV,{role:"menu","aria-orientation":"vertical","data-state":YV(x.open),"data-radix-menu-content":"",dir:g.dir,...v,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,V=>{const ue=V.target.closest("[data-radix-menu-content]")===V.currentTarget,q=V.ctrlKey||V.altKey||V.metaKey,T=V.key.length===1;ue&&(V.key==="Tab"&&V.preventDefault(),!q&&T&&F(V.key));const K=_.current;if(V.target!==K||!CTe.includes(V.key))return;V.preventDefault();const oe=E().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);CV.includes(V.key)&&oe.reverse(),YTe(oe)}),onBlur:Se(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:Se(e.onPointerMove,lg(V=>{const N=V.target,ue=W.current!==V.clientX;if(V.currentTarget.contains(N)&&ue){const q=V.clientX>W.current?"right":"left";X.current=q,W.current=V.clientX}}))})})})})})})});MV.displayName=ra;var PTe="MenuGroup",E2=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(tt.div,{role:"group",...r,ref:t})});E2.displayName=PTe;var FTe="MenuLabel",jV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(tt.div,{...r,ref:t})});jV.displayName=FTe;var r0="MenuItem",_z="menu.itemSelect",pw=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),s=by(r0,e.__scopeMenu),o=w2(r0,e.__scopeMenu),l=Lt(t,a),c=y.useRef(!1),f=()=>{const u=a.current;if(!n&&u){const d=new CustomEvent(_z,{bubbles:!0,cancelable:!0});u.addEventListener(_z,h=>r==null?void 0:r(h),{once:!0}),lq(u,d),d.defaultPrevented?c.current=!1:s.onClose()}};return m.jsx(DV,{...i,ref:l,disabled:n,onClick:Se(e.onClick,f),onPointerDown:u=>{var d;(d=e.onPointerDown)==null||d.call(e,u),c.current=!0},onPointerUp:Se(e.onPointerUp,u=>{var d;c.current||(d=u.currentTarget)==null||d.click()}),onKeyDown:Se(e.onKeyDown,u=>{const d=o.searchRef.current!=="";n||d&&u.key===" "||AC.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});pw.displayName=r0;var DV=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=w2(r0,n),o=RV(n),l=y.useRef(null),c=Lt(t,l),[f,u]=y.useState(!1),[d,h]=y.useState("");return y.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[a.children]),m.jsx(og.ItemSlot,{scope:n,disabled:r,textValue:i??d,children:m.jsx(kV,{asChild:!0,...o,focusable:!r,children:m.jsx(tt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:c,onPointerMove:Se(e.onPointerMove,lg(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,lg(p=>s.onItemLeave(p))),onFocus:Se(e.onFocus,()=>u(!0)),onBlur:Se(e.onBlur,()=>u(!1))})})})}),UTe="MenuCheckboxItem",IV=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.jsx(FV,{scope:e.__scopeMenu,checked:n,children:m.jsx(pw,{role:"menuitemcheckbox","aria-checked":i0(n)?"mixed":n,...i,ref:t,"data-state":C2(n),onSelect:Se(i.onSelect,()=>r==null?void 0:r(i0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});IV.displayName=UTe;var zV="MenuRadioGroup",[BTe,HTe]=Hu(zV,{value:void 0,onValueChange:()=>{}}),$V=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=xs(r);return m.jsx(BTe,{scope:e.__scopeMenu,value:n,onValueChange:a,children:m.jsx(E2,{...i,ref:t})})});$V.displayName=zV;var LV="MenuRadioItem",PV=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=HTe(LV,e.__scopeMenu),a=n===i.value;return m.jsx(FV,{scope:e.__scopeMenu,checked:a,children:m.jsx(pw,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":C2(a),onSelect:Se(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});PV.displayName=LV;var k2="MenuItemIndicator",[FV,qTe]=Hu(k2,{checked:!1}),UV=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=qTe(k2,n);return m.jsx(sc,{present:r||i0(a.checked)||a.checked===!0,children:m.jsx(tt.span,{...i,ref:t,"data-state":C2(a.checked)})})});UV.displayName=k2;var VTe="MenuSeparator",BV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});BV.displayName=VTe;var KTe="MenuArrow",HV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=mw(n);return m.jsx(bV,{...i,...r,ref:t})});HV.displayName=KTe;var GTe="MenuSub",[HLe,qV]=Hu(GTe),Dm="MenuSubTrigger",VV=y.forwardRef((e,t)=>{const n=qu(Dm,e.__scopeMenu),r=by(Dm,e.__scopeMenu),i=qV(Dm,e.__scopeMenu),a=w2(Dm,e.__scopeMenu),s=y.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=a,c={__scopeMenu:e.__scopeMenu},f=y.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return y.useEffect(()=>f,[f]),y.useEffect(()=>{const u=o.current;return()=>{window.clearTimeout(u),l(null)}},[o,l]),m.jsx(x2,{asChild:!0,...c,children:m.jsx(DV,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":YV(n.open),...e,ref:vs(t,i.onTriggerChange),onClick:u=>{var d;(d=e.onClick)==null||d.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,lg(u=>{a.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Se(e.onPointerLeave,lg(u=>{var h,p;f();const d=(h=n.content)==null?void 0:h.getBoundingClientRect();if(d){const b=(p=n.content)==null?void 0:p.dataset.side,x=b==="right",g=x?-5:5,v=d[x?"left":"right"],w=d[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:v,y:d.top},{x:w,y:d.top},{x:w,y:d.bottom},{x:v,y:d.bottom}],side:b}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(u),u.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,u=>{var h;const d=a.searchRef.current!=="";e.disabled||d&&u.key===" "||TTe[r.dir].includes(u.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),u.preventDefault())})})})});VV.displayName=Dm;var KV="MenuSubContent",GV=y.forwardRef((e,t)=>{const n=NV(ra,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=qu(ra,e.__scopeMenu),s=by(ra,e.__scopeMenu),o=qV(KV,e.__scopeMenu),l=y.useRef(null),c=Lt(t,l);return m.jsx(og.Provider,{scope:e.__scopeMenu,children:m.jsx(sc,{present:r||a.open,children:m.jsx(og.Slot,{scope:e.__scopeMenu,children:m.jsx(_2,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;s.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Se(e.onFocusOutside,f=>{f.target!==o.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Se(e.onKeyDown,f=>{var h;const u=f.currentTarget.contains(f.target),d=RTe[s.dir].includes(f.key);u&&d&&(a.onOpenChange(!1),(h=o.trigger)==null||h.focus(),f.preventDefault())})})})})})});GV.displayName=KV;function YV(e){return e?"open":"closed"}function i0(e){return e==="indeterminate"}function C2(e){return i0(e)?"indeterminate":e?"checked":"unchecked"}function YTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function JTe(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=WTe(e,Math.max(a,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function XTe(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const o=t[a],l=t[s],c=o.x,f=o.y,u=l.x,d=l.y;f>r!=d>r&&n<(u-c)*(r-f)/(d-f)+c&&(i=!i)}return i}function QTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return XTe(n,t)}function lg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZTe=AV,eRe=x2,tRe=OV,nRe=MV,rRe=E2,iRe=jV,aRe=pw,sRe=IV,oRe=$V,lRe=PV,cRe=UV,uRe=BV,fRe=HV,dRe=VV,hRe=GV,gw="DropdownMenu",[mRe]=ac(gw,[TV]),Yr=TV(),[pRe,WV]=mRe(gw),JV=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:o=!0}=e,l=Yr(t),c=y.useRef(null),[f,u]=Vl({prop:i,defaultProp:a??!1,onChange:s,caller:gw});return m.jsx(pRe,{scope:t,triggerId:Hr(),triggerRef:c,contentId:Hr(),open:f,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:o,children:m.jsx(ZTe,{...l,open:f,onOpenChange:u,dir:r,modal:o,children:n})})};JV.displayName=gw;var XV="DropdownMenuTrigger",QV=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=WV(XV,n),s=Yr(n);return m.jsx(eRe,{asChild:!0,...s,children:m.jsx(tt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:vs(t,a.triggerRef),onPointerDown:Se(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(a.onOpenToggle(),a.open||o.preventDefault())}),onKeyDown:Se(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&a.onOpenToggle(),o.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});QV.displayName=XV;var gRe="DropdownMenuPortal",ZV=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yr(t);return m.jsx(tRe,{...r,...n})};ZV.displayName=gRe;var eK="DropdownMenuContent",tK=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=WV(eK,n),a=Yr(n),s=y.useRef(!1);return m.jsx(nRe,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,o=>{var l;s.current||(l=i.triggerRef.current)==null||l.focus(),s.current=!1,o.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,f=l.button===2||c;(!i.modal||f)&&(s.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)"}})});tK.displayName=eK;var yRe="DropdownMenuGroup",bRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(rRe,{...i,...r,ref:t})});bRe.displayName=yRe;var vRe="DropdownMenuLabel",xRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(iRe,{...i,...r,ref:t})});xRe.displayName=vRe;var SRe="DropdownMenuItem",nK=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(aRe,{...i,...r,ref:t})});nK.displayName=SRe;var wRe="DropdownMenuCheckboxItem",_Re=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(sRe,{...i,...r,ref:t})});_Re.displayName=wRe;var ERe="DropdownMenuRadioGroup",kRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(oRe,{...i,...r,ref:t})});kRe.displayName=ERe;var CRe="DropdownMenuRadioItem",TRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(lRe,{...i,...r,ref:t})});TRe.displayName=CRe;var RRe="DropdownMenuItemIndicator",ARe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(cRe,{...i,...r,ref:t})});ARe.displayName=RRe;var NRe="DropdownMenuSeparator",ORe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(uRe,{...i,...r,ref:t})});ORe.displayName=NRe;var MRe="DropdownMenuArrow",jRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(fRe,{...i,...r,ref:t})});jRe.displayName=MRe;var DRe="DropdownMenuSubTrigger",IRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(dRe,{...i,...r,ref:t})});IRe.displayName=DRe;var zRe="DropdownMenuSubContent",$Re=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yr(n);return m.jsx(hRe,{...i,...r,ref:t,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)"}})});$Re.displayName=zRe;var LRe=JV,PRe=QV,FRe=ZV,URe=tK,BRe=nK;function Ez(e,[t,n]){return Math.min(n,Math.max(t,e))}var HRe=[" ","Enter","ArrowUp","ArrowDown"],qRe=[" ","Enter"],Su="Select",[yw,bw,VRe]=f2(Su),[$h]=ac(Su,[VRe,dw]),vw=dw(),[KRe,lc]=$h(Su),[GRe,YRe]=$h(Su),rK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:s,defaultValue:o,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:d,required:h,form:p}=e,b=vw(t),[x,g]=y.useState(null),[v,w]=y.useState(null),[E,C]=y.useState(!1),k=ow(c),[_,A]=Vl({prop:r,defaultProp:i??!1,onChange:a,caller:Su}),[D,O]=Vl({prop:s,defaultProp:o,onChange:l,caller:Su}),L=y.useRef(null),B=x?p||!!x.closest("form"):!0,[X,W]=y.useState(new Set),U=Array.from(X).map(I=>I.props.value).join(";");return m.jsx(pV,{...b,children:m.jsxs(KRe,{required:h,scope:t,trigger:x,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:C,contentId:Hr(),value:D,onValueChange:O,open:_,onOpenChange:A,dir:k,triggerPointerDownPosRef:L,disabled:d,children:[m.jsx(yw.Provider,{scope:t,children:m.jsx(GRe,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(I=>{W(F=>new Set(F).add(I))},[]),onNativeOptionRemove:y.useCallback(I=>{W(F=>{const z=new Set(F);return z.delete(I),z})},[]),children:n})}),B?m.jsxs(kK,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:u,value:D,onChange:I=>O(I.target.value),disabled:d,form:p,children:[D===void 0?m.jsx("option",{value:""}):null,Array.from(X)]},U):null]})})};rK.displayName=Su;var iK="SelectTrigger",aK=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=vw(n),s=lc(iK,n),o=s.disabled||r,l=Lt(t,s.onTriggerChange),c=bw(n),f=y.useRef("touch"),[u,d,h]=TK(b=>{const x=c().filter(w=>!w.disabled),g=x.find(w=>w.value===s.value),v=RK(x,b,g);v!==void 0&&s.onValueChange(v.value)}),p=b=>{o||(s.onOpenChange(!0),h()),b&&(s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return m.jsx(gV,{asChild:!0,...a,children:m.jsx(tt.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":CK(s.value)?"":void 0,...i,ref:l,onClick:Se(i.onClick,b=>{b.currentTarget.focus(),f.current!=="mouse"&&p(b)}),onPointerDown:Se(i.onPointerDown,b=>{f.current=b.pointerType;const x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(p(b),b.preventDefault())}),onKeyDown:Se(i.onKeyDown,b=>{const x=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&d(b.key),!(x&&b.key===" ")&&HRe.includes(b.key)&&(p(),b.preventDefault())})})})});aK.displayName=iK;var sK="SelectValue",oK=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:s="",...o}=e,l=lc(sK,n),{onValueNodeHasChildrenChange:c}=l,f=a!==void 0,u=Lt(t,l.onValueNodeChange);return Ar(()=>{c(f)},[c,f]),m.jsx(tt.span,{...o,ref:u,style:{pointerEvents:"none"},children:CK(l.value)?m.jsx(m.Fragment,{children:s}):a})});oK.displayName=sK;var WRe="SelectIcon",lK=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.jsx(tt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});lK.displayName=WRe;var JRe="SelectPortal",cK=e=>m.jsx(nw,{asChild:!0,...e});cK.displayName=JRe;var wu="SelectContent",uK=y.forwardRef((e,t)=>{const n=lc(wu,e.__scopeSelect),[r,i]=y.useState();if(Ar(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?eh.createPortal(m.jsx(fK,{scope:e.__scopeSelect,children:m.jsx(yw.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),a):null}return m.jsx(dK,{...e,ref:t})});uK.displayName=wu;var ga=10,[fK,cc]=$h(wu),XRe="SelectContentImpl",QRe=yu("SelectContent.RemoveScroll"),dK=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:o,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:b,avoidCollisions:x,...g}=e,v=lc(wu,n),[w,E]=y.useState(null),[C,k]=y.useState(null),_=Lt(t,Q=>E(Q)),[A,D]=y.useState(null),[O,L]=y.useState(null),B=bw(n),[X,W]=y.useState(!1),U=y.useRef(!1);y.useEffect(()=>{if(w)return s2(w)},[w]),a2();const I=y.useCallback(Q=>{const[se,...ye]=B().map(ve=>ve.ref.current),[Ae]=ye.slice(-1),He=document.activeElement;for(const ve of Q)if(ve===He||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===se&&C&&(C.scrollTop=0),ve===Ae&&C&&(C.scrollTop=C.scrollHeight),ve==null||ve.focus(),document.activeElement!==He))return},[B,C]),F=y.useCallback(()=>I([A,w]),[I,A,w]);y.useEffect(()=>{X&&F()},[X,F]);const{onOpenChange:z,triggerPointerDownPosRef:V}=v;y.useEffect(()=>{if(w){let Q={x:0,y:0};const se=Ae=>{var He,ve;Q={x:Math.abs(Math.round(Ae.pageX)-(((He=V.current)==null?void 0:He.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((ve=V.current)==null?void 0:ve.y)??0))}},ye=Ae=>{Q.x<=10&&Q.y<=10?Ae.preventDefault():w.contains(Ae.target)||z(!1),document.removeEventListener("pointermove",se),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ye,{capture:!0})}}},[w,z,V]),y.useEffect(()=>{const Q=()=>z(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[z]);const[N,ue]=TK(Q=>{const se=B().filter(He=>!He.disabled),ye=se.find(He=>He.ref.current===document.activeElement),Ae=RK(se,Q,ye);Ae&&setTimeout(()=>Ae.ref.current.focus())}),q=y.useCallback((Q,se,ye)=>{const Ae=!U.current&&!ye;(v.value!==void 0&&v.value===se||Ae)&&(D(Q),Ae&&(U.current=!0))},[v.value]),T=y.useCallback(()=>w==null?void 0:w.focus(),[w]),K=y.useCallback((Q,se,ye)=>{const Ae=!U.current&&!ye;(v.value!==void 0&&v.value===se||Ae)&&L(Q)},[v.value]),G=r==="popper"?NC:hK,oe=G===NC?{side:o,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:b,avoidCollisions:x}:{};return m.jsx(fK,{scope:n,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:A,onItemLeave:T,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:X,searchRef:N,children:m.jsx(iw,{as:QRe,allowPinchZoom:!0,children:m.jsx(tw,{asChild:!0,trapped:v.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Se(i,Q=>{var se;(se=v.trigger)==null||se.focus({preventScroll:!0}),Q.preventDefault()}),children:m.jsx(ew,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:m.jsx(G,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Q=>Q.preventDefault(),...g,...oe,onPlaced:()=>W(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Se(g.onKeyDown,Q=>{const se=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!se&&Q.key.length===1&&ue(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Ae=B().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const He=Q.target,ve=Ae.indexOf(He);Ae=Ae.slice(ve+1)}setTimeout(()=>I(Ae)),Q.preventDefault()}})})})})})})});dK.displayName=XRe;var ZRe="SelectItemAlignedPosition",hK=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=lc(wu,n),s=cc(wu,n),[o,l]=y.useState(null),[c,f]=y.useState(null),u=Lt(t,_=>f(_)),d=bw(n),h=y.useRef(!1),p=y.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:g,focusSelectedItem:v}=s,w=y.useCallback(()=>{if(a.trigger&&a.valueNode&&o&&c&&b&&x&&g){const _=a.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),D=a.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(a.dir!=="rtl"){const He=O.left-A.left,ve=D.left-He,Jt=_.left-ve,Nn=_.width+Jt,Ii=Math.max(Nn,A.width),On=window.innerWidth-ga,yr=Ez(ve,[ga,Math.max(ga,On-Ii)]);o.style.minWidth=Nn+"px",o.style.left=yr+"px"}else{const He=A.right-O.right,ve=window.innerWidth-D.right-He,Jt=window.innerWidth-_.right-ve,Nn=_.width+Jt,Ii=Math.max(Nn,A.width),On=window.innerWidth-ga,yr=Ez(ve,[ga,Math.max(ga,On-Ii)]);o.style.minWidth=Nn+"px",o.style.right=yr+"px"}const L=d(),B=window.innerHeight-ga*2,X=b.scrollHeight,W=window.getComputedStyle(c),U=parseInt(W.borderTopWidth,10),I=parseInt(W.paddingTop,10),F=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),V=U+I+X+z+F,N=Math.min(x.offsetHeight*5,V),ue=window.getComputedStyle(b),q=parseInt(ue.paddingTop,10),T=parseInt(ue.paddingBottom,10),K=_.top+_.height/2-ga,G=B-K,oe=x.offsetHeight/2,Q=x.offsetTop+oe,se=U+I+Q,ye=V-se;if(se<=K){const He=L.length>0&&x===L[L.length-1].ref.current;o.style.bottom="0px";const ve=c.clientHeight-b.offsetTop-b.offsetHeight,Jt=Math.max(G,oe+(He?T:0)+ve+F),Nn=se+Jt;o.style.height=Nn+"px"}else{const He=L.length>0&&x===L[0].ref.current;o.style.top="0px";const Jt=Math.max(K,U+b.offsetTop+(He?q:0)+oe)+ye;o.style.height=Jt+"px",b.scrollTop=se-K+b.offsetTop}o.style.margin=`${ga}px 0`,o.style.minHeight=N+"px",o.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[d,a.trigger,a.valueNode,o,c,b,x,g,a.dir,r]);Ar(()=>w(),[w]);const[E,C]=y.useState();Ar(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const k=y.useCallback(_=>{_&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return m.jsx(tAe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m.jsx(tt.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});hK.displayName=ZRe;var eAe="SelectPopperPosition",NC=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ga,...a}=e,s=vw(n);return m.jsx(yV,{...s,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});NC.displayName=eAe;var[tAe,T2]=$h(wu,{}),OC="SelectViewport",mK=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=cc(OC,n),s=T2(OC,n),o=Lt(t,a.onViewportChange),l=y.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(yw.Slot,{scope:n,children:m.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Se(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=s;if(d!=null&&d.current&&u){const h=Math.abs(l.current-f.scrollTop);if(h>0){const p=window.innerHeight-ga*2,b=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),g=Math.max(b,x);if(g<p){const v=g+h,w=Math.min(p,v),E=v-w;u.style.height=w+"px",u.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});mK.displayName=OC;var pK="SelectGroup",[nAe,rAe]=$h(pK),iAe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Hr();return m.jsx(nAe,{scope:n,id:i,children:m.jsx(tt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});iAe.displayName=pK;var gK="SelectLabel",aAe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=rAe(gK,n);return m.jsx(tt.div,{id:i.id,...r,ref:t})});aAe.displayName=gK;var a0="SelectItem",[sAe,yK]=$h(a0),bK=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...s}=e,o=lc(a0,n),l=cc(a0,n),c=o.value===r,[f,u]=y.useState(a??""),[d,h]=y.useState(!1),p=Lt(t,v=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,v,r,i)}),b=Hr(),x=y.useRef("touch"),g=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(sAe,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:y.useCallback(v=>{u(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:m.jsx(yw.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:m.jsx(tt.div,{role:"option","aria-labelledby":b,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:p,onFocus:Se(s.onFocus,()=>h(!0)),onBlur:Se(s.onBlur,()=>h(!1)),onClick:Se(s.onClick,()=>{x.current!=="mouse"&&g()}),onPointerUp:Se(s.onPointerUp,()=>{x.current==="mouse"&&g()}),onPointerDown:Se(s.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:Se(s.onPointerMove,v=>{var w;x.current=v.pointerType,i?(w=l.onItemLeave)==null||w.call(l):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:Se(s.onKeyDown,v=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(qRe.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});bK.displayName=a0;var Im="SelectItemText",vK=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,s=lc(Im,n),o=cc(Im,n),l=yK(Im,n),c=YRe(Im,n),[f,u]=y.useState(null),d=Lt(t,g=>u(g),l.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,l.value,l.disabled)}),h=f==null?void 0:f.textContent,p=y.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return Ar(()=>(b(p),()=>x(p)),[b,x,p]),m.jsxs(m.Fragment,{children:[m.jsx(tt.span,{id:l.textId,...a,ref:d}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?eh.createPortal(a.children,s.valueNode):null]})});vK.displayName=Im;var xK="SelectItemIndicator",SK=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yK(xK,n).isSelected?m.jsx(tt.span,{"aria-hidden":!0,...r,ref:t}):null});SK.displayName=xK;var MC="SelectScrollUpButton",wK=y.forwardRef((e,t)=>{const n=cc(MC,e.__scopeSelect),r=T2(MC,e.__scopeSelect),[i,a]=y.useState(!1),s=Lt(t,r.onScrollButtonChange);return Ar(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?m.jsx(EK,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});wK.displayName=MC;var jC="SelectScrollDownButton",_K=y.forwardRef((e,t)=>{const n=cc(jC,e.__scopeSelect),r=T2(jC,e.__scopeSelect),[i,a]=y.useState(!1),s=Lt(t,r.onScrollButtonChange);return Ar(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;a(f)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?m.jsx(EK,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});_K.displayName=jC;var EK=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=cc("SelectScrollButton",n),s=y.useRef(null),o=bw(n),l=y.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),Ar(()=>{var f;const c=o().find(u=>u.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),m.jsx(tt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Se(i.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})})}),oAe="SelectSeparator",lAe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(tt.div,{"aria-hidden":!0,...r,ref:t})});lAe.displayName=oAe;var DC="SelectArrow",cAe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vw(n),a=lc(DC,n),s=cc(DC,n);return a.open&&s.position==="popper"?m.jsx(bV,{...i,...r,ref:t}):null});cAe.displayName=DC;var uAe="SelectBubbleInput",kK=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=Lt(r,i),s=Yke(t);return y.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&f){const u=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(u)}},[s,t]),m.jsx(tt.select,{...n,style:{...Gq,...n.style},ref:a,defaultValue:t})});kK.displayName=uAe;function CK(e){return e===""||e===void 0}function TK(e){const t=xs(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(s=>{const o=n.current+s;t(o),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function RK(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=fAe(e,Math.max(a,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function fAe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dAe=rK,hAe=aK,mAe=oK,pAe=lK,gAe=cK,yAe=uK,bAe=mK,vAe=bK,xAe=vK,SAe=SK,wAe=wK,_Ae=_K,EAe="Separator",kz="horizontal",kAe=["horizontal","vertical"],AK=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=kz,...i}=e,a=CAe(r)?r:kz,o=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return m.jsx(tt.div,{"data-orientation":a,...o,...i,ref:t})});AK.displayName=EAe;function CAe(e){return kAe.includes(e)}var TAe=AK,NK="Toggle",OK=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[s,o]=Vl({prop:n,onChange:i,defaultProp:r??!1,caller:NK});return m.jsx(tt.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:Se(e.onClick,()=>{e.disabled||o(!s)})})});OK.displayName=NK;var uc="ToggleGroup",[MK]=ac(uc,[hw]),jK=hw(),R2=ee.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return m.jsx(RAe,{...i,ref:t})}if(n==="multiple"){const i=r;return m.jsx(AAe,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${uc}\``)});R2.displayName=uc;var[DK,IK]=MK(uc),RAe=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,o]=Vl({prop:n,defaultProp:r??"",onChange:i,caller:uc});return m.jsx(DK,{scope:e.__scopeToggleGroup,type:"single",value:ee.useMemo(()=>s?[s]:[],[s]),onItemActivate:o,onItemDeactivate:ee.useCallback(()=>o(""),[o]),children:m.jsx(zK,{...a,ref:t})})}),AAe=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,o]=Vl({prop:n,defaultProp:r??[],onChange:i,caller:uc}),l=ee.useCallback(f=>o((u=[])=>[...u,f]),[o]),c=ee.useCallback(f=>o((u=[])=>u.filter(d=>d!==f)),[o]);return m.jsx(DK,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:l,onItemDeactivate:c,children:m.jsx(zK,{...a,ref:t})})});R2.displayName=uc;var[NAe,OAe]=MK(uc),zK=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:s,loop:o=!0,...l}=e,c=jK(n),f=ow(s),u={role:"group",dir:f,...l};return m.jsx(NAe,{scope:n,rovingFocus:i,disabled:r,children:i?m.jsx(EV,{asChild:!0,...c,orientation:a,dir:f,loop:o,children:m.jsx(tt.div,{...u,ref:t})}):m.jsx(tt.div,{...u,ref:t})})}),s0="ToggleGroupItem",$K=ee.forwardRef((e,t)=>{const n=IK(s0,e.__scopeToggleGroup),r=OAe(s0,e.__scopeToggleGroup),i=jK(e.__scopeToggleGroup),a=n.value.includes(e.value),s=r.disabled||e.disabled,o={...e,pressed:a,disabled:s},l=ee.useRef(null);return r.rovingFocus?m.jsx(kV,{asChild:!0,...i,focusable:!s,active:a,ref:l,children:m.jsx(Cz,{...o,ref:t})}):m.jsx(Cz,{...o,ref:t})});$K.displayName=s0;var Cz=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,a=IK(s0,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},o=a.type==="single"?s:void 0;return m.jsx(OK,{...o,...i,ref:t,onPressedChange:l=>{l?a.onItemActivate(r):a.onItemDeactivate(r)}})}),MAe=R2,jAe=$K;function LK(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=LK(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function PK(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=LK(e))&&(r&&(r+=" "),r+=t);return r}const DAe=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},IAe=(e,t)=>({classGroupId:e,validator:t}),FK=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),o0="-",Tz=[],zAe="arbitrary..",$Ae=e=>{const t=PAe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return LAe(s);const o=s.split(o0),l=o[0]===""&&o.length>1?1:0;return UK(o,l,t)},getConflictingClassGroupIds:(s,o)=>{if(o){const l=r[s],c=n[s];return l?c?DAe(c,l):l:c||Tz}return n[s]||Tz}}},UK=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const c=UK(e,t+1,a);if(c)return c}const s=n.validators;if(s===null)return;const o=t===0?e.join(o0):e.slice(t).join(o0),l=s.length;for(let c=0;c<l;c++){const f=s[c];if(f.validator(o))return f.classGroupId}},LAe=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zAe+r:void 0})(),PAe=e=>{const{theme:t,classGroups:n}=e;return FAe(n,t)},FAe=(e,t)=>{const n=FK();for(const r in e){const i=e[r];A2(i,n,r,t)}return n},A2=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a];UAe(s,t,n,r)}},UAe=(e,t,n,r)=>{if(typeof e=="string"){BAe(e,t,n);return}if(typeof e=="function"){HAe(e,t,n,r);return}qAe(e,t,n,r)},BAe=(e,t,n)=>{const r=e===""?t:BK(t,e);r.classGroupId=n},HAe=(e,t,n,r)=>{if(VAe(e)){A2(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(IAe(n,e))},qAe=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let s=0;s<a;s++){const[o,l]=i[s];A2(l,BK(t,o),n,r)}},BK=(e,t)=>{let n=e;const r=t.split(o0),i=r.length;for(let a=0;a<i;a++){const s=r[a];let o=n.nextPart.get(s);o||(o=FK(),n.nextPart.set(s,o)),n=o}return n},VAe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,KAe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=r[a])!==void 0)return i(a,s),s},set(a,s){a in n?n[a]=s:i(a,s)}}},IC="!",Rz=":",GAe=[],Az=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),YAe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let s=0,o=0,l=0,c;const f=i.length;for(let b=0;b<f;b++){const x=i[b];if(s===0&&o===0){if(x===Rz){a.push(i.slice(l,b)),l=b+1;continue}if(x==="/"){c=b;continue}}x==="["?s++:x==="]"?s--:x==="("?o++:x===")"&&o--}const u=a.length===0?i:i.slice(l);let d=u,h=!1;u.endsWith(IC)?(d=u.slice(0,-1),h=!0):u.startsWith(IC)&&(d=u.slice(1),h=!0);const p=c&&c>l?c-l:void 0;return Az(a,h,d,p)};if(t){const i=t+Rz,a=r;r=s=>s.startsWith(i)?a(s.slice(i.length)):Az(GAe,!1,s,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},WAe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const s=n[a],o=s[0]==="[",l=t.has(s);o||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},JAe=e=>({cache:KAe(e.cacheSize),parseClassName:YAe(e),sortModifiers:WAe(e),...$Ae(e)}),XAe=/\s+/,QAe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,s=[],o=e.trim().split(XAe);let l="";for(let c=o.length-1;c>=0;c-=1){const f=o[c],{isExternal:u,modifiers:d,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:b}=n(f);if(u){l=f+(l.length>0?" "+l:l);continue}let x=!!b,g=r(x?p.substring(0,b):p);if(!g){if(!x){l=f+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=f+(l.length>0?" "+l:l);continue}x=!1}const v=d.length===0?"":d.length===1?d[0]:a(d).join(":"),w=h?v+IC:v,E=w+g;if(s.indexOf(E)>-1)continue;s.push(E);const C=i(g,x);for(let k=0;k<C.length;++k){const _=C[k];s.push(w+_)}l=f+(l.length>0?" "+l:l)}return l},ZAe=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=HK(n))&&(i&&(i+=" "),i+=r);return i},HK=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=HK(e[r]))&&(n&&(n+=" "),n+=t);return n},eNe=(e,...t)=>{let n,r,i,a;const s=l=>{const c=t.reduce((f,u)=>u(f),e());return n=JAe(c),r=n.cache.get,i=n.cache.set,a=o,o(l)},o=l=>{const c=r(l);if(c)return c;const f=QAe(l,n);return i(l,f),f};return a=s,(...l)=>a(ZAe(...l))},tNe=[],Dn=e=>{const t=n=>n[e]||tNe;return t.isThemeGetter=!0,t},qK=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,VK=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nNe=/^\d+\/\d+$/,rNe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iNe=/\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$/,aNe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sNe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oNe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uf=e=>nNe.test(e),Ze=e=>!!e&&!Number.isNaN(Number(e)),Fo=e=>!!e&&Number.isInteger(Number(e)),x_=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),Fs=e=>rNe.test(e),lNe=()=>!0,cNe=e=>iNe.test(e)&&!aNe.test(e),KK=()=>!1,uNe=e=>sNe.test(e),fNe=e=>oNe.test(e),dNe=e=>!pe(e)&&!ge(e),hNe=e=>Lh(e,WK,KK),pe=e=>qK.test(e),bc=e=>Lh(e,JK,cNe),S_=e=>Lh(e,bNe,Ze),Nz=e=>Lh(e,GK,KK),mNe=e=>Lh(e,YK,fNe),pb=e=>Lh(e,XK,uNe),ge=e=>VK.test(e),hm=e=>Ph(e,JK),pNe=e=>Ph(e,vNe),Oz=e=>Ph(e,GK),gNe=e=>Ph(e,WK),yNe=e=>Ph(e,YK),gb=e=>Ph(e,XK,!0),Lh=(e,t,n)=>{const r=qK.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ph=(e,t,n=!1)=>{const r=VK.exec(e);return r?r[1]?t(r[1]):n:!1},GK=e=>e==="position"||e==="percentage",YK=e=>e==="image"||e==="url",WK=e=>e==="length"||e==="size"||e==="bg-size",JK=e=>e==="length",bNe=e=>e==="number",vNe=e=>e==="family-name",XK=e=>e==="shadow",xNe=()=>{const e=Dn("color"),t=Dn("font"),n=Dn("text"),r=Dn("font-weight"),i=Dn("tracking"),a=Dn("leading"),s=Dn("breakpoint"),o=Dn("container"),l=Dn("spacing"),c=Dn("radius"),f=Dn("shadow"),u=Dn("inset-shadow"),d=Dn("text-shadow"),h=Dn("drop-shadow"),p=Dn("blur"),b=Dn("perspective"),x=Dn("aspect"),g=Dn("ease"),v=Dn("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...E(),ge,pe],k=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],A=()=>[ge,pe,l],D=()=>[uf,"full","auto",...A()],O=()=>[Fo,"none","subgrid",ge,pe],L=()=>["auto",{span:["full",Fo,ge,pe]},Fo,ge,pe],B=()=>[Fo,"auto",ge,pe],X=()=>["auto","min","max","fr",ge,pe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...A()],F=()=>[uf,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],z=()=>[e,ge,pe],V=()=>[...E(),Oz,Nz,{position:[ge,pe]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",gNe,hNe,{size:[ge,pe]}],q=()=>[x_,hm,bc],T=()=>["","none","full",c,ge,pe],K=()=>["",Ze,hm,bc],G=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Ze,x_,Oz,Nz],se=()=>["","none",p,ge,pe],ye=()=>["none",Ze,ge,pe],Ae=()=>["none",Ze,ge,pe],He=()=>[Ze,ge,pe],ve=()=>[uf,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fs],breakpoint:[Fs],color:[lNe],container:[Fs],"drop-shadow":[Fs],ease:["in","out","in-out"],font:[dNe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fs],shadow:[Fs],spacing:["px",Ze],text:[Fs],"text-shadow":[Fs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",uf,pe,ge,x]}],container:["container"],columns:[{columns:[Ze,pe,ge,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Fo,"auto",ge,pe]}],basis:[{basis:[uf,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ze,uf,"auto","initial","none",pe]}],grow:[{grow:["",Ze,ge,pe]}],shrink:[{shrink:["",Ze,ge,pe]}],order:[{order:[Fo,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[o,"screen",...F()]}],"min-w":[{"min-w":[o,"screen","none",...F()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,hm,bc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ge,S_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",x_,pe]}],"font-family":[{font:[pNe,pe,t]}],"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:[i,ge,pe]}],"line-clamp":[{"line-clamp":[Ze,"none",ge,S_]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ze,"from-font","auto",ge,bc]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ze,"auto",ge,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,pe]}],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",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fo,ge,pe],radial:["",ge,pe],conic:[Fo,ge,pe]},yNe,mNe]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ze,ge,pe]}],"outline-w":[{outline:["",Ze,hm,bc]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,gb,pb]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",u,gb,pb]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ze,bc]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",d,gb,pb]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ze,ge,pe]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[Ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[Ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:se()}],brightness:[{brightness:[Ze,ge,pe]}],contrast:[{contrast:[Ze,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",h,gb,pb]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ze,ge,pe]}],"hue-rotate":[{"hue-rotate":[Ze,ge,pe]}],invert:[{invert:["",Ze,ge,pe]}],saturate:[{saturate:[Ze,ge,pe]}],sepia:[{sepia:["",Ze,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Ze,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ze,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ze,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ze,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",Ze,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ze,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ze,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ze,ge,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ze,"initial",ge,pe]}],ease:[{ease:["linear","initial",g,ge,pe]}],delay:[{delay:[Ze,ge,pe]}],animate:[{animate:["none",v,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ge,pe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",ge,pe]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",ge,pe]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ze,hm,bc,S_]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},SNe=eNe(xNe);function st(...e){return SNe(PK(e))}function zC({...e}){return m.jsx(Iq,{"data-slot":"dialog",...e})}function wNe({...e}){return m.jsx(zq,{"data-slot":"dialog-portal",...e})}function _Ne({className:e,...t}){return m.jsx($q,{"data-slot":"dialog-overlay",className:st("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),...t})}function $C({children:e,className:t,showCloseButton:n=!0,...r}){return m.jsxs(wNe,{"data-slot":"dialog-portal",children:[m.jsx(_Ne,{}),m.jsxs(Lq,{"data-slot":"dialog-content",className:st("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-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...r,children:[e,n&&m.jsxs(xke,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[m.jsx(i2,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function LC({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:st("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Mz({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-footer",className:st("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function PC({className:e,...t}){return m.jsx(bke,{"data-slot":"dialog-title",className:st("text-lg leading-none font-semibold",e),...t})}function FC({className:e,...t}){return m.jsx(vke,{"data-slot":"dialog-description",className:st("text-muted-foreground text-sm",e),...t})}function ENe({className:e,...t}){return m.jsx(Bu,{"data-slot":"command",className:st("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function kNe({children:e,className:t,description:n="Search for a command to run...",showCloseButton:r=!0,title:i="Command Palette",...a}){return m.jsxs(zC,{...a,children:[m.jsxs(LC,{className:"sr-only",children:[m.jsx(PC,{children:i}),m.jsx(FC,{children:n})]}),m.jsx($C,{className:st("overflow-hidden p-0",t),showCloseButton:r,children:m.jsx(ENe,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})]})}function CNe({className:e,...t}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(n2,{className:"size-4 shrink-0 opacity-50"}),m.jsx(Bu.Input,{"data-slot":"command-input",className:st("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function TNe({className:e,...t}){return m.jsx(Bu.List,{"data-slot":"command-list",className:st("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function RNe({...e}){return m.jsx(Bu.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function w_({className:e,...t}){return m.jsx(Bu.Group,{"data-slot":"command-group",className:st("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function jz({className:e,...t}){return m.jsx(Bu.Separator,{"data-slot":"command-separator",className:st("bg-border -mx-1 h-px",e),...t})}function Us({className:e,...t}){return m.jsx(Bu.Item,{"data-slot":"command-item",className:st("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_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=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}const ANe=[{key:"all",label:"All"},{key:"mine",label:"Mine"},{key:"account",label:"Account"},{key:"author",label:"Author"},{key:"scope",label:"Scope"},{key:"repo",label:"Repo"},{key:"status",label:"Status"}];function NNe(){const e=Zn(WI),t=Ct(WI),n=Fa(),r=Ct(H7),i=a=>{n(a?`/settings/${a}`:"/settings"),t(!1)};return y.useEffect(()=>{const a=s=>{s.key==="p"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),t(o=>!o))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t]),m.jsxs(kNe,{open:e,onOpenChange:t,showCloseButton:!1,children:[m.jsx(CNe,{placeholder:"Type a command..."}),m.jsxs(TNe,{children:[m.jsx(RNe,{children:"No results found."}),m.jsxs(w_,{heading:"Actions",children:[m.jsxs(Us,{onSelect:()=>{r({}),t(!1)},children:[m.jsx(hy,{}),"Refresh PRs"]}),m.jsxs(Us,{onSelect:()=>{n("/"),t(!1)},children:[m.jsx(YI,{}),"View: PR List"]}),m.jsxs(Us,{onSelect:()=>{n("/notifications"),t(!1)},children:[m.jsx(ZN,{}),"View: Notifications"]})]}),m.jsx(jz,{}),m.jsxs(w_,{heading:"Settings",children:[m.jsxs(Us,{onSelect:()=>i(),children:[m.jsx(Sf,{}),"Open Settings"]}),m.jsxs(Us,{onSelect:()=>i("accounts"),children:[m.jsx(Sf,{}),"Settings: Accounts"]}),m.jsxs(Us,{onSelect:()=>i("theme"),children:[m.jsx(Sf,{}),"Settings: Theme"]}),m.jsxs(Us,{onSelect:()=>i("config"),children:[m.jsx(Sf,{}),"Settings: Config"]}),m.jsxs(Us,{onSelect:()=>i("about"),children:[m.jsx(Sf,{}),"Settings: About"]})]}),m.jsx(jz,{}),m.jsx(w_,{heading:"Filters",children:ANe.map(a=>m.jsxs(Us,{onSelect:()=>{n(a.key==="all"?"/":`/?filter=${a.key}`),t(!1)},children:[m.jsx(YI,{}),"Filter: ",a.label]},a.key))})]})]})}const ONe=["all","mine","account","author","scope","repo","status","hot"],MNe=e=>e!==null&&ONe.includes(e);function QK(){const[e,t]=W4(),n=y.useMemo(()=>{const s=e.get("filter"),o=e.get("value")??void 0;return!MNe(s)||s==="all"?{type:"all"}:o?{type:s,value:o}:{type:s}},[e]),r=e.get("q")??"",i=y.useCallback(s=>{t(o=>(s.type==="all"?(o.delete("filter"),o.delete("value")):(o.set("filter",s.type),s.value?o.set("value",s.value):o.delete("value")),o),{replace:!0})},[t]),a=y.useCallback(s=>{t(o=>(s?o.set("q",s):o.delete("q"),o),{replace:!0})},[t]);return{quickFilter:n,filterText:r,setQuickFilter:i,setFilterText:a}}const hd=e=>{const t=e.match(/^\w+\(([^)]+)\):/);if(t!=null&&t[1])return t[1];const n=e.match(/^([A-Z]+-\d+):/);return n!=null&&n[1]?n[1]:null},Dz=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Iz=PK,N2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Iz(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],u=a==null?void 0:a[c];if(f===null)return null;const d=Dz(f)||Dz(u);return i[c][d]}),o=n&&Object.entries(n).reduce((c,f)=>{let[u,d]=f;return d===void 0||(c[u]=d),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:d,...h}=f;return Object.entries(h).every(p=>{let[b,x]=p;return Array.isArray(x)?x.includes({...a,...o}[b]):{...a,...o}[b]===x})?[...c,u,d]:c},[]);return Iz(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},jNe=N2("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 Le({asChild:e=!1,className:t,size:n="default",variant:r="default",...i}){const a=e?oq:"button";return m.jsx(a,{"data-slot":"button","data-variant":r,"data-size":n,className:st(jNe({variant:r,size:n,className:t})),...i})}function xw({className:e,...t}){return m.jsx("div",{"data-slot":"button-group",className:st("inline-flex items-stretch rounded-md border overflow-hidden [&>*]:rounded-none [&>*]:border-0 [&>*]:shadow-none [&>*:not(:last-child)]:border-r",e),...t})}function Gs({className:e,type:t,...n}){return m.jsx("input",{type:t,"data-slot":"input",className:st("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),...n})}function DNe({...e}){return m.jsx(dAe,{"data-slot":"select",...e})}function INe({...e}){return m.jsx(mAe,{"data-slot":"select-value",...e})}function zNe({children:e,className:t,size:n="default",...r}){return m.jsxs(hAe,{"data-slot":"select-trigger","data-size":n,className:st("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e,m.jsx(pAe,{asChild:!0,children:m.jsx(e2,{className:"size-4 opacity-50"})})]})}function $Ne({align:e="center",children:t,className:n,position:r="item-aligned",...i}){return m.jsx(gAe,{children:m.jsxs(yAe,{"data-slot":"select-content",className:st("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:r,align:e,...i,children:[m.jsx(LNe,{}),m.jsx(bAe,{className:st("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),m.jsx(PNe,{})]})})}function zz({children:e,className:t,...n}){return m.jsxs(vAe,{"data-slot":"select-item",className:st("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[m.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:m.jsx(SAe,{children:m.jsx(ZS,{className:"size-4"})})}),m.jsx(xAe,{children:e})]})}function LNe({className:e,...t}){return m.jsx(wAe,{"data-slot":"select-scroll-up-button",className:st("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(q1e,{className:"size-4"})})}function PNe({className:e,...t}){return m.jsx(_Ae,{"data-slot":"select-scroll-down-button",className:st("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(e2,{className:"size-4"})})}const FNe=N2("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ZK=y.createContext({size:"default",variant:"default",spacing:0});function eG({children:e,className:t,size:n,spacing:r=0,variant:i,...a}){return m.jsx(MAe,{"data-slot":"toggle-group","data-variant":i,"data-size":n,"data-spacing":r,className:st("group/toggle-group flex w-fit items-center rounded-md",t),...a,children:m.jsx(ZK,{value:{variant:i,size:n,spacing:r},children:e})})}function fv({children:e,className:t,size:n,variant:r,...i}){const a=y.useContext(ZK);return m.jsx(jAe,{"data-slot":"toggle-group-item","data-variant":a.variant||r,"data-size":a.size||n,"data-spacing":a.spacing,className:st(FNe({variant:a.variant||r,size:a.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...i,children:e})}const UNe=[{key:"all",label:"All"},{key:"hot",label:"Hot",icon:!0},{key:"mine",label:"Mine"},{key:"account",label:"Account"},{key:"author",label:"Author"},{key:"scope",label:"Scope"},{key:"repo",label:"Repo"},{key:"status",label:"Status"}];function BNe(){const e=Zn(As),{quickFilter:t,filterText:n,setQuickFilter:r,setFilterText:i}=QK(),a=e.pullRequests,s=e.currentUser,o=y.useMemo(()=>{var x;const u=new Set,d=new Set,h=new Set,p=new Set,b=new Set;for(const g of a){u.add(g.author),d.add(((x=g.account)==null?void 0:x.profile)??"unknown"),b.add(g.repositoryName);const v=hd(g.title);v&&(h.add(v),s&&g.author===s&&p.add(v))}return{authors:Array.from(u).sort(),accounts:Array.from(d).sort(),scopes:Array.from(h).sort(),myScopes:Array.from(p).sort(),repos:Array.from(b).sort()}},[a,s]),l=u=>{const d=u;if(!d||d==="all"){r({type:"all"});return}if(d==="hot"){r({type:"hot"});return}if(d==="mine"){r({type:"mine"});return}const h=d==="author"?o.authors:d==="account"?o.accounts:d==="scope"?o.scopes:d==="repo"?o.repos:d==="status"?["approved","pending","mergeable","conflicts"]:[];h.length>0&&h[0]!==void 0&&r({type:d,value:h[0]})},c=u=>{t.type!=="all"&&r(u?{type:t.type,value:u}:{type:t.type})},f=t.type==="mine"?o.myScopes:t.type==="author"?o.authors:t.type==="account"?o.accounts:t.type==="scope"?o.scopes:t.type==="repo"?o.repos:t.type==="status"?["approved","pending","mergeable","conflicts"]:[];return m.jsx("div",{className:"border-b bg-background",children:m.jsxs("div",{className:"mx-auto flex max-w-5xl items-center gap-3 px-4 py-2",children:[m.jsx(eG,{type:"single",variant:"outline",size:"sm",value:t.type,onValueChange:l,children:UNe.map(u=>m.jsxs(fv,{value:u.key,className:u.icon?"gap-1":void 0,children:[u.icon&&m.jsx(t_e,{className:"size-3.5"}),u.label]},u.key))}),f.length>0&&t.type!=="all"&&t.type!=="hot"&&m.jsxs(DNe,{value:t.value??"_all",onValueChange:u=>c(u==="_all"?"":u),children:[m.jsx(zNe,{size:"sm",className:"w-[180px]",children:m.jsx(INe,{})}),m.jsxs($Ne,{children:[m.jsx(zz,{value:"_all",children:"All"}),f.map(u=>m.jsx(zz,{value:u,children:u},u))]})]}),m.jsxs("div",{className:"relative ml-auto w-64",children:[m.jsx(n2,{className:"absolute left-2.5 top-2.5 size-4 text-muted-foreground"}),m.jsx(Gs,{placeholder:"Search...",className:"h-8 pl-8",value:n,onChange:u=>i(u.target.value)}),n&&m.jsx(Le,{variant:"ghost",size:"icon-xs",className:"absolute right-1 top-1",onClick:()=>i(""),children:m.jsx(i2,{className:"size-3"})})]})]})})}const O2=e=>{const t=e.getDate().toString().padStart(2,"0"),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return`${t}.${n}.${r}`},Sw=(e,t,n="Updated")=>{const r=Math.max(0,Math.floor((t.getTime()-e.getTime())/1e3));return j7(r).pipe(mp(i=>i<60,i=>`${n} ${i}s ago`),mp(i=>i<3600,i=>`${n} ${Math.floor(i/60)}m ago`),mp(i=>i<86400,i=>`${n} ${Math.floor(i/3600)}h ago`),D7(()=>`${n} on ${O2(e)}`))};function HNe({...e}){return m.jsx(LRe,{"data-slot":"dropdown-menu",...e})}function qNe({...e}){return m.jsx(PRe,{"data-slot":"dropdown-menu-trigger",...e})}function VNe({align:e="end",className:t,sideOffset:n=4,...r}){return m.jsx(FRe,{children:m.jsx(URe,{"data-slot":"dropdown-menu-content",align:e,sideOffset:n,className:st("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",t),...r})})}function KNe({className:e,...t}){return m.jsx(BRe,{"data-slot":"dropdown-menu-item",className:st("focus:bg-accent focus:text-accent-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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function GNe({className:e,...t}){return m.jsx("kbd",{"data-slot":"kbd",className:st("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3",e),...t})}function Cr({className:e,decorative:t=!0,orientation:n="horizontal",...r}){return m.jsx(TAe,{"data-slot":"separator",decorative:t,orientation:n,className:st("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function YNe(){const e=Zn(As),t=Ct(H7),n=Ct(XN),r=Fa(),{setTheme:i,theme:a}=X4(),s=e.status==="loading",o=e.status==="error",l=e.unreadNotificationCount??0,c=(e.sandboxes??[]).filter(f=>f.status==="running"||f.status==="creating"||f.status==="cloning"||f.status==="starting");return m.jsx("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:m.jsxs("div",{className:"mx-auto flex h-14 max-w-5xl items-center gap-4 px-4",children:[m.jsx("button",{className:"text-sm font-semibold tracking-tight hover:text-foreground/80",onClick:()=>r("/"),children:"codecommit"}),m.jsx(Cr,{orientation:"vertical",className:"h-4"}),o&&m.jsx("span",{className:"text-sm text-destructive",children:e.error??"Error loading PRs"}),s&&m.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(gu,{className:"size-3 animate-spin"}),e.statusDetail&&m.jsx("span",{className:"font-mono opacity-60",children:e.statusDetail})]}),e.lastUpdated&&!o&&!s&&m.jsx("span",{className:"text-xs text-muted-foreground",children:Sw(e.lastUpdated,new Date)}),m.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.currentUser&&m.jsxs(HNe,{children:[m.jsx(qNe,{asChild:!0,children:m.jsxs("button",{className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[m.jsx(r2,{className:"size-3"}),e.currentUser]})}),m.jsx(VNe,{children:m.jsxs(KNe,{onClick:()=>n({}),children:[m.jsx(Q7,{className:"size-3"}),"Logout"]})})]}),m.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/sandboxes"),children:[m.jsx(ag,{className:"size-4"}),c.length>0&&m.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-medium text-primary-foreground",children:c.length}),m.jsx("span",{className:"sr-only",children:"Sandboxes"})]}),m.jsx(Le,{variant:"ghost",size:"icon-sm",onClick:()=>t({}),disabled:s,children:m.jsx(hy,{className:st("size-4",s&&"animate-spin")})}),m.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/notifications"),children:[m.jsx(ZN,{className:"size-4"}),l>0&&m.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex size-4 items-center justify-center rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground",children:l>9?"9+":l}),m.jsx("span",{className:"sr-only",children:"Notifications"})]}),m.jsxs(Le,{variant:"ghost",size:"icon-sm",onClick:()=>r("/settings"),children:[m.jsx(Sf,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Settings"})]}),m.jsx(GNe,{children:"⌘P"}),m.jsxs(Le,{variant:"ghost",size:"icon-sm",onClick:()=>i(a==="dark"?"light":a==="light"?"system":"dark"),children:[m.jsx(rq,{className:"size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),m.jsx(Z7,{className:"absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),m.jsx("span",{className:"sr-only",children:"Toggle theme"})]})]})]})})}function WNe(){const e=Ct(As),t=Fa(),n=y.useCallback(()=>t("/notifications"),[t]);C1e(s=>e(s),n);const{pathname:r}=Es(),i=r==="/",a=sLe();return m.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[m.jsx(YNe,{}),i&&m.jsx(BNe,{}),m.jsx("main",{className:a?"flex-1":"mx-auto w-full max-w-5xl flex-1 px-4 py-6",children:m.jsx(mZ,{})}),m.jsx(NNe,{}),m.jsx(wwe,{})]})}function JNe(e={}){var _;const{filter:t,unreadOnly:n}=e,r=t!==void 0||n===!0,a=Zn(As).notifications,[s,o]=y.useState([]),[l,c]=y.useState(null),[f,u]=YSe(p1e,{mode:"promise"}),d=y.useRef(`${t}:${n}`),h=`${t}:${n}`;d.current!==h&&(d.current=h,o([]),c(null));const p=(_=a==null?void 0:a.items[0])==null?void 0:_.id,b=y.useRef(p);!r&&b.current!==p&&(b.current=p,s.length>0&&o([]));const x=y.useMemo(()=>({limit:20,...t?{filter:t}:{},...n?{unreadOnly:1}:{}}),[t,n]);y.useEffect(()=>{if(!r)return;let A=!1;return u({urlParams:x}).then(D=>{A||c({items:D.items,...D.nextCursor!==void 0?{nextCursor:D.nextCursor}:{}})}).catch(()=>{}),()=>{A=!0}},[r,x,u]);const g=r?l:a,v=s.length>0?s[s.length-1].nextCursor:g==null?void 0:g.nextCursor,w=v!==void 0,E=f.waiting,C=y.useCallback(async()=>{if(!(!w||E||v===void 0))try{const A=await u({urlParams:{...x,cursor:v}}),D={items:A.items,...A.nextCursor!==void 0?{nextCursor:A.nextCursor}:{}};o(O=>[...O,D])}catch{}},[w,E,v,u,x]);return{items:y.useMemo(()=>{const A=(g==null?void 0:g.items)??[];return s.length===0?A:[...A,...s.flatMap(D=>D.items)]},[g==null?void 0:g.items,s]),hasMore:w,isLoading:E,loadMore:C}}function XNe(e,t){const n=y.useRef(null),r=y.useRef(e);return r.current=e,y.useCallback(a=>{var s;(s=n.current)==null||s.disconnect(),n.current=null,a&&(n.current=new IntersectionObserver(o=>{var l;(l=o[0])!=null&&l.isIntersecting&&r.current()},t),n.current.observe(a))},[JSON.stringify(t)])}function QNe(e){const[t,n]=y.useState(null),r=y.useRef(e);return r.current!==e&&(r.current=e,t!==null&&n(null)),[t??e,n]}function $z(e){const[t,n]=y.useState(new Set),r=y.useRef(e);r.current!==e&&(r.current=e,t.size>0&&n(new Set));const i=y.useCallback(o=>{n(l=>new Set(l).add(o))},[]),a=y.useCallback(o=>{n(new Set(o))},[]),s=y.useCallback(o=>{n(l=>{const c=new Set(l);return c.delete(o),c})},[]);return[t,i,a,s]}const ZNe=N2("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 Zt({asChild:e=!1,className:t,variant:n="default",...r}){const i=e?oq:"span";return m.jsx(i,{"data-slot":"badge","data-variant":n,className:st(ZNe({variant:n}),t),...r})}const e2e=e=>/ExpiredToken|Unauthorized|AuthFailure|SSO|token|credentials|expired/i.test(e),t2e=e=>{switch(e){case"error":return m.jsx(K1e,{className:"size-4 text-destructive shrink-0"});case"warning":return m.jsx(j_e,{className:"size-4 text-yellow-500 shrink-0"});case"success":return m.jsx(Y7,{className:"size-4 text-green-500 shrink-0"});default:return m.jsx(t2,{className:"size-4 text-blue-500 shrink-0"})}},tG=ze({operation:Ie(P),profile:Ie(P),region:Ie(P),cause:Ie(P),error:Ie(P),message:Ie(P)}),n2e=ON(tG),r2e=rc(P,tG,{decode:e=>({cause:e}),encode:e=>e.cause??""}),i2e=jbe(Lu(n2e,r2e)),nG=e=>i2e(e),a2e=e=>{const t=nG(e);if(Yt(t))return e;const{cause:n,error:r,message:i,operation:a}=t.value,s=n??r??i,o=[];return a&&o.push(a),s&&o.push(s),o.length>0?o.join(" — "):e},s2e=e=>{const t=new Date(e),r=new Date().getTime()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()};function o2e(){var X,W;const[e,t]=y.useState(void 0),[n,r]=y.useState(!0),[i,a]=y.useState(new Set),s=U=>a(I=>{const F=new Set(I);return F.has(U)?F.delete(U):F.add(U),F}),o=Zn(As),l=Fa(),{items:c,hasMore:f,isLoading:u,loadMore:d}=JNe({filter:e,unreadOnly:n}),h=Ct(g1e),p=Ct(y1e),b=Ct(b1e),x=Ct(JN),g=Ct(XN),[v,w,E]=$z((X=c[0])==null?void 0:X.id),[C,k,,_]=$z((W=c[0])==null?void 0:W.id),A=XNe(()=>{f&&!u&&d()}),D=c.map(U=>C.has(U.id)?{...U,read:0}:v.has(U.id)?{...U,read:1}:U),O=o.unreadNotificationCount??0,L=U=>U.pullRequestId==="",B=U=>{U.read===0&&(w(U.id),_(U.id),h({payload:{id:U.id}})),L(U)?s(U.id):l(`/accounts/${encodeURIComponent(U.awsAccountId)}/prs/${U.pullRequestId}`)};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h1",{className:"text-lg font-semibold",children:"Notifications"}),m.jsx(Le,{variant:"ghost",size:"sm",onClick:()=>l("/"),children:"Back"})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs(eG,{type:"single",value:e??"all",onValueChange:U=>t(U==="all"||U===""?void 0:U),variant:"outline",size:"sm",children:[m.jsx(fv,{value:"all",children:"All"}),m.jsx(fv,{value:"system",children:"System"}),m.jsx(fv,{value:"prs",children:"PRs"})]}),m.jsx(Le,{variant:n?"secondary":"ghost",size:"sm",onClick:()=>r(U=>!U),children:"Unread only"})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("div",{className:"flex items-center gap-2",children:O>0&&m.jsxs(Zt,{variant:"destructive",children:[O," unread"]})}),O>0&&m.jsxs(Le,{variant:"ghost",size:"sm",onClick:()=>{E(D.map(U=>U.id)),b({})},children:[m.jsx(ZS,{className:"size-3.5 mr-1"}),"Mark all read"]})]}),D.length===0?m.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No notifications"}):m.jsx("div",{className:"divide-y rounded-md border",children:D.map(U=>{const I=a2e(U.message),F=i.has(U.id);return m.jsxs("div",{className:`flex ${U.read===0?"border-l-2 border-l-blue-500":""}`,children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5 cursor-pointer hover:bg-accent/50 transition-colors",role:"button",tabIndex:0,onClick:()=>B(U),onKeyDown:z=>{z.key==="Enter"&&B(U)},children:[t2e(U.type),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-baseline gap-2",children:[m.jsx("span",{className:`text-sm truncate ${U.read===0?"font-medium":"text-muted-foreground"}`,children:U.title||(L(U)?U.type:`PR #${U.pullRequestId}`)}),m.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:s2e(U.createdAt)})]}),!F&&m.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-1",children:I})]})]}),F&&m.jsxs("div",{className:"px-3 pb-2.5 ml-7 space-y-2 min-w-0 overflow-hidden",children:[Dt(nG(U.message),{onNone:()=>m.jsx("p",{className:"text-xs text-muted-foreground break-words",children:U.message}),onSome:z=>m.jsxs("div",{className:"text-xs text-muted-foreground space-y-0.5",children:[z.operation&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"operation:"})," ",z.operation]}),z.profile&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"profile:"})," ",z.profile]}),z.region&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"region:"})," ",z.region]}),z.cause&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"cause:"})," ",z.cause]}),z.error&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"error:"})," ",z.error]}),z.message&&m.jsxs("div",{children:[m.jsx("span",{className:"font-medium",children:"message:"})," ",z.message]})]})}),m.jsxs(xw,{children:[m.jsx(Le,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{U.read===0?(w(U.id),_(U.id),h({payload:{id:U.id}})):(k(U.id),p({payload:{id:U.id}}))},children:U.read===0?m.jsxs(m.Fragment,{children:[m.jsx(l_e,{className:"size-3"})," Mark as read"]}):m.jsxs(m.Fragment,{children:[m.jsx(u_e,{className:"size-3"})," Mark as unread"]})}),L(U)&&e2e(U.message)&&m.jsxs(m.Fragment,{children:[m.jsx(Le,{variant:"default",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{try{const z=M9(dy)(U.profile||U.title);x({payload:{profile:z}})}catch{}},children:"Login"}),m.jsx(Le,{variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{g({})},children:"Logout"})]})]})]})]}),m.jsx("button",{className:"shrink-0 px-3 flex items-center hover:bg-accent/50 transition-colors border-l border-border",onClick:()=>s(U.id),title:F?"Collapse":"Expand",children:m.jsx(B1e,{className:`size-4 text-muted-foreground transition-transform ${F?"rotate-90":""}`})})]},U.id)})}),m.jsx("div",{ref:A,className:"h-1"}),u&&m.jsx("div",{className:"flex justify-center py-2",children:m.jsx(gu,{className:"size-4 animate-spin text-muted-foreground"})})]})]})}const l2e=864e5,vc=e=>Math.round(e*10)/10,c2e=(e,t,n)=>Math.min(t,Math.max(e,n)),Lz=(e,t)=>Math.max(0,(t.getTime()-e.getTime())/l2e),u2e=e=>/^\w+(\([^)]+\))?:/.test(e)||/^[A-Z]+-\d+:/.test(e),rG=(e,t)=>{const n=Lz(e.lastModifiedDate,t),r=Lz(e.creationDate,t),i=e.commentCount??0,a=u2e(e.title),s=!!e.description&&e.description.trim().length>0,o=-(n*1),l=-(r*.5),c=i*1,f=e.isApproved?2:0,u=e.isMergeable?0:-3,d=a?.5:0,h=s?.5:0,p=10+o+l+c+f+u+d+h,b=vc(c2e(0,10,p)),x=[{label:"Base",value:10},{label:"Time decay",value:vc(o)},{label:"Age",value:vc(l)},{label:"Comments",value:vc(c)},{label:"Approval",value:f},{label:"Conflicts",value:u},{label:"Scope",value:d},{label:"Description",value:h}],g=[{label:"Activity",description:`-1 per day since last update (${Math.round(n)}d ago)`,value:vc(o),...n<2?{status:"positive",statusLabel:"ACTIVE"}:n<=7?{status:"neutral",statusLabel:"SLOWING"}:{status:"negative",statusLabel:"STALE"}},{label:"Age",description:`-0.5 per day since creation (${Math.round(r)}d old)`,value:vc(l),...r<3?{status:"positive",statusLabel:"FRESH"}:r<=14?{status:"neutral",statusLabel:"AGING"}:{status:"negative",statusLabel:"OLD"}},{label:"Engagement",description:`+1 per comment (${i} comments)`,value:vc(c),...i>=3?{status:"positive",statusLabel:"ACTIVE"}:i>=1?{status:"neutral",statusLabel:"QUIET"}:{status:"negative",statusLabel:"SILENT"}},{label:"Approval",description:e.isApproved?"+2 bonus for approval":"No approval yet (+2 when approved)",value:f,...e.isApproved?{status:"positive",statusLabel:"APPROVED"}:{status:"neutral",statusLabel:"PENDING"}},{label:"Mergeable",description:e.isMergeable?"No merge conflicts":"-3 penalty for merge conflicts",value:u,...e.isMergeable?{status:"positive",statusLabel:"CLEAN"}:{status:"negative",statusLabel:"CONFLICT"}},{label:"Scope",description:a?"+0.5 bonus — conventional commit or ticket prefix detected":"No scope prefix found (e.g. feat(auth): or JIRA-123:)",value:d,...a?{status:"positive",statusLabel:"DETECTED"}:{status:"negative",statusLabel:"MISSING"}},{label:"Description",description:s?"+0.5 bonus — PR description provided":"No PR description provided",value:h,...s?{status:"positive",statusLabel:"PROVIDED"}:{status:"negative",statusLabel:"MISSING"}}];return ae({total:b,breakdown:x,categories:g})},M2=e=>j7(e).pipe(mp(t=>t>=7,()=>"green"),mp(t=>t>=4,()=>"yellow"),D7(()=>"red"));function f2e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const d2e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h2e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m2e={};function Pz(e,t){return(m2e.jsx?h2e:d2e).test(e)}const p2e=/[ \t\n\f\r]/g;function g2e(e){return typeof e=="object"?e.type==="text"?Fz(e.value):!1:Fz(e)}function Fz(e){return e.replace(p2e,"")===""}class vy{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vy.prototype.normal={};vy.prototype.property={};vy.prototype.space=void 0;function iG(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vy(n,r,t)}function UC(e){return e.toLowerCase()}class ui{constructor(t,n){this.attribute=n,this.property=t}}ui.prototype.attribute="";ui.prototype.booleanish=!1;ui.prototype.boolean=!1;ui.prototype.commaOrSpaceSeparated=!1;ui.prototype.commaSeparated=!1;ui.prototype.defined=!1;ui.prototype.mustUseProperty=!1;ui.prototype.number=!1;ui.prototype.overloadedBoolean=!1;ui.prototype.property="";ui.prototype.spaceSeparated=!1;ui.prototype.space=void 0;let y2e=0;const Xe=Vu(),bn=Vu(),BC=Vu(),re=Vu(),Pt=Vu(),md=Vu(),hi=Vu();function Vu(){return 2**++y2e}const HC=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:bn,commaOrSpaceSeparated:hi,commaSeparated:md,number:re,overloadedBoolean:BC,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),__=Object.keys(HC);class j2 extends ui{constructor(t,n,r,i){let a=-1;if(super(t,n),Uz(this,"space",i),typeof r=="number")for(;++a<__.length;){const s=__[a];Uz(this,__[a],(r&HC[s])===HC[s])}}}j2.prototype.defined=!0;function Uz(e,t,n){n&&(e[t]=n)}function Fh(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new j2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[UC(r)]=r,n[UC(a.attribute)]=r}return new vy(t,n,e.space)}const aG=Fh({properties:{ariaActiveDescendant:null,ariaAtomic:bn,ariaAutoComplete:null,ariaBusy:bn,ariaChecked:bn,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:bn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:bn,ariaFlowTo:Pt,ariaGrabbed:bn,ariaHasPopup:null,ariaHidden:bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:re,ariaLive:null,ariaModal:bn,ariaMultiLine:bn,ariaMultiSelectable:bn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:bn,ariaReadOnly:bn,ariaRelevant:null,ariaRequired:bn,ariaRoleDescription:Pt,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:bn,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sG(e,t){return t in e?e[t]:t}function oG(e,t){return sG(e,t.toLowerCase())}const b2e=Fh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:md,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Pt,autoFocus:Xe,autoPlay:Xe,blocking:Pt,capture:null,charSet:null,checked:Xe,cite:null,className:Pt,cols:re,colSpan:null,content:null,contentEditable:bn,controls:Xe,controlsList:Pt,coords:re|md,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:BC,draggable:bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Pt,height:re,hidden:BC,high:re,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:Xe,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:re,pattern:null,ping:Pt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Pt,required:Xe,reversed:Xe,rows:re,rowSpan:re,sandbox:Pt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:bn,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:bn,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:oG}),v2e=Fh({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:hi,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Pt,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:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,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:md,g2:md,glyphName:md,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:hi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,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:re,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:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hi,rev:hi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hi,requiredFeatures:hi,requiredFonts:hi,requiredFormats:hi,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:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:hi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:hi,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:hi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sG}),lG=Fh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),cG=Fh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oG}),uG=Fh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),x2e={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"},S2e=/[A-Z]/g,Bz=/-[a-z]/g,w2e=/^data[-\w.:]+$/i;function _2e(e,t){const n=UC(t);let r=t,i=ui;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&w2e.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Bz,k2e);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Bz.test(a)){let s=a.replace(S2e,E2e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=j2}return new i(r,t)}function E2e(e){return"-"+e.toLowerCase()}function k2e(e){return e.charAt(1).toUpperCase()}const C2e=iG([aG,b2e,lG,cG,uG],"html"),D2=iG([aG,v2e,lG,cG,uG],"svg");function T2e(e){return e.join(" ").trim()}var I2={},Hz=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,R2e=/\n/g,A2e=/^\s*/,N2e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,O2e=/^:\s*/,M2e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,j2e=/^[;\s]*/,D2e=/^\s+|\s+$/g,I2e=`
382
+ `,qz="/",Vz="*",Nc="",z2e="comment",$2e="declaration";function L2e(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var b=p.match(R2e);b&&(n+=b.length);var x=p.lastIndexOf(I2e);r=~x?p.length-x:r+p.length}function a(){var p={line:n,column:r};return function(b){return b.position=new s(p),c(),b}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(p){var b=new Error(t.source+":"+n+":"+r+": "+p);if(b.reason=p,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(p){var b=p.exec(e);if(b){var x=b[0];return i(x),e=e.slice(x.length),b}}function c(){l(A2e)}function f(p){var b;for(p=p||[];b=u();)b!==!1&&p.push(b);return p}function u(){var p=a();if(!(qz!=e.charAt(0)||Vz!=e.charAt(1))){for(var b=2;Nc!=e.charAt(b)&&(Vz!=e.charAt(b)||qz!=e.charAt(b+1));)++b;if(b+=2,Nc===e.charAt(b-1))return o("End of comment missing");var x=e.slice(2,b-2);return r+=2,i(x),e=e.slice(b),r+=2,p({type:z2e,comment:x})}}function d(){var p=a(),b=l(N2e);if(b){if(u(),!l(O2e))return o("property missing ':'");var x=l(M2e),g=p({type:$2e,property:Kz(b[0].replace(Hz,Nc)),value:x?Kz(x[0].replace(Hz,Nc)):Nc});return l(j2e),g}}function h(){var p=[];f(p);for(var b;b=d();)b!==!1&&(p.push(b),f(p));return p}return c(),h()}function Kz(e){return e?e.replace(D2e,Nc):Nc}var P2e=L2e,F2e=mv&&mv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I2,"__esModule",{value:!0});I2.default=B2e;const U2e=F2e(P2e);function B2e(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,U2e.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:o}=a;i?t(s,o,a):o&&(n=n||{},n[s]=o)}),n}var ww={};Object.defineProperty(ww,"__esModule",{value:!0});ww.camelCase=void 0;var H2e=/^--[a-zA-Z0-9_-]+$/,q2e=/-([a-z])/g,V2e=/^[^-]+$/,K2e=/^-(webkit|moz|ms|o|khtml)-/,G2e=/^-(ms)-/,Y2e=function(e){return!e||V2e.test(e)||H2e.test(e)},W2e=function(e,t){return t.toUpperCase()},Gz=function(e,t){return"".concat(t,"-")},J2e=function(e,t){return t===void 0&&(t={}),Y2e(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(G2e,Gz):e=e.replace(K2e,Gz),e.replace(q2e,W2e))};ww.camelCase=J2e;var X2e=mv&&mv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q2e=X2e(I2),Z2e=ww;function qC(e,t){var n={};return!e||typeof e!="string"||(0,Q2e.default)(e,function(r,i){r&&i&&(n[(0,Z2e.camelCase)(r,t)]=i)}),n}qC.default=qC;var eOe=qC;const tOe=gg(eOe),fG=dG("end"),z2=dG("start");function dG(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function hG(e){const t=z2(e),n=fG(e);if(t&&n)return{start:t,end:n}}function pp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yz(e.position):"start"in e||"end"in e?Yz(e):"line"in e||"column"in e?VC(e):""}function VC(e){return Wz(e&&e.line)+":"+Wz(e&&e.column)}function Yz(e){return VC(e&&e.start)+"-"+VC(e&&e.end)}function Wz(e){return e&&typeof e=="number"?e:1}class Nr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?a.ruleId=r:(a.source=r.slice(0,l),a.ruleId=r.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=pp(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nr.prototype.file="";Nr.prototype.name="";Nr.prototype.reason="";Nr.prototype.message="";Nr.prototype.stack="";Nr.prototype.column=void 0;Nr.prototype.line=void 0;Nr.prototype.ancestors=void 0;Nr.prototype.cause=void 0;Nr.prototype.fatal=void 0;Nr.prototype.place=void 0;Nr.prototype.ruleId=void 0;Nr.prototype.source=void 0;const $2={}.hasOwnProperty,nOe=new Map,rOe=/[A-Z]/g,iOe=new Set(["table","tbody","thead","tfoot","tr"]),aOe=new Set(["td","th"]),mG="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sOe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=mOe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=hOe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?D2:C2e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=pG(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function pG(e,t,n){if(t.type==="element")return oOe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return lOe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uOe(e,t,n);if(t.type==="mdxjsEsm")return cOe(e,t);if(t.type==="root")return fOe(e,t,n);if(t.type==="text")return dOe(e,t)}function oOe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=D2,e.schema=i),e.ancestors.push(t);const a=yG(e,t.tagName,!1),s=pOe(e,t);let o=P2(e,t);return iOe.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!g2e(l):!0})),gG(e,s,a,t),L2(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function lOe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}cg(e,t.position)}function cOe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cg(e,t.position)}function uOe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=D2,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:yG(e,t.name,!0),s=gOe(e,t),o=P2(e,t);return gG(e,s,a,t),L2(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function fOe(e,t,n){const r={};return L2(r,P2(e,t)),e.create(t,e.Fragment,r,n)}function dOe(e,t){return t.value}function gG(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function L2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hOe(e,t,n){return r;function r(i,a,s,o){const c=Array.isArray(s.children)?n:t;return o?c(a,s,o):c(a,s)}}function mOe(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),l=z2(r);return t(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function pOe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&$2.call(t.properties,i)){const a=yOe(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&aOe.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function gOe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else cg(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else cg(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function P2(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:nOe;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const o=pG(e,a,s);o!==void 0&&n.push(o)}return n}function yOe(e,t,n){const r=_2e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?f2e(n):T2e(n)),r.property==="style"){let i=typeof n=="object"?n:bOe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=vOe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?x2e[r.property]||r.property:r.attribute,n]}}function bOe(e,t){try{return tOe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=mG+"#cannot-parse-style-attribute",i}}function yG(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Pz(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Pz(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return $2.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);cg(e)}function cg(e,t){const n=new Nr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mG+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vOe(e){const t={};let n;for(n in e)$2.call(e,n)&&(t[xOe(n)]=e[n]);return t}function xOe(e){let t=e.replace(rOe,SOe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function SOe(e){return"-"+e.toLowerCase()}const E_={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"]},wOe={};function F2(e,t){const n=wOe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bG(e,r,i)}function bG(e,t,n){if(_Oe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jz(e.children,t,n)}return Array.isArray(e)?Jz(e,t,n):""}function Jz(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=bG(e[i],t,n);return r.join("")}function _Oe(e){return!!(e&&typeof e=="object")}const Xz=document.createElement("i");function U2(e){const t="&"+e+";";Xz.innerHTML=t;const n=Xz.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ni(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Gi(e,t){return e.length>0?(Ni(e,e.length,0,t),e):t}const Qz={}.hasOwnProperty;function vG(e){const t={};let n=-1;for(;++n<e.length;)EOe(t,e[n]);return t}function EOe(e,t){let n;for(n in t){const i=(Qz.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){Qz.call(i,s)||(i[s]=[]);const o=a[s];kOe(i[s],Array.isArray(o)?o:o?[o]:[])}}}function kOe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ni(e,0,0,r)}function xG(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Na(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pr=fc(/[A-Za-z]/),Tr=fc(/[\dA-Za-z]/),COe=fc(/[#-'*+\--9=?A-Z^-~]/);function l0(e){return e!==null&&(e<32||e===127)}const KC=fc(/\d/),TOe=fc(/[\dA-Fa-f]/),ROe=fc(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function $t(e){return e!==null&&(e<0||e===32)}function at(e){return e===-2||e===-1||e===32}const _w=fc(new RegExp("\\p{P}|\\p{S}","u")),_u=fc(/\s/);function fc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uh(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Tr(e.charCodeAt(n+1))&&Tr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return at(l)?(e.enter(n),o(l)):t(l)}function o(l){return at(l)&&a++<i?(e.consume(l),o):(e.exit(n),t(l))}}const AOe={tokenize:NOe};function NOe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),dt(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const OOe={tokenize:MOe},Zz={tokenize:jOe};function MOe(e){const t=this,n=[];let r=0,i,a,s;return o;function o(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const E=t.events.length;let C=E,k;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){k=t.events[C][1].end;break}g(r);let _=E;for(;_<t.events.length;)t.events[_][1].end={...k},_++;return Ni(t.events,C+1,0,t.events.slice(E)),t.events.length=_,c(w)}return o(w)}function c(w){if(r===n.length){if(!i)return d(w);if(i.currentConstruct&&i.currentConstruct.concrete)return p(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zz,f,u)(w)}function f(w){return i&&v(),g(r),d(w)}function u(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(w)}function d(w){return t.containerState={},e.attempt(Zz,h,p)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),d(w)}function p(w){if(w===null){i&&v(),g(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(w)}function b(w){if(w===null){x(e.exit("chunkFlow"),!0),g(0),e.consume(w);return}return Oe(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),b)}function x(w,E){const C=t.sliceStream(w);if(E&&C.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(C),t.parser.lazy[w.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const _=t.events.length;let A=_,D,O;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(D){O=t.events[A][1].end;break}D=!0}for(g(r),k=_;k<t.events.length;)t.events[k][1].end={...O},k++;Ni(t.events,A+1,0,t.events.slice(_)),t.events.length=k}}function g(w){let E=n.length;for(;E-- >w;){const C=n[E];t.containerState=C[1],C[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function jOe(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jd(e){if(e===null||$t(e)||_u(e))return 1;if(_w(e))return 2}function Ew(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const GC={name:"attention",resolveAll:DOe,tokenize:IOe};function DOe(e,t){let n=-1,r,i,a,s,o,l,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},d={...e[n][1].start};e$(u,-l),e$(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},a={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Gi(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Gi(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),c=Gi(c,Ew(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Gi(c,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=Gi(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ni(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function IOe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jd(r);let a;return s;function s(l){return a=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===a)return e.consume(l),o;const c=e.exit("attentionSequence"),f=Jd(l),u=!f||f===2&&i||n.includes(l),d=!i||i===2&&f||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(f||!u)),t(l)}}function e$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const zOe={name:"autolink",tokenize:$Oe};function $Oe(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(h){return Pr(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Tr(h)?(r=1,o(h)):c(h)}function o(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Tr(h))&&r++<32?(e.consume(h),o):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||l0(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),f):COe(h)?(e.consume(h),c):n(h)}function f(h){return Tr(h)?u(h):n(h)}function u(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):d(h)}function d(h){if((h===45||Tr(h))&&r++<63){const p=h===45?d:u;return e.consume(h),p}return n(h)}}const xy={partial:!0,tokenize:LOe};function LOe(e,t,n){return r;function r(a){return at(a)?dt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Oe(a)?t(a):n(a)}}const SG={continuation:{tokenize:FOe},exit:UOe,name:"blockQuote",tokenize:POe};function POe(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return at(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function FOe(e,t,n){const r=this;return i;function i(s){return at(s)?dt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(SG,t,n)(s)}}function UOe(e){e.exit("blockQuote")}const wG={name:"characterEscape",tokenize:BOe};function BOe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return ROe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const _G={name:"characterReference",tokenize:HOe};function HOe(e,t,n){const r=this;let i=0,a,s;return o;function o(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,s=Tr,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=TOe,f):(e.enter("characterReferenceValue"),a=7,s=KC,f(u))}function f(u){if(u===59&&i){const d=e.exit("characterReferenceValue");return s===Tr&&!U2(r.sliceSerialize(d))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(u)&&i++<a?(e.consume(u),f):n(u)}}const t$={partial:!0,tokenize:VOe},n$={concrete:!0,name:"codeFenced",tokenize:qOe};function qOe(e,t,n){const r=this,i={partial:!0,tokenize:C};let a=0,s=0,o;return l;function l(k){return c(k)}function c(k){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===o?(s++,e.consume(k),f):s<3?n(k):(e.exit("codeFencedFenceSequence"),at(k)?dt(e,u,"whitespace")(k):u(k))}function u(k){return k===null||Oe(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(t$,b,E)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||Oe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(k)):at(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),dt(e,h,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),d)}function h(k){return k===null||Oe(k)?u(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||Oe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(k)):k===96&&k===o?n(k):(e.consume(k),p)}function b(k){return e.attempt(i,E,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return a>0&&at(k)?dt(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||Oe(k)?e.check(t$,b,E)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||Oe(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function E(k){return e.exit("codeFenced"),t(k)}function C(k,_,A){let D=0;return O;function O(U){return k.enter("lineEnding"),k.consume(U),k.exit("lineEnding"),L}function L(U){return k.enter("codeFencedFence"),at(U)?dt(k,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(k.enter("codeFencedFenceSequence"),X(U)):A(U)}function X(U){return U===o?(D++,k.consume(U),X):D>=s?(k.exit("codeFencedFenceSequence"),at(U)?dt(k,W,"whitespace")(U):W(U)):A(U)}function W(U){return U===null||Oe(U)?(k.exit("codeFencedFence"),_(U)):A(U)}}}function VOe(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const k_={name:"codeIndented",tokenize:GOe},KOe={partial:!0,tokenize:YOe};function GOe(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),dt(e,a,"linePrefix",5)(c)}function a(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Oe(c)?e.attempt(KOe,s,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||Oe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function YOe(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Oe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):dt(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Oe(s)?i(s):n(s)}}const WOe={name:"codeText",previous:XOe,resolve:JOe,tokenize:QOe};function JOe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function XOe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QOe(e,t,n){let r=0,i,a;return s;function s(u){return e.enter("codeText"),e.enter("codeTextSequence"),o(u)}function o(u){return u===96?(e.consume(u),r++,o):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(a=e.enter("codeTextSequence"),i=0,f(u)):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||Oe(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(a.type="codeTextData",c(u))}}class ZOe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&mm(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),mm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);mm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);mm(this.left,n.reverse())}}}function mm(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function EG(e){const t={};let n=-1,r,i,a,s,o,l,c;const f=new ZOe(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,eMe(f,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=f.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},o=f.slice(i,n),o.unshift(r),f.splice(i,n-i+1,o))}}return Ni(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function eMe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let f,u,d=-1,h=n,p=0,b=0;const x=[b];for(;h;){for(;e.get(++i)[1]!==h;);a.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),u&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),u=h,h=h.next}for(h=n;++d<o.length;)o[d][0]==="exit"&&o[d-1][0]==="enter"&&o[d][1].type===o[d-1][1].type&&o[d][1].start.line!==o[d][1].end.line&&(b=d+1,x.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):x.pop(),d=x.length;d--;){const g=o.slice(x[d],x[d+1]),v=a.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const tMe={resolve:rMe,tokenize:iMe},nMe={partial:!0,tokenize:aMe};function rMe(e){return EG(e),e}function iMe(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):Oe(o)?e.check(nMe,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function aMe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),dt(e,a,"linePrefix")}function a(s){if(s===null||Oe(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function kG(e,t,n,r,i,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(g){return g===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(g),e.exit(a),d):g===null||g===32||g===41||l0(g)?n(g):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(g))}function d(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(o),d(g)):g===null||g===60||Oe(g)?n(g):(e.consume(g),g===92?p:h)}function p(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function b(g){return!f&&(g===null||g===41||$t(g))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(g)):f<c&&g===40?(e.consume(g),f++,b):g===41?(e.consume(g),f--,b):g===null||g===32||g===40||l0(g)?n(g):(e.consume(g),g===92?x:b)}function x(g){return g===40||g===41||g===92?(e.consume(g),b):b(g)}}function CG(e,t,n,r,i,a){const s=this;let o=0,l;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(a),f}function f(h){return o>999||h===null||h===91||h===93&&!l||h===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===null||h===91||h===93||Oe(h)||o++>999?(e.exit("chunkString"),f(h)):(e.consume(h),l||(l=!at(h)),h===92?d:u)}function d(h){return h===91||h===92||h===93?(e.consume(h),o++,u):u(h)}}function TG(e,t,n,r,i,a){let s;return o;function o(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(a),c(d))}function c(d){return d===s?(e.exit(a),l(s)):d===null?n(d):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),dt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===s||d===null||Oe(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?u:f)}function u(d){return d===s||d===92?(e.consume(d),f):f(d)}}function gp(e,t){let n;return r;function r(i){return Oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):at(i)?dt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sMe={name:"definition",tokenize:lMe},oMe={partial:!0,tokenize:cMe};function lMe(e,t,n){const r=this;let i;return a;function a(h){return e.enter("definition"),s(h)}function s(h){return CG.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return i=Na(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return $t(h)?gp(e,c)(h):c(h)}function c(h){return kG(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(oMe,u,u)(h)}function u(h){return at(h)?dt(e,d,"whitespace")(h):d(h)}function d(h){return h===null||Oe(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function cMe(e,t,n){return r;function r(o){return $t(o)?gp(e,i)(o):n(o)}function i(o){return TG(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return at(o)?dt(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Oe(o)?t(o):n(o)}}const uMe={name:"hardBreakEscape",tokenize:fMe};function fMe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Oe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const dMe={name:"headingAtx",resolve:hMe,tokenize:mMe};function hMe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ni(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function mMe(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||$t(f)?(e.exit("atxHeadingSequence"),o(f)):n(f)}function o(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||Oe(f)?(e.exit("atxHeading"),t(f)):at(f)?dt(e,o,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),o(f))}function c(f){return f===null||f===35||$t(f)?(e.exit("atxHeadingText"),o(f)):(e.consume(f),c)}}const pMe=["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"],r$=["pre","script","style","textarea"],gMe={concrete:!0,name:"htmlFlow",resolveTo:vMe,tokenize:xMe},yMe={partial:!0,tokenize:wMe},bMe={partial:!0,tokenize:SMe};function vMe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xMe(e,t,n){const r=this;let i,a,s,o,l;return c;function c(T){return f(T)}function f(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),a=!0,b):T===63?(e.consume(T),i=3,r.interrupt?t:N):Pr(T)?(e.consume(T),s=String.fromCharCode(T),x):n(T)}function d(T){return T===45?(e.consume(T),i=2,h):T===91?(e.consume(T),i=5,o=0,p):Pr(T)?(e.consume(T),i=4,r.interrupt?t:N):n(T)}function h(T){return T===45?(e.consume(T),r.interrupt?t:N):n(T)}function p(T){const K="CDATA[";return T===K.charCodeAt(o++)?(e.consume(T),o===K.length?r.interrupt?t:B:p):n(T)}function b(T){return Pr(T)?(e.consume(T),s=String.fromCharCode(T),x):n(T)}function x(T){if(T===null||T===47||T===62||$t(T)){const K=T===47,G=s.toLowerCase();return!K&&!a&&r$.includes(G)?(i=1,r.interrupt?t(T):B(T)):pMe.includes(s.toLowerCase())?(i=6,K?(e.consume(T),g):r.interrupt?t(T):B(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):a?v(T):w(T))}return T===45||Tr(T)?(e.consume(T),s+=String.fromCharCode(T),x):n(T)}function g(T){return T===62?(e.consume(T),r.interrupt?t:B):n(T)}function v(T){return at(T)?(e.consume(T),v):O(T)}function w(T){return T===47?(e.consume(T),O):T===58||T===95||Pr(T)?(e.consume(T),E):at(T)?(e.consume(T),w):O(T)}function E(T){return T===45||T===46||T===58||T===95||Tr(T)?(e.consume(T),E):C(T)}function C(T){return T===61?(e.consume(T),k):at(T)?(e.consume(T),C):w(T)}function k(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,_):at(T)?(e.consume(T),k):A(T)}function _(T){return T===l?(e.consume(T),l=null,D):T===null||Oe(T)?n(T):(e.consume(T),_)}function A(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||$t(T)?C(T):(e.consume(T),A)}function D(T){return T===47||T===62||at(T)?w(T):n(T)}function O(T){return T===62?(e.consume(T),L):n(T)}function L(T){return T===null||Oe(T)?B(T):at(T)?(e.consume(T),L):n(T)}function B(T){return T===45&&i===2?(e.consume(T),I):T===60&&i===1?(e.consume(T),F):T===62&&i===4?(e.consume(T),ue):T===63&&i===3?(e.consume(T),N):T===93&&i===5?(e.consume(T),V):Oe(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yMe,q,X)(T)):T===null||Oe(T)?(e.exit("htmlFlowData"),X(T)):(e.consume(T),B)}function X(T){return e.check(bMe,W,q)(T)}function W(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),U}function U(T){return T===null||Oe(T)?X(T):(e.enter("htmlFlowData"),B(T))}function I(T){return T===45?(e.consume(T),N):B(T)}function F(T){return T===47?(e.consume(T),s="",z):B(T)}function z(T){if(T===62){const K=s.toLowerCase();return r$.includes(K)?(e.consume(T),ue):B(T)}return Pr(T)&&s.length<8?(e.consume(T),s+=String.fromCharCode(T),z):B(T)}function V(T){return T===93?(e.consume(T),N):B(T)}function N(T){return T===62?(e.consume(T),ue):T===45&&i===2?(e.consume(T),N):B(T)}function ue(T){return T===null||Oe(T)?(e.exit("htmlFlowData"),q(T)):(e.consume(T),ue)}function q(T){return e.exit("htmlFlow"),t(T)}}function SMe(e,t,n){const r=this;return i;function i(s){return Oe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function wMe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xy,t,n)}}const _Me={name:"htmlText",tokenize:EMe};function EMe(e,t,n){const r=this;let i,a,s;return o;function o(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),l}function l(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),C):N===63?(e.consume(N),w):Pr(N)?(e.consume(N),A):n(N)}function c(N){return N===45?(e.consume(N),f):N===91?(e.consume(N),a=0,p):Pr(N)?(e.consume(N),v):n(N)}function f(N){return N===45?(e.consume(N),h):n(N)}function u(N){return N===null?n(N):N===45?(e.consume(N),d):Oe(N)?(s=u,F(N)):(e.consume(N),u)}function d(N){return N===45?(e.consume(N),h):u(N)}function h(N){return N===62?I(N):N===45?d(N):u(N)}function p(N){const ue="CDATA[";return N===ue.charCodeAt(a++)?(e.consume(N),a===ue.length?b:p):n(N)}function b(N){return N===null?n(N):N===93?(e.consume(N),x):Oe(N)?(s=b,F(N)):(e.consume(N),b)}function x(N){return N===93?(e.consume(N),g):b(N)}function g(N){return N===62?I(N):N===93?(e.consume(N),g):b(N)}function v(N){return N===null||N===62?I(N):Oe(N)?(s=v,F(N)):(e.consume(N),v)}function w(N){return N===null?n(N):N===63?(e.consume(N),E):Oe(N)?(s=w,F(N)):(e.consume(N),w)}function E(N){return N===62?I(N):w(N)}function C(N){return Pr(N)?(e.consume(N),k):n(N)}function k(N){return N===45||Tr(N)?(e.consume(N),k):_(N)}function _(N){return Oe(N)?(s=_,F(N)):at(N)?(e.consume(N),_):I(N)}function A(N){return N===45||Tr(N)?(e.consume(N),A):N===47||N===62||$t(N)?D(N):n(N)}function D(N){return N===47?(e.consume(N),I):N===58||N===95||Pr(N)?(e.consume(N),O):Oe(N)?(s=D,F(N)):at(N)?(e.consume(N),D):I(N)}function O(N){return N===45||N===46||N===58||N===95||Tr(N)?(e.consume(N),O):L(N)}function L(N){return N===61?(e.consume(N),B):Oe(N)?(s=L,F(N)):at(N)?(e.consume(N),L):D(N)}function B(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,X):Oe(N)?(s=B,F(N)):at(N)?(e.consume(N),B):(e.consume(N),W)}function X(N){return N===i?(e.consume(N),i=void 0,U):N===null?n(N):Oe(N)?(s=X,F(N)):(e.consume(N),X)}function W(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||$t(N)?D(N):(e.consume(N),W)}function U(N){return N===47||N===62||$t(N)?D(N):n(N)}function I(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function F(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return at(N)?dt(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):V(N)}function V(N){return e.enter("htmlTextData"),s(N)}}const B2={name:"labelEnd",resolveAll:RMe,resolveTo:AMe,tokenize:NMe},kMe={tokenize:OMe},CMe={tokenize:MMe},TMe={tokenize:jMe};function RMe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ni(e,0,e.length,n),e}function AMe(e,t){let n=e.length,r=0,i,a,s,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Gi(o,e.slice(a+1,a+r+3)),o=Gi(o,[["enter",f,t]]),o=Gi(o,Ew(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Gi(o,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),o=Gi(o,e.slice(s+1)),o=Gi(o,[["exit",l,t]]),Ni(e,a,e.length,o),e}function NMe(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(d){return a?a._inactive?u(d):(s=r.parser.defined.includes(Na(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),l):n(d)}function l(d){return d===40?e.attempt(kMe,f,s?f:u)(d):d===91?e.attempt(CMe,f,s?c:u)(d):s?f(d):u(d)}function c(d){return e.attempt(TMe,f,u)(d)}function f(d){return t(d)}function u(d){return a._balanced=!0,n(d)}}function OMe(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return $t(u)?gp(e,a)(u):a(u)}function a(u){return u===41?f(u):kG(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function s(u){return $t(u)?gp(e,l)(u):f(u)}function o(u){return n(u)}function l(u){return u===34||u===39||u===40?TG(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return $t(u)?gp(e,f)(u):f(u)}function f(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function MMe(e,t,n){const r=this;return i;function i(o){return CG.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(Na(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function jMe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const DMe={name:"labelStartImage",resolveAll:B2.resolveAll,tokenize:IMe};function IMe(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const zMe={name:"labelStartLink",resolveAll:B2.resolveAll,tokenize:$Me};function $Me(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const C_={name:"lineEnding",tokenize:LMe};function LMe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),dt(e,t,"linePrefix")}}const dv={name:"thematicBreak",tokenize:PMe};function PMe(e,t,n){let r=0,i;return a;function a(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),at(c)?dt(e,o,"whitespace")(c):o(c))}}const Qr={continuation:{tokenize:HMe},exit:VMe,name:"list",tokenize:BMe},FMe={partial:!0,tokenize:KMe},UMe={partial:!0,tokenize:qMe};function BMe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:KC(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(dv,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return KC(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(xy,r.interrupt?n:f,e.attempt(FMe,d,u))}function f(h){return r.containerState.initialBlankLine=!0,a++,d(h)}function u(h){return at(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function HMe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xy,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!at(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UMe,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(Qr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function qMe(e,t,n){const r=this;return dt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function VMe(e){e.exit(this.containerState.type)}function KMe(e,t,n){const r=this;return dt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!at(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const i$={name:"setextUnderline",resolveTo:GMe,tokenize:YMe};function GMe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function YMe(e,t,n){const r=this;let i;return a;function a(c){let f=r.events.length,u;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){u=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),at(c)?dt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const WMe={tokenize:JMe};function JMe(e){const t=this,n=e.attempt(xy,r,e.attempt(this.parser.constructs.flowInitial,i,dt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tMe,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const XMe={resolveAll:AG()},QMe=RG("string"),ZMe=RG("text");function RG(e){return{resolveAll:AG(e==="text"?eje:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(f){return c(f)?a(f):o(f)}function o(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return c(f)?(n.exit("data"),a(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const u=i[f];let d=-1;if(u)for(;++d<u.length;){const h=u[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function AG(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function eje(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,o=0,l;for(;a--;){const c=i[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const tje={42:Qr,43:Qr,45:Qr,48:Qr,49:Qr,50:Qr,51:Qr,52:Qr,53:Qr,54:Qr,55:Qr,56:Qr,57:Qr,62:SG},nje={91:sMe},rje={[-2]:k_,[-1]:k_,32:k_},ije={35:dMe,42:dv,45:[i$,dv],60:gMe,61:i$,95:dv,96:n$,126:n$},aje={38:_G,92:wG},sje={[-5]:C_,[-4]:C_,[-3]:C_,33:DMe,38:_G,42:GC,60:[zOe,_Me],91:zMe,92:[uMe,wG],93:B2,95:GC,96:WOe},oje={null:[GC,XMe]},lje={null:[42,95]},cje={null:[]},uje=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:lje,contentInitial:nje,disable:cje,document:tje,flow:ije,flowInitial:rje,insideSpan:oje,string:aje,text:sje},Symbol.toStringTag,{value:"Module"}));function fje(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],o=[];const l={attempt:_(C),check:_(k),consume:v,enter:w,exit:E,interrupt:_(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:p,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:u};let f=t.tokenize.call(c,l);return t.resolveAll&&a.push(t),c;function u(L){return s=Gi(s,L),x(),s[s.length-1]!==null?[]:(A(t,0),c.events=Ew(a,c.events,c),c.events)}function d(L,B){return hje(h(L),B)}function h(L){return dje(s,L)}function p(){const{_bufferIndex:L,_index:B,line:X,column:W,offset:U}=r;return{_bufferIndex:L,_index:B,line:X,column:W,offset:U}}function b(L){i[L.line]=L.column,O()}function x(){let L;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<B.length;)g(B.charCodeAt(r._bufferIndex));else g(B)}}function g(L){f=f(L)}function v(L){Oe(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,O()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function w(L,B){const X=B||{};return X.type=L,X.start=p(),c.events.push(["enter",X,c]),o.push(X),X}function E(L){const B=o.pop();return B.end=p(),c.events.push(["exit",B,c]),B}function C(L,B){A(L,B.from)}function k(L,B){B.restore()}function _(L,B){return X;function X(W,U,I){let F,z,V,N;return Array.isArray(W)?q(W):"tokenize"in W?q([W]):ue(W);function ue(oe){return Q;function Q(se){const ye=se!==null&&oe[se],Ae=se!==null&&oe.null,He=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return q(He)(se)}}function q(oe){return F=oe,z=0,oe.length===0?I:T(oe[z])}function T(oe){return Q;function Q(se){return N=D(),V=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?G():oe.tokenize.call(B?Object.assign(Object.create(c),B):c,l,K,G)(se)}}function K(oe){return L(V,N),U}function G(oe){return N.restore(),++z<F.length?T(F[z]):I}}}function A(L,B){L.resolveAll&&!a.includes(L)&&a.push(L),L.resolve&&Ni(c.events,B,c.events.length-B,L.resolve(c.events.slice(B),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function D(){const L=p(),B=c.previous,X=c.currentConstruct,W=c.events.length,U=Array.from(o);return{from:W,restore:I};function I(){r=L,c.previous=B,c.currentConstruct=X,c.events.length=W,o=U,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dje(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function hje(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
383
+ `;break}case-3:{s=`\r
384
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function mje(e){const r={constructs:vG([uje,...(e||{}).extensions||[]]),content:i(AOe),defined:[],document:i(OOe),flow:i(WMe),lazy:{},string:i(QMe),text:i(ZMe)};return r;function i(a){return s;function s(o){return fje(r,a,o)}}}function pje(e){for(;!EG(e););return e}const a$=/[\0\t\n\r]/g;function gje(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const l=[];let c,f,u,d,h;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),u=0,t="",n&&(a.charCodeAt(0)===65279&&u++,n=void 0);u<a.length;){if(a$.lastIndex=u,c=a$.exec(a),d=c&&c.index!==void 0?c.index:a.length,h=a.charCodeAt(d),!c){t=a.slice(u);break}if(h===10&&u===d&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<d&&(l.push(a.slice(u,d)),e+=d-u),h){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=d+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const yje=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bje(e){return e.replace(yje,vje)}function vje(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return xG(n.slice(a?2:1),a?16:10)}return U2(n)||e}const NG={}.hasOwnProperty;function xje(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Sje(n)(pje(mje(n).document().write(gje()(e,t,!0))))}function Sje(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(pn),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Ii),blockQuote:a(Ae),characterEscape:D,characterReference:D,codeFenced:a(He),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(He,s),codeText:a(ve,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(Jt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Nn),hardBreakEscape:a(On),hardBreakTrailing:a(On),htmlFlow:a(yr,s),htmlFlowData:D,htmlText:a(yr,s),htmlTextData:D,image:a(zo),label:s,link:a(pn),listItem:a(Bh),listItemValue:d,listOrdered:a(Gu,u),listUnordered:a(Gu),paragraph:a(er),reference:T,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ii),strong:a(Va),thematicBreak:a(Ms)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ye,autolinkProtocol:se,blockQuote:l(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:oe,characterReference:Q,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:l(g),codeText:l(U),codeTextData:O,data:O,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(X),htmlFlowData:O,htmlText:l(W),htmlTextData:O,image:l(F),label:V,labelText:z,lineEnding:L,link:l(I),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:K,resourceDestinationString:N,resourceTitleString:ue,resource:q,setextHeading:l(A),setextHeadingLineSequence:_,setextHeadingText:k,strong:l(),thematicBreak:l()}};OG(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let le={type:"root",children:[]};const we={stack:[le],tokenStack:[],config:t,enter:o,exit:c,buffer:s,resume:f,data:n},$e=[];let nt=-1;for(;++nt<Y.length;)if(Y[nt][1].type==="listOrdered"||Y[nt][1].type==="listUnordered")if(Y[nt][0]==="enter")$e.push(nt);else{const br=$e.pop();nt=i(Y,br,nt)}for(nt=-1;++nt<Y.length;){const br=t[Y[nt][0]];NG.call(br,Y[nt][1].type)&&br[Y[nt][1].type].call(Object.assign({sliceSerialize:Y[nt][2].sliceSerialize},we),Y[nt][1])}if(we.tokenStack.length>0){const br=we.tokenStack[we.tokenStack.length-1];(br[1]||s$).call(we,void 0,br[0])}for(le.position={start:Uo(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Uo(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)le=t.transforms[nt](le)||le;return le}function i(Y,le,we){let $e=le-1,nt=-1,br=!1,Hn,fi,tr,fa;for(;++$e<=we;){const Mn=Y[$e];switch(Mn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mn[0]==="enter"?nt++:nt--,fa=void 0;break}case"lineEndingBlank":{Mn[0]==="enter"&&(Hn&&!fa&&!nt&&!tr&&(tr=$e),fa=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fa=void 0}if(!nt&&Mn[0]==="enter"&&Mn[1].type==="listItemPrefix"||nt===-1&&Mn[0]==="exit"&&(Mn[1].type==="listUnordered"||Mn[1].type==="listOrdered")){if(Hn){let da=$e;for(fi=void 0;da--;){const Or=Y[da];if(Or[1].type==="lineEnding"||Or[1].type==="lineEndingBlank"){if(Or[0]==="exit")continue;fi&&(Y[fi][1].type="lineEndingBlank",br=!0),Or[1].type="lineEnding",fi=da}else if(!(Or[1].type==="linePrefix"||Or[1].type==="blockQuotePrefix"||Or[1].type==="blockQuotePrefixWhitespace"||Or[1].type==="blockQuoteMarker"||Or[1].type==="listItemIndent"))break}tr&&(!fi||tr<fi)&&(Hn._spread=!0),Hn.end=Object.assign({},fi?Y[fi][1].start:Mn[1].end),Y.splice(fi||$e,0,["exit",Hn,Mn[2]]),$e++,we++}if(Mn[1].type==="listItemPrefix"){const da={type:"listItem",_spread:!1,start:Object.assign({},Mn[1].start),end:void 0};Hn=da,Y.splice($e,0,["enter",da,Mn[2]]),$e++,we++,tr=void 0,fa=!0}}}return Y[le][1]._spread=br,we}function a(Y,le){return we;function we($e){o.call(this,Y($e),$e),le&&le.call(this,$e)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(Y,le,we){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([le,we||void 0]),Y.position={start:Uo(le.start),end:void 0}}function l(Y){return le;function le(we){Y&&Y.call(this,we),c.call(this,we)}}function c(Y,le){const we=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==Y.type&&(le?le.call(this,Y,$e[0]):($e[1]||s$).call(this,Y,$e[0]));else throw new Error("Cannot close `"+Y.type+"` ("+pp({start:Y.start,end:Y.end})+"): it’s not open");we.position.end=Uo(Y.end)}function f(){return F2(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(Y){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function h(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.lang=Y}function p(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.meta=Y}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y.replace(/(\r?\n|\r)$/g,"")}function v(Y){const le=this.resume(),we=this.stack[this.stack.length-1];we.label=le,we.identifier=Na(this.sliceSerialize(Y)).toLowerCase()}function w(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.title=Y}function E(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.url=Y}function C(Y){const le=this.stack[this.stack.length-1];if(!le.depth){const we=this.sliceSerialize(Y).length;le.depth=we}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(Y){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Y){const we=this.stack[this.stack.length-1].children;let $e=we[we.length-1];(!$e||$e.type!=="text")&&($e=ua(),$e.position={start:Uo(Y.start),end:void 0},we.push($e)),this.stack.push($e)}function O(Y){const le=this.stack.pop();le.value+=this.sliceSerialize(Y),le.position.end=Uo(Y.end)}function L(Y){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=le.children[le.children.length-1];we.position.end=Uo(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(D.call(this,Y),O.call(this,Y))}function B(){this.data.atHardBreak=!0}function X(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function W(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function U(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.value=Y}function I(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=le,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function F(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=le,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function z(Y){const le=this.sliceSerialize(Y),we=this.stack[this.stack.length-2];we.label=bje(le),we.identifier=Na(le).toLowerCase()}function V(){const Y=this.stack[this.stack.length-1],le=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const $e=Y.children;we.children=$e}else we.alt=le}function N(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.url=Y}function ue(){const Y=this.resume(),le=this.stack[this.stack.length-1];le.title=Y}function q(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function K(Y){const le=this.resume(),we=this.stack[this.stack.length-1];we.label=le,we.identifier=Na(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function G(Y){this.data.characterReferenceType=Y.type}function oe(Y){const le=this.sliceSerialize(Y),we=this.data.characterReferenceType;let $e;we?($e=xG(le,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=U2(le);const nt=this.stack[this.stack.length-1];nt.value+=$e}function Q(Y){const le=this.stack.pop();le.position.end=Uo(Y.end)}function se(Y){O.call(this,Y);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(Y)}function ye(Y){O.call(this,Y);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(Y)}function Ae(){return{type:"blockquote",children:[]}}function He(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Jt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Nn(){return{type:"emphasis",children:[]}}function Ii(){return{type:"heading",depth:0,children:[]}}function On(){return{type:"break"}}function yr(){return{type:"html",value:""}}function zo(){return{type:"image",title:null,url:"",alt:null}}function pn(){return{type:"link",title:null,url:"",children:[]}}function Gu(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Bh(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function er(){return{type:"paragraph",children:[]}}function Va(){return{type:"strong",children:[]}}function ua(){return{type:"text",value:""}}function Ms(){return{type:"thematicBreak"}}}function Uo(e){return{line:e.line,column:e.column,offset:e.offset}}function OG(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?OG(e,r):wje(e,r)}}function wje(e,t){let n;for(n in t)if(NG.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function s$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pp({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pp({start:t.start,end:t.end})+") is still open")}function _je(e){const t=this;t.parser=n;function n(r){return xje(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Eje(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function kje(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
385
+ `}]}function Cje(e,t){const n=t.value?t.value+`
386
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Tje(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rje(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Aje(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Uh(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Nje(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oje(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function MG(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Mje(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return MG(e,t);const i={src:Uh(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function jje(e,t){const n={src:Uh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Dje(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ije(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return MG(e,t);const i={href:Uh(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zje(e,t){const n={href:Uh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $je(e,t,n){const r=e.all(t),i=n?Lje(n):jG(t),a={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let u;f&&f.type==="element"&&f.tagName==="p"?u=f:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const f=r[o];(i||o!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
387
+ `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
388
+ `});const c={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,c),e.applyData(t,c)}function Lje(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=jG(n[r])}return t}function jG(e){const t=e.spread;return t??e.children.length>1}function Pje(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Fje(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uje(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Bje(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hje(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=z2(t.children[1]),l=fG(t.children[t.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function qje(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const u=t.children[l],d={},h=s?s[l]:void 0;h&&(d.align=h);let p={type:"element",tagName:a,properties:d,children:[]};u&&(p.children=e.all(u),e.patch(u,p),p=e.applyData(u,p)),c.push(p)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function Vje(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const o$=9,l$=32;function Kje(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(c$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(c$(t.slice(i),i>0,!1)),a.join("")}function c$(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===o$||a===l$;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===o$||a===l$;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Gje(e,t){const n={type:"text",value:Kje(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yje(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Wje={blockquote:Eje,break:kje,code:Cje,delete:Tje,emphasis:Rje,footnoteReference:Aje,heading:Nje,html:Oje,imageReference:Mje,image:jje,inlineCode:Dje,linkReference:Ije,link:zje,listItem:$je,list:Pje,paragraph:Fje,root:Uje,strong:Bje,table:Hje,tableCell:Vje,tableRow:qje,text:Gje,thematicBreak:Yje,toml:yb,yaml:yb,definition:yb,footnoteDefinition:yb};function yb(){}const DG=-1,kw=0,yp=1,c0=2,H2=3,q2=4,V2=5,K2=6,IG=7,zG=8,u$=typeof self=="object"?self:globalThis,Jje=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case kw:case DG:return n(s,i);case yp:{const o=n([],i);for(const l of s)o.push(r(l));return o}case c0:{const o=n({},i);for(const[l,c]of s)o[r(l)]=r(c);return o}case H2:return n(new Date(s),i);case q2:{const{source:o,flags:l}=s;return n(new RegExp(o,l),i)}case V2:{const o=n(new Map,i);for(const[l,c]of s)o.set(r(l),r(c));return o}case K2:{const o=n(new Set,i);for(const l of s)o.add(r(l));return o}case IG:{const{name:o,message:l}=s;return n(new u$[o](l),i)}case zG:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new u$[a](s),i)};return r},f$=e=>Jje(new Map,e)(0),ff="",{toString:Xje}={},{keys:Qje}=Object,pm=e=>{const t=typeof e;if(t!=="object"||!e)return[kw,t];const n=Xje.call(e).slice(8,-1);switch(n){case"Array":return[yp,ff];case"Object":return[c0,ff];case"Date":return[H2,ff];case"RegExp":return[q2,ff];case"Map":return[V2,ff];case"Set":return[K2,ff];case"DataView":return[yp,n]}return n.includes("Array")?[yp,n]:n.includes("Error")?[IG,n]:[c0,n]},bb=([e,t])=>e===kw&&(t==="function"||t==="symbol"),Zje=(e,t,n,r)=>{const i=(s,o)=>{const l=r.push(s)-1;return n.set(o,l),l},a=s=>{if(n.has(s))return n.get(s);let[o,l]=pm(s);switch(o){case kw:{let f=s;switch(l){case"bigint":o=zG,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([DG],s)}return i([o,f],s)}case yp:{if(l){let d=s;return l==="DataView"?d=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(s)),i([l,[...d]],s)}const f=[],u=i([o,f],s);for(const d of s)f.push(a(d));return u}case c0:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const f=[],u=i([o,f],s);for(const d of Qje(s))(e||!bb(pm(s[d])))&&f.push([a(d),a(s[d])]);return u}case H2:return i([o,s.toISOString()],s);case q2:{const{source:f,flags:u}=s;return i([o,{source:f,flags:u}],s)}case V2:{const f=[],u=i([o,f],s);for(const[d,h]of s)(e||!(bb(pm(d))||bb(pm(h))))&&f.push([a(d),a(h)]);return u}case K2:{const f=[],u=i([o,f],s);for(const d of s)(e||!bb(pm(d)))&&f.push(a(d));return u}}const{message:c}=s;return i([o,{name:l,message:c}],s)};return a},d$=(e,{json:t,lossy:n}={})=>{const r=[];return Zje(!(t||n),!!t,new Map,r)(e),r},ug=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?f$(d$(e,t)):structuredClone(e):(e,t)=>f$(d$(e,t));function eDe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function tDe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function nDe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||eDe,r=e.options.footnoteBackLabel||tDe,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const f=e.all(c),u=String(c.identifier).toUpperCase(),d=Uh(u.toLowerCase());let h=0;const p=[],b=e.footnoteCounts.get(u);for(;b!==void 0&&++h<=b;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,h);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=f[f.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...p)}else f.push(...p);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(f,!0)};e.patch(c,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ug(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
389
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
390
+ `}]}}const Cw=function(e){if(e==null)return sDe;if(typeof e=="function")return Tw(e);if(typeof e=="object")return Array.isArray(e)?rDe(e):iDe(e);if(typeof e=="string")return aDe(e);throw new Error("Expected function, string, or object as test")};function rDe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Cw(e[n]);return Tw(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function iDe(e){const t=e;return Tw(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function aDe(e){return Tw(t);function t(n){return n&&n.type===e}}function Tw(e){return t;function t(n,r,i){return!!(oDe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sDe(){return!0}function oDe(e){return e!==null&&typeof e=="object"&&"type"in e}const $G=[],lDe=!0,YC=!1,cDe="skip";function LG(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Cw(i),s=r?-1:1;o(e,void 0,[])();function o(l,c,f){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=$G,p,b,x;if((!t||a(l,c,f[f.length-1]||void 0))&&(h=uDe(n(l,f)),h[0]===YC))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==cDe)for(b=(r?g.children.length:-1)+s,x=f.concat(g);b>-1&&b<g.children.length;){const v=g.children[b];if(p=o(v,b,x)(),p[0]===YC)return p;b=typeof p[1]=="number"?p[1]:b+s}}return h}}}function uDe(e){return Array.isArray(e)?e:typeof e=="number"?[lDe,e]:e==null?$G:[e]}function G2(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),LG(e,a,o,i);function o(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return s(l,u,f)}}const WC={}.hasOwnProperty,fDe={};function dDe(e,t){const n=t||fDe,r=new Map,i=new Map,a=new Map,s={...Wje,...n.handlers},o={all:c,applyData:mDe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:n,patch:hDe,wrap:gDe};return G2(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?r:i,d=String(f.identifier).toUpperCase();u.has(d)||u.set(d,f)}}),o;function l(f,u){const d=f.type,h=o.handlers[d];if(WC.call(o.handlers,d)&&h)return h(o,f,u);if(o.options.passThrough&&o.options.passThrough.includes(d)){if("children"in f){const{children:b,...x}=f,g=ug(x);return g.children=o.all(f),g}return ug(f)}return(o.options.unknownHandler||pDe)(o,f,u)}function c(f){const u=[];if("children"in f){const d=f.children;let h=-1;for(;++h<d.length;){const p=o.one(d[h],f);if(p){if(h&&d[h-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=h$(p.value)),!Array.isArray(p)&&p.type==="element")){const b=p.children[0];b&&b.type==="text"&&(b.value=h$(b.value))}Array.isArray(p)?u.push(...p):u.push(p)}}}return u}}function hDe(e,t){e.position&&(t.position=hG(e))}function mDe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,ug(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function pDe(e,t){const n=t.data||{},r="value"in t&&!(WC.call(n,"hProperties")||WC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gDe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
391
+ `});++r<e.length;)r&&n.push({type:"text",value:`
392
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
393
+ `}),n}function h$(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function m$(e,t){const n=dDe(e,t),r=n.one(e,void 0),i=nDe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
394
+ `},i),a}function yDe(e,t){return e&&"run"in e?async function(n,r){const i=m$(n,{file:r,...t});await e.run(i,r)}:function(n,r){return m$(n,{file:r,...e||t})}}function p$(e){if(e)throw e}var hv=Object.prototype.hasOwnProperty,PG=Object.prototype.toString,g$=Object.defineProperty,y$=Object.getOwnPropertyDescriptor,b$=function(t){return typeof Array.isArray=="function"?Array.isArray(t):PG.call(t)==="[object Array]"},v$=function(t){if(!t||PG.call(t)!=="[object Object]")return!1;var n=hv.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&hv.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||hv.call(t,i)},x$=function(t,n){g$&&n.name==="__proto__"?g$(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},S$=function(t,n){if(n==="__proto__")if(hv.call(t,n)){if(y$)return y$(t,n).value}else return;return t[n]},bDe=function e(){var t,n,r,i,a,s,o=arguments[0],l=1,c=arguments.length,f=!1;for(typeof o=="boolean"&&(f=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=S$(o,n),i=S$(t,n),o!==i&&(f&&i&&(v$(i)||(a=b$(i)))?(a?(a=!1,s=r&&b$(r)?r:[]):s=r&&v$(r)?r:{},x$(o,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&x$(o,{name:n,newValue:i}));return o};const T_=gg(bDe);function JC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vDe(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(l,...c){const f=e[++a];let u=-1;if(l){s(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,f?xDe(f,o)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function xDe(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(i);try{l=e.apply(this,s)}catch(c){const f=c;if(o&&n)throw f;return i(f)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const Ja={basename:SDe,dirname:wDe,extname:_De,join:EDe,sep:"/"};function SDe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sy(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function wDe(e){if(Sy(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function _De(e){Sy(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function EDe(...e){let t=-1,n;for(;++t<e.length;)Sy(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":kDe(n)}function kDe(e){Sy(e);const t=e.codePointAt(0)===47;let n=CDe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CDe(e,t){let n="",r=0,i=-1,a=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function Sy(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const TDe={cwd:RDe};function RDe(){return"/"}function XC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ADe(e){if(typeof e=="string")e=new URL(e);else if(!XC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return NDe(e)}function NDe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const R_=["history","path","basename","stem","extname","dirname"];class FG{constructor(t){let n;t?XC(t)?n={path:t}:typeof t=="string"||ODe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":TDe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<R_.length;){const a=R_[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)R_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ja.basename(this.path):void 0}set basename(t){N_(t,"basename"),A_(t,"basename"),this.path=Ja.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ja.dirname(this.path):void 0}set dirname(t){w$(this.basename,"dirname"),this.path=Ja.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ja.extname(this.path):void 0}set extname(t){if(A_(t,"extname"),w$(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ja.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){XC(t)&&(t=ADe(t)),N_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ja.basename(this.path,this.extname):void 0}set stem(t){N_(t,"stem"),A_(t,"stem"),this.path=Ja.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Nr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function A_(e,t){if(e&&e.includes(Ja.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ja.sep+"`")}function N_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function w$(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ODe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MDe=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},jDe={}.hasOwnProperty;class Y2 extends MDe{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=vDe()}copy(){const t=new Y2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(T_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(j_("data",this.frozen),this.namespace[t]=n,this):jDe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(j_("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=vb(t),r=this.parser||this.Parser;return O_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),O_("process",this.parser||this.Parser),M_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=vb(t),l=r.parse(o);r.run(l,o,function(f,u,d){if(f||!u||!d)return c(f);const h=u,p=r.stringify(h,d);zDe(p)?d.value=p:d.result=p,c(f,d)});function c(f,u){f||!u?s(f):a?a(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),O_("processSync",this.parser||this.Parser),M_("processSync",this.compiler||this.Compiler),this.process(t,i),E$("processSync","process",n),r;function i(a,s){n=!0,p$(a),r=s}}run(t,n,r){_$(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,o){const l=vb(n);i.run(t,l,c);function c(f,u,d){const h=u||t;f?o(f):s?s(h):r(void 0,h,d)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),E$("runSync","run",r),i;function a(s,o){p$(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=vb(n),i=this.compiler||this.Compiler;return M_("stringify",i),_$(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(j_("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=T_(!0,i.settings,c.settings))}function o(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];a(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,d=-1;for(;++u<r.length;)if(r[u][0]===c){d=u;break}if(d===-1)r.push([c,...f]);else if(f.length>0){let[h,...p]=f;const b=r[d][1];JC(b)&&JC(h)&&(h=T_(!0,b,h)),r[d]=[c,h,...p]}}}}const DDe=new Y2().freeze();function O_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function M_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function j_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _$(e){if(!JC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function E$(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vb(e){return IDe(e)?e:new FG(e)}function IDe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zDe(e){return typeof e=="string"||$De(e)}function $De(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LDe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",k$=[],C$={allowDangerousHtml:!0},PDe=/^(https?|ircs?|mailto|xmpp)$/i,FDe=[{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 UG(e){const t=UDe(e),n=BDe(e);return HDe(t.runSync(t.parse(n),n),e)}function UDe(e){const t=e.rehypePlugins||k$,n=e.remarkPlugins||k$,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C$}:C$;return DDe().use(_je).use(n).use(yDe,r).use(t)}function BDe(e){const t=e.children||"",n=new FG;return typeof t=="string"&&(n.value=t),n}function HDe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||qDe;for(const f of FDe)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+LDe+f.id,void 0);return G2(e,c),sOe(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function c(f,u,d){if(f.type==="raw"&&d&&typeof u=="number")return s?d.children.splice(u,1):d.children[u]={type:"text",value:f.value},u;if(f.type==="element"){let h;for(h in E_)if(Object.hasOwn(E_,h)&&Object.hasOwn(f.properties,h)){const p=f.properties[h],b=E_[h];(b===null||b.includes(f.tagName))&&(f.properties[h]=l(String(p||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!h&&r&&typeof u=="number"&&(h=!r(f,u,d)),h&&d&&typeof u=="number")return o&&f.children?d.children.splice(u,1,...f.children):d.children.splice(u,1),u}}}function qDe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||PDe.test(e.slice(0,t))?e:""}const xc=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],T$={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...xc,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...xc],h2:[["className","sr-only"]],img:[...xc,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...xc,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...xc],table:[...xc],ul:[...xc,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Yo={}.hasOwnProperty;function VDe(e,t){let n={type:"root",children:[]};const r={schema:t?{...T$,...t}:T$,stack:[]},i=BG(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function BG(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return KDe(e,n);case"doctype":return GDe(e,n);case"element":return YDe(e,n);case"root":return WDe(e,n);case"text":return JDe(e,n)}}}function KDe(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return wy(a,t),a}}function GDe(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return wy(n,t),n}}function YDe(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=HG(e,t.children),i=XDe(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Yo.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let l=-1;for(a=!1;++l<o.length;)e.stack.includes(o[l])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:i,children:r};return wy(s,t),s}function WDe(e,t){const r={type:"root",children:HG(e,t.children)};return wy(r,t),r}function JDe(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return wy(r,t),r}function HG(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=BG(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function XDe(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Yo.call(r,n)?r[n]:void 0,s=r&&Yo.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},l={};let c;for(c in o)if(Yo.call(o,c)){const f=o[c];let u=R$(e,A$(a,c),c,f);u==null&&(u=R$(e,A$(s,c),c,f)),u!=null&&(l[c]=u)}if(i&&Yo.call(i,n)){const f=i[n];for(c in f)Yo.call(f,c)&&!Yo.call(l,c)&&(l[c]=f[c])}return l}function R$(e,t,n,r){return t?Array.isArray(r)?QDe(e,t,n,r):qG(e,t,n,r):void 0}function QDe(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const s=qG(e,t,n,r[i]);(typeof s=="number"||typeof s=="string")&&a.push(s)}return a}function qG(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&ZDe(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const s=t[a];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function ZDe(e,t,n){const r=e.schema.protocols&&Yo.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),s=i.indexOf("?"),o=i.indexOf("#"),l=i.indexOf("/");if(a<0||l>-1&&a>l||s>-1&&a>s||o>-1&&a>o)return!0;let c=-1;for(;++c<r.length;){const f=r[c];if(a===f.length&&i.slice(0,f.length)===f)return!0}return!1}function wy(e,t){const n=hG(t);t.data&&(e.data=ug(t.data)),n&&(e.position=n)}function A$(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function VG(e){return function(t){return VDe(t,e)}}function N$(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function eIe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function tIe(e,t,n){const i=Cw((n||{}).ignore||[]),a=nIe(t);let s=-1;for(;++s<a.length;)LG(e,"text",o);function o(c,f){let u=-1,d;for(;++u<f.length;){const h=f[u],p=d?d.children:void 0;if(i(h,p?p.indexOf(h):void 0,d))return;d=h}if(d)return l(c,f)}function l(c,f){const u=f[f.length-1],d=a[s][0],h=a[s][1];let p=0;const x=u.children.indexOf(c);let g=!1,v=[];d.lastIndex=0;let w=d.exec(c.value);for(;w;){const E=w.index,C={index:w.index,input:w.input,stack:[...f,c]};let k=h(...w,C);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?d.lastIndex=E+1:(p!==E&&v.push({type:"text",value:c.value.slice(p,E)}),Array.isArray(k)?v.push(...k):k&&v.push(k),p=E+w[0].length,g=!0),!d.global)break;w=d.exec(c.value)}return g?(p<c.value.length&&v.push({type:"text",value:c.value.slice(p)}),u.children.splice(x,1,...v)):v=[c],x+v.length}}function nIe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([rIe(i[0]),iIe(i[1])])}return t}function rIe(e){return typeof e=="string"?new RegExp(eIe(e),"g"):e}function iIe(e){return typeof e=="function"?e:function(){return e}}const D_="phrasing",I_=["autolink","link","image","label"];function aIe(){return{transforms:[dIe],enter:{literalAutolink:oIe,literalAutolinkEmail:z_,literalAutolinkHttp:z_,literalAutolinkWww:z_},exit:{literalAutolink:fIe,literalAutolinkEmail:uIe,literalAutolinkHttp:lIe,literalAutolinkWww:cIe}}}function sIe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:D_,notInConstruct:I_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:D_,notInConstruct:I_},{character:":",before:"[ps]",after:"\\/",inConstruct:D_,notInConstruct:I_}]}}function oIe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function z_(e){this.config.enter.autolinkProtocol.call(this,e)}function lIe(e){this.config.exit.autolinkProtocol.call(this,e)}function cIe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function uIe(e){this.config.exit.autolinkEmail.call(this,e)}function fIe(e){this.exit(e)}function dIe(e){tIe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hIe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),mIe]],{ignore:["link","linkReference"]})}function hIe(e,t,n,r,i){let a="";if(!KG(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!pIe(n)))return!1;const s=gIe(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function mIe(e,t,n,r){return!KG(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function pIe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gIe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=N$(e,"(");let a=N$(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function KG(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||_u(n)||_w(n))&&(!t||n!==47)}GG.peek=kIe;function yIe(){this.buffer()}function bIe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vIe(){this.buffer()}function xIe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function SIe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wIe(e){this.exit(e)}function _Ie(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EIe(e){this.exit(e)}function kIe(){return"["}function GG(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function CIe(){return{enter:{gfmFootnoteCallString:yIe,gfmFootnoteCall:bIe,gfmFootnoteDefinitionLabelString:vIe,gfmFootnoteDefinition:xIe},exit:{gfmFootnoteCallString:SIe,gfmFootnoteCall:wIe,gfmFootnoteDefinitionLabelString:_Ie,gfmFootnoteDefinition:EIe}}}function TIe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GG},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let l=o.move("[^");const c=a.enter("footnoteDefinition"),f=a.enter("label");return l+=o.move(a.safe(a.associationId(r),{before:l,after:"]"})),f(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
395
+ `:" ")+a.indentLines(a.containerFlow(r,o.current()),t?YG:RIe))),c(),l}}function RIe(e,t,n){return t===0?e:YG(e,t,n)}function YG(e,t,n){return(n?"":" ")+e}const AIe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];WG.peek=DIe;function NIe(){return{canContainEols:["delete"],enter:{strikethrough:MIe},exit:{strikethrough:jIe}}}function OIe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AIe}],handlers:{delete:WG}}}function MIe(e){this.enter({type:"delete",children:[]},e)}function jIe(e){this.exit(e)}function WG(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function DIe(){return"~"}function IIe(e){return e.length}function zIe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||IIe,a=[],s=[],o=[],l=[];let c=0,f=-1;for(;++f<e.length;){const b=[],x=[];let g=-1;for(e[f].length>c&&(c=e[f].length);++g<e[f].length;){const v=$Ie(e[f][g]);if(n.alignDelimiters!==!1){const w=i(v);x[g]=w,(l[g]===void 0||w>l[g])&&(l[g]=w)}b.push(v)}s[f]=b,o[f]=x}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)a[u]=O$(r[u]);else{const b=O$(r);for(;++u<c;)a[u]=b}u=-1;const d=[],h=[];for(;++u<c;){const b=a[u];let x="",g="";b===99?(x=":",g=":"):b===108?x=":":b===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[u]-x.length-g.length);const w=x+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=x.length+v+g.length,v>l[u]&&(l[u]=v),h[u]=v),d[u]=w}s.splice(1,0,d),o.splice(1,0,h),f=-1;const p=[];for(;++f<s.length;){const b=s[f],x=o[f];u=-1;const g=[];for(;++u<c;){const v=b[u]||"";let w="",E="";if(n.alignDelimiters!==!1){const C=l[u]-(x[u]||0),k=a[u];k===114?w=" ".repeat(C):k===99?C%2?(w=" ".repeat(C/2+.5),E=" ".repeat(C/2-.5)):(w=" ".repeat(C/2),E=w):E=" ".repeat(C)}n.delimiterStart!==!1&&!u&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||u)&&g.push(" "),n.alignDelimiters!==!1&&g.push(w),g.push(v),n.alignDelimiters!==!1&&g.push(E),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&g.push("|")}p.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return p.join(`
396
+ `)}function $Ie(e){return e==null?"":String(e)}function O$(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function LIe(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),PIe);return i(),s}function PIe(e,t,n){return">"+(n?"":" ")+e}function FIe(e,t){return M$(e,t.inConstruct,!0)&&!M$(e,t.notInConstruct,!1)}function M$(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function j$(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
397
+ `&&FIe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
398
+ `}function UIe(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function BIe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HIe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function qIe(e,t,n,r){const i=HIe(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(BIe(e,n)){const u=n.enter("codeIndented"),d=n.indentLines(a,VIe);return u(),d}const o=n.createTracker(r),l=i.repeat(Math.max(UIe(a,i)+1,3)),c=n.enter("codeFenced");let f=o.move(l);if(e.lang){const u=n.enter(`codeFencedLang${s}`);f+=o.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...o.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${s}`);f+=o.move(" "),f+=o.move(n.safe(e.meta,{before:f,after:`
399
+ `,encode:["`"],...o.current()})),u()}return f+=o.move(`
400
+ `),a&&(f+=o.move(a+`
401
+ `)),f+=o.move(l),c(),f}function VIe(e,t,n){return(n?"":" ")+e}function W2(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function KIe(e,t,n,r){const i=W2(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
402
+ `,...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),s(),c}function GIe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fg(e){return"&#x"+e.toString(16).toUpperCase()+";"}function u0(e,t,n){const r=Jd(e),i=Jd(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JG.peek=YIe;function JG(e,t,n,r){const i=GIe(n),a=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),f=u0(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=fg(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=u0(r.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+fg(u));const h=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},o+l+h}function YIe(e,t,n){return n.options.emphasis||"*"}function WIe(e,t){let n=!1;return G2(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,YC}),!!((!e.depth||e.depth<3)&&F2(e)&&(t.options.setext||n))}function JIe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(WIe(e,n)){const f=n.enter("headingSetext"),u=n.enter("phrasing"),d=n.containerPhrasing(e,{...a.current(),before:`
403
+ `,after:`
404
+ `});return u(),f(),d+`
405
+ `+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
406
+ `))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");a.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
407
+ `,...a.current()});return/^[\t ]/.test(c)&&(c=fg(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),o(),c}XG.peek=XIe;function XG(e){return e.value||""}function XIe(){return"<"}QG.peek=QIe;function QG(e,t,n,r){const i=W2(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),s(),c}function QIe(){return"!"}ZG.peek=ZIe;function ZG(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=f,a(),i==="full"||!c||c!==u?l+=o.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function ZIe(){return"!"}eY.peek=eze;function eY(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function eze(){return"`"}function tY(e,t){const n=F2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nY.peek=tze;function nY(e,t,n,r){const i=W2(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(tY(e,n)){const f=n.stack;n.stack=[],o=n.enter("autolink");let u=s.move("<");return u+=s.move(n.containerPhrasing(e,{before:u,after:">",...s.current()})),u+=s.move(">"),o(),n.stack=f,u}o=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${a}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),o(),c}function tze(e,t,n){return tY(e,n)?"<":"["}rY.peek=nze;function rY(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=f,a(),i==="full"||!c||c!==u?l+=o.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function nze(){return"["}function J2(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function rze(e){const t=J2(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ize(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iY(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function aze(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?ize(n):J2(n);const o=e.ordered?s==="."?")":".":rze(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),iY(n)===s&&f){let u=-1;for(;++u<e.children.length;){const d=e.children[u];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),c}function sze(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function oze(e,t,n,r){const i=sze(n);let a=n.bulletCurrent||J2(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),f);return l(),c;function f(u,d,h){return d?(h?"":" ".repeat(s))+u:(h?a:a+" ".repeat(s-a.length))+u}}function lze(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const cze=Cw(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function uze(e,t,n,r){return(e.children.some(function(s){return cze(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function fze(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aY.peek=dze;function aY(e,t,n,r){const i=fze(n),a=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),f=u0(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=fg(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=u0(r.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+fg(u));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},o+l+h}function dze(e,t,n){return n.options.strong||"*"}function hze(e,t,n,r){return n.safe(e.value,r)}function mze(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function pze(e,t,n){const r=(iY(n)+(n.options.ruleSpaces?" ":"")).repeat(mze(n));return n.options.ruleSpaces?r.slice(0,-1):r}const sY={blockquote:LIe,break:j$,code:qIe,definition:KIe,emphasis:JG,hardBreak:j$,heading:JIe,html:XG,image:QG,imageReference:ZG,inlineCode:eY,link:nY,linkReference:rY,list:aze,listItem:oze,paragraph:lze,root:uze,strong:aY,text:hze,thematicBreak:pze};function gze(){return{enter:{table:yze,tableData:D$,tableHeader:D$,tableRow:vze},exit:{codeText:xze,table:bze,tableData:$_,tableHeader:$_,tableRow:$_}}}function yze(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function bze(e){this.exit(e),this.data.inTable=void 0}function vze(e){this.enter({type:"tableRow",children:[]},e)}function $_(e){this.exit(e)}function D$(e){this.enter({type:"tableCell",children:[]},e)}function xze(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Sze));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Sze(e,t){return t==="|"?t:e}function wze(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
408
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:l,tableRow:o}};function s(h,p,b,x){return c(f(h,b,x),h.align)}function o(h,p,b,x){const g=u(h,b,x),v=c([g]);return v.slice(0,v.indexOf(`
409
+ `))}function l(h,p,b,x){const g=b.enter("tableCell"),v=b.enter("phrasing"),w=b.containerPhrasing(h,{...x,before:a,after:a});return v(),g(),w}function c(h,p){return zIe(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function f(h,p,b){const x=h.children;let g=-1;const v=[],w=p.enter("table");for(;++g<x.length;)v[g]=u(x[g],p,b);return w(),v}function u(h,p,b){const x=h.children;let g=-1;const v=[],w=p.enter("tableRow");for(;++g<x.length;)v[g]=l(x[g],h,p,b);return w(),v}function d(h,p,b){let x=sY.inlineCode(h,p,b);return b.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function _ze(){return{exit:{taskListCheckValueChecked:I$,taskListCheckValueUnchecked:I$,paragraph:kze}}}function Eze(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Cze}}}function I$(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function kze(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Cze(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=sY.listItem(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+s}}function Tze(){return[aIe(),CIe(),NIe(),gze(),_ze()]}function Rze(e){return{extensions:[sIe(),TIe(e),OIe(),wze(e),Eze()]}}const Aze={tokenize:Ize,partial:!0},oY={tokenize:zze,partial:!0},lY={tokenize:$ze,partial:!0},cY={tokenize:Lze,partial:!0},Nze={tokenize:Pze,partial:!0},uY={name:"wwwAutolink",tokenize:jze,previous:dY},fY={name:"protocolAutolink",tokenize:Dze,previous:hY},Io={name:"emailAutolink",tokenize:Mze,previous:mY},Os={};function Oze(){return{text:Os}}let Sc=48;for(;Sc<123;)Os[Sc]=Io,Sc++,Sc===58?Sc=65:Sc===91&&(Sc=97);Os[43]=Io;Os[45]=Io;Os[46]=Io;Os[95]=Io;Os[72]=[Io,fY];Os[104]=[Io,fY];Os[87]=[Io,uY];Os[119]=[Io,uY];function Mze(e,t,n){const r=this;let i,a;return s;function s(u){return!QC(u)||!mY.call(r,r.previous)||X2(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(u))}function o(u){return QC(u)?(e.consume(u),o):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(Nze,f,c)(u):u===45||u===95||Tr(u)?(a=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),i=!0,l}function f(u){return a&&i&&Pr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function jze(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!dY.call(r,r.previous)||X2(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Aze,e.attempt(oY,e.attempt(lY,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Dze(e,t,n){const r=this;let i="",a=!1;return s;function s(u){return(u===72||u===104)&&hY.call(r,r.previous)&&!X2(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),e.consume(u),o):n(u)}function o(u){if(Pr(u)&&i.length<5)return i+=String.fromCodePoint(u),e.consume(u),o;if(u===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),a?c:(a=!0,l)):n(u)}function c(u){return u===null||l0(u)||$t(u)||_u(u)||_w(u)?n(u):e.attempt(oY,e.attempt(lY,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function Ize(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function zze(e,t,n){let r,i,a;return s;function s(c){return c===46||c===95?e.check(cY,l,o)(c):c===null||$t(c)||_u(c)||c!==45&&_w(c)?l(c):(a=!0,e.consume(c),s)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!a?n(c):t(c)}}function $ze(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(cY,t,a)(s):s===null||$t(s)||_u(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function Lze(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||$t(o)||_u(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||$t(o)||_u(o)?t(o):r(o)}function a(o){return Pr(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Pr(o)?(e.consume(o),s):n(o)}}function Pze(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Tr(a)?n(a):t(a)}}function dY(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$t(e)}function hY(e){return!Pr(e)}function mY(e){return!(e===47||QC(e))}function QC(e){return e===43||e===45||e===46||e===95||Tr(e)}function X2(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Fze={tokenize:Yze,partial:!0};function Uze(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Vze,continuation:{tokenize:Kze},exit:Gze}},text:{91:{name:"gfmFootnoteCall",tokenize:qze},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Bze,resolveTo:Hze}}}}function Bze(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const c=Na(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Hze(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function qze(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(a>999||u===93&&!s||u===null||u===91||$t(u))return n(u);if(u===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(Na(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return $t(u)||(s=!0),a++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),a++,c):c(u)}}function Vze(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(p)}function f(p){if(s>999||p===93&&!o||p===null||p===91||$t(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=Na(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return $t(p)||(o=!0),s++,e.consume(p),p===92?u:f}function u(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(a)||i.push(a),dt(e,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return t(p)}}function Kze(e,t,n){return e.check(xy,t,e.attempt(Fze,t,n))}function Gze(e){e.exit("gfmFootnoteDefinition")}function Yze(e,t,n){const r=this;return dt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function Wze(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},u={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},d=[["enter",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",u,o]],h=o.parser.constructs.insideSpan.null;h&&Ni(d,d.length,0,Ew(h,s.slice(c+1,l),o)),Ni(d,d.length,0,[["exit",u,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",f,o]]),Ni(s,c-1,l-c+3,d),l=c+d.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const c=this.previous,f=this.events;let u=0;return d;function d(p){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),h(p))}function h(p){const b=Jd(c);if(p===126)return u>1?l(p):(s.consume(p),u++,h);if(u<2&&!n)return l(p);const x=s.exit("strikethroughSequenceTemporary"),g=Jd(p);return x._open=!g||g===2&&!!b,x._close=!b||b===2&&!!g,o(p)}}}class Jze{constructor(){this.map=[]}add(t,n,r){Xze(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function Xze(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Qze(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Zze(){return{flow:{null:{name:"table",tokenize:e$e,resolveAll:t$e}}}}function e$e(e,t,n){const r=this;let i=0,a=0,s;return o;function o(O){let L=r.events.length-1;for(;L>-1;){const W=r.events[L][1].type;if(W==="lineEnding"||W==="linePrefix")L--;else break}const B=L>-1?r.events[L][1].type:null,X=B==="tableHead"||B==="tableRow"?k:l;return X===k&&r.parser.lazy[r.now().line]?n(O):X(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),c(O)}function c(O){return O===124||(s=!0,a+=1),f(O)}function f(O){return O===null?n(O):Oe(O)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),h):n(O):at(O)?dt(e,f,"whitespace")(O):(a+=1,s&&(s=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),u(O)))}function u(O){return O===null||O===124||$t(O)?(e.exit("data"),f(O)):(e.consume(O),O===92?d:u)}function d(O){return O===92||O===124?(e.consume(O),u):u(O)}function h(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),s=!1,at(O)?dt(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):p(O))}function p(O){return O===45||O===58?x(O):O===124?(s=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),b):C(O)}function b(O){return at(O)?dt(e,x,"whitespace")(O):x(O)}function x(O){return O===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(a+=1,g(O)):O===null||Oe(O)?E(O):C(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),v(O)):C(O)}function v(O){return O===45?(e.consume(O),v):O===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(O))}function w(O){return at(O)?dt(e,E,"whitespace")(O):E(O)}function E(O){return O===124?p(O):O===null||Oe(O)?!s||i!==a?C(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):C(O)}function C(O){return n(O)}function k(O){return e.enter("tableRow"),_(O)}function _(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),_):O===null||Oe(O)?(e.exit("tableRow"),t(O)):at(O)?dt(e,_,"whitespace")(O):(e.enter("data"),A(O))}function A(O){return O===null||O===124||$t(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?D:A)}function D(O){return O===92||O===124?(e.consume(O),A):A(O)}}function t$e(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,c,f,u;const d=new Jze;for(;++n<e.length;){const h=e[n],p=h[1];h[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(z$(d,t,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,u=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",f,t]])),i=p.type==="tableDelimiterRow"?2:f?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],u=xb(d,t,a,i,void 0,u),a=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],u=xb(d,t,a,i,void 0,u)),a=s,s=[a[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],u=xb(d,t,a,i,n,u)):s[1]!==0&&(u=xb(d,t,s,i,n,u)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&z$(d,t,l,c,f),d.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Qze(t.events,n))}return e}function xb(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Ef(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const l=Ef(t.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const c=Ef(t.events,n[2]),f=Ef(t.events,n[3]),u={type:o,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",u,t]]),r!==2){const d=t.events[n[2]],h=t.events[n[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,b=n[3]-n[2]-1;e.add(p,b,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return i!==void 0&&(a.end=Object.assign({},Ef(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function z$(e,t,n,r,i){const a=[],s=Ef(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ef(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const n$e={name:"tasklistCheck",tokenize:i$e};function r$e(){return{text:{91:n$e}}}function i$e(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),a)}function a(l){return $t(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Oe(l)?t(l):at(l)?e.check({tokenize:a$e},t,n)(l):n(l)}}function a$e(e,t,n){return dt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function s$e(e){return vG([Oze(),Uze(),Wze(e),Zze(),r$e()])}const o$e={};function pY(e){const t=this,n=e||o$e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(s$e(n)),a.push(Tze()),s.push(Rze(n))}function $$(e){const[t,n]=y.useState(!1),[r,i]=y.useState(!1),a=()=>localStorage.getItem(e)==="true",s=y.useCallback(()=>a()?!1:(n(!0),!0),[e]),o=y.useCallback(()=>{r&&localStorage.setItem(e,"true"),n(!1)},[r,e]);return{cancel:y.useCallback(()=>{n(!1)},[]),dismiss:o,dontRemind:r,isDismissed:a,setDontRemind:i,show:s,visible:t}}function ZC({className:e,...t}){return m.jsx("div",{"data-slot":"card",className:st("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function gY({className:e,...t}){return m.jsx("div",{"data-slot":"card-header",className:st("@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),...t})}function yY({className:e,...t}){return m.jsx("div",{"data-slot":"card-title",className:st("leading-none font-semibold",e),...t})}function eT({className:e,...t}){return m.jsx("div",{"data-slot":"card-content",className:st("px-6",e),...t})}const bY=e=>e==="green"?"text-green-600 dark:text-green-400":e==="yellow"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",l$e=e=>e==="green"?"border-green-500/30":e==="yellow"?"border-yellow-500/30":"border-red-500/30",c$e=e=>e==="positive"?"outline":e==="neutral"?"secondary":"destructive",u$e=e=>e==="positive"?"border-green-500/30 text-green-600 dark:text-green-400":"",f$e=e=>{const t=new Date(e),n=t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),r=Date.now()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return`${n} · just now`;if(i<60)return`${n} · ${i}m ago`;const a=Math.floor(i/60);if(a<24)return`${n} · ${a}h ago`;const s=Math.floor(a/24);return`${n} · ${s}d ago`},L$=e=>e.comments.length===0?0:Math.min(...e.comments.map(t=>new Date(t.root.creationDate).getTime())),vY=e=>1+e.replies.reduce((t,n)=>t+vY(n),0);function d$e({score:e}){if(!e)return null;const t=M2(e.total);return m.jsx(Zt,{variant:"outline",className:`${l$e(t)} ${bY(t)} tabular-nums font-semibold`,children:e.total.toFixed(1)})}function h$e({score:e}){if(!e)return m.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"Waiting for comment count..."});const t=M2(e.total);return m.jsxs("div",{className:"space-y-3 pt-2",children:[m.jsxs("div",{className:"flex items-baseline gap-2",children:[m.jsx("span",{className:`text-lg font-bold tabular-nums ${bY(t)}`,children:e.total.toFixed(1)}),m.jsx("span",{className:"text-xs text-muted-foreground",children:"/ 10"}),m.jsx("div",{className:"ml-2 h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:m.jsx("div",{className:`h-full rounded-full ${t==="green"?"bg-green-500":t==="yellow"?"bg-yellow-500":"bg-red-500"}`,style:{width:`${e.total*10}%`}})})]}),m.jsx("div",{className:"space-y-2",children:e.categories.map(n=>m.jsxs("div",{className:"flex items-start gap-3 rounded border px-3 py-2",children:[m.jsx("span",{className:`w-8 text-right text-xs font-semibold tabular-nums ${n.value>0?"text-green-600 dark:text-green-400":n.value<0?"text-red-600 dark:text-red-400":"text-muted-foreground"}`,children:n.value>0?`+${n.value}`:n.value}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs font-medium",children:n.label}),m.jsx(Zt,{variant:c$e(n.status),className:`text-[10px] px-1.5 py-0 ${u$e(n.status)}`,children:n.statusLabel})]}),m.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.description})]})]},n.label))})]})}function xY({depth:e,thread:t}){return t.root.deleted?null:m.jsxs("div",{className:e>0?"ml-4 border-l-2 border-muted pl-3":"",children:[m.jsxs("div",{className:"space-y-1 py-2",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx("span",{className:"font-medium",children:t.root.author}),m.jsx("span",{children:"·"}),m.jsx("span",{children:f$e(t.root.creationDate)})]}),m.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words [&_a]:text-primary [&_img]:inline [&_img]:h-5 [&_img]:w-auto",children:m.jsx(UG,{remarkPlugins:[pY],rehypePlugins:[VG],children:t.root.content})})]}),t.replies.map(n=>m.jsx(xY,{thread:n,depth:e+1},n.root.id))]})}function m$e({pr:e}){const t=Ct(KI),n=Zn(KI),r=y.useRef(null);return y.useEffect(()=>{r.current!==e.id&&(r.current=e.id,t({payload:{pullRequestId:e.id,repositoryName:e.repositoryName,account:{profile:e.account.profile,region:e.account.region}}}))},[e.id,e.repositoryName,e.account.profile,e.account.region,t]),Wc(n).onInitialOrWaiting(()=>m.jsx("div",{className:"pt-2",children:m.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading comments..."})})).onError(()=>m.jsx("div",{className:"pt-2",children:m.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onDefect(()=>m.jsx("div",{className:"pt-2",children:m.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onSuccess(i=>{const a=i.reduce((s,o)=>s+o.comments.reduce((l,c)=>l+vY(c),0),0);return m.jsxs("div",{className:"pt-2",children:[i.length===0&&m.jsx("p",{className:"text-xs text-muted-foreground",children:"No comments"}),a>0&&m.jsx("div",{className:"space-y-1",children:[...i].sort((s,o)=>L$(o)-L$(s)).map((s,o)=>m.jsxs("div",{children:[s.filePath&&m.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s.filePath}),s.comments.map(l=>m.jsx(xY,{thread:l,depth:0},l.root.id)),o<i.length-1&&m.jsx(Cr,{className:"my-2"})]},o))})]})}).render()}function P$({children:e,count:t,title:n}){const[r,i]=y.useState(!1);return m.jsxs("div",{className:"rounded-lg border bg-card",children:[m.jsxs("button",{className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm font-medium hover:bg-accent/50",onClick:()=>i(!r),children:[m.jsx(e2,{className:`size-4 text-muted-foreground transition-transform ${r?"":"-rotate-90"}`}),n,t!==void 0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t,")"]})]}),r&&m.jsx("div",{className:"border-t px-4 pb-3",children:e})]})}function p$e(){const{accountId:e,prId:t}=fR(),n=Zn(As),r=Ct(x1e),i=y.useRef(null),a=y.useMemo(()=>t?n.pullRequests.find(K=>K.id===t&&(K.account.awsAccountId===e||K.account.profile===e))??null:null,[e,t,n.pullRequests]);y.useEffect(()=>{if(a||!e||!t)return;const K=`${e}:${t}`;i.current!==K&&(i.current=K,r({path:{awsAccountId:e,prId:ql.make(t)}}))},[a,e,t,r]);const s=y.useMemo(()=>a?Vi(rG(a,new Date)):void 0,[a]),o=Fa(),l=Ct(o1e),c=$$(Vv.grantedDismissed),f=$$(Vv.dockerDismissed),u=Zn(d1e),d=Ct(h1e),h=Ct(m1e),p=(a==null?void 0:a.account.awsAccountId)??(a==null?void 0:a.account.profile),b=y.useMemo(()=>bs(u)&&p?u.value.some(K=>K.awsAccountId===p&&K.pullRequestId===t):!1,[u,p,t]),[x,g]=QNe(b),v=y.useCallback(()=>{if(!p||!a)return;const K={awsAccountId:p,pullRequestId:a.id};g(!x),x?h({payload:K}):d({payload:K})},[p,x,a,d,h]),[w,E]=y.useState(!1),C=y.useRef(a==null?void 0:a.fetchedAt);y.useEffect(()=>{w&&(a!=null&&a.fetchedAt)&&a.fetchedAt!==C.current&&E(!1),C.current=a==null?void 0:a.fetchedAt},[w,a==null?void 0:a.fetchedAt]);const k=y.useCallback(()=>{!p||!t||w||(E(!0),r({path:{awsAccountId:p,prId:ql.make(t)}}))},[p,w,t,r]),_=a?a.link||`https://${a.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${a.repositoryName}/pull-requests/${a.id}?region=${a.account.region}`:"",[A,D]=y.useState(!1),O=y.useCallback(()=>{_&&navigator.clipboard.writeText(_).then(()=>{D(!0),setTimeout(()=>D(!1),2e3)},()=>{})},[_]),L=Ct(v1e),B=y.useMemo(()=>{var K;return(K=n.sandboxes)==null?void 0:K.find(G=>G.pullRequestId===t&&G.awsAccountId===e&&G.status!=="stopped"&&G.status!=="error")},[n.sandboxes,t,e]),[X,W]=y.useState(!1);y.useEffect(()=>{X&&B&&(W(!1),o(`/sandbox/${B.id}`))},[X,B,o]);const U=y.useCallback(()=>{if(!a)return;const K=a.account.awsAccountId??a.account.profile;L({payload:{pullRequestId:a.id,awsAccountId:K,repositoryName:a.repositoryName,sourceBranch:a.sourceBranch,profile:a.account.profile,region:a.account.region}}),W(!0)},[a,L]),I=y.useCallback(()=>{if(a){if(B){o(`/sandbox/${B.id}`);return}f.show()||U()}},[a,B,f,U,o]),F=()=>{f.dismiss(),U()},z=y.useCallback(()=>{!a||!_||l({payload:{profile:a.account.profile,link:_}})},[_,l,a]),V=y.useCallback(()=>{a&&(c.show()||z())},[c,a,z]),N=()=>{c.dismiss(),z()};if(y.useEffect(()=>{const K=G=>{G.target instanceof HTMLInputElement||G.target instanceof HTMLTextAreaElement||(G.key==="Escape"?(G.preventDefault(),o("/")):(G.key==="Enter"||G.key==="o")&&(a!=null&&a.link)?V():G.key==="."&&a&&(G.preventDefault(),I()))};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[V,I,o,a]),!a)return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[m.jsx(gu,{className:"size-6 animate-spin opacity-40"}),m.jsx("p",{className:"text-sm",children:"Loading pull request..."})]});const ue=a.status==="OPEN",q=ue?a.isMergeable?m.jsx(Zt,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):m.jsx(Zt,{variant:"destructive",children:"Conflict"}):null,T=ue?a.isApproved?m.jsx(Zt,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):m.jsx(Zt,{variant:"secondary",children:"Pending"}):null;return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsxs(Le,{variant:"ghost",size:"sm",onClick:()=>o("/"),children:[m.jsx(QN,{className:"size-4"}),"Back"]}),m.jsxs(xw,{className:"ml-auto",children:[m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:k,disabled:w,children:[m.jsx(hy,{className:`size-3.5 ${w?"animate-spin":""}`}),"Refresh"]}),m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:v,children:[x?m.jsx(z1e,{className:"size-3.5"}):m.jsx(ZN,{className:"size-3.5"}),x?"Unsubscribe":"Subscribe"]}),m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:I,children:[m.jsx(W7,{className:"size-3.5"}),B?"Open Sandbox":"Sandbox"]}),m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:O,children:[A?m.jsx(ZS,{className:"size-3.5"}):m.jsx(J7,{className:"size-3.5"}),A?"Copied":"Copy Link"]}),m.jsxs(Le,{variant:"default",size:"sm",className:"h-7 text-xs",onClick:V,children:[m.jsx(X1e,{className:"size-3.5"}),"Open in Console"]})]})]}),m.jsxs("div",{children:[m.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:a.title}),m.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[q,T,m.jsx(Zt,{variant:"outline",children:a.status}),m.jsx(d$e,{score:s}),m.jsx(Qa,{to:`/?filter=author&value=${encodeURIComponent(a.author)}`,className:"text-sm text-muted-foreground hover:underline",children:a.author}),m.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),m.jsx("span",{className:"text-sm text-muted-foreground",children:O2(a.creationDate)}),a.fetchedAt&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:Sw(a.fetchedAt,new Date,"Fetched")})]})]})]}),m.jsx(Cr,{}),m.jsx(ZC,{children:m.jsxs(eT,{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 py-4 text-sm",children:[m.jsx("span",{className:"text-muted-foreground",children:"Account"}),m.jsx(Qa,{to:`/?filter=account&value=${encodeURIComponent(a.account.profile)}`,className:"font-mono text-xs hover:underline",children:a.account.profile}),m.jsx("span",{className:"text-muted-foreground",children:"Repository"}),m.jsx(Qa,{to:`/?filter=repo&value=${encodeURIComponent(a.repositoryName)}`,className:"font-mono text-xs hover:underline",children:a.repositoryName}),m.jsx("span",{className:"text-muted-foreground",children:"Branch"}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Zt,{variant:"outline",className:"font-mono text-xs",children:a.sourceBranch}),m.jsx(D1e,{className:"size-3 text-muted-foreground"}),m.jsx(Zt,{variant:"outline",className:"font-mono text-xs",children:a.destinationBranch})]}),m.jsx("span",{className:"text-muted-foreground",children:"Author"}),m.jsx(Qa,{to:`/?filter=author&value=${encodeURIComponent(a.author)}`,className:"text-xs hover:underline",children:a.author}),hd(a.title)&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Scope"}),m.jsx(Qa,{to:`/?filter=scope&value=${encodeURIComponent(hd(a.title))}`,className:"text-xs hover:underline",children:hd(a.title)})]}),m.jsx("span",{className:"text-muted-foreground",children:"Status"}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Qa,{to:`/?filter=status&value=${a.isApproved?"approved":"pending"}`,className:"hover:underline",children:a.isApproved?m.jsx(Zt,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):m.jsx(Zt,{variant:"secondary",children:"Pending"})}),m.jsx(Qa,{to:`/?filter=status&value=${a.isMergeable?"mergeable":"conflicts"}`,className:"hover:underline",children:a.isMergeable?m.jsx(Zt,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):m.jsx(Zt,{variant:"destructive",children:"Conflict"})})]}),m.jsx("span",{className:"text-muted-foreground",children:"ID"}),m.jsx("span",{className:"font-mono text-xs",children:a.id})]})}),m.jsx(P$,{title:"Health Score Breakdown",children:m.jsx(h$e,{score:s})}),a.description&&m.jsxs(ZC,{children:[m.jsx(gY,{children:m.jsx(yY,{className:"text-sm",children:"Description"})}),m.jsx(eT,{children:m.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:m.jsx(UG,{remarkPlugins:[pY],rehypePlugins:[VG],children:a.description})})})]}),m.jsx(P$,{title:"Comments",...a.commentCount!==void 0?{count:a.commentCount}:{},children:m.jsx(m$e,{pr:a},a.id)}),m.jsx(zC,{open:c.visible,onOpenChange:c.cancel,children:m.jsxs($C,{children:[m.jsxs(LC,{children:[m.jsx(PC,{children:"Granted CLI Required"}),m.jsxs(FC,{children:['"Open in Console" uses'," ",m.jsx("a",{href:"https://docs.commonfate.io/granted/introduction",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Granted"})," ","to assume the AWS role for this account. Make sure the"," ",m.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",children:"assume"})," CLI is installed and configured before continuing."]})]}),m.jsxs(Mz,{children:[m.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground mr-auto",children:[m.jsx("input",{type:"checkbox",checked:c.dontRemind,onChange:K=>c.setDontRemind(K.target.checked),className:"accent-primary"}),"Don't remind again"]}),m.jsx(Le,{variant:"ghost",onClick:c.cancel,children:"Cancel"}),m.jsx(Le,{onClick:N,children:"Continue"})]})]})}),m.jsx(zC,{open:f.visible,onOpenChange:f.cancel,children:m.jsxs($C,{children:[m.jsxs(LC,{children:[m.jsx(PC,{children:"Docker Required"}),m.jsx(FC,{children:"Sandbox uses Docker to run a code-server container. Make sure Docker is started before continuing."})]}),m.jsxs(Mz,{children:[m.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground mr-auto",children:[m.jsx("input",{type:"checkbox",checked:f.dontRemind,onChange:K=>f.setDontRemind(K.target.checked),className:"accent-primary"}),"Don't show again"]}),m.jsx(Le,{onClick:F,children:"OK"})]})]})})]})}const tT=new Set,qr=new WeakMap,Eu=new WeakMap,Ro=new WeakMap,dg=new WeakMap,L_=new WeakMap,nT=new WeakMap,Jc=new WeakMap,Xd=new WeakMap,kf=new WeakSet;let Wl,Q2=0,Z2=0;const co="__aa_tgt",hg="__aa_del",f0="__aa_new",SY=e=>{const t=x$e(e);t&&t.forEach(n=>S$e(n))},g$e=e=>{e.forEach(t=>{t.target===Wl&&b$e(),qr.has(t.target)&&Ku(t.target)})};function y$e(e){const t=dg.get(e);t==null||t.disconnect();let n=qr.get(e),r=0;const i=5;n||(n=Qd(e),qr.set(e,n));const{offsetWidth:a,offsetHeight:s}=Wl,l=[n.top-i,a-(n.left+i+n.width),s-(n.top+i+n.height),n.left-i].map(f=>`${-1*Math.floor(f)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&Ku(e)},{root:Wl,threshold:1,rootMargin:l});c.observe(e),dg.set(e,c)}function Ku(e){clearTimeout(Xd.get(e));const t=Rw(e),n=mg(t)?500:t.duration;Xd.set(e,setTimeout(async()=>{const r=Ro.get(e);try{await(r==null?void 0:r.finished),qr.set(e,Qd(e)),y$e(e)}catch{}},n))}function b$e(){clearTimeout(Xd.get(Wl)),Xd.set(Wl,setTimeout(()=>{tT.forEach(e=>rT(e,t=>wY(()=>Ku(t))))},100))}function v$e(e){setTimeout(()=>{nT.set(e,setInterval(()=>wY(Ku.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function wY(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Ys;const _Y=typeof window<"u"&&"ResizeObserver"in window;_Y&&(Wl=document.documentElement,new MutationObserver(SY),Ys=new ResizeObserver(g$e),window.addEventListener("scroll",()=>{Z2=window.scrollY,Q2=window.scrollX}),Ys.observe(Wl));function x$e(e){return e.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(P_(i.target),!r.has(i.target)){r.add(i.target);for(let a=0;a<i.target.children.length;a++){const s=i.target.children.item(a);if(s){if(hg in s)return!1;P_(i.target,s),r.add(s)}}}if(i.removedNodes.length)for(let a=0;a<i.removedNodes.length;a++){const s=i.removedNodes[a];if(hg in s)return!1;s instanceof Element&&(r.add(s),P_(i.target,s),Eu.set(s,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function P_(e,t){!t&&!(co in e)?Object.defineProperty(e,co,{value:e}):t&&!(co in t)&&Object.defineProperty(t,co,{value:e})}function S$e(e){var t;const n=e.isConnected,r=qr.has(e);n&&Eu.has(e)&&Eu.delete(e),Ro.has(e)&&((t=Ro.get(e))===null||t===void 0||t.cancel()),f0 in e?F$(e):r&&n?_$e(e):r&&!n?E$e(e):F$(e)}function Xa(e){return Number(e.replace(/[^0-9.\-]/g,""))}function w$e(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Qd(e){const t=e.getBoundingClientRect(),{x:n,y:r}=w$e(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function EY(e,t,n){let r=t.width,i=t.height,a=n.width,s=n.height;const o=getComputedStyle(e);if(o.getPropertyValue("box-sizing")==="content-box"){const c=Xa(o.paddingTop)+Xa(o.paddingBottom)+Xa(o.borderTopWidth)+Xa(o.borderBottomWidth),f=Xa(o.paddingLeft)+Xa(o.paddingRight)+Xa(o.borderRightWidth)+Xa(o.borderLeftWidth);r-=f,a-=f,i-=c,s-=c}return[r,a,i,s].map(Math.round)}function Rw(e){return co in e&&Jc.has(e[co])?Jc.get(e[co]):{duration:250,easing:"ease-in-out"}}function kY(e){if(co in e)return e[co]}function eO(e){const t=kY(e);return t?kf.has(t):!1}function rT(e,...t){t.forEach(n=>n(e,Jc.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,Jc.has(r)))}}function tO(e){return Array.isArray(e)?e:[e]}function mg(e){return typeof e=="function"}function _$e(e){const t=qr.get(e),n=Qd(e);if(!eO(e))return qr.set(e,n);let r;if(!t)return;const i=Rw(e);if(typeof i!="function"){const a=t.left-n.left,s=t.top-n.top,[o,l,c,f]=EY(e,t,n),u={transform:`translate(${a}px, ${s}px)`},d={transform:"translate(0, 0)"};o!==l&&(u.width=`${o}px`,d.width=`${l}px`),c!==f&&(u.height=`${c}px`,d.height=`${f}px`),r=e.animate([u,d],{duration:i.duration,easing:i.easing})}else{const[a]=tO(i(e,"remain",t,n));r=new Animation(a),r.play()}Ro.set(e,r),qr.set(e,n),r.addEventListener("finish",()=>Ku(e),{once:!0})}function F$(e){f0 in e&&delete e[f0];const t=Qd(e);qr.set(e,t);const n=Rw(e);if(!eO(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=tO(n(e,"add",t));r=new Animation(i),r.play()}Ro.set(e,r),r.addEventListener("finish",()=>Ku(e),{once:!0})}function U$(e,t){var n;e.remove(),qr.delete(e),Eu.delete(e),Ro.delete(e),(n=dg.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(hg in e&&delete e[hg],Object.defineProperty(e,f0,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function E$e(e){var t;if(!Eu.has(e)||!qr.has(e))return;const[n,r]=Eu.get(e);Object.defineProperty(e,hg,{value:!0,configurable:!0});const i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=kY(e))===null||t===void 0||t.appendChild(e),!eO(e))return U$(e);const[s,o,l,c]=C$e(e),f=Rw(e),u=qr.get(e);(i!==Q2||a!==Z2)&&k$e(e,i,a,f);let d,h={position:"absolute",top:`${s}px`,left:`${o}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!mg(f))Object.assign(e.style,h),d=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:f.duration,easing:"ease-out"});else{const[p,b]=tO(f(e,"remove",u));(b==null?void 0:b.styleReset)!==!1&&(h=(b==null?void 0:b.styleReset)||h,Object.assign(e.style,h)),d=new Animation(p),d.play()}Ro.set(e,d),d.addEventListener("finish",()=>U$(e,h),{once:!0})}function k$e(e,t,n,r){const i=Q2-t,a=Z2-n,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(Wl).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,f=l.clientWidth;const u=performance.now();function d(){requestAnimationFrame(()=>{if(!mg(r)){const h=c-l.clientHeight,p=f-l.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-h}),c=l.clientHeight,f=l.clientWidth,d()):document.documentElement.style.scrollBehavior=s}})}d()}function C$e(e){const t=qr.get(e),[n,,r]=EY(e,t,Qd(e));let i=e.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const a=getComputedStyle(i),s=qr.get(i)||Qd(i),o=Math.round(t.top-s.top)-Xa(a.borderTopWidth),l=Math.round(t.left-s.left)-Xa(a.borderLeftWidth);return[o,l,n,r]}function T$e(e,t={}){if(_Y&&Ys&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!mg(t)&&!t.disrespectUserMotionPreference)){kf.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),rT(e,Ku,v$e,s=>Ys==null?void 0:Ys.observe(s)),mg(t)?Jc.set(e,t):Jc.set(e,{duration:250,easing:"ease-in-out",...t});const a=new MutationObserver(SY);a.observe(e,{childList:!0}),L_.set(e,a),tT.add(e)}return Object.freeze({parent:e,enable:()=>{kf.add(e)},disable:()=>{kf.delete(e)},isEnabled:()=>kf.has(e),destroy:()=>{kf.delete(e),tT.delete(e),Jc.delete(e);const r=L_.get(e);r==null||r.disconnect(),L_.delete(e),rT(e,i=>{Ys==null||Ys.unobserve(i);const a=Ro.get(i);try{a==null||a.cancel()}catch{}Ro.delete(i);const s=dg.get(i);s==null||s.disconnect(),dg.delete(i);const o=nT.get(i);o&&clearInterval(o),nT.delete(i);const l=Xd.get(i);l&&clearTimeout(l),Xd.delete(i),qr.delete(i),Eu.delete(i)})}})}function R$e(e){const[t,n]=y.useState(),r=y.useMemo(()=>e,[]),i=y.useCallback(s=>{s instanceof HTMLElement?n(T$e(s,r)):n(void 0)},[r]),a=y.useCallback(s=>{t&&(s?t.enable():t.disable())},[t]);return y.useEffect(()=>()=>{var s;(s=t==null?void 0:t.destroy)===null||s===void 0||s.call(t)},[t]),[i,a]}function B$({pr:e,to:t,showUpdated:n}){const r=y.useMemo(()=>Vi(rG(e,new Date)),[e]),i=r?M2(r.total):void 0,a=i==="green"?"text-green-600 dark:text-green-400":i==="yellow"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",s=e.isMergeable?e.isApproved?m.jsx(Zt,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):m.jsx(Zt,{variant:"secondary",children:"Pending"}):m.jsx(Zt,{variant:"destructive",children:"Conflict"});return m.jsxs(Qa,{to:t,className:"group flex cursor-pointer flex-col gap-1.5 px-4 py-3 transition-colors hover:bg-accent/50 no-underline text-inherit",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[s,r&&m.jsx("span",{className:`text-xs font-semibold tabular-nums ${a}`,children:r.total.toFixed(1)}),m.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.author," ·"," ",n?Sw(e.lastModifiedDate,new Date):O2(e.creationDate)]}),e.commentCount!==void 0&&e.commentCount>0&&m.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[m.jsx(d_e,{className:"size-3"}),e.commentCount]})]}),m.jsxs("div",{className:"flex items-baseline gap-1.5",children:[m.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:e.repositoryName}),m.jsx("span",{className:"text-muted-foreground/50",children:"›"}),m.jsx("span",{className:"text-sm font-medium",children:e.title})]}),e.description&&m.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description.split(`
410
+ `).slice(0,2).join(" ")})]})}function A$e(){const e=Zn(As),t=Ct(JN),{filterText:n,quickFilter:r}=QK(),[i,a]=R$e(),s=e.status==="loading",o=e.pullRequests,l=e.currentUser,c=r.type==="hot";y.useEffect(()=>{a(c)},[c,a]);const{flat:f,grouped:u}=y.useMemo(()=>{var E;if(o.length===0)return{flat:[],grouped:[]};const p=n.toLowerCase(),b=C=>{var k;return n?C.repositoryName.toLowerCase().includes(p)||C.title.toLowerCase().includes(p)||C.author.toLowerCase().includes(p)||C.sourceBranch.toLowerCase().includes(p)||(((k=C.description)==null?void 0:k.toLowerCase().includes(p))??!1):!0},x=C=>{var k;if(r.type==="all"||r.type==="hot")return!0;if(r.type==="mine")return l&&C.author!==l?!1:r.value===void 0?!0:hd(C.title)===r.value;if(r.type==="account")return((k=C.account)==null?void 0:k.profile)===r.value;if(r.type==="author")return C.author===r.value;if(r.type==="scope")return hd(C.title)===r.value;if(r.type==="repo")return C.repositoryName===r.value;if(r.type==="status")switch(r.value){case"approved":return C.isApproved;case"pending":return!C.isApproved;case"mergeable":return C.isMergeable;case"conflicts":return!C.isMergeable;default:return!0}return!0},g=o.filter(C=>C.status!=="MERGED"&&b(C)&&x(C));if(r.type==="hot")return{flat:[...g].sort((k,_)=>_.lastModifiedDate.getTime()-k.lastModifiedDate.getTime()),grouped:[]};const v=new Map;for(const C of g){const k=((E=C.account)==null?void 0:E.profile)??"unknown";v.has(k)||v.set(k,[]),v.get(k).push(C)}const w=[];for(const[C,k]of v)k.length>0&&w.push([C,k]);return{flat:[],grouped:w}},[o,l,n,r]),d=p=>{const b=p.account.awsAccountId??p.account.profile;return`/accounts/${encodeURIComponent(b)}/prs/${p.id}`};if(f.length===0&&u.length===0){if(s)return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[m.jsx(gu,{className:"size-8 animate-spin opacity-40"}),m.jsx("p",{className:"text-sm font-medium",children:"Loading pull requests..."}),o.length>0&&m.jsxs("p",{className:"text-xs opacity-50",children:[o.length," PRs fetched (filter hides all)"]})]});const p=[...new Set(e.accounts.filter(x=>x.enabled).map(x=>x.profile))],b=o.length===0&&p.length>0;return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[m.jsxs("svg",{className:"size-16 opacity-30",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("rect",{x:"8",y:"12",width:"48",height:"40",rx:"4",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M8 24h48",stroke:"currentColor",strokeWidth:"2"}),m.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"currentColor"}),m.jsx("circle",{cx:"22",cy:"18",r:"2",fill:"currentColor"}),m.jsx("circle",{cx:"28",cy:"18",r:"2",fill:"currentColor"}),m.jsx("path",{d:"M24 36h16M28 42h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),m.jsx("p",{className:"text-sm",children:"No pull requests found"}),o.length>0&&m.jsxs("p",{className:"text-xs opacity-50",children:[o.length," PRs loaded — try a different filter"]}),b&&m.jsxs(ZC,{className:"mt-4 w-full max-w-sm",children:[m.jsx(gY,{className:"pb-2",children:m.jsx(yY,{className:"text-sm",children:"SSO Login"})}),m.jsxs(eT,{className:"flex flex-col gap-2",children:[m.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Session may have expired. Log in to fetch PRs."}),p.map(x=>m.jsxs(Le,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:()=>t({payload:{profile:x}}),children:[m.jsx(X7,{className:"size-3.5"}),x]},x))]})]})]})}return c?m.jsx("div",{ref:i,className:"divide-y rounded-lg border bg-card",children:f.map(p=>m.jsx(B$,{pr:p,to:d(p),showUpdated:!0},p.id))},"hot"):m.jsx("div",{className:"space-y-6",children:u.map(([p,b])=>m.jsxs("section",{children:[m.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[m.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:p}),m.jsx(Zt,{variant:"secondary",children:b.length})]}),m.jsx("div",{className:"divide-y rounded-lg border bg-card",children:b.map(x=>m.jsx(B$,{pr:x,to:d(x)},x.id))})]},p))},"grouped")}const N$e=e=>{switch(e){case"running":return"default";case"creating":case"cloning":case"starting":return"secondary";case"error":return"destructive";default:return"outline"}};function O$e({logs:e}){const t=y.useRef(null);y.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]);const n=e.trimEnd().split(`
411
+ `);return m.jsx("div",{ref:t,className:"flex-1 min-h-0 overflow-y-auto bg-black/40 rounded-lg p-4 font-mono text-xs leading-relaxed",children:n.map((r,i)=>{const a=r.match(/^\[([^\]]+)\]\s*(.*)$/);if(!a)return m.jsx("div",{className:"text-muted-foreground",children:r},i);const[,s,o]=a;return m.jsxs("div",{className:"flex gap-3",children:[m.jsx("span",{className:"text-muted-foreground/50 shrink-0 select-none",children:s}),m.jsx("span",{className:"text-muted-foreground",children:o})]},i)})})}function M$e(){const{sandboxId:e}=fR(),[t,n]=W4(),r=Zn(As),i=Ct(q7),a=Ct(V7),s=Ct(K7),o=Fa(),l=t.get("view"),[c,f]=y.useState(l==="logs"),u=y.useCallback(()=>{f(g=>{const v=!g;return n(v?{view:"logs"}:{},{replace:!0}),v})},[n]),d=y.useMemo(()=>{var g;return((g=r.sandboxes)==null?void 0:g.find(v=>v.id===e))??null},[r.sandboxes,e]),h=y.useCallback(()=>{e&&i({path:{sandboxId:Nl.make(e)}})},[e,i]),p=d?`/accounts/${d.awsAccountId}/prs/${d.pullRequestId}`:"/";if(!d)return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[m.jsx(gu,{className:"size-6 animate-spin opacity-40"}),m.jsx("p",{className:"text-sm",children:"Loading sandbox..."})]});const b=d.status==="running",x=["creating","cloning","starting"].includes(d.status);return m.jsxs("div",{className:"flex flex-col h-[calc(100vh-4rem)]",children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b shrink-0",children:[m.jsxs(Le,{variant:"ghost",size:"sm",onClick:()=>o(p),children:[m.jsx(QN,{className:"size-4"}),"Back to PR"]}),m.jsx(Zt,{variant:"outline",className:"font-mono text-xs",children:d.repositoryName}),m.jsx(Zt,{variant:"secondary",className:"font-mono text-xs",children:d.sourceBranch}),m.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[x&&m.jsx(gu,{className:"size-3.5 animate-spin text-muted-foreground"}),m.jsx(Zt,{variant:N$e(d.status),className:"mr-1",children:d.status}),d.logs&&m.jsx(Le,{variant:c?"secondary":"outline",size:"sm",onClick:u,children:c?m.jsxs(m.Fragment,{children:[m.jsx(W7,{className:"size-3.5"})," Editor"]}):m.jsxs(m.Fragment,{children:[m.jsx(tq,{className:"size-3.5"})," Logs"]})}),(d.status==="stopped"||d.status==="error")&&d.containerId&&m.jsxs(Le,{variant:"outline",size:"sm",onClick:()=>e&&a({path:{sandboxId:Nl.make(e)}}),children:[m.jsx(eq,{className:"size-3"}),"Restart"]}),(d.status==="stopped"||d.status==="error")&&m.jsxs(Le,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>{e&&(s({path:{sandboxId:Nl.make(e)}}),o("/sandboxes"))},children:[m.jsx(iq,{className:"size-3"}),"Delete"]}),(x||b)&&m.jsxs(Le,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:h,children:[m.jsx(nq,{className:"size-3"}),"Stop"]})]})]}),c||!b?m.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-3 p-4",children:[d.statusDetail&&m.jsx("p",{className:"text-sm text-muted-foreground shrink-0",children:d.statusDetail}),d.error&&m.jsx("p",{className:"rounded bg-destructive/10 px-3 py-2 text-xs text-destructive font-mono break-all shrink-0",children:d.error}),d.logs?m.jsx(O$e,{logs:d.logs}):m.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"No logs available"})]}):m.jsx("iframe",{src:`http://localhost:${d.port}/`,className:"flex-1 w-full border-0",title:"Code Sandbox"})]})}const j$e=e=>{switch(e){case"running":return"default";case"creating":case"cloning":case"starting":return"secondary";case"error":return"destructive";default:return"outline"}},F_=e=>["creating","cloning","starting","running"].includes(e),D$e=e=>{const t=new Date(e),r=new Date().getTime()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`};function I$e(){const e=Zn(As),t=Ct(q7),n=Ct(V7),r=Ct(K7),i=Fa(),a=e.sandboxes??[];return a.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[m.jsx(ag,{className:"size-8 opacity-30"}),m.jsx("p",{className:"text-sm",children:"No sandboxes"}),m.jsx("p",{className:"text-xs",children:'Open a PR and press "." or click "Sandbox" to create one'})]}):m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Sandboxes"}),m.jsxs("span",{className:"text-xs text-muted-foreground",children:[a.length," total"]})]}),m.jsx("div",{className:"space-y-2",children:a.map(s=>m.jsxs("div",{className:"rounded-lg border bg-card px-4 py-3 hover:bg-accent/50 cursor-pointer",onClick:()=>i(`/sandbox/${s.id}`),children:[m.jsxs("div",{className:"flex items-center gap-3",children:[F_(s.status)&&s.status!=="running"?m.jsx(gu,{className:"size-4 animate-spin text-muted-foreground shrink-0"}):m.jsx(ag,{className:"size-4 text-muted-foreground shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"font-mono text-sm truncate",children:s.repositoryName}),m.jsx(Zt,{variant:"outline",className:"font-mono text-[10px] shrink-0",children:s.sourceBranch})]}),m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-0.5",children:[m.jsxs("span",{children:["PR #",s.pullRequestId]}),m.jsx("span",{children:"·"}),m.jsx("span",{children:D$e(s.createdAt)}),s.port&&s.status==="running"&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"·"}),m.jsxs("span",{children:["port ",s.port]})]}),s.statusDetail&&F_(s.status)&&s.status!=="running"&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"·"}),m.jsx("span",{className:"truncate",children:s.statusDetail})]})]})]}),m.jsx(Zt,{variant:j$e(s.status),className:"shrink-0",children:s.status}),s.logs&&m.jsx(Le,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),i(`/sandbox/${s.id}?view=logs`)},children:m.jsx(tq,{className:"size-3.5"})}),(s.status==="running"||F_(s.status))&&m.jsx(Le,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),t({path:{sandboxId:Nl.make(s.id)}})},children:m.jsx(nq,{className:"size-3"})}),(s.status==="stopped"||s.status==="error")&&s.containerId&&m.jsx(Le,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),n({path:{sandboxId:Nl.make(s.id)}})},children:m.jsx(eq,{className:"size-3.5"})}),(s.status==="stopped"||s.status==="error")&&m.jsx(Le,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),r({path:{sandboxId:Nl.make(s.id)}})},children:m.jsx(iq,{className:"size-3.5"})})]}),s.error&&m.jsx("p",{className:"mt-2 rounded bg-destructive/10 px-3 py-1.5 text-xs text-destructive font-mono break-all",children:s.error})]},s.id))})]})}const z$e=[{key:"Esc",desc:"Back / Close"},{key:"R",desc:"Refresh PRs"},{key:"/",desc:"Filter PRs"},{key:"1-7",desc:"Quick filters"},{key:"Enter",desc:"Open PR details"},{key:"Cmd+P",desc:"Command palette"}];function $$e(){return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"About"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Keyboard shortcuts and info"})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Keyboard Shortcuts"}),z$e.map(e=>m.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[m.jsx("span",{className:"text-sm text-muted-foreground",children:e.desc}),m.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 font-mono text-xs",children:e.key})]},e.key))]})]})}function L$e(){const e=Zn(YN),t=Zn(As),n=Ct(WN),r=Ct(JN),i=Ct(XN),[a,s]=y.useState(""),[o,l]=y.useState("all"),[c,f]=y.useState({}),u=y.useRef(null);y.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const d=y.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{n({payload:p})},500)},[n]),h=y.useCallback((p,b)=>{var w;const g=!(c[p]??((w=b.accounts.find(E=>E.profile===p))==null?void 0:w.enabled)??!0),v={...c,[p]:g};f(v),d({accounts:b.accounts.map(E=>({profile:E.profile,regions:[...E.regions],enabled:E.profile===p?g:v[E.profile]??E.enabled})),autoDetect:b.autoDetect,autoRefresh:b.autoRefresh,refreshIntervalSeconds:b.refreshIntervalSeconds})},[d,c]);return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Accounts"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"AWS profiles configured for CodeCommit"})]}),m.jsx(Cr,{}),Wc(e).onInitialOrWaiting(()=>m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(p=>m.jsx(P$e,{currentUser:t.currentUser,data:p,overrides:c,search:a,setSearch:s,statusFilter:o,setStatusFilter:l,toggleAccount:h,onSsoLogin:b=>{try{r({payload:{profile:M9(dy)(b)}})}catch{}},onSsoLogout:()=>i({})})).render()]})}function P$e({currentUser:e,data:t,onSsoLogin:n,onSsoLogout:r,overrides:i,search:a,setSearch:s,setStatusFilter:o,statusFilter:l,toggleAccount:c}){const f=y.useMemo(()=>t.accounts.map(p=>({...p,enabled:i[p.profile]??p.enabled})),[t.accounts,i]),u=y.useMemo(()=>{const p=a.toLowerCase();return f.filter(b=>!(l==="on"&&!b.enabled||l==="off"&&b.enabled||p&&!b.profile.toLowerCase().includes(p)&&!b.regions.some(x=>x.toLowerCase().includes(p))))},[f,a,l]),d=f.filter(p=>p.enabled),h=d.length;return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(r2,{className:"size-4 text-muted-foreground"}),e?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Current user:"}),m.jsx("span",{className:"font-medium",children:e}),m.jsx(Le,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Logout",onClick:()=>r(),children:m.jsx(Q7,{className:"size-3"})})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Not logged in"}),d[0]&&(()=>{const p=d[0].profile;return m.jsx(Le,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Login",onClick:()=>n(p),children:m.jsx(X7,{className:"size-3"})})})()]})]}),f.length===0?m.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No accounts configured. Edit the config file to add AWS profiles."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("div",{className:"relative flex-1",children:[m.jsx(n2,{className:"absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),m.jsx(Gs,{placeholder:"Search profiles...",value:a,onChange:p=>s(p.target.value),className:"h-8 pl-8 text-sm"})]}),m.jsx(xw,{children:["all","on","off"].map(p=>m.jsx(Le,{variant:l===p?"default":"outline",size:"sm",className:"h-8 px-2.5 text-xs capitalize",onClick:()=>o(p),children:p},p))})]}),m.jsxs("div",{className:"text-xs text-muted-foreground",children:[h,"/",f.length," enabled",u.length!==f.length&&` · ${u.length} shown`]}),m.jsxs("div",{className:"divide-y rounded-md border",children:[u.map(p=>m.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(C_e,{className:"size-3.5 text-muted-foreground shrink-0"}),m.jsx("span",{className:"text-sm font-medium truncate",children:p.profile}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:p.regions.join(", ")||"default"})]}),m.jsx(Le,{variant:p.enabled?"default":"outline",size:"sm",className:"ml-2 h-6 px-2 text-xs shrink-0",onClick:()=>c(p.profile,t),children:p.enabled?"On":"Off"})]},p.profile)),u.length===0&&m.jsx("p",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No matching accounts"})]})]}),m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(t2,{className:"size-3"}),"Auto-detect: ",t.autoDetect?"enabled":"disabled"]})]})}const F$e=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;function H$({copyKey:e,copied:t,label:n,onCopy:r,path:i,detail:a}){return m.jsxs("div",{className:"flex items-baseline gap-3 py-1.5",children:[m.jsx("span",{className:"shrink-0 text-xs text-muted-foreground w-24",children:n}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("code",{className:"truncate text-xs font-mono",children:i}),m.jsx("button",{onClick:()=>r(i,e),className:"shrink-0 rounded p-0.5 hover:bg-muted",children:t===e?m.jsx(Y7,{className:"size-3 text-green-500"}):m.jsx(J7,{className:"size-3 text-muted-foreground"})})]}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:a})]})]})}function U$e(){const e=Zn(l1e),t=Zn(u1e),n=Zn(c1e),r=Ct(f1e),[i,a]=y.useState(null),[s,o]=y.useState(!1),l=y.useCallback((u,d)=>{navigator.clipboard.writeText(u).then(()=>{a(d),setTimeout(()=>a(null),2e3)},()=>{})},[]),c=y.useCallback(async()=>{o(!0);try{await r({})}finally{o(!1)}},[r]),f=u=>u?`Modified ${Sw(new Date(u),new Date,"").trim()}`:"";return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Configuration"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"File locations, validation, and storage"})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-1",children:[Wc(e).onInitialOrWaiting(()=>m.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading config path..."})).onError(()=>m.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onDefect(()=>m.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onSuccess(u=>{const d=bs(t)?` · ${t.value.status}`:"",h=u.exists?`${f(u.modifiedAt)}${d}`:`Not created yet${d}`;return m.jsx(H$,{label:"Config file",path:u.path,detail:h,copyKey:"config",copied:i,onCopy:l})}).render(),Wc(t).onInitialOrWaiting(()=>null).onError(()=>null).onDefect(()=>null).onSuccess(u=>u.errors.length>0?m.jsx("div",{className:"ml-27 rounded bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:u.errors.map((d,h)=>m.jsx("p",{children:d},h))}):null).render(),m.jsx(Cr,{}),Wc(n).onInitialOrWaiting(()=>m.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading database info..."})).onError(()=>m.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onDefect(()=>m.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onSuccess(u=>{const d=u.exists?`${F$e(u.sizeBytes)} · ${f(u.modifiedAt)}`:"Not created yet";return m.jsx(H$,{label:"Cache database",path:u.path,detail:d,copyKey:"db",copied:i,onCopy:l})}).render()]}),m.jsx(Cr,{}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("div",{className:"flex-1",children:[m.jsx("p",{className:"text-sm font-medium",children:"Reset to Defaults"}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Backs up current config, then re-detects AWS profiles"})]}),m.jsxs(Le,{variant:"outline",size:"sm",onClick:c,disabled:s,className:"shrink-0 gap-2",children:[m.jsx(w_e,{className:st("size-3.5",s&&"animate-spin")}),s?"Resetting...":"Reset"]})]})]})}const B$e=[{label:"1 min",value:60},{label:"5 min",value:300},{label:"10 min",value:600},{label:"15 min",value:900},{label:"30 min",value:1800}];function H$e(){const e=Zn(YN),t=Ct(WN),n=y.useRef(null),r=y.useRef(null),[i,a]=y.useState({});y.useEffect(()=>{bs(e)&&(r.current=e.value)},[e]),y.useEffect(()=>{const o=new BroadcastChannel("codecommit-config");return n.current=o,o.onmessage=l=>{a(c=>({...c,...l.data}))},()=>o.close()},[]);const s=y.useCallback(o=>{var c;const l=r.current;l&&(a(f=>({...f,...o})),(c=n.current)==null||c.postMessage(o),t({payload:{accounts:l.accounts.map(f=>({profile:f.profile,regions:[...f.regions],enabled:f.enabled})),autoDetect:l.autoDetect,autoRefresh:o.autoRefresh??l.autoRefresh,refreshIntervalSeconds:o.refreshIntervalSeconds??l.refreshIntervalSeconds}}))},[t]);return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Auto-refresh"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Periodically fetch PR updates from AWS"})]}),m.jsx(Cr,{}),Wc(e).onInitialOrWaiting(()=>m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(o=>{const l=i.autoRefresh??o.autoRefresh,c=i.refreshIntervalSeconds??o.refreshIntervalSeconds;return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(hy,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:"Auto-refresh"})]}),m.jsx(Le,{variant:l?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>s({autoRefresh:!l}),children:l?"On":"Off"})]}),l&&m.jsxs("div",{className:"space-y-2",children:[m.jsx("span",{className:"text-sm text-muted-foreground",children:"Refresh interval"}),m.jsx(xw,{children:B$e.map(f=>m.jsx(Le,{variant:c===f.value?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>s({refreshIntervalSeconds:f.value}),children:f.label},f.value))})]})]})}).render()]})}const q$e={image:"codercom/code-server:latest",extensions:[],setupCommands:[],env:{},enableClaudeCode:!0,volumeMounts:[],cloneDepth:0};function V$e(){const e=Zn(YN),t=Ct(WN),n=y.useRef(null),[r,i]=y.useState(null),[a,s]=y.useState(null),[o,l]=y.useState(!1);y.useEffect(()=>{if(bs(e)&&(n.current=e.value,!r)){const d=e.value.sandbox??q$e;i(d),s(d)}},[e,r]);const c=y.useMemo(()=>r!==null&&a!==null&&JSON.stringify(r)!==JSON.stringify(a),[r,a]),f=y.useCallback(d=>{i(h=>h&&{...h,...d})},[]),u=y.useCallback(()=>{const d=n.current;!d||!r||(l(!0),t({payload:{accounts:d.accounts.map(h=>({profile:h.profile,regions:[...h.regions],enabled:h.enabled})),autoDetect:d.autoDetect,autoRefresh:d.autoRefresh,refreshIntervalSeconds:d.refreshIntervalSeconds,sandbox:r}}),s(r),setTimeout(()=>l(!1),600))},[t,r]);return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Sandbox"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Docker sandbox defaults for code review environments"})]}),r&&m.jsx(Le,{size:"sm",className:"h-8 gap-1.5 px-3",disabled:!c&&!o,onClick:u,children:o?m.jsxs(m.Fragment,{children:[m.jsx(ZS,{className:"size-3.5"})," Saved"]}):"Save"})]}),m.jsx(Cr,{}),Wc(e).onInitialOrWaiting(()=>m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>m.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(()=>r&&m.jsx(K$e,{settings:r,onChange:f})).render()]})}function K$e({settings:e,onChange:t}){const[n,r]=y.useState(""),[i,a]=y.useState(""),[s,o]=y.useState(""),[l,c]=y.useState(""),[f,u]=y.useState(""),[d,h]=y.useState(""),[p,b]=y.useState(!1);return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Docker Image"}),m.jsx(Gs,{value:e.image,placeholder:"codercom/code-server:latest",onChange:x=>t({image:x.target.value}),className:"h-8 text-sm"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Base image for sandboxes. Must have code-server or install via setup commands."})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Clone Depth"}),m.jsx("div",{className:"flex gap-1.5",children:[{label:"Full",value:0},{label:"1",value:1},{label:"10",value:10},{label:"50",value:50},{label:"100",value:100}].map(x=>m.jsx(Le,{variant:e.cloneDepth===x.value?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>t({cloneDepth:x.value}),children:x.label},x.value))}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = full history. Higher values speed up clone but limit git log."})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"VS Code Extensions"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Installed via code-server --install-extension"}),m.jsx(Y$e,{settings:e,onChange:t}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.extensions.map(x=>m.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs",children:[m.jsx(ag,{className:"size-3 text-muted-foreground"}),x,m.jsx("button",{className:"ml-0.5 text-muted-foreground hover:text-foreground",onClick:()=>t({extensions:e.extensions.filter(g=>g!==x)}),children:m.jsx(i2,{className:"size-3"})})]},x))}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx(Gs,{value:n,placeholder:"publisher.extension-id",onChange:x=>r(x.target.value),onKeyDown:x=>{x.key==="Enter"&&n.trim()&&(t({extensions:[...e.extensions,n.trim()]}),r(""))},className:"h-8 text-sm flex-1"}),m.jsx(Le,{variant:"outline",size:"sm",className:"h-8",disabled:!n.trim(),onClick:()=>{t({extensions:[...e.extensions,n.trim()]}),r("")},children:m.jsx(zc,{className:"size-3.5"})})]})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Setup Commands"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Shell commands run in container after ready"}),m.jsx(X$e,{settings:e,onChange:t}),m.jsx("div",{className:"space-y-1.5",children:e.setupCommands.map((x,g)=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:x}),m.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>t({setupCommands:e.setupCommands.filter((v,w)=>w!==g)}),children:m.jsx(s_,{className:"size-3.5"})})]},g))}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx(Gs,{value:i,placeholder:"npm i -g tsx",onChange:x=>a(x.target.value),onKeyDown:x=>{x.key==="Enter"&&i.trim()&&(t({setupCommands:[...e.setupCommands,i.trim()]}),a(""))},className:"h-8 text-sm font-mono flex-1"}),m.jsx(Le,{variant:"outline",size:"sm",className:"h-8",disabled:!i.trim(),onClick:()=>{t({setupCommands:[...e.setupCommands,i.trim()]}),a("")},children:m.jsx(zc,{className:"size-3.5"})})]})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Environment Variables"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Extra env vars injected into sandbox container"}),m.jsx("div",{className:"space-y-1.5",children:Object.entries(e.env).map(([x,g])=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs font-mono",children:x}),m.jsx("span",{className:"text-xs text-muted-foreground",children:"="}),m.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:g}),m.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>{const v={...e.env};delete v[x],t({env:v})},children:m.jsx(s_,{className:"size-3.5"})})]},x))}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx(Gs,{value:s,placeholder:"KEY",onChange:x=>o(x.target.value),className:"h-8 text-sm font-mono w-32"}),m.jsx("span",{className:"flex items-center text-xs text-muted-foreground",children:"="}),m.jsx(Gs,{value:l,placeholder:"value",onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&s.trim()&&(t({env:{...e.env,[s.trim()]:l}}),o(""),c(""))},className:"h-8 text-sm font-mono flex-1"}),m.jsx(Le,{variant:"outline",size:"sm",className:"h-8",disabled:!s.trim(),onClick:()=>{t({env:{...e.env,[s.trim()]:l}}),o(""),c("")},children:m.jsx(zc,{className:"size-3.5"})})]})]}),m.jsx(Cr,{}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Volume Mounts"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Map host paths into the container"}),m.jsx(Q$e,{settings:e,onChange:t}),m.jsx("div",{className:"space-y-1.5",children:e.volumeMounts.map((x,g)=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:x.hostPath}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:":"}),m.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:x.containerPath}),x.readonly&&m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"(ro)"}),m.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>t({volumeMounts:e.volumeMounts.filter((v,w)=>w!==g)}),children:m.jsx(s_,{className:"size-3.5"})})]},g))}),m.jsxs("div",{className:"flex gap-1.5 items-center",children:[m.jsx(Gs,{value:f,placeholder:"/host/path",onChange:x=>u(x.target.value),className:"h-8 text-sm font-mono flex-1"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:":"}),m.jsx(Gs,{value:d,placeholder:"/container/path",onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&f.trim()&&d.trim()&&(t({volumeMounts:[...e.volumeMounts,{hostPath:f.trim(),containerPath:d.trim(),readonly:p}]}),u(""),h(""),b(!1))},className:"h-8 text-sm font-mono flex-1"}),m.jsx(Le,{variant:p?"default":"outline",size:"sm",className:"h-8 px-2 text-xs shrink-0",onClick:()=>b(!p),title:"Read-only",children:"RO"}),m.jsx(Le,{variant:"outline",size:"sm",className:"h-8",disabled:!f.trim()||!d.trim(),onClick:()=>{t({volumeMounts:[...e.volumeMounts,{hostPath:f.trim(),containerPath:d.trim(),readonly:p}]}),u(""),h(""),b(!1)},children:m.jsx(zc,{className:"size-3.5"})})]})]})]})}const G$e=[{label:"Claude Code",id:"anthropic.claude-code"},{label:"ESLint",id:"dbaeumer.vscode-eslint"},{label:"Prettier",id:"esbenp.prettier-vscode"},{label:"GitLens",id:"eamodio.gitlens"},{label:"Error Lens",id:"usernamehw.errorlens"}];function Y$e({settings:e,onChange:t}){const n=y.useMemo(()=>G$e.filter(r=>!e.extensions.includes(r.id)),[e.extensions]);return n.length===0?null:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({extensions:[...e.extensions,r.id]}),children:[m.jsx(zc,{className:"size-3"}),r.label]},r.id))})}const W$e=[{label:"Node 22",cmd:"curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs"},{label:"Claude Code",cmd:"sudo npm i -g @anthropic-ai/claude-code"},{label:"pnpm",cmd:"sudo npm i -g pnpm"},{label:"Bun",cmd:`curl -fsSL https://bun.sh/install | bash && echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.bashrc && echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.profile`}],J$e=[{label:"VS Code Extensions",mount:{hostPath:"~/.vscode/extensions",containerPath:"/home/coder/.local/share/code-server/extensions",readonly:!1}},{label:"VS Code Settings",mount:{hostPath:"~/Library/Application Support/Code/User/settings.json",containerPath:"/home/coder/.local/share/code-server/User/settings.json",readonly:!0}},{label:"VS Code Keybindings",mount:{hostPath:"~/Library/Application Support/Code/User/keybindings.json",containerPath:"/home/coder/.local/share/code-server/User/keybindings.json",readonly:!0}},{label:"SSH Keys",mount:{hostPath:"~/.ssh",containerPath:"/home/coder/.ssh",readonly:!0}},{label:"Git Config",mount:{hostPath:"~/.gitconfig",containerPath:"/home/coder/.gitconfig",readonly:!0}},{label:"AWS Credentials",mount:{hostPath:"~/.aws",containerPath:"/home/coder/.aws",readonly:!0}},{label:"Claude Config",mount:{hostPath:"~/.claude",containerPath:"/home/coder/.claude",readonly:!1}}];function X$e({settings:e,onChange:t}){const n=y.useMemo(()=>W$e.filter(r=>!e.setupCommands.some(i=>i===r.cmd)),[e.setupCommands]);return n.length===0?null:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({setupCommands:[...e.setupCommands,r.cmd]}),children:[m.jsx(zc,{className:"size-3"}),r.label]},r.label))})}function Q$e({settings:e,onChange:t}){const n=y.useMemo(()=>J$e.filter(r=>!e.volumeMounts.some(i=>i.hostPath===r.mount.hostPath)),[e.volumeMounts]);return n.length===0?null:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>m.jsxs(Le,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({volumeMounts:[...e.volumeMounts,r.mount]}),children:[m.jsx(zc,{className:"size-3"}),r.label]},r.label))})}function Z$e(){const{setTheme:e,theme:t}=X4(),n=[{id:"light",label:"Light",icon:m.jsx(rq,{className:"size-5"})},{id:"dark",label:"Dark",icon:m.jsx(Z7,{className:"size-5"})},{id:"system",label:"System",icon:m.jsx(m_e,{className:"size-5"})}];return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Theme"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred appearance"})]}),m.jsx(Cr,{}),m.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(r=>m.jsxs("button",{onClick:()=>e(r.id),className:st("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",t===r.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"),children:[r.icon,m.jsx("span",{className:"text-sm font-medium",children:r.label})]},r.id))})]})}const eLe={accounts:m.jsx(r2,{className:"size-4"}),refresh:m.jsx(hy,{className:"size-4"}),sandbox:m.jsx(ag,{className:"size-4"}),theme:m.jsx(y_e,{className:"size-4"}),config:m.jsx(Z1e,{className:"size-4"}),about:m.jsx(t2,{className:"size-4"})},tLe={accounts:"Accounts",refresh:"Refresh",sandbox:"Sandbox",theme:"Theme",config:"Config",about:"About"},nLe=e=>aq.includes(e);function rLe(){const{tab:e}=fR(),t=nLe(e)?e:"accounts",n=Fa();return m.jsxs("div",{className:"flex gap-6",children:[m.jsxs("nav",{className:"w-48 shrink-0",children:[m.jsxs(Le,{variant:"ghost",size:"sm",className:"mb-4 gap-2",onClick:()=>n("/"),children:[m.jsx(QN,{className:"size-4"}),"Back to PRs"]}),m.jsx("div",{className:"flex flex-col gap-1",role:"tablist",children:aq.map(r=>m.jsxs("button",{role:"tab","aria-selected":t===r,onClick:()=>n(`/settings/${r}`,{replace:!0}),className:st("flex items-center gap-2 rounded-md px-3 py-2 text-sm text-left transition-colors",t===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[eLe[r],tLe[r]]},r))})]}),m.jsxs("div",{className:"flex-1 min-w-0",children:[t==="accounts"&&m.jsx(L$e,{}),t==="refresh"&&m.jsx(H$e,{}),t==="sandbox"&&m.jsx(V$e,{}),t==="theme"&&m.jsx(Z$e,{}),t==="config"&&m.jsx(U$e,{}),t==="about"&&m.jsx($$e,{})]})]})}const iLe=e=>e!=null&&typeof e=="object"&&"fullWidth"in e,aLe=e=>iLe(e.handle)&&e.handle.fullWidth===!0,sLe=()=>tZ().some(aLe),oLe=FZ([{element:m.jsx(WNe,{}),children:[{index:!0,element:m.jsx(A$e,{})},{path:"accounts/:accountId/prs/:prId",element:m.jsx(p$e,{})},{path:"sandboxes",element:m.jsx(I$e,{})},{path:"sandbox/:sandboxId",element:m.jsx(M$e,{}),handle:{fullWidth:!0}},{path:"settings/:tab?",element:m.jsx(rLe,{})},{path:"notifications",element:m.jsx(o2e,{})},{path:"*",element:m.jsx(hZ,{to:"/",replace:!0})}]}]);class lLe extends ee.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?m.jsxs("div",{style:{padding:"2rem",textAlign:"center"},children:[m.jsx("h1",{children:"Something went wrong"}),m.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem"},children:"Reload"})]}):this.props.children}}const q$=document.getElementById("root");q$&&kX.createRoot(q$).render(m.jsx(ee.StrictMode,{children:m.jsx(lLe,{children:m.jsx(ZZ,{children:m.jsx(uZ,{router:oLe})})})}));