@knpkv/codecommit-web 0.7.0 → 0.9.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 (35) hide show
  1. package/dist/client/assets/index-C9jULpBN.js +456 -0
  2. package/dist/client/assets/index-DTVrh9Vx.css +1 -0
  3. package/dist/client/index.html +2 -2
  4. package/dist/server/Api.d.ts +105 -2
  5. package/dist/server/Api.d.ts.map +1 -1
  6. package/dist/server/Api.js +131 -1
  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 +27 -7
  10. package/dist/server/Server.js.map +1 -1
  11. package/dist/server/handlers/audit-live.d.ts +3 -0
  12. package/dist/server/handlers/audit-live.d.ts.map +1 -0
  13. package/dist/server/handlers/audit-live.js +29 -0
  14. package/dist/server/handlers/audit-live.js.map +1 -0
  15. package/dist/server/handlers/events-live.d.ts +1 -1
  16. package/dist/server/handlers/events-live.d.ts.map +1 -1
  17. package/dist/server/handlers/events-live.js +33 -3
  18. package/dist/server/handlers/events-live.js.map +1 -1
  19. package/dist/server/handlers/index.d.ts +2 -0
  20. package/dist/server/handlers/index.d.ts.map +1 -1
  21. package/dist/server/handlers/index.js +2 -0
  22. package/dist/server/handlers/index.js.map +1 -1
  23. package/dist/server/handlers/notifications-live.d.ts.map +1 -1
  24. package/dist/server/handlers/notifications-live.js +11 -16
  25. package/dist/server/handlers/notifications-live.js.map +1 -1
  26. package/dist/server/handlers/permissions-live.d.ts +3 -0
  27. package/dist/server/handlers/permissions-live.d.ts.map +1 -0
  28. package/dist/server/handlers/permissions-live.js +34 -0
  29. package/dist/server/handlers/permissions-live.js.map +1 -0
  30. package/dist/server/handlers/prs-live.d.ts.map +1 -1
  31. package/dist/server/handlers/prs-live.js +72 -11
  32. package/dist/server/handlers/prs-live.js.map +1 -1
  33. package/package.json +2 -2
  34. package/dist/client/assets/index-Bdn-6XJ9.css +0 -1
  35. package/dist/client/assets/index-DlRfzSp5.js +0 -436
@@ -0,0 +1,456 @@
1
+ var TW=Object.defineProperty;var $O=e=>{throw TypeError(e)};var AW=(e,t,n)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>AW(e,typeof t!="symbol"?t+"":t,n),zO=(e,t,n)=>t.has(e)||$O("Cannot "+n);var Zy=(e,t,n)=>(zO(e,t,"read from private field"),n?n.call(e):t.get(e)),h1=(e,t,n)=>t.has(e)?$O("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ev=(e,t,n,r)=>(zO(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function OW(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Bb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var QL={exports:{}},H0={};/**
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 MW=Symbol.for("react.transitional.element"),jW=Symbol.for("react.fragment");function ZL(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 s in t)s!=="key"&&(n[s]=t[s])}else n=t;return t=n.ref,{$$typeof:MW,type:e,key:r,ref:t!==void 0?t:null,props:n}}H0.Fragment=jW;H0.jsx=ZL;H0.jsxs=ZL;QL.exports=H0;var d=QL.exports,e3={exports:{}},Xe={};/**
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 LR=Symbol.for("react.transitional.element"),DW=Symbol.for("react.portal"),IW=Symbol.for("react.fragment"),PW=Symbol.for("react.strict_mode"),$W=Symbol.for("react.profiler"),zW=Symbol.for("react.consumer"),LW=Symbol.for("react.context"),FW=Symbol.for("react.forward_ref"),UW=Symbol.for("react.suspense"),BW=Symbol.for("react.memo"),t3=Symbol.for("react.lazy"),HW=Symbol.for("react.activity"),LO=Symbol.iterator;function qW(e){return e===null||typeof e!="object"?null:(e=LO&&e[LO]||e["@@iterator"],typeof e=="function"?e:null)}var n3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},r3=Object.assign,s3={};function ph(e,t,n){this.props=e,this.context=t,this.refs=s3,this.updater=n||n3}ph.prototype.isReactComponent={};ph.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")};ph.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function i3(){}i3.prototype=ph.prototype;function FR(e,t,n){this.props=e,this.context=t,this.refs=s3,this.updater=n||n3}var UR=FR.prototype=new i3;UR.constructor=FR;r3(UR,ph.prototype);UR.isPureReactComponent=!0;var FO=Array.isArray;function Ck(){}var Xt={H:null,A:null,T:null,S:null},a3=Object.prototype.hasOwnProperty;function BR(e,t,n){var r=n.ref;return{$$typeof:LR,type:e,key:t,ref:r!==void 0?r:null,props:n}}function VW(e,t){return BR(e.type,t,e.props)}function HR(e){return typeof e=="object"&&e!==null&&e.$$typeof===LR}function KW(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var UO=/\/+/g;function m1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?KW(""+e.key):t.toString(36)}function GW(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ck,Ck):(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 _f(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case LR:case DW:a=!0;break;case t3:return a=e._init,_f(a(e._payload),t,n,r,s)}}if(a)return s=s(e),a=r===""?"."+m1(e,0):r,FO(s)?(n="",a!=null&&(n=a.replace(UO,"$&/")+"/"),_f(s,t,n,"",function(c){return c})):s!=null&&(HR(s)&&(s=VW(s,n+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(UO,"$&/")+"/")+a)),t.push(s)),1;a=0;var o=r===""?".":r+":";if(FO(e))for(var l=0;l<e.length;l++)r=e[l],i=o+m1(r,l),a+=_f(r,t,n,i,s);else if(l=qW(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=o+m1(r,l++),a+=_f(r,t,n,i,s);else if(i==="object"){if(typeof e.then=="function")return _f(GW(e),t,n,r,s);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 a}function tv(e,t,n){if(e==null)return e;var r=[],s=0;return _f(e,r,"","",function(i){return t.call(n,i,s++)}),r}function YW(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 BO=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)},WW={map:tv,forEach:function(e,t,n){tv(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tv(e,function(){t++}),t},toArray:function(e){return tv(e,function(t){return t})||[]},only:function(e){if(!HR(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Xe.Activity=HW;Xe.Children=WW;Xe.Component=ph;Xe.Fragment=IW;Xe.Profiler=$W;Xe.PureComponent=FR;Xe.StrictMode=PW;Xe.Suspense=UW;Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Xt;Xe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Xt.H.useMemoCache(e)}};Xe.cache=function(e){return function(){return e.apply(null,arguments)}};Xe.cacheSignal=function(){return null};Xe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=r3({},e.props),s=e.key;if(t!=null)for(i in t.key!==void 0&&(s=""+t.key),t)!a3.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var a=Array(i),o=0;o<i;o++)a[o]=arguments[o+2];r.children=a}return BR(e.type,s,r)};Xe.createContext=function(e){return e={$$typeof:LW,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:zW,_context:e},e};Xe.createElement=function(e,t,n){var r,s={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)a3.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return BR(e,i,s)};Xe.createRef=function(){return{current:null}};Xe.forwardRef=function(e){return{$$typeof:FW,render:e}};Xe.isValidElement=HR;Xe.lazy=function(e){return{$$typeof:t3,_payload:{_status:-1,_result:e},_init:YW}};Xe.memo=function(e,t){return{$$typeof:BW,type:e,compare:t===void 0?null:t}};Xe.startTransition=function(e){var t=Xt.T,n={};Xt.T=n;try{var r=e(),s=Xt.S;s!==null&&s(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Ck,BO)}catch(i){BO(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Xt.T=t}};Xe.unstable_useCacheRefresh=function(){return Xt.H.useCacheRefresh()};Xe.use=function(e){return Xt.H.use(e)};Xe.useActionState=function(e,t,n){return Xt.H.useActionState(e,t,n)};Xe.useCallback=function(e,t){return Xt.H.useCallback(e,t)};Xe.useContext=function(e){return Xt.H.useContext(e)};Xe.useDebugValue=function(){};Xe.useDeferredValue=function(e,t){return Xt.H.useDeferredValue(e,t)};Xe.useEffect=function(e,t){return Xt.H.useEffect(e,t)};Xe.useEffectEvent=function(e){return Xt.H.useEffectEvent(e)};Xe.useId=function(){return Xt.H.useId()};Xe.useImperativeHandle=function(e,t,n){return Xt.H.useImperativeHandle(e,t,n)};Xe.useInsertionEffect=function(e,t){return Xt.H.useInsertionEffect(e,t)};Xe.useLayoutEffect=function(e,t){return Xt.H.useLayoutEffect(e,t)};Xe.useMemo=function(e,t){return Xt.H.useMemo(e,t)};Xe.useOptimistic=function(e,t){return Xt.H.useOptimistic(e,t)};Xe.useReducer=function(e,t,n){return Xt.H.useReducer(e,t,n)};Xe.useRef=function(e){return Xt.H.useRef(e)};Xe.useState=function(e){return Xt.H.useState(e)};Xe.useSyncExternalStore=function(e,t,n){return Xt.H.useSyncExternalStore(e,t,n)};Xe.useTransition=function(){return Xt.H.useTransition()};Xe.version="19.2.4";e3.exports=Xe;var g=e3.exports;const ee=Dg(g),q0=OW({__proto__:null,default:ee},[g]);var o3={exports:{}},V0={},l3={exports:{}},c3={};/**
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(j,F){var z=j.length;j.push(F);e:for(;0<z;){var V=z-1>>>1,O=j[V];if(0<s(O,F))j[V]=F,j[z]=O,z=V;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var F=j[0],z=j.pop();if(z!==F){j[0]=z;e:for(var V=0,O=j.length,me=O>>>1;V<me;){var q=2*(V+1)-1,N=j[q],J=q+1,Y=j[J];if(0>s(N,z))J<O&&0>s(Y,N)?(j[V]=Y,j[J]=z,V=J):(j[V]=N,j[q]=z,V=q);else if(J<O&&0>s(Y,z))j[V]=Y,j[J]=z,V=J;else break e}}return F}function s(j,F){var z=j.sortIndex-F.sortIndex;return z!==0?z:j.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],f=1,u=null,h=3,m=!1,p=!1,v=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=j)r(c),F.sortIndex=F.expirationTime,t(l,F);else break;F=n(c)}}function C(j){if(v=!1,_(j),!p)if(n(l)!==null)p=!0,E||(E=!0,U());else{var F=n(c);F!==null&&B(C,F.startTime-j)}}var E=!1,k=-1,A=5,I=-1;function R(){return S?!0:!(e.unstable_now()-I<A)}function $(){if(S=!1,E){var j=e.unstable_now();I=j;var F=!0;try{e:{p=!1,v&&(v=!1,b(k),k=-1),m=!0;var z=h;try{t:{for(_(j),u=n(l);u!==null&&!(u.expirationTime>j&&R());){var V=u.callback;if(typeof V=="function"){u.callback=null,h=u.priorityLevel;var O=V(u.expirationTime<=j);if(j=e.unstable_now(),typeof O=="function"){u.callback=O,_(j),F=!0;break t}u===n(l)&&r(l),_(j)}else r(l);u=n(l)}if(u!==null)F=!0;else{var me=n(c);me!==null&&B(C,me.startTime-j),F=!1}}break e}finally{u=null,h=z,m=!1}F=void 0}}finally{F?U():E=!1}}}var U;if(typeof x=="function")U=function(){x($)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,W=K.port2;K.port1.onmessage=$,U=function(){W.postMessage(null)}}else U=function(){y($,0)};function B(j,F){k=y(function(){j(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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(j){switch(h){case 1:case 2:case 3:var F=3;break;default:F=h}var z=h;h=F;try{return j()}finally{h=z}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var z=h;h=j;try{return F()}finally{h=z}},e.unstable_scheduleCallback=function(j,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,j){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,j={id:f++,callback:F,priorityLevel:j,startTime:z,expirationTime:O,sortIndex:-1},z>V?(j.sortIndex=z,t(c,j),n(l)===null&&j===n(c)&&(v?(b(k),k=-1):v=!0,B(C,z-V))):(j.sortIndex=O,t(l,j),p||m||(p=!0,E||(E=!0,U()))),j},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(j){var F=h;return function(){var z=h;h=F;try{return j.apply(this,arguments)}finally{h=z}}}})(c3);l3.exports=c3;var Rk=l3.exports,u3={exports:{}},Yr={};/**
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 JW=g;function f3(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 Xo(){}var Hr={d:{f:Xo,r:function(){throw Error(f3(522))},D:Xo,C:Xo,L:Xo,m:Xo,X:Xo,S:Xo,M:Xo},p:0,findDOMNode:null},XW=Symbol.for("react.portal");function QW(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:XW,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var ep=JW.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function K0(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Yr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Hr;Yr.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(f3(299));return QW(e,t,null,n)};Yr.flushSync=function(e){var t=ep.T,n=Hr.p;try{if(ep.T=null,Hr.p=2,e)return e()}finally{ep.T=t,Hr.p=n,Hr.d.f()}};Yr.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Hr.d.C(e,t))};Yr.prefetchDNS=function(e){typeof e=="string"&&Hr.d.D(e)};Yr.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=K0(n,t.crossOrigin),s=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Hr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:s,fetchPriority:i}):n==="script"&&Hr.d.X(e,{crossOrigin:r,integrity:s,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Yr.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=K0(t.as,t.crossOrigin);Hr.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&&Hr.d.M(e)};Yr.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=K0(n,t.crossOrigin);Hr.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})}};Yr.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=K0(t.as,t.crossOrigin);Hr.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 Hr.d.m(e)};Yr.requestFormReset=function(e){Hr.d.r(e)};Yr.unstable_batchedUpdates=function(e,t){return e(t)};Yr.useFormState=function(e,t,n){return ep.H.useFormState(e,t,n)};Yr.useFormStatus=function(){return ep.H.useHostTransitionStatus()};Yr.version="19.2.4";function d3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d3)}catch(e){console.error(e)}}d3(),u3.exports=Yr;var gh=u3.exports;const h3=Dg(gh);/**
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 qn=Rk,m3=g,ZW=gh;function X(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 p3(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ig(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 g3(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 y3(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 HO(e){if(Ig(e)!==e)throw Error(X(188))}function eJ(e){var t=e.alternate;if(!t){if(t=Ig(e),t===null)throw Error(X(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return HO(s),e;if(i===r)return HO(s),t;i=i.sibling}throw Error(X(188))}if(n.return!==r.return)n=s,r=i;else{for(var a=!1,o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a){for(o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?e:t}function v3(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v3(e),t!==null)return t;e=e.sibling}return null}var Zt=Object.assign,tJ=Symbol.for("react.element"),nv=Symbol.for("react.transitional.element"),Dm=Symbol.for("react.portal"),$f=Symbol.for("react.fragment"),b3=Symbol.for("react.strict_mode"),Nk=Symbol.for("react.profiler"),x3=Symbol.for("react.consumer"),lo=Symbol.for("react.context"),qR=Symbol.for("react.forward_ref"),Tk=Symbol.for("react.suspense"),Ak=Symbol.for("react.suspense_list"),VR=Symbol.for("react.memo"),sl=Symbol.for("react.lazy"),Ok=Symbol.for("react.activity"),nJ=Symbol.for("react.memo_cache_sentinel"),qO=Symbol.iterator;function lm(e){return e===null||typeof e!="object"?null:(e=qO&&e[qO]||e["@@iterator"],typeof e=="function"?e:null)}var rJ=Symbol.for("react.client.reference");function Mk(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===rJ?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $f:return"Fragment";case Nk:return"Profiler";case b3:return"StrictMode";case Tk:return"Suspense";case Ak:return"SuspenseList";case Ok:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Dm:return"Portal";case lo:return e.displayName||"Context";case x3:return(e._context.displayName||"Context")+".Consumer";case qR:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case VR:return t=e.displayName||null,t!==null?t:Mk(e.type)||"Memo";case sl:t=e._payload,e=e._init;try{return Mk(e(t))}catch{}}return null}var Im=Array.isArray,He=m3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_t=ZW.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Jc={pending:!1,data:null,method:null,action:null},jk=[],zf=-1;function Oa(e){return{current:e}}function nr(e){0>zf||(e.current=jk[zf],jk[zf]=null,zf--)}function Vt(e,t){zf++,jk[zf]=e.current,e.current=t}var va=Oa(null),Pp=Oa(null),_l=Oa(null),Hb=Oa(null);function qb(e,t){switch(Vt(_l,t),Vt(Pp,e),Vt(va,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?JM(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=JM(t),e=F4(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nr(va),Vt(va,e)}function Rd(){nr(va),nr(Pp),nr(_l)}function Dk(e){e.memoizedState!==null&&Vt(Hb,e);var t=va.current,n=F4(t,e.type);t!==n&&(Vt(Pp,e),Vt(va,n))}function Vb(e){Pp.current===e&&(nr(va),nr(Pp)),Hb.current===e&&(nr(Hb),Gp._currentValue=Jc)}var p1,VO;function Ic(e){if(p1===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);p1=t&&t[1]||"",VO=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+p1+e+VO}var g1=!1;function y1(e,t){if(!e||g1)return"";g1=!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(m){var h=m}Reflect.construct(e,[],u)}else{try{u.call()}catch(m){h=m}e.call(u.prototype)}}else{try{throw Error()}catch(m){h=m}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(m){if(m&&h&&typeof m.stack=="string")return[m.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),a=i[0],o=i[1];if(a&&o){var l=a.split(`
44
+ `),c=o.split(`
45
+ `);for(s=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;if(r===l.length||s===c.length)for(r=l.length-1,s=c.length-1;1<=r&&0<=s&&l[r]!==c[s];)s--;for(;1<=r&&0<=s;r--,s--)if(l[r]!==c[s]){if(r!==1||s!==1)do if(r--,s--,0>s||l[r]!==c[s]){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<=s);break}}}finally{g1=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ic(n):""}function sJ(e,t){switch(e.tag){case 26:case 27:case 5:return Ic(e.type);case 16:return Ic("Lazy");case 13:return e.child!==t&&t!==null?Ic("Suspense Fallback"):Ic("Suspense");case 19:return Ic("SuspenseList");case 0:case 15:return y1(e.type,!1);case 11:return y1(e.type.render,!1);case 1:return y1(e.type,!0);case 31:return Ic("Activity");default:return""}}function KO(e){try{var t="",n=null;do t+=sJ(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var Ik=Object.prototype.hasOwnProperty,KR=qn.unstable_scheduleCallback,v1=qn.unstable_cancelCallback,iJ=qn.unstable_shouldYield,aJ=qn.unstable_requestPaint,Rs=qn.unstable_now,oJ=qn.unstable_getCurrentPriorityLevel,S3=qn.unstable_ImmediatePriority,w3=qn.unstable_UserBlockingPriority,Kb=qn.unstable_NormalPriority,lJ=qn.unstable_LowPriority,_3=qn.unstable_IdlePriority,cJ=qn.log,uJ=qn.unstable_setDisableYieldValue,Pg=null,Ns=null;function ml(e){if(typeof cJ=="function"&&uJ(e),Ns&&typeof Ns.setStrictMode=="function")try{Ns.setStrictMode(Pg,e)}catch{}}var Ts=Math.clz32?Math.clz32:hJ,fJ=Math.log,dJ=Math.LN2;function hJ(e){return e>>>=0,e===0?32:31-(fJ(e)/dJ|0)|0}var rv=256,sv=262144,iv=4194304;function Pc(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 s=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=r&134217727;return o!==0?(r=o&~i,r!==0?s=Pc(r):(a&=o,a!==0?s=Pc(a):n||(n=o&~e,n!==0&&(s=Pc(n))))):(o=r&~i,o!==0?s=Pc(o):a!==0?s=Pc(a):n||(n=r&~e,n!==0&&(s=Pc(n)))),s===0?0:t!==0&&t!==s&&!(t&i)&&(i=s&-s,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:s}function $g(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mJ(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 k3(){var e=iv;return iv<<=1,!(iv&62914560)&&(iv=4194304),e}function b1(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function zg(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pJ(e,t,n,r,s,i){var a=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=a&~n;0<n;){var f=31-Ts(n),u=1<<f;o[f]=0,l[f]=-1;var h=c[f];if(h!==null)for(c[f]=null,f=0;f<h.length;f++){var m=h[f];m!==null&&(m.lane&=-536870913)}n&=~u}r!==0&&E3(e,r,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(a&~t))}function E3(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ts(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function C3(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ts(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}function R3(e,t){var n=t&-t;return n=n&42?1:GR(n),n&(e.suspendedLanes|t)?0:n}function GR(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 YR(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function N3(){var e=_t.p;return e!==0?e:(e=window.event,e===void 0?32:X4(e.type))}function GO(e,t){var n=_t.p;try{return _t.p=e,t()}finally{_t.p=n}}var lc=Math.random().toString(36).slice(2),pr="__reactFiber$"+lc,cs="__reactProps$"+lc,yh="__reactContainer$"+lc,Pk="__reactEvents$"+lc,gJ="__reactListeners$"+lc,yJ="__reactHandles$"+lc,YO="__reactResources$"+lc,Lg="__reactMarker$"+lc;function WR(e){delete e[pr],delete e[cs],delete e[Pk],delete e[gJ],delete e[yJ]}function Lf(e){var t=e[pr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yh]||n[pr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tj(e);e!==null;){if(n=e[pr])return n;e=tj(e)}return t}e=n,n=e.parentNode}return null}function vh(e){if(e=e[pr]||e[yh]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pm(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(X(33))}function sd(e){var t=e[YO];return t||(t=e[YO]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function er(e){e[Lg]=!0}var T3=new Set,A3={};function Pu(e,t){Nd(e,t),Nd(e+"Capture",t)}function Nd(e,t){for(A3[e]=t,e=0;e<t.length;e++)T3.add(t[e])}var vJ=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]*$"),WO={},JO={};function bJ(e){return Ik.call(JO,e)?!0:Ik.call(WO,e)?!1:vJ.test(e)?JO[e]=!0:(WO[e]=!0,!1)}function Gv(e,t,n){if(bJ(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 av(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 Ha(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 Js(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function O3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xJ(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 s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $k(e){if(!e._valueTracker){var t=O3(e)?"checked":"value";e._valueTracker=xJ(e,t,""+e[t])}}function M3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=O3(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gb(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 SJ=/[\n"\\]/g;function ni(e){return e.replace(SJ,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zk(e,t,n,r,s,i,a,o){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Js(t)):e.value!==""+Js(t)&&(e.value=""+Js(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?Lk(e,a,Js(t)):n!=null?Lk(e,a,Js(n)):r!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Js(o):e.removeAttribute("name")}function j3(e,t,n,r,s,i,a,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){$k(e);return}n=n!=null?""+Js(n):"",t=t!=null?""+Js(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r=r??s,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),$k(e)}function Lk(e,t,n){t==="number"&&Gb(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function id(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Js(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function D3(e,t,n){if(t!=null&&(t=""+Js(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Js(n):""}function I3(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(X(92));if(Im(r)){if(1<r.length)throw Error(X(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Js(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),$k(e)}function Td(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wJ=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||wJ.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function P3(e,t,n){if(t!=null&&typeof t!="object")throw Error(X(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 s in t)r=t[s],t.hasOwnProperty(s)&&n[s]!==r&&XO(e,s,r)}else for(var i in t)t.hasOwnProperty(i)&&XO(e,i,t[i])}function JR(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 _J=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"]]),kJ=/^[\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 Yv(e){return kJ.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function co(){}var Fk=null;function XR(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ff=null,ad=null;function QO(e){var t=vh(e);if(t&&(e=t.stateNode)){var n=e[cs]||null;e:switch(e=t.stateNode,t.type){case"input":if(zk(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="'+ni(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=r[cs]||null;if(!s)throw Error(X(90));zk(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&M3(r)}break e;case"textarea":D3(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&id(e,!!n.multiple,t,!1)}}}var x1=!1;function $3(e,t,n){if(x1)return e(t,n);x1=!0;try{var r=e(t);return r}finally{if(x1=!1,(Ff!==null||ad!==null)&&(iS(),Ff&&(t=Ff,e=ad,ad=Ff=null,QO(t),e)))for(t=0;t<e.length;t++)QO(e[t])}}function $p(e,t){var n=e.stateNode;if(n===null)return null;var r=n[cs]||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(X(231,t,typeof n));return n}var No=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uk=!1;if(No)try{var cm={};Object.defineProperty(cm,"passive",{get:function(){Uk=!0}}),window.addEventListener("test",cm,cm),window.removeEventListener("test",cm,cm)}catch{Uk=!1}var pl=null,QR=null,Wv=null;function z3(){if(Wv)return Wv;var e,t=QR,n=t.length,r,s="value"in pl?pl.value:pl.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[i-r];r++);return Wv=s.slice(e,1<r?1-r:void 0)}function Jv(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 ov(){return!0}function ZO(){return!1}function ds(e){function t(n,r,s,i,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ov:ZO,this.isPropagationStopped=ZO,this}return Zt(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=ov)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ov)},persist:function(){},isPersistent:ov}),t}var $u={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Y0=ds($u),Fg=Zt({},$u,{view:0,detail:0}),EJ=ds(Fg),S1,w1,um,W0=Zt({},Fg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ZR,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!==um&&(um&&e.type==="mousemove"?(S1=e.screenX-um.screenX,w1=e.screenY-um.screenY):w1=S1=0,um=e),S1)},movementY:function(e){return"movementY"in e?e.movementY:w1}}),eM=ds(W0),CJ=Zt({},W0,{dataTransfer:0}),RJ=ds(CJ),NJ=Zt({},Fg,{relatedTarget:0}),_1=ds(NJ),TJ=Zt({},$u,{animationName:0,elapsedTime:0,pseudoElement:0}),AJ=ds(TJ),OJ=Zt({},$u,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MJ=ds(OJ),jJ=Zt({},$u,{data:0}),tM=ds(jJ),DJ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IJ={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"},PJ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $J(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PJ[e])?!!t[e]:!1}function ZR(){return $J}var zJ=Zt({},Fg,{key:function(e){if(e.key){var t=DJ[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jv(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?IJ[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ZR,charCode:function(e){return e.type==="keypress"?Jv(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jv(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),LJ=ds(zJ),FJ=Zt({},W0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nM=ds(FJ),UJ=Zt({},Fg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ZR}),BJ=ds(UJ),HJ=Zt({},$u,{propertyName:0,elapsedTime:0,pseudoElement:0}),qJ=ds(HJ),VJ=Zt({},W0,{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}),KJ=ds(VJ),GJ=Zt({},$u,{newState:0,oldState:0}),YJ=ds(GJ),WJ=[9,13,27,32],eN=No&&"CompositionEvent"in window,tp=null;No&&"documentMode"in document&&(tp=document.documentMode);var JJ=No&&"TextEvent"in window&&!tp,L3=No&&(!eN||tp&&8<tp&&11>=tp),rM=" ",sM=!1;function F3(e,t){switch(e){case"keyup":return WJ.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U3(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Uf=!1;function XJ(e,t){switch(e){case"compositionend":return U3(t);case"keypress":return t.which!==32?null:(sM=!0,rM);case"textInput":return e=t.data,e===rM&&sM?null:e;default:return null}}function QJ(e,t){if(Uf)return e==="compositionend"||!eN&&F3(e,t)?(e=z3(),Wv=QR=pl=null,Uf=!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 L3&&t.locale!=="ko"?null:t.data;default:return null}}var ZJ={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 iM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZJ[e.type]:t==="textarea"}function B3(e,t,n,r){Ff?ad?ad.push(r):ad=[r]:Ff=r,t=fx(t,"onChange"),0<t.length&&(n=new Y0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var np=null,zp=null;function eX(e){$4(e,0)}function J0(e){var t=Pm(e);if(M3(t))return e}function aM(e,t){if(e==="change")return t}var H3=!1;if(No){var k1;if(No){var E1="oninput"in document;if(!E1){var oM=document.createElement("div");oM.setAttribute("oninput","return;"),E1=typeof oM.oninput=="function"}k1=E1}else k1=!1;H3=k1&&(!document.documentMode||9<document.documentMode)}function lM(){np&&(np.detachEvent("onpropertychange",q3),zp=np=null)}function q3(e){if(e.propertyName==="value"&&J0(zp)){var t=[];B3(t,zp,e,XR(e)),$3(eX,t)}}function tX(e,t,n){e==="focusin"?(lM(),np=t,zp=n,np.attachEvent("onpropertychange",q3)):e==="focusout"&&lM()}function nX(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return J0(zp)}function rX(e,t){if(e==="click")return J0(t)}function sX(e,t){if(e==="input"||e==="change")return J0(t)}function iX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Is=typeof Object.is=="function"?Object.is:iX;function Lp(e,t){if(Is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ik.call(t,s)||!Is(e[s],t[s]))return!1}return!0}function cM(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uM(e,t){var n=cM(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=cM(n)}}function V3(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?V3(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function K3(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gb(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=Gb(e.document)}return t}function tN(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 aX=No&&"documentMode"in document&&11>=document.documentMode,Bf=null,Bk=null,rp=null,Hk=!1;function fM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hk||Bf==null||Bf!==Gb(r)||(r=Bf,"selectionStart"in r&&tN(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}),rp&&Lp(rp,r)||(rp=r,r=fx(Bk,"onSelect"),0<r.length&&(t=new Y0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Bf)))}function Nc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hf={animationend:Nc("Animation","AnimationEnd"),animationiteration:Nc("Animation","AnimationIteration"),animationstart:Nc("Animation","AnimationStart"),transitionrun:Nc("Transition","TransitionRun"),transitionstart:Nc("Transition","TransitionStart"),transitioncancel:Nc("Transition","TransitionCancel"),transitionend:Nc("Transition","TransitionEnd")},C1={},G3={};No&&(G3=document.createElement("div").style,"AnimationEvent"in window||(delete Hf.animationend.animation,delete Hf.animationiteration.animation,delete Hf.animationstart.animation),"TransitionEvent"in window||delete Hf.transitionend.transition);function zu(e){if(C1[e])return C1[e];if(!Hf[e])return e;var t=Hf[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in G3)return C1[e]=t[n];return e}var Y3=zu("animationend"),W3=zu("animationiteration"),J3=zu("animationstart"),oX=zu("transitionrun"),lX=zu("transitionstart"),cX=zu("transitioncancel"),X3=zu("transitionend"),Q3=new Map,qk="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(" ");qk.push("scrollEnd");function Wi(e,t){Q3.set(e,t),Pu(t,[e])}var Yb=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)},Ys=[],qf=0,nN=0;function X0(){for(var e=qf,t=nN=qf=0;t<e;){var n=Ys[t];Ys[t++]=null;var r=Ys[t];Ys[t++]=null;var s=Ys[t];Ys[t++]=null;var i=Ys[t];if(Ys[t++]=null,r!==null&&s!==null){var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}i!==0&&Z3(n,s,i)}}function Q0(e,t,n,r){Ys[qf++]=e,Ys[qf++]=t,Ys[qf++]=n,Ys[qf++]=r,nN|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function rN(e,t,n,r){return Q0(e,t,n,r),Wb(e)}function Lu(e,t){return Q0(e,null,null,t),Wb(e)}function Z3(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var s=!1,i=e.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-Ts(n),e=i.hiddenUpdates,r=e[s],r===null?e[s]=[t]:r.push(t),t.lane=n|536870912),i):null}function Wb(e){if(50<dp)throw dp=0,fE=null,Error(X(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vf={};function uX(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 ks(e,t,n,r){return new uX(e,t,n,r)}function sN(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xo(e,t){var n=e.alternate;return n===null?(n=ks(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 eF(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 Xv(e,t,n,r,s,i){var a=0;if(r=e,typeof e=="function")sN(e)&&(a=1);else if(typeof e=="string")a=pQ(e,n,va.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ok:return e=ks(31,n,t,s),e.elementType=Ok,e.lanes=i,e;case $f:return Xc(n.children,s,i,t);case b3:a=8,s|=24;break;case Nk:return e=ks(12,n,t,s|2),e.elementType=Nk,e.lanes=i,e;case Tk:return e=ks(13,n,t,s),e.elementType=Tk,e.lanes=i,e;case Ak:return e=ks(19,n,t,s),e.elementType=Ak,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lo:a=10;break e;case x3:a=9;break e;case qR:a=11;break e;case VR:a=14;break e;case sl:a=16,r=null;break e}a=29,n=Error(X(130,e===null?"null":typeof e,"")),r=null}return t=ks(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Xc(e,t,n,r){return e=ks(7,e,r,t),e.lanes=n,e}function R1(e,t,n){return e=ks(6,e,null,t),e.lanes=n,e}function tF(e){var t=ks(18,null,null,0);return t.stateNode=e,t}function N1(e,t,n){return t=ks(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var dM=new WeakMap;function ri(e,t){if(typeof e=="object"&&e!==null){var n=dM.get(e);return n!==void 0?n:(t={value:e,source:t,stack:KO(t)},dM.set(e,t),t)}return{value:e,source:t,stack:KO(t)}}var Kf=[],Gf=0,Jb=null,Fp=0,Xs=[],Qs=0,ql=null,ca=1,ua="";function ro(e,t){Kf[Gf++]=Fp,Kf[Gf++]=Jb,Jb=e,Fp=t}function nF(e,t,n){Xs[Qs++]=ca,Xs[Qs++]=ua,Xs[Qs++]=ql,ql=e;var r=ca;e=ua;var s=32-Ts(r)-1;r&=~(1<<s),n+=1;var i=32-Ts(t)+s;if(30<i){var a=s-s%5;i=(r&(1<<a)-1).toString(32),r>>=a,s-=a,ca=1<<32-Ts(t)+s|n<<s|r,ua=i+e}else ca=1<<i|n<<s|r,ua=e}function iN(e){e.return!==null&&(ro(e,1),nF(e,1,0))}function aN(e){for(;e===Jb;)Jb=Kf[--Gf],Kf[Gf]=null,Fp=Kf[--Gf],Kf[Gf]=null;for(;e===ql;)ql=Xs[--Qs],Xs[Qs]=null,ua=Xs[--Qs],Xs[Qs]=null,ca=Xs[--Qs],Xs[Qs]=null}function rF(e,t){Xs[Qs++]=ca,Xs[Qs++]=ua,Xs[Qs++]=ql,ca=t.id,ua=t.overflow,ql=e}var gr=null,Yt=null,mt=!1,kl=null,si=!1,Vk=Error(X(519));function Vl(e){var t=Error(X(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Up(ri(t,e)),Vk}function hM(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pr]=e,t[cs]=r,n){case"dialog":lt("cancel",t),lt("close",t);break;case"iframe":case"object":case"embed":lt("load",t);break;case"video":case"audio":for(n=0;n<Vp.length;n++)lt(Vp[n],t);break;case"source":lt("error",t);break;case"img":case"image":case"link":lt("error",t),lt("load",t);break;case"details":lt("toggle",t);break;case"input":lt("invalid",t),j3(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":lt("invalid",t);break;case"textarea":lt("invalid",t),I3(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||L4(t.textContent,n)?(r.popover!=null&&(lt("beforetoggle",t),lt("toggle",t)),r.onScroll!=null&&lt("scroll",t),r.onScrollEnd!=null&&lt("scrollend",t),r.onClick!=null&&(t.onclick=co),t=!0):t=!1,t||Vl(e,!0)}function mM(e){for(gr=e.return;gr;)switch(gr.tag){case 5:case 31:case 13:si=!1;return;case 27:case 3:si=!0;return;default:gr=gr.return}}function uf(e){if(e!==gr)return!1;if(!mt)return mM(e),mt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||gE(e.type,e.memoizedProps)),n=!n),n&&Yt&&Vl(e),mM(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));Yt=ej(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));Yt=ej(e)}else t===27?(t=Yt,cc(e.type)?(e=xE,xE=null,Yt=e):Yt=t):Yt=gr?li(e.stateNode.nextSibling):null;return!0}function cu(){Yt=gr=null,mt=!1}function T1(){var e=kl;return e!==null&&(ns===null?ns=e:ns.push.apply(ns,e),kl=null),e}function Up(e){kl===null?kl=[e]:kl.push(e)}var Kk=Oa(null),Fu=null,uo=null;function ll(e,t,n){Vt(Kk,t._currentValue),t._currentValue=n}function So(e){e._currentValue=Kk.current,nr(Kk)}function Gk(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 Yk(e,t,n,r){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var a=s.child;i=i.firstContext;e:for(;i!==null;){var o=i;i=s;for(var l=0;l<t.length;l++)if(o.context===t[l]){i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Gk(i.return,n,e),r||(a=null);break e}i=o.next}}else if(s.tag===18){if(a=s.return,a===null)throw Error(X(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),Gk(a,n,e),a=null}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}}function bh(e,t,n,r){e=null;for(var s=t,i=!1;s!==null;){if(!i){if(s.flags&524288)i=!0;else if(s.flags&262144)break}if(s.tag===10){var a=s.alternate;if(a===null)throw Error(X(387));if(a=a.memoizedProps,a!==null){var o=s.type;Is(s.pendingProps.value,a.value)||(e!==null?e.push(o):e=[o])}}else if(s===Hb.current){if(a=s.alternate,a===null)throw Error(X(387));a.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Gp):e=[Gp])}s=s.return}e!==null&&Yk(t,e,n,r),t.flags|=262144}function Xb(e){for(e=e.firstContext;e!==null;){if(!Is(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function uu(e){Fu=e,uo=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function vr(e){return sF(Fu,e)}function lv(e,t){return Fu===null&&uu(e),sF(e,t)}function sF(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},uo===null){if(e===null)throw Error(X(308));uo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else uo=uo.next=t;return n}var fX=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()})}},dX=qn.unstable_scheduleCallback,hX=qn.unstable_NormalPriority,An={$$typeof:lo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oN(){return{controller:new fX,data:new Map,refCount:0}}function Ug(e){e.refCount--,e.refCount===0&&dX(hX,function(){e.controller.abort()})}var sp=null,Wk=0,Ad=0,od=null;function mX(e,t){if(sp===null){var n=sp=[];Wk=0,Ad=MN(),od={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Wk++,t.then(pM,pM),t}function pM(){if(--Wk===0&&sp!==null){od!==null&&(od.status="fulfilled");var e=sp;sp=null,Ad=0,od=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pX(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(r.status="rejected",r.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),r}var gM=He.S;He.S=function(e,t){v4=Rs(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&mX(e,t),gM!==null&&gM(e,t)};var Qc=Oa(null);function lN(){var e=Qc.current;return e!==null?e:Ut.pooledCache}function Qv(e,t){t===null?Vt(Qc,Qc.current):Vt(Qc,t.pool)}function iF(){var e=lN();return e===null?null:{parent:An._currentValue,pool:e}}var xh=Error(X(460)),cN=Error(X(474)),Z0=Error(X(542)),Qb={then:function(){}};function yM(e){return e=e.status,e==="fulfilled"||e==="rejected"}function aF(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(co,co),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bM(e),e;default:if(typeof t.status=="string")t.then(co,co);else{if(e=Ut,e!==null&&100<e.shellSuspendCounter)throw Error(X(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=r}},function(r){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bM(e),e}throw Zc=t,xh}}function $c(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zc=n,xh):n}}var Zc=null;function vM(){if(Zc===null)throw Error(X(459));var e=Zc;return Zc=null,e}function bM(e){if(e===xh||e===Z0)throw Error(X(483))}var ld=null,Bp=0;function cv(e){var t=Bp;return Bp+=1,ld===null&&(ld=[]),aF(ld,e,t)}function fm(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function uv(e,t){throw t.$$typeof===tJ?Error(X(525)):(e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function oF(e){function t(y,b){if(e){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y){for(var b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function s(y,b){return y=xo(y,b),y.index=0,y.sibling=null,y}function i(y,b,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=67108866,b):x):(y.flags|=67108866,b)):(y.flags|=1048576,b)}function a(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function o(y,b,x,_){return b===null||b.tag!==6?(b=R1(x,y.mode,_),b.return=y,b):(b=s(b,x),b.return=y,b)}function l(y,b,x,_){var C=x.type;return C===$f?f(y,b,x.props.children,_,x.key):b!==null&&(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===sl&&$c(C)===b.type)?(b=s(b,x.props),fm(b,x),b.return=y,b):(b=Xv(x.type,x.key,x.props,null,y.mode,_),fm(b,x),b.return=y,b)}function c(y,b,x,_){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=N1(x,y.mode,_),b.return=y,b):(b=s(b,x.children||[]),b.return=y,b)}function f(y,b,x,_,C){return b===null||b.tag!==7?(b=Xc(x,y.mode,_,C),b.return=y,b):(b=s(b,x),b.return=y,b)}function u(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=R1(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case nv:return x=Xv(b.type,b.key,b.props,null,y.mode,x),fm(x,b),x.return=y,x;case Dm:return b=N1(b,y.mode,x),b.return=y,b;case sl:return b=$c(b),u(y,b,x)}if(Im(b)||lm(b))return b=Xc(b,y.mode,x,null),b.return=y,b;if(typeof b.then=="function")return u(y,cv(b),x);if(b.$$typeof===lo)return u(y,lv(y,b),x);uv(y,b)}return null}function h(y,b,x,_){var C=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return C!==null?null:o(y,b,""+x,_);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nv:return x.key===C?l(y,b,x,_):null;case Dm:return x.key===C?c(y,b,x,_):null;case sl:return x=$c(x),h(y,b,x,_)}if(Im(x)||lm(x))return C!==null?null:f(y,b,x,_,null);if(typeof x.then=="function")return h(y,b,cv(x),_);if(x.$$typeof===lo)return h(y,b,lv(y,x),_);uv(y,x)}return null}function m(y,b,x,_,C){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return y=y.get(x)||null,o(b,y,""+_,C);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case nv:return y=y.get(_.key===null?x:_.key)||null,l(b,y,_,C);case Dm:return y=y.get(_.key===null?x:_.key)||null,c(b,y,_,C);case sl:return _=$c(_),m(y,b,x,_,C)}if(Im(_)||lm(_))return y=y.get(x)||null,f(b,y,_,C,null);if(typeof _.then=="function")return m(y,b,x,cv(_),C);if(_.$$typeof===lo)return m(y,b,x,lv(b,_),C);uv(b,_)}return null}function p(y,b,x,_){for(var C=null,E=null,k=b,A=b=0,I=null;k!==null&&A<x.length;A++){k.index>A?(I=k,k=null):I=k.sibling;var R=h(y,k,x[A],_);if(R===null){k===null&&(k=I);break}e&&k&&R.alternate===null&&t(y,k),b=i(R,b,A),E===null?C=R:E.sibling=R,E=R,k=I}if(A===x.length)return n(y,k),mt&&ro(y,A),C;if(k===null){for(;A<x.length;A++)k=u(y,x[A],_),k!==null&&(b=i(k,b,A),E===null?C=k:E.sibling=k,E=k);return mt&&ro(y,A),C}for(k=r(k);A<x.length;A++)I=m(k,y,A,x[A],_),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?A:I.key),b=i(I,b,A),E===null?C=I:E.sibling=I,E=I);return e&&k.forEach(function($){return t(y,$)}),mt&&ro(y,A),C}function v(y,b,x,_){if(x==null)throw Error(X(151));for(var C=null,E=null,k=b,A=b=0,I=null,R=x.next();k!==null&&!R.done;A++,R=x.next()){k.index>A?(I=k,k=null):I=k.sibling;var $=h(y,k,R.value,_);if($===null){k===null&&(k=I);break}e&&k&&$.alternate===null&&t(y,k),b=i($,b,A),E===null?C=$:E.sibling=$,E=$,k=I}if(R.done)return n(y,k),mt&&ro(y,A),C;if(k===null){for(;!R.done;A++,R=x.next())R=u(y,R.value,_),R!==null&&(b=i(R,b,A),E===null?C=R:E.sibling=R,E=R);return mt&&ro(y,A),C}for(k=r(k);!R.done;A++,R=x.next())R=m(k,y,A,R.value,_),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?A:R.key),b=i(R,b,A),E===null?C=R:E.sibling=R,E=R);return e&&k.forEach(function(U){return t(y,U)}),mt&&ro(y,A),C}function S(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===$f&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nv:e:{for(var C=x.key;b!==null;){if(b.key===C){if(C=x.type,C===$f){if(b.tag===7){n(y,b.sibling),_=s(b,x.props.children),_.return=y,y=_;break e}}else if(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===sl&&$c(C)===b.type){n(y,b.sibling),_=s(b,x.props),fm(_,x),_.return=y,y=_;break e}n(y,b);break}else t(y,b);b=b.sibling}x.type===$f?(_=Xc(x.props.children,y.mode,_,x.key),_.return=y,y=_):(_=Xv(x.type,x.key,x.props,null,y.mode,_),fm(_,x),_.return=y,y=_)}return a(y);case Dm:e:{for(C=x.key;b!==null;){if(b.key===C)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),_=s(b,x.children||[]),_.return=y,y=_;break e}else{n(y,b);break}else t(y,b);b=b.sibling}_=N1(x,y.mode,_),_.return=y,y=_}return a(y);case sl:return x=$c(x),S(y,b,x,_)}if(Im(x))return p(y,b,x,_);if(lm(x)){if(C=lm(x),typeof C!="function")throw Error(X(150));return x=C.call(x),v(y,b,x,_)}if(typeof x.then=="function")return S(y,b,cv(x),_);if(x.$$typeof===lo)return S(y,b,lv(y,x),_);uv(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),_=s(b,x),_.return=y,y=_):(n(y,b),_=R1(x,y.mode,_),_.return=y,y=_),a(y)):n(y,b)}return function(y,b,x,_){try{Bp=0;var C=S(y,b,x,_);return ld=null,C}catch(k){if(k===xh||k===Z0)throw k;var E=ks(29,k,null,y.mode);return E.lanes=_,E.return=y,E}finally{}}}var fu=oF(!0),lF=oF(!1),il=!1;function uN(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jk(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 El(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,wt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,t=Wb(e),Z3(e,null,n),t}return Q0(e,r,t,n),Wb(e)}function ip(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,C3(e,n)}}function A1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xk=!1;function ap(){if(Xk){var e=od;if(e!==null)throw e}}function op(e,t,n,r){Xk=!1;var s=e.updateQueue;il=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?i=c:a.next=c,a=l;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==a&&(o===null?f.firstBaseUpdate=c:o.next=c,f.lastBaseUpdate=l))}if(i!==null){var u=s.baseState;a=0,f=c=l=null,o=i;do{var h=o.lane&-536870913,m=h!==o.lane;if(m?(dt&h)===h:(r&h)===h){h!==0&&h===Ad&&(Xk=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,v=o;h=t;var S=n;switch(v.tag){case 1:if(p=v.payload,typeof p=="function"){u=p.call(S,u,h);break e}u=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=v.payload,h=typeof p=="function"?p.call(S,u,h):p,h==null)break e;u=Zt({},u,h);break e;case 2:il=!0}}h=o.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=s.callbacks,m===null?s.callbacks=[h]:m.push(h))}else m={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(c=f=m,l=u):f=f.next=m,a|=h;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;m=o,o=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);f===null&&(l=u),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=f,i===null&&(s.shared.lanes=0),Gl|=a,e.lanes=a,e.memoizedState=u}}function cF(e,t){if(typeof e!="function")throw Error(X(191,e));e.call(t)}function uF(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)cF(n[e],t)}var Od=Oa(null),Zb=Oa(0);function xM(e,t){e=Mo,Vt(Zb,e),Vt(Od,t),Mo=e|t.baseLanes}function Qk(){Vt(Zb,Mo),Vt(Od,Od.current)}function fN(){Mo=Zb.current,nr(Od),nr(Zb)}var Ps=Oa(null),oi=null;function cl(e){var t=e.alternate;Vt(bn,bn.current&1),Vt(Ps,e),oi===null&&(t===null||Od.current!==null||t.memoizedState!==null)&&(oi=e)}function Zk(e){Vt(bn,bn.current),Vt(Ps,e),oi===null&&(oi=e)}function fF(e){e.tag===22?(Vt(bn,bn.current),Vt(Ps,e),oi===null&&(oi=e)):ul()}function ul(){Vt(bn,bn.current),Vt(Ps,Ps.current)}function Ss(e){nr(Ps),oi===e&&(oi=null),nr(bn)}var bn=Oa(0);function ex(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vE(n)||bE(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 To=0,Ze=null,$t=null,Nn=null,tx=!1,cd=!1,du=!1,nx=0,Hp=0,ud=null,gX=0;function ln(){throw Error(X(321))}function dN(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Is(e[n],t[n]))return!1;return!0}function hN(e,t,n,r,s,i){return To=i,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,He.H=e===null||e.memoizedState===null?BF:kN,du=!1,i=n(r,s),du=!1,cd&&(i=hF(t,n,r,s)),dF(e),i}function dF(e){He.H=qp;var t=$t!==null&&$t.next!==null;if(To=0,Nn=$t=Ze=null,tx=!1,Hp=0,ud=null,t)throw Error(X(300));e===null||jn||(e=e.dependencies,e!==null&&Xb(e)&&(jn=!0))}function hF(e,t,n,r){Ze=e;var s=0;do{if(cd&&(ud=null),Hp=0,cd=!1,25<=s)throw Error(X(301));if(s+=1,Nn=$t=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}He.H=HF,i=t(n,r)}while(cd);return i}function yX(){var e=He.H,t=e.useState()[0];return t=typeof t.then=="function"?Bg(t):t,e=e.useState()[0],($t!==null?$t.memoizedState:null)!==e&&(Ze.flags|=1024),t}function mN(){var e=nx!==0;return nx=0,e}function pN(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function gN(e){if(tx){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}tx=!1}To=0,Nn=$t=Ze=null,cd=!1,Hp=nx=0,ud=null}function zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?Ze.memoizedState=Nn=e:Nn=Nn.next=e,Nn}function xn(){if($t===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var t=Nn===null?Ze.memoizedState:Nn.next;if(t!==null)Nn=t,$t=e;else{if(e===null)throw Ze.alternate===null?Error(X(467)):Error(X(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Nn===null?Ze.memoizedState=Nn=e:Nn=Nn.next=e}return Nn}function eS(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bg(e){var t=Hp;return Hp+=1,ud===null&&(ud=[]),e=aF(ud,e,t),t=Ze,(Nn===null?t.memoizedState:Nn.next)===null&&(t=t.alternate,He.H=t===null||t.memoizedState===null?BF:kN),e}function tS(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bg(e);if(e.$$typeof===lo)return vr(e)}throw Error(X(438,String(e)))}function yN(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ze.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=eS(),Ze.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]=nJ;return t.index++,n}function Ao(e,t){return typeof t=="function"?t(e):t}function Zv(e){var t=xn();return vN(t,$t,e)}function vN(e,t,n){var r=e.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=n;var s=e.baseQueue,i=r.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}t.baseQueue=s=i,r.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var o=a=null,l=null,c=t,f=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(dt&u)===u:(To&u)===u){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===Ad&&(f=!0);else if((To&h)===h){c=c.next,h===Ad&&(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,a=i):l=l.next=u,Ze.lanes|=h,Gl|=h;u=c.action,du&&n(i,u),i=c.hasEagerState?c.eagerState:n(i,u)}else h={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,a=i):l=l.next=h,Ze.lanes|=u,Gl|=u;c=c.next}while(c!==null&&c!==t);if(l===null?a=i:l.next=o,!Is(i,e.memoizedState)&&(jn=!0,f&&(n=od,n!==null)))throw n;e.memoizedState=i,e.baseState=a,e.baseQueue=l,r.lastRenderedState=i}return s===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function O1(e){var t=xn(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do i=e(i,a.action),a=a.next;while(a!==s);Is(i,t.memoizedState)||(jn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function mF(e,t,n){var r=Ze,s=xn(),i=mt;if(i){if(n===void 0)throw Error(X(407));n=n()}else n=t();var a=!Is(($t||s).memoizedState,n);if(a&&(s.memoizedState=n,jn=!0),s=s.queue,bN(yF.bind(null,r,s,e),[e]),s.getSnapshot!==t||a||Nn!==null&&Nn.memoizedState.tag&1){if(r.flags|=2048,Md(9,{destroy:void 0},gF.bind(null,r,s,n,t),null),Ut===null)throw Error(X(349));i||To&127||pF(r,t,n)}return n}function pF(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=eS(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gF(e,t,n,r){t.value=n,t.getSnapshot=r,vF(t)&&bF(e)}function yF(e,t,n){return n(function(){vF(t)&&bF(e)})}function vF(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Is(e,n)}catch{return!0}}function bF(e){var t=Lu(e,2);t!==null&&ls(t,e,2)}function eE(e){var t=zr();if(typeof e=="function"){var n=e;if(e=n(),du){ml(!0);try{n()}finally{ml(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function xF(e,t,n,r){return e.baseState=n,vN(e,$t,typeof r=="function"?r:Ao)}function vX(e,t,n,r,s){if(rS(e))throw Error(X(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};He.T!==null?n(!0):i.isTransition=!1,r(i),n=t.pending,n===null?(i.next=t.pending=i,SF(t,i)):(i.next=n.next,t.pending=n.next=i)}}function SF(e,t){var n=t.action,r=t.payload,s=e.state;if(t.isTransition){var i=He.T,a={};He.T=a;try{var o=n(s,r),l=He.S;l!==null&&l(a,o),SM(e,t,o)}catch(c){tE(e,t,c)}finally{i!==null&&a.types!==null&&(i.types=a.types),He.T=i}}else try{i=n(s,r),SM(e,t,i)}catch(c){tE(e,t,c)}}function SM(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){wM(e,t,r)},function(r){return tE(e,t,r)}):wM(e,t,n)}function wM(e,t,n){t.status="fulfilled",t.value=n,wF(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,SF(e,n)))}function tE(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,wF(t),t=t.next;while(t!==r)}e.action=null}function wF(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _F(e,t){return t}function _M(e,t){if(mt){var n=Ut.formState;if(n!==null){e:{var r=Ze;if(mt){if(Yt){t:{for(var s=Yt,i=si;s.nodeType!==8;){if(!i){s=null;break t}if(s=li(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){Yt=li(s.nextSibling),r=s.data==="F!";break e}}Vl(r)}r=!1}r&&(t=n[0])}}return n=zr(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_F,lastRenderedState:t},n.queue=r,n=LF.bind(null,Ze,r),r.dispatch=n,r=eE(!1),i=_N.bind(null,Ze,!1,r.queue),r=zr(),s={state:t,dispatch:null,action:e,pending:null},r.queue=s,n=vX.bind(null,Ze,s,i,n),s.dispatch=n,r.memoizedState=e,[t,n,!1]}function kM(e){var t=xn();return kF(t,$t,e)}function kF(e,t,n){if(t=vN(e,t,_F)[0],e=Zv(Ao)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Bg(t)}catch(a){throw a===xh?Z0:a}else r=t;t=xn();var s=t.queue,i=s.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Md(9,{destroy:void 0},bX.bind(null,s,n),null)),[r,i,e]}function bX(e,t){e.action=t}function EM(e){var t=xn(),n=$t;if(n!==null)return kF(t,n,e);xn(),t=t.memoizedState,n=xn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Md(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=eS(),Ze.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 EF(){return xn().memoizedState}function eb(e,t,n,r){var s=zr();Ze.flags|=e,s.memoizedState=Md(1|t,{destroy:void 0},n,r===void 0?null:r)}function nS(e,t,n,r){var s=xn();r=r===void 0?null:r;var i=s.memoizedState.inst;$t!==null&&r!==null&&dN(r,$t.memoizedState.deps)?s.memoizedState=Md(t,i,n,r):(Ze.flags|=e,s.memoizedState=Md(1|t,i,n,r))}function CM(e,t){eb(8390656,8,e,t)}function bN(e,t){nS(2048,8,e,t)}function xX(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=eS(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function CF(e){var t=xn().memoizedState;return xX({ref:t,nextImpl:e}),function(){if(wt&2)throw Error(X(440));return t.impl.apply(void 0,arguments)}}function RF(e,t){return nS(4,2,e,t)}function NF(e,t){return nS(4,4,e,t)}function TF(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 AF(e,t,n){n=n!=null?n.concat([e]):null,nS(4,4,TF.bind(null,t,e),n)}function xN(){}function OF(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&dN(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function MF(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&dN(t,r[1]))return r[0];if(r=e(),du){ml(!0);try{e()}finally{ml(!1)}}return n.memoizedState=[r,t],r}function SN(e,t,n){return n===void 0||To&1073741824&&!(dt&261930)?e.memoizedState=t:(e.memoizedState=n,e=x4(),Ze.lanes|=e,Gl|=e,n)}function jF(e,t,n,r){return Is(n,t)?n:Od.current!==null?(e=SN(e,n,r),Is(e,t)||(jn=!0),e):!(To&42)||To&1073741824&&!(dt&261930)?(jn=!0,e.memoizedState=n):(e=x4(),Ze.lanes|=e,Gl|=e,t)}function DF(e,t,n,r,s){var i=_t.p;_t.p=i!==0&&8>i?i:8;var a=He.T,o={};He.T=o,_N(e,!1,t,n);try{var l=s(),c=He.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var f=pX(l,r);lp(e,t,f,As(e))}else lp(e,t,r,As(e))}catch(u){lp(e,t,{then:function(){},status:"rejected",reason:u},As())}finally{_t.p=i,a!==null&&o.types!==null&&(a.types=o.types),He.T=a}}function SX(){}function nE(e,t,n,r){if(e.tag!==5)throw Error(X(476));var s=IF(e).queue;DF(e,s,t,Jc,n===null?SX:function(){return PF(e),n(r)})}function IF(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Jc,baseState:Jc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:Jc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function PF(e){var t=IF(e);t.next===null&&(t=e.alternate.memoizedState),lp(e,t.next.queue,{},As())}function wN(){return vr(Gp)}function $F(){return xn().memoizedState}function zF(){return xn().memoizedState}function wX(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=As();e=El(n);var r=Cl(t,e,n);r!==null&&(ls(r,t,n),ip(r,t,n)),t={cache:oN()},e.payload=t;return}t=t.return}}function _X(e,t,n){var r=As();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rS(e)?FF(t,n):(n=rN(e,t,n,r),n!==null&&(ls(n,e,r),UF(n,t,r)))}function LF(e,t,n){var r=As();lp(e,t,n,r)}function lp(e,t,n,r){var s={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rS(e))FF(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,Is(o,a))return Q0(e,t,s,0),Ut===null&&X0(),!1}catch{}finally{}if(n=rN(e,t,s,r),n!==null)return ls(n,e,r),UF(n,t,r),!0}return!1}function _N(e,t,n,r){if(r={lane:2,revertLane:MN(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},rS(e)){if(t)throw Error(X(479))}else t=rN(e,n,r,2),t!==null&&ls(t,e,2)}function rS(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function FF(e,t){cd=tx=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function UF(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,C3(e,n)}}var qp={readContext:vr,use:tS,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};qp.useEffectEvent=ln;var BF={readContext:vr,use:tS,useCallback:function(e,t){return zr().memoizedState=[e,t===void 0?null:t],e},useContext:vr,useEffect:CM,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,eb(4194308,4,TF.bind(null,t,e),n)},useLayoutEffect:function(e,t){return eb(4194308,4,e,t)},useInsertionEffect:function(e,t){eb(4,2,e,t)},useMemo:function(e,t){var n=zr();t=t===void 0?null:t;var r=e();if(du){ml(!0);try{e()}finally{ml(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zr();if(n!==void 0){var s=n(t);if(du){ml(!0);try{n(t)}finally{ml(!1)}}}else s=t;return r.memoizedState=r.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},r.queue=e,e=e.dispatch=_X.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=zr();return e={current:e},t.memoizedState=e},useState:function(e){e=eE(e);var t=e.queue,n=LF.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xN,useDeferredValue:function(e,t){var n=zr();return SN(n,e,t)},useTransition:function(){var e=eE(!1);return e=DF.bind(null,Ze,e.queue,!0,!1),zr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ze,s=zr();if(mt){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),Ut===null)throw Error(X(349));dt&127||pF(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,CM(yF.bind(null,r,i,e),[e]),r.flags|=2048,Md(9,{destroy:void 0},gF.bind(null,r,i,n,t),null),n},useId:function(){var e=zr(),t=Ut.identifierPrefix;if(mt){var n=ua,r=ca;n=(r&~(1<<32-Ts(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=nx++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=gX++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wN,useFormState:_M,useActionState:_M,useOptimistic:function(e){var t=zr();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=_N.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:yN,useCacheRefresh:function(){return zr().memoizedState=wX.bind(null,Ze)},useEffectEvent:function(e){var t=zr(),n={impl:e};return t.memoizedState=n,function(){if(wt&2)throw Error(X(440));return n.impl.apply(void 0,arguments)}}},kN={readContext:vr,use:tS,useCallback:OF,useContext:vr,useEffect:bN,useImperativeHandle:AF,useInsertionEffect:RF,useLayoutEffect:NF,useMemo:MF,useReducer:Zv,useRef:EF,useState:function(){return Zv(Ao)},useDebugValue:xN,useDeferredValue:function(e,t){var n=xn();return jF(n,$t.memoizedState,e,t)},useTransition:function(){var e=Zv(Ao)[0],t=xn().memoizedState;return[typeof e=="boolean"?e:Bg(e),t]},useSyncExternalStore:mF,useId:$F,useHostTransitionStatus:wN,useFormState:kM,useActionState:kM,useOptimistic:function(e,t){var n=xn();return xF(n,$t,e,t)},useMemoCache:yN,useCacheRefresh:zF};kN.useEffectEvent=CF;var HF={readContext:vr,use:tS,useCallback:OF,useContext:vr,useEffect:bN,useImperativeHandle:AF,useInsertionEffect:RF,useLayoutEffect:NF,useMemo:MF,useReducer:O1,useRef:EF,useState:function(){return O1(Ao)},useDebugValue:xN,useDeferredValue:function(e,t){var n=xn();return $t===null?SN(n,e,t):jF(n,$t.memoizedState,e,t)},useTransition:function(){var e=O1(Ao)[0],t=xn().memoizedState;return[typeof e=="boolean"?e:Bg(e),t]},useSyncExternalStore:mF,useId:$F,useHostTransitionStatus:wN,useFormState:EM,useActionState:EM,useOptimistic:function(e,t){var n=xn();return $t!==null?xF(n,$t,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:yN,useCacheRefresh:zF};HF.useEffectEvent=CF;function M1(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Zt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rE={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=As(),s=El(r);s.payload=t,n!=null&&(s.callback=n),t=Cl(e,s,r),t!==null&&(ls(t,e,r),ip(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=As(),s=El(r);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Cl(e,s,r),t!==null&&(ls(t,e,r),ip(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=As(),r=El(n);r.tag=2,t!=null&&(r.callback=t),t=Cl(e,r,n),t!==null&&(ls(t,e,n),ip(t,e,n))}};function RM(e,t,n,r,s,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!Lp(n,r)||!Lp(s,i):!0}function NM(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rE.enqueueReplaceState(t,t.state,null)}function hu(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=Zt({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function qF(e){Yb(e)}function VF(e){console.error(e)}function KF(e){Yb(e)}function rx(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function TM(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function sE(e,t,n){return n=El(n),n.tag=3,n.payload={element:null},n.callback=function(){rx(e,t)},n}function GF(e){return e=El(e),e.tag=3,e}function YF(e,t,n,r){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var i=r.value;e.payload=function(){return s(i)},e.callback=function(){TM(t,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){TM(t,n,r),typeof s!="function"&&(Rl===null?Rl=new Set([this]):Rl.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function kX(e,t,n,r,s){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&bh(t,n,s,!0),n=Ps.current,n!==null){switch(n.tag){case 31:case 13:return oi===null?lx():n.alternate===null&&fn===0&&(fn=3),n.flags&=-257,n.flags|=65536,n.lanes=s,r===Qb?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),H1(e,r,s)),!1;case 22:return n.flags|=65536,r===Qb?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)),H1(e,r,s)),!1}throw Error(X(435,n.tag))}return H1(e,r,s),lx(),!1}if(mt)return t=Ps.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=s,r!==Vk&&(e=Error(X(422),{cause:r}),Up(ri(e,n)))):(r!==Vk&&(t=Error(X(423),{cause:r}),Up(ri(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,r=ri(r,n),s=sE(e.stateNode,r,s),A1(e,s),fn!==4&&(fn=2)),!1;var i=Error(X(520),{cause:r});if(i=ri(i,n),fp===null?fp=[i]:fp.push(i),fn!==4&&(fn=2),t===null)return!0;r=ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=sE(n.stateNode,r,e),A1(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Rl===null||!Rl.has(i))))return n.flags|=65536,s&=-s,n.lanes|=s,s=GF(s),YF(s,e,n,r),A1(n,s),!1}n=n.return}while(n!==null);return!1}var EN=Error(X(461)),jn=!1;function ur(e,t,n,r){t.child=e===null?lF(t,null,n,r):fu(t,e.child,n,r)}function AM(e,t,n,r,s){n=n.render;var i=t.ref;if("ref"in r){var a={};for(var o in r)o!=="ref"&&(a[o]=r[o])}else a=r;return uu(t),r=hN(e,t,n,a,i,s),o=mN(),e!==null&&!jn?(pN(e,t,s),Oo(e,t,s)):(mt&&o&&iN(t),t.flags|=1,ur(e,t,r,s),t.child)}function OM(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!sN(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,WF(e,t,i,r,s)):(e=Xv(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!CN(e,s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Lp,n(a,r)&&e.ref===t.ref)return Oo(e,t,s)}return t.flags|=1,e=xo(i,r),e.ref=t.ref,e.return=t,t.child=e}function WF(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Lp(i,r)&&e.ref===t.ref)if(jn=!1,t.pendingProps=r=i,CN(e,s))e.flags&131072&&(jn=!0);else return t.lanes=e.lanes,Oo(e,t,s)}return iE(e,t,n,r,s)}function JF(e,t,n,r){var s=r.children,i=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(i=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;r=s&~i}else r=0,t.child=null;return MM(e,t,i,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qv(t,i!==null?i.cachePool:null),i!==null?xM(t,i):Qk(),fF(t);else return r=t.lanes=536870912,MM(e,t,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(Qv(t,i.cachePool),xM(t,i),ul(),t.memoizedState=null):(e!==null&&Qv(t,null),Qk(),ul());return ur(e,t,s,n),t.child}function $m(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function MM(e,t,n,r,s){var i=lN();return i=i===null?null:{parent:An._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&Qv(t,null),Qk(),fF(t),e!==null&&bh(e,t,r,!0),t.childLanes=s,null}function tb(e,t){return t=sx({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jM(e,t,n){return fu(t,e.child,null,n),e=tb(t,t.pendingProps),e.flags|=2,Ss(t),t.memoizedState=null,e}function EX(e,t,n){var r=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(mt){if(r.mode==="hidden")return e=tb(t,r),t.lanes=536870912,$m(null,e);if(Zk(t),(e=Yt)?(e=B4(e,si),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ql!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=tF(e),n.return=t,t.child=n,gr=t,Yt=null)):e=null,e===null)throw Vl(t);return t.lanes=536870912,null}return tb(t,r)}var i=e.memoizedState;if(i!==null){var a=i.dehydrated;if(Zk(t),s)if(t.flags&256)t.flags&=-257,t=jM(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(X(558));else if(jn||bh(e,t,n,!1),s=(n&e.childLanes)!==0,jn||s){if(r=Ut,r!==null&&(a=R3(r,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Lu(e,a),ls(r,e,a),EN;lx(),t=jM(e,t,n)}else e=i.treeContext,Yt=li(a.nextSibling),gr=t,mt=!0,kl=null,si=!1,e!==null&&rF(t,e),t=tb(t,r),t.flags|=4096;return t}return e=xo(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(X(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function iE(e,t,n,r,s){return uu(t),n=hN(e,t,n,r,void 0,s),r=mN(),e!==null&&!jn?(pN(e,t,s),Oo(e,t,s)):(mt&&r&&iN(t),t.flags|=1,ur(e,t,n,s),t.child)}function DM(e,t,n,r,s,i){return uu(t),t.updateQueue=null,n=hF(t,r,n,s),dF(e),r=mN(),e!==null&&!jn?(pN(e,t,i),Oo(e,t,i)):(mt&&r&&iN(t),t.flags|=1,ur(e,t,n,i),t.child)}function IM(e,t,n,r,s){if(uu(t),t.stateNode===null){var i=Vf,a=n.contextType;typeof a=="object"&&a!==null&&(i=vr(a)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=rE,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},uN(t),a=n.contextType,i.context=typeof a=="object"&&a!==null?vr(a):Vf,i.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(M1(t,n,a,r),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&rE.enqueueReplaceState(i,i.state,null),op(t,r,i,s),ap(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var o=t.memoizedProps,l=hu(n,o);i.props=l;var c=i.context,f=n.contextType;a=Vf,typeof f=="object"&&f!==null&&(a=vr(f));var u=n.getDerivedStateFromProps;f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o||c!==a)&&NM(t,i,r,a),il=!1;var h=t.memoizedState;i.state=h,op(t,r,i,s),ap(),c=t.memoizedState,o||h!==c||il?(typeof u=="function"&&(M1(t,n,u,r),c=t.memoizedState),(l=il||RM(t,n,l,r,h,c,a))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=a,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Jk(e,t),a=t.memoizedProps,f=hu(n,a),i.props=f,u=t.pendingProps,h=i.context,c=n.contextType,l=Vf,typeof c=="object"&&c!==null&&(l=vr(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==u||h!==l)&&NM(t,i,r,l),il=!1,h=t.memoizedState,i.state=h,op(t,r,i,s),ap();var m=t.memoizedState;a!==u||h!==m||il||e!==null&&e.dependencies!==null&&Xb(e.dependencies)?(typeof o=="function"&&(M1(t,n,o,r),m=t.memoizedState),(f=il||RM(t,n,f,r,h,m,l)||e!==null&&e.dependencies!==null&&Xb(e.dependencies))?(c||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,m,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,m,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=l,r=f):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,nb(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=fu(t,e.child,null,s),t.child=fu(t,null,n,s)):ur(e,t,n,s),t.memoizedState=i.state,e=t.child):e=Oo(e,t,s),e}function PM(e,t,n,r){return cu(),t.flags|=256,ur(e,t,n,r),t.child}var j1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function D1(e){return{baseLanes:e,cachePool:iF()}}function I1(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Cs),e}function XF(e,t,n){var r=t.pendingProps,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(bn.current&2)!==0),a&&(s=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(mt){if(s?cl(t):ul(),(e=Yt)?(e=B4(e,si),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ql!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=tF(e),n.return=t,t.child=n,gr=t,Yt=null)):e=null,e===null)throw Vl(t);return bE(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,s?(ul(),s=t.mode,o=sx({mode:"hidden",children:o},s),r=Xc(r,s,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=D1(n),r.childLanes=I1(e,a,n),t.memoizedState=j1,$m(null,r)):(cl(t),aE(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(i)t.flags&256?(cl(t),t.flags&=-257,t=P1(e,t,n)):t.memoizedState!==null?(ul(),t.child=e.child,t.flags|=128,t=null):(ul(),o=r.fallback,s=t.mode,r=sx({mode:"visible",children:r.children},s),o=Xc(o,s,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,fu(t,e.child,null,n),r=t.child,r.memoizedState=D1(n),r.childLanes=I1(e,a,n),t.memoizedState=j1,t=$m(null,r));else if(cl(t),bE(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(X(419)),r.stack="",r.digest=a,Up({value:r,source:null,stack:null}),t=P1(e,t,n)}else if(jn||bh(e,t,n,!1),a=(n&e.childLanes)!==0,jn||a){if(a=Ut,a!==null&&(r=R3(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Lu(e,r),ls(a,e,r),EN;vE(o)||lx(),t=P1(e,t,n)}else vE(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Yt=li(o.nextSibling),gr=t,mt=!0,kl=null,si=!1,e!==null&&rF(t,e),t=aE(t,r.children),t.flags|=4096);return t}return s?(ul(),o=r.fallback,s=t.mode,l=e.child,c=l.sibling,r=xo(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?o=xo(c,o):(o=Xc(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,$m(null,r),r=t.child,o=e.child.memoizedState,o===null?o=D1(n):(s=o.cachePool,s!==null?(l=An._currentValue,s=s.parent!==l?{parent:l,pool:l}:s):s=iF(),o={baseLanes:o.baseLanes|n,cachePool:s}),r.memoizedState=o,r.childLanes=I1(e,a,n),t.memoizedState=j1,$m(e.child,r)):(cl(t),n=e.child,e=n.sibling,n=xo(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function aE(e,t){return t=sx({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function sx(e,t){return e=ks(22,e,null,t),e.lanes=0,e}function P1(e,t,n){return fu(t,e.child,null,n),e=aE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $M(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gk(e.return,t,n)}function $1(e,t,n,r,s,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s,a.treeForkCount=i)}function QF(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;r=r.children;var a=bn.current,o=(a&2)!==0;if(o?(a=a&1|2,t.flags|=128):a&=1,Vt(bn,a),ur(e,t,r,n),r=mt?Fp:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$M(e,n,t);else if(e.tag===19)$M(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(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ex(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),$1(t,!1,s,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ex(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}$1(t,!0,n,null,i,r);break;case"together":$1(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,!(n&t.childLanes))if(e!==null){if(bh(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,n=xo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function CN(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Xb(e)))}function CX(e,t,n){switch(t.tag){case 3:qb(t,t.stateNode.containerInfo),ll(t,An,e.memoizedState.cache),cu();break;case 27:case 5:Dk(t);break;case 4:qb(t,t.stateNode.containerInfo);break;case 10:ll(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Zk(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(cl(t),t.flags|=128,null):n&t.child.childLanes?XF(e,t,n):(cl(t),e=Oo(e,t,n),e!==null?e.sibling:null);cl(t);break;case 19:var s=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(bh(e,t,n,!1),r=(n&t.childLanes)!==0),s){if(r)return QF(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Vt(bn,bn.current),r)break;return null;case 22:return t.lanes=0,JF(e,t,n,t.pendingProps);case 24:ll(t,An,e.memoizedState.cache)}return Oo(e,t,n)}function ZF(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)jn=!0;else{if(!CN(e,n)&&!(t.flags&128))return jn=!1,CX(e,t,n);jn=!!(e.flags&131072)}else jn=!1,mt&&t.flags&1048576&&nF(t,Fp,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=$c(t.elementType),t.type=e,typeof e=="function")sN(e)?(r=hu(e,r),t.tag=1,t=IM(null,t,e,r,n)):(t.tag=0,t=iE(null,t,e,r,n));else{if(e!=null){var s=e.$$typeof;if(s===qR){t.tag=11,t=AM(null,t,e,r,n);break e}else if(s===VR){t.tag=14,t=OM(null,t,e,r,n);break e}}throw t=Mk(e)||e,Error(X(306,t,""))}}return t;case 0:return iE(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,s=hu(r,t.pendingProps),IM(e,t,r,s,n);case 3:e:{if(qb(t,t.stateNode.containerInfo),e===null)throw Error(X(387));r=t.pendingProps;var i=t.memoizedState;s=i.element,Jk(e,t),op(t,r,null,n);var a=t.memoizedState;if(r=a.cache,ll(t,An,r),r!==i.cache&&Yk(t,[An],n,!0),ap(),r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=PM(e,t,r,n);break e}else if(r!==s){s=ri(Error(X(424)),t),Up(s),t=PM(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(Yt=li(e.firstChild),gr=t,mt=!0,kl=null,si=!0,n=lF(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(cu(),r===s){t=Oo(e,t,n);break e}ur(e,t,r,n)}t=t.child}return t;case 26:return nb(e,t),e===null?(n=rj(t.type,null,t.pendingProps,null))?t.memoizedState=n:mt||(n=t.type,e=t.pendingProps,r=dx(_l.current).createElement(n),r[pr]=t,r[cs]=e,xr(r,n,e),er(r),t.stateNode=r):t.memoizedState=rj(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dk(t),e===null&&mt&&(r=t.stateNode=H4(t.type,t.pendingProps,_l.current),gr=t,si=!0,s=Yt,cc(t.type)?(xE=s,Yt=li(r.firstChild)):Yt=s),ur(e,t,t.pendingProps.children,n),nb(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&mt&&((s=r=Yt)&&(r=nQ(r,t.type,t.pendingProps,si),r!==null?(t.stateNode=r,gr=t,Yt=li(r.firstChild),si=!1,s=!0):s=!1),s||Vl(t)),Dk(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,r=i.children,gE(s,i)?r=null:a!==null&&gE(s,a)&&(t.flags|=32),t.memoizedState!==null&&(s=hN(e,t,yX,null,null,n),Gp._currentValue=s),nb(e,t),ur(e,t,r,n),t.child;case 6:return e===null&&mt&&((e=n=Yt)&&(n=rQ(n,t.pendingProps,si),n!==null?(t.stateNode=n,gr=t,Yt=null,e=!0):e=!1),e||Vl(t)),null;case 13:return XF(e,t,n);case 4:return qb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fu(t,null,r,n):ur(e,t,r,n),t.child;case 11:return AM(e,t,t.type,t.pendingProps,n);case 7:return ur(e,t,t.pendingProps,n),t.child;case 8:return ur(e,t,t.pendingProps.children,n),t.child;case 12:return ur(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ll(t,t.type,r.value),ur(e,t,r.children,n),t.child;case 9:return s=t.type._context,r=t.pendingProps.children,uu(t),s=vr(s),r=r(s),t.flags|=1,ur(e,t,r,n),t.child;case 14:return OM(e,t,t.type,t.pendingProps,n);case 15:return WF(e,t,t.type,t.pendingProps,n);case 19:return QF(e,t,n);case 31:return EX(e,t,n);case 22:return JF(e,t,n,t.pendingProps);case 24:return uu(t),r=vr(An),e===null?(s=lN(),s===null&&(s=Ut,i=oN(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=n),s=i),t.memoizedState={parent:r,cache:s},uN(t),ll(t,An,s)):(e.lanes&n&&(Jk(e,t),op(t,null,null,n),ap()),s=e.memoizedState,i=t.memoizedState,s.parent!==r?(s={parent:r,cache:r},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ll(t,An,r)):(r=i.cache,ll(t,An,r),r!==s.cache&&Yk(t,[An],n,!0))),ur(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(X(156,t.tag))}function qa(e){e.flags|=4}function z1(e,t,n,r,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(_4())e.flags|=8192;else throw Zc=Qb,cN}else e.flags&=-16777217}function zM(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!K4(t))if(_4())e.flags|=8192;else throw Zc=Qb,cN}function fv(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?k3():536870912,e.lanes|=t,jd|=t)}function dm(e,t){if(!mt)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 Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&65011712,r|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function RX(e,t,n){var r=t.pendingProps;switch(aN(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return Gt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),So(An),Rd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(uf(t)?qa(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,T1())),Gt(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(qa(t),i!==null?(Gt(t),zM(t,i)):(Gt(t),z1(t,s,null,r,n))):i?i!==e.memoizedState?(qa(t),Gt(t),zM(t,i)):(Gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&qa(t),Gt(t),z1(t,s,e,r,n)),null;case 27:if(Vb(t),n=_l.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&qa(t);else{if(!r){if(t.stateNode===null)throw Error(X(166));return Gt(t),null}e=va.current,uf(t)?hM(t):(e=H4(s,r,n),t.stateNode=e,qa(t))}return Gt(t),null;case 5:if(Vb(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&qa(t);else{if(!r){if(t.stateNode===null)throw Error(X(166));return Gt(t),null}if(i=va.current,uf(t))hM(t);else{var a=dx(_l.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?a.createElement(s,{is:r.is}):a.createElement(s)}}i[pr]=t,i[cs]=r;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=i;e:switch(xr(i,s,r),s){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&qa(t)}}return Gt(t),z1(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&qa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(X(166));if(e=_l.current,uf(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,s=gr,s!==null)switch(s.tag){case 27:case 5:r=s.memoizedProps}e[pr]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||L4(e.nodeValue,n)),e||Vl(t,!0)}else e=dx(e).createTextNode(r),e[pr]=t,t.stateNode=e}return Gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=uf(t),n!==null){if(e===null){if(!r)throw Error(X(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(557));e[pr]=t}else cu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gt(t),e=!1}else n=T1(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ss(t),t):(Ss(t),null);if(t.flags&128)throw Error(X(558))}return Gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=uf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(X(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(X(317));s[pr]=t}else cu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gt(t),s=!1}else s=T1(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Ss(t),t):(Ss(t),null)}return Ss(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,s=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(s=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==s&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fv(t,t.updateQueue),Gt(t),null);case 4:return Rd(),e===null&&jN(t.stateNode.containerInfo),Gt(t),null;case 10:return So(t.type),Gt(t),null;case 19:if(nr(bn),r=t.memoizedState,r===null)return Gt(t),null;if(s=(t.flags&128)!==0,i=r.rendering,i===null)if(s)dm(r,!1);else{if(fn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=ex(e),i!==null){for(t.flags|=128,dm(r,!1),e=i.updateQueue,t.updateQueue=e,fv(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)eF(n,e),n=n.sibling;return Vt(bn,bn.current&1|2),mt&&ro(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Rs()>ax&&(t.flags|=128,s=!0,dm(r,!1),t.lanes=4194304)}else{if(!s)if(e=ex(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,fv(t,e),dm(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!mt)return Gt(t),null}else 2*Rs()-r.renderingStartTime>ax&&n!==536870912&&(t.flags|=128,s=!0,dm(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Rs(),e.sibling=null,n=bn.current,Vt(bn,s?n&1|2:n&1),mt&&ro(t,r.treeForkCount),e):(Gt(t),null);case 22:case 23:return Ss(t),fN(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),n=t.updateQueue,n!==null&&fv(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&&nr(Qc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),So(An),Gt(t),null;case 25:return null;case 30:return null}throw Error(X(156,t.tag))}function NX(e,t){switch(aN(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return So(An),Rd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Vb(t),null;case 31:if(t.memoizedState!==null){if(Ss(t),t.alternate===null)throw Error(X(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ss(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nr(bn),null;case 4:return Rd(),null;case 10:return So(t.type),null;case 22:case 23:return Ss(t),fN(),e!==null&&nr(Qc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return So(An),null;case 25:return null;default:return null}}function e4(e,t){switch(aN(t),t.tag){case 3:So(An),Rd();break;case 26:case 27:case 5:Vb(t);break;case 4:Rd();break;case 31:t.memoizedState!==null&&Ss(t);break;case 13:Ss(t);break;case 19:nr(bn);break;case 10:So(t.type);break;case 22:case 23:Ss(t),fN(),e!==null&&nr(Qc);break;case 24:So(An)}}function Hg(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var s=r.next;n=s;do{if((n.tag&e)===e){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==s)}}catch(o){Nt(t,t.return,o)}}function Kl(e,t,n){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var i=s.next;r=i;do{if((r.tag&e)===e){var a=r.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,s=t;var l=n,c=o;try{c()}catch(f){Nt(s,l,f)}}}r=r.next}while(r!==i)}}catch(f){Nt(t,t.return,f)}}function t4(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{uF(t,n)}catch(r){Nt(e,e.return,r)}}}function n4(e,t,n){n.props=hu(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Nt(e,t,r)}}function cp(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(s){Nt(e,t,s)}}function fa(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(s){Nt(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){Nt(e,t,s)}else n.current=null}function r4(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(s){Nt(e,e.return,s)}}function L1(e,t,n){try{var r=e.stateNode;JX(r,e.type,n,t),r[cs]=t}catch(s){Nt(e,e.return,s)}}function s4(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cc(e.type)||e.tag===4}function F1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||s4(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&&cc(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 oE(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=co));else if(r!==4&&(r===27&&cc(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(oE(e,t,n),e=e.sibling;e!==null;)oE(e,t,n),e=e.sibling}function ix(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&&cc(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ix(e,t,n),e=e.sibling;e!==null;)ix(e,t,n),e=e.sibling}function i4(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);xr(t,r,n),t[pr]=e,t[cs]=n}catch(i){Nt(e,e.return,i)}}var io=!1,Tn=!1,U1=!1,LM=typeof WeakSet=="function"?WeakSet:Set,Zn=null;function TX(e,t){if(e=e.containerInfo,mE=gx,e=K3(e),tN(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,f=0,u=e,h=null;t:for(;;){for(var m;u!==n||s!==0&&u.nodeType!==3||(o=a+s),u!==i||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(m=u.firstChild)!==null;)h=u,u=m;for(;;){if(u===e)break t;if(h===n&&++c===s&&(o=a),h===i&&++f===r&&(l=a),(m=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(pE={focusedElem:e,selectionRange:n},gx=!1,Zn=t;Zn!==null;)if(t=Zn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zn=e;else for(;Zn!==null;){switch(t=Zn,i=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++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,s=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var p=hu(n.type,s);e=r.getSnapshotBeforeUpdate(p,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(v){Nt(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)yE(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yE(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(X(163))}if(e=t.sibling,e!==null){e.return=t.return,Zn=e;break}Zn=t.return}}function a4(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ka(e,n),r&4&&Hg(5,n);break;case 1:if(Ka(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){Nt(n,n.return,a)}else{var s=hu(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Nt(n,n.return,a)}}r&64&&t4(n),r&512&&cp(n,n.return);break;case 3:if(Ka(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{uF(e,t)}catch(a){Nt(n,n.return,a)}}break;case 27:t===null&&r&4&&i4(n);case 26:case 5:Ka(e,n),t===null&&r&4&&r4(n),r&512&&cp(n,n.return);break;case 12:Ka(e,n);break;case 31:Ka(e,n),r&4&&c4(e,n);break;case 13:Ka(e,n),r&4&&u4(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=zX.bind(null,n),sQ(e,n))));break;case 22:if(r=n.memoizedState!==null||io,!r){t=t!==null&&t.memoizedState!==null||Tn,s=io;var i=Tn;io=r,(Tn=t)&&!i?Ja(e,n,(n.subtreeFlags&8772)!==0):Ka(e,n),io=s,Tn=i}break;case 30:break;default:Ka(e,n)}}function o4(e){var t=e.alternate;t!==null&&(e.alternate=null,o4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&WR(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 en=null,ts=!1;function Va(e,t,n){for(n=n.child;n!==null;)l4(e,t,n),n=n.sibling}function l4(e,t,n){if(Ns&&typeof Ns.onCommitFiberUnmount=="function")try{Ns.onCommitFiberUnmount(Pg,n)}catch{}switch(n.tag){case 26:Tn||fa(n,t),Va(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Tn||fa(n,t);var r=en,s=ts;cc(n.type)&&(en=n.stateNode,ts=!1),Va(e,t,n),hp(n.stateNode),en=r,ts=s;break;case 5:Tn||fa(n,t);case 6:if(r=en,s=ts,en=null,Va(e,t,n),en=r,ts=s,en!==null)if(ts)try{(en.nodeType===9?en.body:en.nodeName==="HTML"?en.ownerDocument.body:en).removeChild(n.stateNode)}catch(i){Nt(n,t,i)}else try{en.removeChild(n.stateNode)}catch(i){Nt(n,t,i)}break;case 18:en!==null&&(ts?(e=en,QM(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),$d(e)):QM(en,n.stateNode));break;case 4:r=en,s=ts,en=n.stateNode.containerInfo,ts=!0,Va(e,t,n),en=r,ts=s;break;case 0:case 11:case 14:case 15:Kl(2,n,t),Tn||Kl(4,n,t),Va(e,t,n);break;case 1:Tn||(fa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&n4(n,t,r)),Va(e,t,n);break;case 21:Va(e,t,n);break;case 22:Tn=(r=Tn)||n.memoizedState!==null,Va(e,t,n),Tn=r;break;default:Va(e,t,n)}}function c4(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$d(e)}catch(n){Nt(t,t.return,n)}}}function u4(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$d(e)}catch(n){Nt(t,t.return,n)}}function AX(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(X(435,e.tag))}}function dv(e,t){var n=AX(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var s=LX.bind(null,e,r);r.then(s,s)}})}function Qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r],i=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(cc(o.type)){en=o.stateNode,ts=!1;break e}break;case 5:en=o.stateNode,ts=!1;break e;case 3:case 4:en=o.stateNode.containerInfo,ts=!0;break e}o=o.return}if(en===null)throw Error(X(160));l4(i,a,s),en=null,ts=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)f4(t,e),t=t.sibling}var Ni=null;function f4(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qr(t,e),Zr(e),r&4&&(Kl(3,e,e.return),Hg(3,e),Kl(5,e,e.return));break;case 1:Qr(t,e),Zr(e),r&512&&(Tn||n===null||fa(n,n.return)),r&64&&io&&(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 s=Ni;if(Qr(t,e),Zr(e),r&512&&(Tn||n===null||fa(n,n.return)),r&4){var i=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,s=s.ownerDocument||s;t:switch(r){case"title":i=s.getElementsByTagName("title")[0],(!i||i[Lg]||i[pr]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(r),s.head.insertBefore(i,s.querySelector("head > title"))),xr(i,r,n),i[pr]=e,er(i),r=i;break e;case"link":var a=ij("link","href",s).get(r+(n.href||""));if(a){for(var o=0;o<a.length;o++)if(i=a[o],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break t}}i=s.createElement(r),xr(i,r,n),s.head.appendChild(i);break;case"meta":if(a=ij("meta","content",s).get(r+(n.content||""))){for(o=0;o<a.length;o++)if(i=a[o],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(o,1);break t}}i=s.createElement(r),xr(i,r,n),s.head.appendChild(i);break;default:throw Error(X(468,r))}i[pr]=e,er(i),r=i}e.stateNode=r}else aj(s,e.type,e.stateNode);else e.stateNode=sj(s,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?aj(s,e.type,e.stateNode):sj(s,r,e.memoizedProps)):r===null&&e.stateNode!==null&&L1(e,e.memoizedProps,n.memoizedProps)}break;case 27:Qr(t,e),Zr(e),r&512&&(Tn||n===null||fa(n,n.return)),n!==null&&r&4&&L1(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Qr(t,e),Zr(e),r&512&&(Tn||n===null||fa(n,n.return)),e.flags&32){s=e.stateNode;try{Td(s,"")}catch(p){Nt(e,e.return,p)}}r&4&&e.stateNode!=null&&(s=e.memoizedProps,L1(e,s,n!==null?n.memoizedProps:s)),r&1024&&(U1=!0);break;case 6:if(Qr(t,e),Zr(e),r&4){if(e.stateNode===null)throw Error(X(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){Nt(e,e.return,p)}}break;case 3:if(ib=null,s=Ni,Ni=hx(t.containerInfo),Qr(t,e),Ni=s,Zr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$d(t.containerInfo)}catch(p){Nt(e,e.return,p)}U1&&(U1=!1,d4(e));break;case 4:r=Ni,Ni=hx(e.stateNode.containerInfo),Qr(t,e),Zr(e),Ni=r;break;case 12:Qr(t,e),Zr(e);break;case 31:Qr(t,e),Zr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dv(e,r)));break;case 13:Qr(t,e),Zr(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(sS=Rs()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dv(e,r)));break;case 22:s=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=io,f=Tn;if(io=c||s,Tn=f||l,Qr(t,e),Tn=f,io=c,Zr(e),r&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||l||io||Tn||zc(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(i=l.stateNode,s)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{o=l.stateNode;var u=l.memoizedProps.style,h=u!=null&&u.hasOwnProperty("display")?u.display:null;o.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(p){Nt(l,l.return,p)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=s?"":l.memoizedProps}catch(p){Nt(l,l.return,p)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;s?ZM(m,!0):ZM(l.stateNode,!1)}catch(p){Nt(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,dv(e,n))));break;case 19:Qr(t,e),Zr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dv(e,r)));break;case 30:break;case 21:break;default:Qr(t,e),Zr(e)}}function Zr(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(s4(r)){n=r;break}r=r.return}if(n==null)throw Error(X(160));switch(n.tag){case 27:var s=n.stateNode,i=F1(e);ix(e,i,s);break;case 5:var a=n.stateNode;n.flags&32&&(Td(a,""),n.flags&=-33);var o=F1(e);ix(e,o,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=F1(e);oE(e,c,l);break;default:throw Error(X(161))}}catch(f){Nt(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function d4(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;d4(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)a4(e,t.alternate,t),t=t.sibling}function zc(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kl(4,t,t.return),zc(t);break;case 1:fa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&n4(t,t.return,n),zc(t);break;case 27:hp(t.stateNode);case 26:case 5:fa(t,t.return),zc(t);break;case 22:t.memoizedState===null&&zc(t);break;case 30:zc(t);break;default:zc(t)}e=e.sibling}}function Ja(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,s=e,i=t,a=i.flags;switch(i.tag){case 0:case 11:case 15:Ja(s,i,n),Hg(4,i);break;case 1:if(Ja(s,i,n),r=i,s=r.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(c){Nt(r,r.return,c)}if(r=i,s=r.updateQueue,s!==null){var o=r.stateNode;try{var l=s.shared.hiddenCallbacks;if(l!==null)for(s.shared.hiddenCallbacks=null,s=0;s<l.length;s++)cF(l[s],o)}catch(c){Nt(r,r.return,c)}}n&&a&64&&t4(i),cp(i,i.return);break;case 27:i4(i);case 26:case 5:Ja(s,i,n),n&&r===null&&a&4&&r4(i),cp(i,i.return);break;case 12:Ja(s,i,n);break;case 31:Ja(s,i,n),n&&a&4&&c4(s,i);break;case 13:Ja(s,i,n),n&&a&4&&u4(s,i);break;case 22:i.memoizedState===null&&Ja(s,i,n),cp(i,i.return);break;case 30:break;default:Ja(s,i,n)}t=t.sibling}}function RN(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&&Ug(n))}function NN(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ug(e))}function _i(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)h4(e,t,n,r),t=t.sibling}function h4(e,t,n,r){var s=t.flags;switch(t.tag){case 0:case 11:case 15:_i(e,t,n,r),s&2048&&Hg(9,t);break;case 1:_i(e,t,n,r);break;case 3:_i(e,t,n,r),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ug(e)));break;case 12:if(s&2048){_i(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,o=i.onPostCommit;typeof o=="function"&&o(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Nt(t,t.return,l)}}else _i(e,t,n,r);break;case 31:_i(e,t,n,r);break;case 13:_i(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,t.memoizedState!==null?i._visibility&2?_i(e,t,n,r):up(e,t):i._visibility&2?_i(e,t,n,r):(i._visibility|=2,kf(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),s&2048&&RN(a,t);break;case 24:_i(e,t,n,r),s&2048&&NN(t.alternate,t);break;default:_i(e,t,n,r)}}function kf(e,t,n,r,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,a=t,o=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:kf(i,a,o,l,s),Hg(8,a);break;case 23:break;case 22:var f=a.stateNode;a.memoizedState!==null?f._visibility&2?kf(i,a,o,l,s):up(i,a):(f._visibility|=2,kf(i,a,o,l,s)),s&&c&2048&&RN(a.alternate,a);break;case 24:kf(i,a,o,l,s),s&&c&2048&&NN(a.alternate,a);break;default:kf(i,a,o,l,s)}t=t.sibling}}function up(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,s=r.flags;switch(r.tag){case 22:up(n,r),s&2048&&RN(r.alternate,r);break;case 24:up(n,r),s&2048&&NN(r.alternate,r);break;default:up(n,r)}t=t.sibling}}var zm=8192;function ff(e,t,n){if(e.subtreeFlags&zm)for(e=e.child;e!==null;)m4(e,t,n),e=e.sibling}function m4(e,t,n){switch(e.tag){case 26:ff(e,t,n),e.flags&zm&&e.memoizedState!==null&&gQ(n,Ni,e.memoizedState,e.memoizedProps);break;case 5:ff(e,t,n);break;case 3:case 4:var r=Ni;Ni=hx(e.stateNode.containerInfo),ff(e,t,n),Ni=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zm,zm=16777216,ff(e,t,n),zm=r):ff(e,t,n));break;default:ff(e,t,n)}}function p4(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 hm(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zn=r,y4(r,e)}p4(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)g4(e),e=e.sibling}function g4(e){switch(e.tag){case 0:case 11:case 15:hm(e),e.flags&2048&&Kl(9,e,e.return);break;case 3:hm(e);break;case 12:hm(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,rb(e)):hm(e);break;default:hm(e)}}function rb(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zn=r,y4(r,e)}p4(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kl(8,t,t.return),rb(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,rb(t));break;default:rb(t)}e=e.sibling}}function y4(e,t){for(;Zn!==null;){var n=Zn;switch(n.tag){case 0:case 11:case 15:Kl(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:Ug(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zn=r;else e:for(n=e;Zn!==null;){r=Zn;var s=r.sibling,i=r.return;if(o4(r),r===n){Zn=null;break e}if(s!==null){s.return=i,Zn=s;break e}Zn=i}}}var OX={getCacheForType:function(e){var t=vr(An),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return vr(An).controller.signal}},MX=typeof WeakMap=="function"?WeakMap:Map,wt=0,Ut=null,ct=null,dt=0,Ct=0,bs=null,gl=!1,Sh=!1,TN=!1,Mo=0,fn=0,Gl=0,eu=0,AN=0,Cs=0,jd=0,fp=null,ns=null,lE=!1,sS=0,v4=0,ax=1/0,ox=null,Rl=null,Bn=0,Nl=null,Dd=null,wo=0,cE=0,uE=null,b4=null,dp=0,fE=null;function As(){return wt&2&&dt!==0?dt&-dt:He.T!==null?MN():N3()}function x4(){if(Cs===0)if(!(dt&536870912)||mt){var e=sv;sv<<=1,!(sv&3932160)&&(sv=262144),Cs=e}else Cs=536870912;return e=Ps.current,e!==null&&(e.flags|=32),Cs}function ls(e,t,n){(e===Ut&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)&&(Id(e,0),yl(e,dt,Cs,!1)),zg(e,n),(!(wt&2)||e!==Ut)&&(e===Ut&&(!(wt&2)&&(eu|=n),fn===4&&yl(e,dt,Cs,!1)),Ma(e))}function S4(e,t,n){if(wt&6)throw Error(X(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||$g(e,t),s=r?IX(e,t):B1(e,t,!0),i=r;do{if(s===0){Sh&&!r&&yl(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!jX(n)){s=B1(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var o=e;s=fp;var l=o.current.memoizedState.isDehydrated;if(l&&(Id(o,a).flags|=256),a=B1(o,a,!1),a!==2){if(TN&&!l){o.errorRecoveryDisabledLanes|=i,eu|=i,s=4;break e}i=ns,ns=s,i!==null&&(ns===null?ns=i:ns.push.apply(ns,i))}s=a}if(i=!1,s!==2)continue}}if(s===1){Id(e,0),yl(e,t,0,!0);break}e:{switch(r=e,i=s,i){case 0:case 1:throw Error(X(345));case 4:if((t&4194048)!==t)break;case 6:yl(r,t,Cs,!gl);break e;case 2:ns=null;break;case 3:case 5:break;default:throw Error(X(329))}if((t&62914560)===t&&(s=sS+300-Rs(),10<s)){if(yl(r,t,Cs,!gl),G0(r,0,!0)!==0)break e;wo=t,r.timeoutHandle=U4(FM.bind(null,r,n,ns,ox,lE,t,Cs,eu,jd,gl,i,"Throttled",-0,0),s);break e}FM(r,n,ns,ox,lE,t,Cs,eu,jd,gl,i,null,-0,0)}}break}while(!0);Ma(e)}function FM(e,t,n,r,s,i,a,o,l,c,f,u,h,m){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:co},m4(t,i,u);var p=(i&62914560)===i?sS-Rs():(i&4194048)===i?v4-Rs():0;if(p=yQ(u,p),p!==null){wo=i,e.cancelPendingCommit=p(BM.bind(null,e,t,i,n,r,s,a,o,l,f,u,null,h,m)),yl(e,i,a,!c);return}}BM(e,t,i,n,r,s,a,o,l)}function jX(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!Is(i(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yl(e,t,n,r){t&=~AN,t&=~eu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var s=t;0<s;){var i=31-Ts(s),a=1<<i;r[i]=-1,s&=~a}n!==0&&E3(e,n,t)}function iS(){return wt&6?!0:(qg(0),!1)}function ON(){if(ct!==null){if(Ct===0)var e=ct.return;else e=ct,uo=Fu=null,gN(e),ld=null,Bp=0,e=ct;for(;e!==null;)e4(e.alternate,e),e=e.return;ct=null}}function Id(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ZX(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wo=0,ON(),Ut=e,ct=n=xo(e.current,null),dt=t,Ct=0,bs=null,gl=!1,Sh=$g(e,t),TN=!1,jd=Cs=AN=eu=Gl=fn=0,ns=fp=null,lE=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var s=31-Ts(r),i=1<<s;t|=e[s],r&=~i}return Mo=t,X0(),n}function w4(e,t){Ze=null,He.H=qp,t===xh||t===Z0?(t=vM(),Ct=3):t===cN?(t=vM(),Ct=4):Ct=t===EN?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,bs=t,ct===null&&(fn=1,rx(e,ri(t,e.current)))}function _4(){var e=Ps.current;return e===null?!0:(dt&4194048)===dt?oi===null:(dt&62914560)===dt||dt&536870912?e===oi:!1}function k4(){var e=He.H;return He.H=qp,e===null?qp:e}function E4(){var e=He.A;return He.A=OX,e}function lx(){fn=4,gl||(dt&4194048)!==dt&&Ps.current!==null||(Sh=!0),!(Gl&134217727)&&!(eu&134217727)||Ut===null||yl(Ut,dt,Cs,!1)}function B1(e,t,n){var r=wt;wt|=2;var s=k4(),i=E4();(Ut!==e||dt!==t)&&(ox=null,Id(e,t)),t=!1;var a=fn;e:do try{if(Ct!==0&&ct!==null){var o=ct,l=bs;switch(Ct){case 8:ON(),a=6;break e;case 3:case 2:case 9:case 6:Ps.current===null&&(t=!0);var c=Ct;if(Ct=0,bs=null,Yf(e,o,l,c),n&&Sh){a=0;break e}break;default:c=Ct,Ct=0,bs=null,Yf(e,o,l,c)}}DX(),a=fn;break}catch(f){w4(e,f)}while(!0);return t&&e.shellSuspendCounter++,uo=Fu=null,wt=r,He.H=s,He.A=i,ct===null&&(Ut=null,dt=0,X0()),a}function DX(){for(;ct!==null;)C4(ct)}function IX(e,t){var n=wt;wt|=2;var r=k4(),s=E4();Ut!==e||dt!==t?(ox=null,ax=Rs()+500,Id(e,t)):Sh=$g(e,t);e:do try{if(Ct!==0&&ct!==null){t=ct;var i=bs;t:switch(Ct){case 1:Ct=0,bs=null,Yf(e,t,i,1);break;case 2:case 9:if(yM(i)){Ct=0,bs=null,UM(t);break}t=function(){Ct!==2&&Ct!==9||Ut!==e||(Ct=7),Ma(e)},i.then(t,t);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:yM(i)?(Ct=0,bs=null,UM(t)):(Ct=0,bs=null,Yf(e,t,i,7));break;case 5:var a=null;switch(ct.tag){case 26:a=ct.memoizedState;case 5:case 27:var o=ct;if(a?K4(a):o.stateNode.complete){Ct=0,bs=null;var l=o.sibling;if(l!==null)ct=l;else{var c=o.return;c!==null?(ct=c,aS(c)):ct=null}break t}}Ct=0,bs=null,Yf(e,t,i,5);break;case 6:Ct=0,bs=null,Yf(e,t,i,6);break;case 8:ON(),fn=6;break e;default:throw Error(X(462))}}PX();break}catch(f){w4(e,f)}while(!0);return uo=Fu=null,He.H=r,He.A=s,wt=n,ct!==null?0:(Ut=null,dt=0,X0(),fn)}function PX(){for(;ct!==null&&!iJ();)C4(ct)}function C4(e){var t=ZF(e.alternate,e,Mo);e.memoizedProps=e.pendingProps,t===null?aS(e):ct=t}function UM(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=DM(n,t,t.pendingProps,t.type,void 0,dt);break;case 11:t=DM(n,t,t.pendingProps,t.type.render,t.ref,dt);break;case 5:gN(t);default:e4(n,t),t=ct=eF(t,Mo),t=ZF(n,t,Mo)}e.memoizedProps=e.pendingProps,t===null?aS(e):ct=t}function Yf(e,t,n,r){uo=Fu=null,gN(t),ld=null,Bp=0;var s=t.return;try{if(kX(e,s,t,n,dt)){fn=1,rx(e,ri(n,e.current)),ct=null;return}}catch(i){if(s!==null)throw ct=s,i;fn=1,rx(e,ri(n,e.current)),ct=null;return}t.flags&32768?(mt||r===1?e=!0:Sh||dt&536870912?e=!1:(gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ps.current,r!==null&&r.tag===13&&(r.flags|=16384))),R4(t,e)):aS(t)}function aS(e){var t=e;do{if(t.flags&32768){R4(t,gl);return}e=t.return;var n=RX(t.alternate,t,Mo);if(n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);fn===0&&(fn=5)}function R4(e,t){do{var n=NX(e.alternate,e);if(n!==null){n.flags&=32767,ct=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ct=e;return}ct=e=n}while(e!==null);fn=6,ct=null}function BM(e,t,n,r,s,i,a,o,l){e.cancelPendingCommit=null;do oS();while(Bn!==0);if(wt&6)throw Error(X(327));if(t!==null){if(t===e.current)throw Error(X(177));if(i=t.lanes|t.childLanes,i|=nN,pJ(e,n,i,a,o,l),e===Ut&&(ct=Ut=null,dt=0),Dd=t,Nl=e,wo=n,cE=i,uE=s,b4=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,FX(Kb,function(){return M4(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=He.T,He.T=null,s=_t.p,_t.p=2,a=wt,wt|=4;try{TX(e,t,n)}finally{wt=a,_t.p=s,He.T=r}}Bn=1,N4(),T4(),A4()}}function N4(){if(Bn===1){Bn=0;var e=Nl,t=Dd,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=He.T,He.T=null;var r=_t.p;_t.p=2;var s=wt;wt|=4;try{f4(t,e);var i=pE,a=K3(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(a!==o&&o&&o.ownerDocument&&V3(o.ownerDocument.documentElement,o)){if(l!==null&&tN(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,h=u&&u.defaultView||window;if(h.getSelection){var m=h.getSelection(),p=o.textContent.length,v=Math.min(l.start,p),S=l.end===void 0?v:Math.min(l.end,p);!m.extend&&v>S&&(a=S,S=v,v=a);var y=uM(o,v),b=uM(o,S);if(y&&b&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==b.node||m.focusOffset!==b.offset)){var x=u.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),v>S?(m.addRange(x),m.extend(b.node,b.offset)):(x.setEnd(b.node,b.offset),m.addRange(x))}}}}for(u=[],m=o;m=m.parentNode;)m.nodeType===1&&u.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<u.length;o++){var _=u[o];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}gx=!!mE,pE=mE=null}finally{wt=s,_t.p=r,He.T=n}}e.current=t,Bn=2}}function T4(){if(Bn===2){Bn=0;var e=Nl,t=Dd,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=He.T,He.T=null;var r=_t.p;_t.p=2;var s=wt;wt|=4;try{a4(e,t.alternate,t)}finally{wt=s,_t.p=r,He.T=n}}Bn=3}}function A4(){if(Bn===4||Bn===3){Bn=0,aJ();var e=Nl,t=Dd,n=wo,r=b4;t.subtreeFlags&10256||t.flags&10256?Bn=5:(Bn=0,Dd=Nl=null,O4(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Rl=null),YR(n),t=t.stateNode,Ns&&typeof Ns.onCommitFiberRoot=="function")try{Ns.onCommitFiberRoot(Pg,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=He.T,s=_t.p,_t.p=2,He.T=null;try{for(var i=e.onRecoverableError,a=0;a<r.length;a++){var o=r[a];i(o.value,{componentStack:o.stack})}}finally{He.T=t,_t.p=s}}wo&3&&oS(),Ma(e),s=e.pendingLanes,n&261930&&s&42?e===fE?dp++:(dp=0,fE=e):dp=0,qg(0)}}function O4(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ug(t)))}function oS(){return N4(),T4(),A4(),M4()}function M4(){if(Bn!==5)return!1;var e=Nl,t=cE;cE=0;var n=YR(wo),r=He.T,s=_t.p;try{_t.p=32>n?32:n,He.T=null,n=uE,uE=null;var i=Nl,a=wo;if(Bn=0,Dd=Nl=null,wo=0,wt&6)throw Error(X(331));var o=wt;if(wt|=4,g4(i.current),h4(i,i.current,a,n),wt=o,qg(0,!1),Ns&&typeof Ns.onPostCommitFiberRoot=="function")try{Ns.onPostCommitFiberRoot(Pg,i)}catch{}return!0}finally{_t.p=s,He.T=r,O4(e,t)}}function HM(e,t,n){t=ri(n,t),t=sE(e.stateNode,t,2),e=Cl(e,t,2),e!==null&&(zg(e,2),Ma(e))}function Nt(e,t,n){if(e.tag===3)HM(e,e,n);else for(;t!==null;){if(t.tag===3){HM(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rl===null||!Rl.has(r))){e=ri(n,e),n=GF(2),r=Cl(t,n,2),r!==null&&(YF(n,r,t,e),zg(r,2),Ma(r));break}}t=t.return}}function H1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new MX;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(TN=!0,s.add(n),e=$X.bind(null,e,t,n),t.then(e,e))}function $X(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ut===e&&(dt&n)===n&&(fn===4||fn===3&&(dt&62914560)===dt&&300>Rs()-sS?!(wt&2)&&Id(e,0):AN|=n,jd===dt&&(jd=0)),Ma(e)}function j4(e,t){t===0&&(t=k3()),e=Lu(e,t),e!==null&&(zg(e,t),Ma(e))}function zX(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),j4(e,n)}function LX(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(X(314))}r!==null&&r.delete(t),j4(e,n)}function FX(e,t){return KR(e,t)}var cx=null,Ef=null,dE=!1,ux=!1,q1=!1,vl=0;function Ma(e){e!==Ef&&e.next===null&&(Ef===null?cx=Ef=e:Ef=Ef.next=e),ux=!0,dE||(dE=!0,BX())}function qg(e,t){if(!q1&&ux){q1=!0;do for(var n=!1,r=cx;r!==null;){if(e!==0){var s=r.pendingLanes;if(s===0)var i=0;else{var a=r.suspendedLanes,o=r.pingedLanes;i=(1<<31-Ts(42|e)+1)-1,i&=s&~(a&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,qM(r,i))}else i=dt,i=G0(r,r===Ut?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(i&3)||$g(r,i)||(n=!0,qM(r,i));r=r.next}while(n);q1=!1}}function UX(){D4()}function D4(){ux=dE=!1;var e=0;vl!==0&&QX()&&(e=vl);for(var t=Rs(),n=null,r=cx;r!==null;){var s=r.next,i=I4(r,t);i===0?(r.next=null,n===null?cx=s:n.next=s,s===null&&(Ef=n)):(n=r,(e!==0||i&3)&&(ux=!0)),r=s}Bn!==0&&Bn!==5||qg(e),vl!==0&&(vl=0)}function I4(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var a=31-Ts(i),o=1<<a,l=s[a];l===-1?(!(o&n)||o&r)&&(s[a]=mJ(o,t)):l<=t&&(e.expiredLanes|=o),i&=~o}if(t=Ut,n=dt,n=G0(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&v1(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$g(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&v1(r),YR(n)){case 2:case 8:n=w3;break;case 32:n=Kb;break;case 268435456:n=_3;break;default:n=Kb}return r=P4.bind(null,e),n=KR(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&v1(r),e.callbackPriority=2,e.callbackNode=null,2}function P4(e,t){if(Bn!==0&&Bn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(oS()&&e.callbackNode!==n)return null;var r=dt;return r=G0(e,e===Ut?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(S4(e,r,t),I4(e,Rs()),e.callbackNode!=null&&e.callbackNode===n?P4.bind(null,e):null)}function qM(e,t){if(oS())return null;S4(e,t,!0)}function BX(){eQ(function(){wt&6?KR(S3,UX):D4()})}function MN(){if(vl===0){var e=Ad;e===0&&(e=rv,rv<<=1,!(rv&261888)&&(rv=256)),vl=e}return vl}function VM(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yv(""+e)}function KM(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 HX(e,t,n,r,s){if(t==="submit"&&n&&n.stateNode===s){var i=VM((s[cs]||null).action),a=r.submitter;a&&(t=(t=a[cs]||null)?VM(t.formAction):a.getAttribute("formAction"),t!==null&&(i=t,a=null));var o=new Y0("action","action",null,r,s);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vl!==0){var l=a?KM(s,a):new FormData(s);nE(n,{pending:!0,data:l,method:s.method,action:i},null,l)}}else typeof i=="function"&&(o.preventDefault(),l=a?KM(s,a):new FormData(s),nE(n,{pending:!0,data:l,method:s.method,action:i},i,l))},currentTarget:s}]})}}for(var V1=0;V1<qk.length;V1++){var K1=qk[V1],qX=K1.toLowerCase(),VX=K1[0].toUpperCase()+K1.slice(1);Wi(qX,"on"+VX)}Wi(Y3,"onAnimationEnd");Wi(W3,"onAnimationIteration");Wi(J3,"onAnimationStart");Wi("dblclick","onDoubleClick");Wi("focusin","onFocus");Wi("focusout","onBlur");Wi(oX,"onTransitionRun");Wi(lX,"onTransitionStart");Wi(cX,"onTransitionCancel");Wi(X3,"onTransitionEnd");Nd("onMouseEnter",["mouseout","mouseover"]);Nd("onMouseLeave",["mouseout","mouseover"]);Nd("onPointerEnter",["pointerout","pointerover"]);Nd("onPointerLeave",["pointerout","pointerover"]);Pu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pu("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vp="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(" "),KX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vp));function $4(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==i&&s.isPropagationStopped())break e;i=o,s.currentTarget=c;try{i(s)}catch(f){Yb(f)}s.currentTarget=null,i=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==i&&s.isPropagationStopped())break e;i=o,s.currentTarget=c;try{i(s)}catch(f){Yb(f)}s.currentTarget=null,i=l}}}}function lt(e,t){var n=t[Pk];n===void 0&&(n=t[Pk]=new Set);var r=e+"__bubble";n.has(r)||(z4(t,e,2,!1),n.add(r))}function G1(e,t,n){var r=0;t&&(r|=4),z4(n,e,r,t)}var hv="_reactListening"+Math.random().toString(36).slice(2);function jN(e){if(!e[hv]){e[hv]=!0,T3.forEach(function(n){n!=="selectionchange"&&(KX.has(n)||G1(n,!1,e),G1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hv]||(t[hv]=!0,G1("selectionchange",!1,t))}}function z4(e,t,n,r){switch(X4(t)){case 2:var s=xQ;break;case 8:s=SQ;break;default:s=$N}n=s.bind(null,t,n,e),s=void 0,!Uk||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Y1(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===s)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===s)return;a=a.return}for(;o!==null;){if(a=Lf(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=i=a;continue e}o=o.parentNode}}r=r.return}$3(function(){var c=i,f=XR(n),u=[];e:{var h=Q3.get(e);if(h!==void 0){var m=Y0,p=e;switch(e){case"keypress":if(Jv(n)===0)break e;case"keydown":case"keyup":m=LJ;break;case"focusin":p="focus",m=_1;break;case"focusout":p="blur",m=_1;break;case"beforeblur":case"afterblur":m=_1;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":m=eM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=RJ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=BJ;break;case Y3:case W3:case J3:m=AJ;break;case X3:m=qJ;break;case"scroll":case"scrollend":m=EJ;break;case"wheel":m=KJ;break;case"copy":case"cut":case"paste":m=MJ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=nM;break;case"toggle":case"beforetoggle":m=YJ}var v=(t&4)!==0,S=!v&&(e==="scroll"||e==="scrollend"),y=v?h!==null?h+"Capture":null:h;v=[];for(var b=c,x;b!==null;){var _=b;if(x=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||x===null||y===null||(_=$p(b,y),_!=null&&v.push(Kp(b,_,x))),S)break;b=b.return}0<v.length&&(h=new m(h,p,null,n,f),u.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Fk&&(p=n.relatedTarget||n.fromElement)&&(Lf(p)||p[yh]))break e;if((m||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?Lf(p):null,p!==null&&(S=Ig(p),v=p.tag,p!==S||v!==5&&v!==27&&v!==6)&&(p=null)):(m=null,p=c),m!==p)){if(v=eM,_="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=nM,_="onPointerLeave",y="onPointerEnter",b="pointer"),S=m==null?h:Pm(m),x=p==null?h:Pm(p),h=new v(_,b+"leave",m,n,f),h.target=S,h.relatedTarget=x,_=null,Lf(f)===c&&(v=new v(y,b+"enter",p,n,f),v.target=x,v.relatedTarget=S,_=v),S=_,m&&p)t:{for(v=GX,y=m,b=p,x=0,_=y;_;_=v(_))x++;_=0;for(var C=b;C;C=v(C))_++;for(;0<x-_;)y=v(y),x--;for(;0<_-x;)b=v(b),_--;for(;x--;){if(y===b||b!==null&&y===b.alternate){v=y;break t}y=v(y),b=v(b)}v=null}else v=null;m!==null&&GM(u,h,m,v,!1),p!==null&&S!==null&&GM(u,S,p,v,!0)}}e:{if(h=c?Pm(c):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var E=aM;else if(iM(h))if(H3)E=sX;else{E=nX;var k=tX}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&JR(c.elementType)&&(E=aM):E=rX;if(E&&(E=E(e,c))){B3(u,E,n,f);break e}k&&k(e,h,c),e==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&Lk(h,"number",h.value)}switch(k=c?Pm(c):window,e){case"focusin":(iM(k)||k.contentEditable==="true")&&(Bf=k,Bk=c,rp=null);break;case"focusout":rp=Bk=Bf=null;break;case"mousedown":Hk=!0;break;case"contextmenu":case"mouseup":case"dragend":Hk=!1,fM(u,n,f);break;case"selectionchange":if(aX)break;case"keydown":case"keyup":fM(u,n,f)}var A;if(eN)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Uf?F3(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(L3&&n.locale!=="ko"&&(Uf||I!=="onCompositionStart"?I==="onCompositionEnd"&&Uf&&(A=z3()):(pl=f,QR="value"in pl?pl.value:pl.textContent,Uf=!0)),k=fx(c,I),0<k.length&&(I=new tM(I,e,null,n,f),u.push({event:I,listeners:k}),A?I.data=A:(A=U3(n),A!==null&&(I.data=A)))),(A=JJ?XJ(e,n):QJ(e,n))&&(I=fx(c,"onBeforeInput"),0<I.length&&(k=new tM("onBeforeInput","beforeinput",null,n,f),u.push({event:k,listeners:I}),k.data=A)),HX(u,e,c,n,f)}$4(u,t)})}function Kp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fx(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=$p(e,n),s!=null&&r.unshift(Kp(e,s,i)),s=$p(e,t),s!=null&&r.push(Kp(e,s,i))),e.tag===3)return r;e=e.return}return[]}function GX(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,s){for(var i=t._reactName,a=[];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,s?(c=$p(n,i),c!=null&&a.unshift(Kp(n,c,l))):s||(c=$p(n,i),c!=null&&a.push(Kp(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var YX=/\r\n?/g,WX=/\u0000|\uFFFD/g;function YM(e){return(typeof e=="string"?e:""+e).replace(YX,`
49
+ `).replace(WX,"")}function L4(e,t){return t=YM(t),YM(e)===t}function It(e,t,n,r,s,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Td(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Td(e,""+r);break;case"className":av(e,"class",r);break;case"tabIndex":av(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":av(e,n,r);break;case"style":P3(e,r,i);break;case"data":if(t!=="object"){av(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=Yv(""+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 i=="function"&&(n==="formAction"?(t!=="input"&&It(e,t,"name",s.name,s,null),It(e,t,"formEncType",s.formEncType,s,null),It(e,t,"formMethod",s.formMethod,s,null),It(e,t,"formTarget",s.formTarget,s,null)):(It(e,t,"encType",s.encType,s,null),It(e,t,"method",s.method,s,null),It(e,t,"target",s.target,s,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yv(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=co);break;case"onScroll":r!=null&&lt("scroll",e);break;case"onScrollEnd":r!=null&&lt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(X(61));if(n=r.__html,n!=null){if(s.children!=null)throw Error(X(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=Yv(""+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":lt("beforetoggle",e),lt("toggle",e),Gv(e,"popover",r);break;case"xlinkActuate":Ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ha(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ha(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ha(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ha(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Gv(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=_J.get(n)||n,Gv(e,n,r))}}function hE(e,t,n,r,s,i){switch(n){case"style":P3(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(X(61));if(n=r.__html,n!=null){if(s.children!=null)throw Error(X(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Td(e,r):(typeof r=="number"||typeof r=="bigint")&&Td(e,""+r);break;case"onScroll":r!=null&&lt("scroll",e);break;case"onScrollEnd":r!=null&&lt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=co);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!A3.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),i=e[cs]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof r=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,s);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Gv(e,n,r)}}}function xr(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",e),lt("load",e);var r=!1,s=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":r=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(X(137,t));default:It(e,t,i,a,n,null)}}s&&It(e,t,"srcSet",n.srcSet,n,null),r&&It(e,t,"src",n.src,n,null);return;case"input":lt("invalid",e);var o=i=a=s=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"name":s=f;break;case"type":a=f;break;case"checked":l=f;break;case"defaultChecked":c=f;break;case"value":i=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(X(137,t));break;default:It(e,t,r,f,n,null)}}j3(e,i,o,l,c,a,s,!1);return;case"select":lt("invalid",e),r=a=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":a=o;break;case"multiple":r=o;default:It(e,t,s,o,n,null)}t=i,n=a,e.multiple=!!r,t!=null?id(e,!!r,t,!1):n!=null&&id(e,!!r,n,!0);return;case"textarea":lt("invalid",e),i=s=r=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":r=o;break;case"defaultValue":s=o;break;case"children":i=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(X(91));break;default:It(e,t,a,o,n,null)}I3(e,r,s,i);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:It(e,t,l,r,n,null)}return;case"dialog":lt("beforetoggle",e),lt("toggle",e),lt("cancel",e),lt("close",e);break;case"iframe":case"object":lt("load",e);break;case"video":case"audio":for(r=0;r<Vp.length;r++)lt(Vp[r],e);break;case"image":lt("error",e),lt("load",e);break;case"details":lt("toggle",e);break;case"embed":case"source":case"link":lt("error",e),lt("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(X(137,t));default:It(e,t,c,r,n,null)}return;default:if(JR(t)){for(f in n)n.hasOwnProperty(f)&&(r=n[f],r!==void 0&&hE(e,t,f,r,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(r=n[o],r!=null&&It(e,t,o,r,n,null))}function JX(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 s=null,i=null,a=null,o=null,l=null,c=null,f=null;for(m in n){var u=n[m];if(n.hasOwnProperty(m)&&u!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(m)||It(e,t,m,null,r,u)}}for(var h in r){var m=r[h];if(u=n[h],r.hasOwnProperty(h)&&(m!=null||u!=null))switch(h){case"type":i=m;break;case"name":s=m;break;case"checked":c=m;break;case"defaultChecked":f=m;break;case"value":a=m;break;case"defaultValue":o=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(X(137,t));break;default:m!==u&&It(e,t,h,m,r,u)}}zk(e,a,o,l,c,f,i,s);return;case"select":m=a=o=h=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":m=l;default:r.hasOwnProperty(i)||It(e,t,i,null,r,l)}for(s in r)if(i=r[s],l=n[s],r.hasOwnProperty(s)&&(i!=null||l!=null))switch(s){case"value":h=i;break;case"defaultValue":o=i;break;case"multiple":a=i;default:i!==l&&It(e,t,s,i,r,l)}t=o,n=a,r=m,h!=null?id(e,!!n,h,!1):!!r!=!!n&&(t!=null?id(e,!!n,t,!0):id(e,!!n,n?[]:"",!1));return;case"textarea":m=h=null;for(o in n)if(s=n[o],n.hasOwnProperty(o)&&s!=null&&!r.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:It(e,t,o,null,r,s)}for(a in r)if(s=r[a],i=n[a],r.hasOwnProperty(a)&&(s!=null||i!=null))switch(a){case"value":h=s;break;case"defaultValue":m=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(X(91));break;default:s!==i&&It(e,t,a,s,r,i)}D3(e,h,m);return;case"option":for(var p in n)if(h=n[p],n.hasOwnProperty(p)&&h!=null&&!r.hasOwnProperty(p))switch(p){case"selected":e.selected=!1;break;default:It(e,t,p,null,r,h)}for(l in r)if(h=r[l],m=n[l],r.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null))switch(l){case"selected":e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:It(e,t,l,h,r,m)}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 v in n)h=n[v],n.hasOwnProperty(v)&&h!=null&&!r.hasOwnProperty(v)&&It(e,t,v,null,r,h);for(c in r)if(h=r[c],m=n[c],r.hasOwnProperty(c)&&h!==m&&(h!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(X(137,t));break;default:It(e,t,c,h,r,m)}return;default:if(JR(t)){for(var S in n)h=n[S],n.hasOwnProperty(S)&&h!==void 0&&!r.hasOwnProperty(S)&&hE(e,t,S,void 0,r,h);for(f in r)h=r[f],m=n[f],!r.hasOwnProperty(f)||h===m||h===void 0&&m===void 0||hE(e,t,f,h,r,m);return}}for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!=null&&!r.hasOwnProperty(y)&&It(e,t,y,null,r,h);for(u in r)h=r[u],m=n[u],!r.hasOwnProperty(u)||h===m||h==null&&m==null||It(e,t,u,h,r,m)}function WM(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function XX(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var s=n[r],i=s.transferSize,a=s.initiatorType,o=s.duration;if(i&&o&&WM(a)){for(a=0,o=s.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&&WM(u)&&(l=l.responseEnd,a+=f*(l<o?1:(o-c)/(l-c)))}if(--r,t+=8*(i+a)/(s.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 mE=null,pE=null;function dx(e){return e.nodeType===9?e:e.ownerDocument}function JM(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 F4(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 gE(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 W1=null;function QX(){var e=window.event;return e&&e.type==="popstate"?e===W1?!1:(W1=e,!0):(W1=null,!1)}var U4=typeof setTimeout=="function"?setTimeout:void 0,ZX=typeof clearTimeout=="function"?clearTimeout:void 0,XM=typeof Promise=="function"?Promise:void 0,eQ=typeof queueMicrotask=="function"?queueMicrotask:typeof XM<"u"?function(e){return XM.resolve(null).then(e).catch(tQ)}:U4;function tQ(e){setTimeout(function(){throw e})}function cc(e){return e==="head"}function QM(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(s),$d(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")hp(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,hp(n);for(var i=n.firstChild;i;){var a=i.nextSibling,o=i.nodeName;i[Lg]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&hp(e.ownerDocument.body);n=s}while(n);$d(t)}function ZM(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 yE(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":yE(n),WR(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function nQ(e,t,n,r){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Lg])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=li(e.nextSibling),e===null)break}return null}function rQ(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=li(e.nextSibling),e===null))return null;return e}function B4(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=li(e.nextSibling),e===null))return null;return e}function vE(e){return e.data==="$?"||e.data==="$~"}function bE(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function sQ(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 li(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 xE=null;function ej(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return li(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function tj(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 H4(e,t,n){switch(t=dx(n),e){case"html":if(e=t.documentElement,!e)throw Error(X(452));return e;case"head":if(e=t.head,!e)throw Error(X(453));return e;case"body":if(e=t.body,!e)throw Error(X(454));return e;default:throw Error(X(451))}}function hp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);WR(e)}var di=new Map,nj=new Set;function hx(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Uo=_t.d;_t.d={f:iQ,r:aQ,D:oQ,C:lQ,L:cQ,m:uQ,X:dQ,S:fQ,M:hQ};function iQ(){var e=Uo.f(),t=iS();return e||t}function aQ(e){var t=vh(e);t!==null&&t.tag===5&&t.type==="form"?PF(t):Uo.r(e)}var wh=typeof document>"u"?null:document;function q4(e,t,n){var r=wh;if(r&&typeof t=="string"&&t){var s=ni(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),nj.has(s)||(nj.add(s),e={rel:e,crossOrigin:n,href:t},r.querySelector(s)===null&&(t=r.createElement("link"),xr(t,"link",e),er(t),r.head.appendChild(t)))}}function oQ(e){Uo.D(e),q4("dns-prefetch",e,null)}function lQ(e,t){Uo.C(e,t),q4("preconnect",e,t)}function cQ(e,t,n){Uo.L(e,t,n);var r=wh;if(r&&e&&t){var s='link[rel="preload"][as="'+ni(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+ni(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+ni(n.imageSizes)+'"]')):s+='[href="'+ni(e)+'"]';var i=s;switch(t){case"style":i=Pd(e);break;case"script":i=_h(e)}di.has(i)||(e=Zt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),di.set(i,e),r.querySelector(s)!==null||t==="style"&&r.querySelector(Vg(i))||t==="script"&&r.querySelector(Kg(i))||(t=r.createElement("link"),xr(t,"link",e),er(t),r.head.appendChild(t)))}}function uQ(e,t){Uo.m(e,t);var n=wh;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+ni(r)+'"][href="'+ni(e)+'"]',i=s;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_h(e)}if(!di.has(i)&&(e=Zt({rel:"modulepreload",href:e},t),di.set(i,e),n.querySelector(s)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Kg(i)))return}r=n.createElement("link"),xr(r,"link",e),er(r),n.head.appendChild(r)}}}function fQ(e,t,n){Uo.S(e,t,n);var r=wh;if(r&&e){var s=sd(r).hoistableStyles,i=Pd(e);t=t||"default";var a=s.get(i);if(!a){var o={loading:0,preload:null};if(a=r.querySelector(Vg(i)))o.loading=5;else{e=Zt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=di.get(i))&&DN(e,n);var l=a=r.createElement("link");er(l),xr(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,sb(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:o},s.set(i,a)}}}function dQ(e,t){Uo.X(e,t);var n=wh;if(n&&e){var r=sd(n).hoistableScripts,s=_h(e),i=r.get(s);i||(i=n.querySelector(Kg(s)),i||(e=Zt({src:e,async:!0},t),(t=di.get(s))&&IN(e,t),i=n.createElement("script"),er(i),xr(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(s,i))}}function hQ(e,t){Uo.M(e,t);var n=wh;if(n&&e){var r=sd(n).hoistableScripts,s=_h(e),i=r.get(s);i||(i=n.querySelector(Kg(s)),i||(e=Zt({src:e,async:!0,type:"module"},t),(t=di.get(s))&&IN(e,t),i=n.createElement("script"),er(i),xr(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(s,i))}}function rj(e,t,n,r){var s=(s=_l.current)?hx(s):null;if(!s)throw Error(X(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Pd(n.href),n=sd(s).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=Pd(n.href);var i=sd(s).hoistableStyles,a=i.get(e);if(a||(s=s.ownerDocument||s,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,a),(i=s.querySelector(Vg(e)))&&!i._p&&(a.instance=i,a.state.loading=5),di.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},di.set(e,n),i||mQ(s,e,n,a.state))),t&&r===null)throw Error(X(528,""));return a}if(t&&r!==null)throw Error(X(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_h(n),n=sd(s).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(X(444,e))}}function Pd(e){return'href="'+ni(e)+'"'}function Vg(e){return'link[rel="stylesheet"]['+e+"]"}function V4(e){return Zt({},e,{"data-precedence":e.precedence,precedence:null})}function mQ(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}),xr(t,"link",n),er(t),e.head.appendChild(t))}function _h(e){return'[src="'+ni(e)+'"]'}function Kg(e){return"script[async]"+e}function sj(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ni(n.href)+'"]');if(r)return t.instance=r,er(r),r;var s=Zt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),er(r),xr(r,"style",s),sb(r,n.precedence,e),t.instance=r;case"stylesheet":s=Pd(n.href);var i=e.querySelector(Vg(s));if(i)return t.state.loading|=4,t.instance=i,er(i),i;r=V4(n),(s=di.get(s))&&DN(r,s),i=(e.ownerDocument||e).createElement("link"),er(i);var a=i;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),xr(i,"link",r),t.state.loading|=4,sb(i,n.precedence,e),t.instance=i;case"script":return i=_h(n.src),(s=e.querySelector(Kg(i)))?(t.instance=s,er(s),s):(r=n,(s=di.get(i))&&(r=Zt({},n),IN(r,s)),e=e.ownerDocument||e,s=e.createElement("script"),er(s),xr(s,"link",r),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(X(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,sb(r,n.precedence,e));return t.instance}function sb(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=r.length?r[r.length-1]:null,i=s,a=0;a<r.length;a++){var o=r[a];if(o.dataset.precedence===t)i=o;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function DN(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function IN(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ib=null;function ij(e,t,n){if(ib===null){var r=new Map,s=ib=new Map;s.set(n,r)}else s=ib,r=s.get(n),r||(r=new Map,s.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var i=n[s];if(!(i[Lg]||i[pr]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(t)||"";a=e+a;var o=r.get(a);o?o.push(i):r.set(a,[i])}}return r}function aj(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function pQ(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 K4(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function gQ(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 s=Pd(r.href),i=t.querySelector(Vg(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=mx.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,er(i);return}i=t.ownerDocument||t,r=V4(r),(s=di.get(s))&&DN(r,s),i=i.createElement("link"),er(i);var a=i;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),xr(i,"link",r),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=mx.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var J1=0;function yQ(e,t){return e.stylesheets&&e.count===0&&ab(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ab(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&J1===0&&(J1=62500*XX());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ab(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>J1?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(s)}}:null}function mx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ab(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var px=null;function ab(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,px=new Map,t.forEach(vQ,e),px=null,mx.call(e))}function vQ(e,t){if(!(t.state.loading&4)){var n=px.get(e);if(n)var r=n.get(null);else{n=new Map,px.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var a=s[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}s=t.instance,a=s.getAttribute("data-precedence"),i=n.get(a)||r,i===r&&n.set(null,s),n.set(a,s),this.count++,r=mx.bind(this),s.addEventListener("load",r),s.addEventListener("error",r),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Gp={$$typeof:lo,Provider:null,Consumer:null,_currentValue:Jc,_currentValue2:Jc,_threadCount:0};function bQ(e,t,n,r,s,i,a,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=b1(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=b1(0),this.hiddenUpdates=b1(null),this.identifierPrefix=r,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function G4(e,t,n,r,s,i,a,o,l,c,f,u){return e=new bQ(e,t,n,a,l,c,f,u,o),t=1,i===!0&&(t|=24),i=ks(3,null,null,t),e.current=i,i.stateNode=e,t=oN(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},uN(i),e}function Y4(e){return e?(e=Vf,e):Vf}function W4(e,t,n,r,s,i){s=Y4(s),r.context===null?r.context=s:r.pendingContext=s,r=El(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=Cl(e,r,t),n!==null&&(ls(n,e,t),ip(n,e,t))}function oj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function PN(e,t){oj(e,t),(e=e.alternate)&&oj(e,t)}function J4(e){if(e.tag===13||e.tag===31){var t=Lu(e,67108864);t!==null&&ls(t,e,67108864),PN(e,67108864)}}function lj(e){if(e.tag===13||e.tag===31){var t=As();t=GR(t);var n=Lu(e,t);n!==null&&ls(n,e,t),PN(e,t)}}var gx=!0;function xQ(e,t,n,r){var s=He.T;He.T=null;var i=_t.p;try{_t.p=2,$N(e,t,n,r)}finally{_t.p=i,He.T=s}}function SQ(e,t,n,r){var s=He.T;He.T=null;var i=_t.p;try{_t.p=8,$N(e,t,n,r)}finally{_t.p=i,He.T=s}}function $N(e,t,n,r){if(gx){var s=SE(r);if(s===null)Y1(e,t,r,yx,n),cj(e,r);else if(_Q(s,e,t,n,r))r.stopPropagation();else if(cj(e,r),t&4&&-1<wQ.indexOf(e)){for(;s!==null;){var i=vh(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=Pc(i.pendingLanes);if(a!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-Ts(a);o.entanglements[1]|=l,a&=~l}Ma(i),!(wt&6)&&(ax=Rs()+500,qg(0))}}break;case 31:case 13:o=Lu(i,2),o!==null&&ls(o,i,2),iS(),PN(i,2)}if(i=SE(r),i===null&&Y1(e,t,r,yx,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Y1(e,t,r,null,n)}}function SE(e){return e=XR(e),zN(e)}var yx=null;function zN(e){if(yx=null,e=Lf(e),e!==null){var t=Ig(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g3(t),e!==null)return e;e=null}else if(n===31){if(e=y3(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 yx=e,null}function X4(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(oJ()){case S3:return 2;case w3:return 8;case Kb:case lJ:return 32;case _3:return 268435456;default:return 32}default:return 32}}var wE=!1,Tl=null,Al=null,Ol=null,Yp=new Map,Wp=new Map,fl=[],wQ="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 cj(e,t){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":Yp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wp.delete(t.pointerId)}}function mm(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=vh(t),t!==null&&J4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function _Q(e,t,n,r,s){switch(t){case"focusin":return Tl=mm(Tl,e,t,n,r,s),!0;case"dragenter":return Al=mm(Al,e,t,n,r,s),!0;case"mouseover":return Ol=mm(Ol,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Yp.set(i,mm(Yp.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Wp.set(i,mm(Wp.get(i)||null,e,t,n,r,s)),!0}return!1}function Q4(e){var t=Lf(e.target);if(t!==null){var n=Ig(t);if(n!==null){if(t=n.tag,t===13){if(t=g3(n),t!==null){e.blockedOn=t,GO(e.priority,function(){lj(n)});return}}else if(t===31){if(t=y3(n),t!==null){e.blockedOn=t,GO(e.priority,function(){lj(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 ob(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=SE(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fk=r,n.target.dispatchEvent(r),Fk=null}else return t=vh(n),t!==null&&J4(t),e.blockedOn=n,!1;t.shift()}return!0}function uj(e,t,n){ob(e)&&n.delete(t)}function kQ(){wE=!1,Tl!==null&&ob(Tl)&&(Tl=null),Al!==null&&ob(Al)&&(Al=null),Ol!==null&&ob(Ol)&&(Ol=null),Yp.forEach(uj),Wp.forEach(uj)}function mv(e,t){e.blockedOn===t&&(e.blockedOn=null,wE||(wE=!0,qn.unstable_scheduleCallback(qn.unstable_NormalPriority,kQ)))}var pv=null;function fj(e){pv!==e&&(pv=e,qn.unstable_scheduleCallback(qn.unstable_NormalPriority,function(){pv===e&&(pv=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],s=e[t+2];if(typeof r!="function"){if(zN(r||n)===null)continue;break}var i=vh(n);i!==null&&(e.splice(t,3),t-=3,nE(i,{pending:!0,data:s,method:n.method,action:r},r,s))}}))}function $d(e){function t(l){return mv(l,e)}Tl!==null&&mv(Tl,e),Al!==null&&mv(Al,e),Ol!==null&&mv(Ol,e),Yp.forEach(t),Wp.forEach(t);for(var n=0;n<fl.length;n++){var r=fl[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<fl.length&&(n=fl[0],n.blockedOn===null);)Q4(n),n.blockedOn===null&&fl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var s=n[r],i=n[r+1],a=s[cs]||null;if(typeof i=="function")a||fj(n);else if(a){var o=null;if(i&&i.hasAttribute("formAction")){if(s=i,a=i[cs]||null)o=a.formAction;else if(zN(s)!==null)continue}else o=a.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),fj(n)}}}function Z4(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return s=a})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,s=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),s!==null&&(s(),s=null)}}}function LN(e){this._internalRoot=e}lS.prototype.render=LN.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));var n=t.current,r=As();W4(n,r,e,t,null,null)};lS.prototype.unmount=LN.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;W4(e.current,2,null,e,null,null),iS(),t[yh]=null}};function lS(e){this._internalRoot=e}lS.prototype.unstable_scheduleHydration=function(e){if(e){var t=N3();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fl.length&&t!==0&&t<fl[n].priority;n++);fl.splice(n,0,e),n===0&&Q4(e)}};var dj=m3.version;if(dj!=="19.2.4")throw Error(X(527,dj,"19.2.4"));_t.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=eJ(t),e=e!==null?v3(e):null,e=e===null?null:e.stateNode,e};var EQ={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:He,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gv.isDisabled&&gv.supportsFiber)try{Pg=gv.inject(EQ),Ns=gv}catch{}}V0.createRoot=function(e,t){if(!p3(e))throw Error(X(299));var n=!1,r="",s=qF,i=VF,a=KF;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=G4(e,1,!1,null,null,n,r,null,s,i,a,Z4),e[yh]=t.current,jN(e),new LN(t)};V0.hydrateRoot=function(e,t,n){if(!p3(e))throw Error(X(299));var r=!1,s="",i=qF,a=VF,o=KF,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=G4(e,1,!0,t,n??null,r,s,l,i,a,o,Z4),t.context=Y4(null),n=t.current,r=As(),r=GR(r),s=El(r),s.callback=null,Cl(n,s,r),n=r,t.current.lanes=n,zg(t,n),Ma(t),e[yh]=t.current,jN(e),new lS(t)};V0.version="19.2.4";function e5(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e5)}catch(e){console.error(e)}}e5(),o3.exports=V0;var CQ=o3.exports;const RQ=Dg(CQ);/**
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 t5=e=>{throw TypeError(e)},NQ=(e,t,n)=>t.has(e)||t5("Cannot "+n),X1=(e,t,n)=>(NQ(e,t,"read from private field"),n?n.call(e):t.get(e)),TQ=(e,t,n)=>t.has(e)?t5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),hj="popstate";function AQ(e={}){function t(r,s){let{pathname:i,search:a,hash:o}=r.location;return Jp("",{pathname:i,search:a,hash:o},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:ka(s)}return MQ(t,n,null,e)}function it(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function OQ(){return Math.random().toString(36).substring(2,10)}function mj(e,t){return{usr:e.state,key:e.key,idx:t}}function Jp(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?uc(t):t,state:n,key:t&&t.key||r||OQ()}}function ka({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 uc(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 MQ(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,o="POP",l=null,c=f();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function f(){return(a.state||{idx:null}).idx}function u(){o="POP";let S=f(),y=S==null?null:S-c;c=S,l&&l({action:o,location:v.location,delta:y})}function h(S,y){o="PUSH";let b=Jp(v.location,S,y);c=f()+1;let x=mj(b,c),_=v.createHref(b);try{a.pushState(x,"",_)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(_)}i&&l&&l({action:o,location:v.location,delta:1})}function m(S,y){o="REPLACE";let b=Jp(v.location,S,y);c=f();let x=mj(b,c),_=v.createHref(b);a.replaceState(x,"",_),i&&l&&l({action:o,location:v.location,delta:0})}function p(S){return n5(S)}let v={get action(){return o},get location(){return e(s,a)},listen(S){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(hj,u),l=S,()=>{s.removeEventListener(hj,u),l=null}},createHref(S){return t(s,S)},createURL:p,encodeLocation(S){let y=p(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(S){return a.go(S)}};return v}function n5(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),it(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ka(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Lm,pj=class{constructor(e){if(TQ(this,Lm,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(X1(this,Lm).has(e))return X1(this,Lm).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){X1(this,Lm).set(e,t)}};Lm=new WeakMap;var jQ=new Set(["lazy","caseSensitive","path","id","index","children"]);function DQ(e){return jQ.has(e)}var IQ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function PQ(e){return IQ.has(e)}function $Q(e){return e.index===!0}function Xp(e,t,n=[],r={},s=!1){return e.map((i,a)=>{let o=[...n,String(a)],l=typeof i.id=="string"?i.id:o.join("-");if(it(i.index!==!0||!i.children,"Cannot specify children on an index route"),it(s||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),$Q(i)){let c={...i,id:l};return r[l]=gj(c,t(c)),c}else{let c={...i,id:l,children:void 0};return r[l]=gj(c,t(c)),i.children&&(c.children=Xp(i.children,t,o,r,s)),c}})}function gj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function dl(e,t,n="/"){return Fm(e,t,n,!1)}function Fm(e,t,n,r){let s=typeof t=="string"?uc(t):t,i=hi(s.pathname||"/",n);if(i==null)return null;let a=s5(e);zQ(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let c=WQ(i);o=GQ(a[l],c,r)}return o}function r5(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function s5(e,t=[],n=[],r="",s=!1){let i=(a,o,l=s,c)=>{let f={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;it(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=ba([r,f.relativePath]),h=n.concat(f);a.children&&a.children.length>0&&(it(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),s5(a.children,t,h,u,l)),!(a.path==null&&!a.index)&&t.push({path:u,score:VQ(u,a.index),routesMeta:h})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of i5(a.path))i(a,o,!0,c)}),t}function i5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=i5(r.join("/")),o=[];return o.push(...a.map(l=>l===""?i:[i,l].join("/"))),s&&o.push(...a),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function zQ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var LQ=/^:[\w-]+$/,FQ=3,UQ=2,BQ=1,HQ=10,qQ=-2,yj=e=>e==="*";function VQ(e,t){let n=e.split("/"),r=n.length;return n.some(yj)&&(r+=qQ),t&&(r+=UQ),n.filter(s=>!yj(s)).reduce((s,i)=>s+(LQ.test(i)?FQ:i===""?BQ:HQ),r)}function KQ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function GQ(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],c=o===r.length-1,f=i==="/"?t:t.slice(i.length)||"/",u=vx({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),h=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=vx({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(s,u.params),a.push({params:s,pathname:ba([i,u.pathname]),pathnameBase:QQ(ba([i,u.pathnameBase])),route:h}),u.pathnameBase!=="/"&&(i=ba([i,u.pathnameBase]))}return a}function vx(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=YQ(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:u},h)=>{if(f==="*"){let p=o[h]||"";a=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const m=o[h];return u&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function YQ(e,t=!1,n=!0){pn(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function WQ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pn(!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 hi(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 JQ({basename:e,pathname:t}){return t==="/"?e:ba([e,t])}var a5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FN=e=>a5.test(e);function XQ(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?uc(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=vj(n.substring(1),"/"):i=vj(n,t)):i=t,{pathname:i,search:ZQ(r),hash:eZ(s)}}function vj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Q1(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 o5(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cS(e){let t=o5(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function uS(e,t,n,r=!1){let s;typeof e=="string"?s=uc(e):(s={...e},it(!s.pathname||!s.pathname.includes("?"),Q1("?","pathname","search",s)),it(!s.pathname||!s.pathname.includes("#"),Q1("#","pathname","hash",s)),it(!s.search||!s.search.includes("#"),Q1("#","search","hash",s)));let i=e===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=n;else{let u=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),u-=1;s.pathname=h.join("/")}o=u>=0?t[u]:"/"}let l=XQ(s,o),c=a&&a!=="/"&&a.endsWith("/"),f=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var ba=e=>e.join("/").replace(/\/\/+/g,"/"),QQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ZQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Gg=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 Qp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yg(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var l5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function c5(e,t){let n=e;if(typeof n!="string"||!a5.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(l5)try{let i=new URL(window.location.href),a=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=hi(a.pathname,t);a.origin===i.origin&&o!=null?n=o+a.search+a.hash:s=!0}catch{pn(!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:s,to:n}}var bl=Symbol("Uninstrumented");function tZ(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(i){let a=Object.keys(n);for(let o of a)i[o]&&n[o].push(i[o])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=Wf(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(i=>{let a=s[i],o=n[`lazy.${i}`];if(typeof a=="function"&&o.length>0){let l=Wf(o,a,()=>{});l&&(r.lazy=Object.assign(r.lazy||{},{[i]:l}))}})}return["loader","action"].forEach(s=>{let i=t[s];if(typeof i=="function"&&n[s].length>0){let a=i[bl]??i,o=Wf(n[s],a,(...l)=>bj(l[0]));o&&(s==="loader"&&a.hydrate===!0&&(o.hydrate=!0),o[bl]=a,r[s]=o)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[bl]??s,a=Wf(n.middleware,i,(...o)=>bj(o[0]));return a?(a[bl]=i,a):s})),r}function nZ(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let i=Object.keys(s);for(let a of i)s[a]&&n[a].push(s[a])}})),n.navigate.length>0){let r=e.navigate[bl]??e.navigate,s=Wf(n.navigate,r,(...i)=>{let[a,o]=i;return{to:typeof a=="number"||typeof a=="string"?a:a?ka(a):".",...xj(e,o??{})}});s&&(s[bl]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[bl]??e.fetch,s=Wf(n.fetch,r,(...i)=>{let[a,,o,l]=i;return{href:o??".",fetcherKey:a,...xj(e,l??{})}});s&&(s[bl]=r,e.fetch=s)}return e}function Wf(e,t,n){return e.length===0?null:async(...r)=>{let s=await u5(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function u5(e,t,n,r){let s=e[r],i;if(s){let a,o=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=u5(e,t,n,r-1),i=await a,it(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(o,t)}catch(l){console.error("An instrumentation function threw an error:",l)}a||await o(),await a}else try{i={type:"success",value:await n()}}catch(a){i={type:"error",value:a}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function bj(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:rZ(t),params:{...r},unstable_pattern:s,context:sZ(n)}}function xj(e,t){return{currentUrl:ka(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 rZ(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function sZ(e){if(aZ(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var iZ=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function aZ(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")===iZ}var f5=["POST","PUT","PATCH","DELETE"],oZ=new Set(f5),lZ=["GET",...f5],cZ=new Set(lZ),d5=new Set([301,302,303,307,308]),uZ=new Set([307,308]),Z1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},pm={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),h5="remix-router-transitions",m5=Symbol("ResetLoaderData");function hZ(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";it(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||dZ,i=s;if(e.unstable_instrumentations){let P=e.unstable_instrumentations;i=L=>({...s(L),...tZ(P.map(H=>H.route).filter(Boolean),L)})}let a={},o=Xp(e.routes,i,void 0,a),l,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let f=e.dataStrategy||vZ,u={...e.future},h=null,m=new Set,p=null,v=null,S=null,y=e.hydrationData!=null,b=dl(o,e.history.location,c),x=!1,_=null,C;if(b==null&&!e.patchRoutesOnNavigation){let P=Ws(404,{pathname:e.history.location.pathname}),{matches:L,route:H}=yv(o);C=!0,b=L,_={[H.id]:P}}else if(b&&!e.hydrationData&&Wn(b,o,e.history.location.pathname).active&&(b=null),b)if(b.some(P=>P.route.lazy))C=!1;else if(!b.some(P=>UN(P.route)))C=!0;else{let P=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;if(L){let H=b.findIndex(Z=>L[Z.route.id]!==void 0);C=b.slice(0,H+1).every(Z=>!kE(Z.route,P,L))}else C=b.every(H=>!kE(H.route,P,L))}else{C=!1,b=[];let P=Wn(null,o,e.history.location.pathname);P.active&&P.matches&&(x=!0,b=P.matches)}let E,k={historyAction:e.history.action,location:e.history.location,matches:b,initialized:C,navigation:Z1,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||_,fetchers:new Map,blockers:new Map},A="POP",I=null,R=!1,$,U=!1,K=new Map,W=null,B=!1,j=!1,F=new Set,z=new Map,V=0,O=-1,me=new Map,q=new Set,N=new Map,J=new Map,Y=new Set,le=new Map,Q,ae=null;function te(){if(h=e.history.listen(({action:P,location:L,delta:H})=>{if(Q){Q(),Q=void 0;return}pn(le.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=Yy({currentLocation:k.location,nextLocation:L,historyAction:P});if(Z&&H!=null){let ue=new Promise(Te=>{Q=Te});e.history.go(H*-1),af(Z,{state:"blocked",location:L,proceed(){af(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),ue.then(()=>e.history.go(H))},reset(){let Te=new Map(k.blockers);Te.set(Z,pm),ye({blockers:Te})}}),I==null||I.resolve(),I=null;return}return Pn(P,L)}),n){PZ(t,K);let P=()=>$Z(t,K);t.addEventListener("pagehide",P),W=()=>t.removeEventListener("pagehide",P)}return k.initialized||Pn("POP",k.location,{initialHydration:!0}),E}function fe(){h&&h(),W&&W(),m.clear(),$&&$.abort(),k.fetchers.forEach((P,L)=>Yn(L)),k.blockers.forEach((P,L)=>wi(L))}function Ce(P){return m.add(P),()=>m.delete(P)}function ye(P,L={}){P.matches&&(P.matches=P.matches.map(ue=>{let Te=a[ue.route.id],Pe=ue.route;return Pe.element!==Te.element||Pe.errorElement!==Te.errorElement||Pe.hydrateFallbackElement!==Te.hydrateFallbackElement?{...ue,route:Te}:ue})),k={...k,...P};let H=[],Z=[];k.fetchers.forEach((ue,Te)=>{ue.state==="idle"&&(Y.has(Te)?H.push(Te):Z.push(Te))}),Y.forEach(ue=>{!k.fetchers.has(ue)&&!z.has(ue)&&H.push(ue)}),[...m].forEach(ue=>ue(k,{deletedFetchers:H,newErrors:P.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),H.forEach(ue=>Yn(ue)),Z.forEach(ue=>k.fetchers.delete(ue))}function xt(P,L,{flushSync:H}={}){var Qe,Ae;let Z=k.actionData!=null&&k.navigation.formMethod!=null&&kr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((Qe=P.state)==null?void 0:Qe._isRedirect)!==!0,ue;L.actionData?Object.keys(L.actionData).length>0?ue=L.actionData:ue=null:Z?ue=k.actionData:ue=null;let Te=L.loaderData?Aj(k.loaderData,L.loaderData,L.matches||[],L.errors):k.loaderData,Pe=k.blockers;Pe.size>0&&(Pe=new Map(Pe),Pe.forEach((et,gt)=>Pe.set(gt,pm)));let Se=B?!1:zn(P,L.matches||k.matches),ke=R===!0||k.navigation.formMethod!=null&&kr(k.navigation.formMethod)&&((Ae=P.state)==null?void 0:Ae._isRedirect)!==!0;l&&(o=l,l=void 0),B||A==="POP"||(A==="PUSH"?e.history.push(P,P.state):A==="REPLACE"&&e.history.replace(P,P.state));let Me;if(A==="POP"){let et=K.get(k.location.pathname);et&&et.has(P.pathname)?Me={currentLocation:k.location,nextLocation:P}:K.has(P.pathname)&&(Me={currentLocation:P,nextLocation:k.location})}else if(U){let et=K.get(k.location.pathname);et?et.add(P.pathname):(et=new Set([P.pathname]),K.set(k.location.pathname,et)),Me={currentLocation:k.location,nextLocation:P}}ye({...L,actionData:ue,loaderData:Te,historyAction:A,location:P,initialized:!0,navigation:Z1,revalidation:"idle",restoreScrollPosition:Se,preventScrollReset:ke,blockers:Pe},{viewTransitionOpts:Me,flushSync:H===!0}),A="POP",R=!1,U=!1,B=!1,j=!1,I==null||I.resolve(),I=null,ae==null||ae.resolve(),ae=null}async function rn(P,L){if(I==null||I.resolve(),I=null,typeof P=="number"){I||(I=Dj());let gt=I.promise;return e.history.go(P),gt}let H=_E(k.location,k.matches,c,P,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:Z,submission:ue,error:Te}=Sj(!1,H,L),Pe=k.location,Se=Jp(k.location,Z,L&&L.state);Se={...Se,...e.history.encodeLocation(Se)};let ke=L&&L.replace!=null?L.replace:void 0,Me="PUSH";ke===!0?Me="REPLACE":ke===!1||ue!=null&&kr(ue.formMethod)&&ue.formAction===k.location.pathname+k.location.search&&(Me="REPLACE");let Qe=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Ae=(L&&L.flushSync)===!0,et=Yy({currentLocation:Pe,nextLocation:Se,historyAction:Me});if(et){af(et,{state:"blocked",location:Se,proceed(){af(et,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),rn(P,L)},reset(){let gt=new Map(k.blockers);gt.set(et,pm),ye({blockers:gt})}});return}await Pn(Me,Se,{submission:ue,pendingError:Te,preventScrollReset:Qe,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Ae,callSiteDefaultShouldRevalidate:L&&L.unstable_defaultShouldRevalidate})}function Bs(){ae||(ae=Dj()),ce(),ye({revalidation:"loading"});let P=ae.promise;return k.navigation.state==="submitting"?P:k.navigation.state==="idle"?(Pn(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),P):(Pn(A||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:U===!0}),P)}async function Pn(P,L,H){$&&$.abort(),$=null,A=P,B=(H&&H.startUninterruptedRevalidation)===!0,_n(k.location,k.matches),R=(H&&H.preventScrollReset)===!0,U=(H&&H.enableViewTransition)===!0;let Z=l||o,ue=H&&H.overrideNavigation,Te=H!=null&&H.initialHydration&&k.matches&&k.matches.length>0&&!x?k.matches:dl(Z,L,c),Pe=(H&&H.flushSync)===!0;if(Te&&k.initialized&&!j&&CZ(k.location,L)&&!(H&&H.submission&&kr(H.submission.formMethod))){xt(L,{matches:Te},{flushSync:Pe});return}let Se=Wn(Te,Z,L.pathname);if(Se.active&&Se.matches&&(Te=Se.matches),!Te){let{error:Jn,notFoundMatches:Pr,route:jt}=of(L.pathname);xt(L,{matches:Pr,loaderData:{},errors:{[jt.id]:Jn}},{flushSync:Pe});return}$=new AbortController;let ke=Cf(e.history,L,$.signal,H&&H.submission),Me=e.getContext?await e.getContext():new pj,Qe;if(H&&H.pendingError)Qe=[hl(Te).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&kr(H.submission.formMethod)){let Jn=await Sr(ke,L,H.submission,Te,Me,Se.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:Pe});if(Jn.shortCircuited)return;if(Jn.pendingActionResult){let[Pr,jt]=Jn.pendingActionResult;if(xs(jt)&&Qp(jt.error)&&jt.error.status===404){$=null,xt(L,{matches:Jn.matches,loaderData:{},errors:{[Pr]:jt.error}});return}}Te=Jn.matches||Te,Qe=Jn.pendingActionResult,ue=e_(L,H.submission),Pe=!1,Se.active=!1,ke=Cf(e.history,ke.url,ke.signal)}let{shortCircuited:Ae,matches:et,loaderData:gt,errors:or}=await Wo(ke,L,Te,Me,Se.active,ue,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,Pe,Qe,H&&H.callSiteDefaultShouldRevalidate);Ae||($=null,xt(L,{matches:et||Te,...Oj(Qe),loaderData:gt,errors:or}))}async function Sr(P,L,H,Z,ue,Te,Pe,Se={}){ce();let ke=DZ(L,H);if(ye({navigation:ke},{flushSync:Se.flushSync===!0}),Te){let Ae=await Ba(Z,L.pathname,P.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){if(Ae.partialMatches.length===0){let{matches:gt,route:or}=yv(o);return{matches:gt,pendingActionResult:[or.id,{type:"error",error:Ae.error}]}}let et=hl(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,pendingActionResult:[et,{type:"error",error:Ae.error}]}}else if(Ae.matches)Z=Ae.matches;else{let{notFoundMatches:et,error:gt,route:or}=of(L.pathname);return{matches:et,pendingActionResult:[or.id,{type:"error",error:gt}]}}}let Me,Qe=lb(Z,L);if(!Qe.route.action&&!Qe.route.lazy)Me={type:"error",error:Ws(405,{method:P.method,pathname:L.pathname,routeId:Qe.route.id})};else{let Ae=fd(i,a,P,Z,Qe,Pe?[]:r,ue),et=await Ua(P,Ae,ue,null);if(Me=et[Qe.route.id],!Me){for(let gt of Z)if(et[gt.route.id]){Me=et[gt.route.id];break}}if(P.signal.aborted)return{shortCircuited:!0}}if(qc(Me)){let Ae;return Se&&Se.replace!=null?Ae=Se.replace:Ae=Rj(Me.response.headers.get("Location"),new URL(P.url),c,e.history)===k.location.pathname+k.location.search,await bi(P,Me,!0,{submission:H,replace:Ae}),{shortCircuited:!0}}if(xs(Me)){let Ae=hl(Z,Qe.route.id);return(Se&&Se.replace)!==!0&&(A="PUSH"),{matches:Z,pendingActionResult:[Ae.route.id,Me,Qe.route.id]}}return{matches:Z,pendingActionResult:[Qe.route.id,Me]}}async function Wo(P,L,H,Z,ue,Te,Pe,Se,ke,Me,Qe,Ae,et){let gt=Te||e_(L,Pe),or=Pe||Se||jj(gt),Jn=!B&&!Me;if(ue){if(Jn){let _r=wn(Ae);ye({navigation:gt,..._r!==void 0?{actionData:_r}:{}},{flushSync:Qe})}let bt=await Ba(H,L.pathname,P.signal);if(bt.type==="aborted")return{shortCircuited:!0};if(bt.type==="error"){if(bt.partialMatches.length===0){let{matches:cf,route:Rc}=yv(o);return{matches:cf,loaderData:{},errors:{[Rc.id]:bt.error}}}let _r=hl(bt.partialMatches).route.id;return{matches:bt.partialMatches,loaderData:{},errors:{[_r]:bt.error}}}else if(bt.matches)H=bt.matches;else{let{error:_r,notFoundMatches:cf,route:Rc}=of(L.pathname);return{matches:cf,loaderData:{},errors:{[Rc.id]:_r}}}}let Pr=l||o,{dsMatches:jt,revalidatingFetchers:Hs}=wj(P,Z,i,a,e.history,k,H,or,L,Me?[]:r,Me===!0,j,F,Y,N,q,Pr,c,e.patchRoutesOnNavigation!=null,Ae,et);if(O=++V,!e.dataStrategy&&!jt.some(bt=>bt.shouldLoad)&&!jt.some(bt=>bt.route.middleware&&bt.route.middleware.length>0)&&Hs.length===0){let bt=$n();return xt(L,{matches:H,loaderData:{},errors:Ae&&xs(Ae[1])?{[Ae[0]]:Ae[1].error}:null,...Oj(Ae),...bt?{fetchers:new Map(k.fetchers)}:{}},{flushSync:Qe}),{shortCircuited:!0}}if(Jn){let bt={};if(!ue){bt.navigation=gt;let _r=wn(Ae);_r!==void 0&&(bt.actionData=_r)}Hs.length>0&&(bt.fetchers=sf(Hs)),ye(bt,{flushSync:Qe})}Hs.forEach(bt=>{ar(bt.key),bt.controller&&z.set(bt.key,bt.controller)});let Ec=()=>Hs.forEach(bt=>ar(bt.key));$&&$.signal.addEventListener("abort",Ec);let{loaderResults:am,fetcherResults:Jo}=await G(jt,Hs,P,Z);if(P.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Ec),Hs.forEach(bt=>z.delete(bt.key));let ta=vv(am);if(ta)return await bi(P,ta.result,!0,{replace:ke}),{shortCircuited:!0};if(ta=vv(Jo),ta)return q.add(ta.key),await bi(P,ta.result,!0,{replace:ke}),{shortCircuited:!0};let{loaderData:d1,errors:om}=Tj(k,H,am,Ae,Hs,Jo);Me&&k.errors&&(om={...k.errors,...om});let Cc=$n(),Jy=Si(O),Xy=Cc||Jy||Hs.length>0;return{matches:H,loaderData:d1,errors:om,...Xy?{fetchers:new Map(k.fetchers)}:{}}}function wn(P){if(P&&!xs(P[1]))return{[P[0]]:P[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function sf(P){return P.forEach(L=>{let H=k.fetchers.get(L.key),Z=gm(void 0,H?H.data:void 0);k.fetchers.set(L.key,Z)}),new Map(k.fetchers)}async function im(P,L,H,Z){ar(P);let ue=(Z&&Z.flushSync)===!0,Te=l||o,Pe=_E(k.location,k.matches,c,H,L,Z==null?void 0:Z.relative),Se=dl(Te,Pe,c),ke=Wn(Se,Te,Pe);if(ke.active&&ke.matches&&(Se=ke.matches),!Se){Be(P,L,Ws(404,{pathname:Pe}),{flushSync:ue});return}let{path:Me,submission:Qe,error:Ae}=Sj(!0,Pe,Z);if(Ae){Be(P,L,Ae,{flushSync:ue});return}let et=e.getContext?await e.getContext():new pj,gt=(Z&&Z.preventScrollReset)===!0;if(Qe&&kr(Qe.formMethod)){await ir(P,L,Me,Se,et,ke.active,ue,gt,Qe,Z&&Z.unstable_defaultShouldRevalidate);return}N.set(P,{routeId:L,path:Me}),await ea(P,L,Me,Se,et,ke.active,ue,gt,Qe)}async function ir(P,L,H,Z,ue,Te,Pe,Se,ke,Me){ce(),N.delete(P);let Qe=k.fetchers.get(P);Ne(P,IZ(ke,Qe),{flushSync:Pe});let Ae=new AbortController,et=Cf(e.history,H,Ae.signal,ke);if(Te){let on=await Ba(Z,new URL(et.url).pathname,et.signal,P);if(on.type==="aborted")return;if(on.type==="error"){Be(P,L,on.error,{flushSync:Pe});return}else if(on.matches)Z=on.matches;else{Be(P,L,Ws(404,{pathname:H}),{flushSync:Pe});return}}let gt=lb(Z,H);if(!gt.route.action&&!gt.route.lazy){let on=Ws(405,{method:ke.formMethod,pathname:H,routeId:L});Be(P,L,on,{flushSync:Pe});return}z.set(P,Ae);let or=V,Jn=fd(i,a,et,Z,gt,r,ue),Pr=await Ua(et,Jn,ue,P),jt=Pr[gt.route.id];if(!jt){for(let on of Jn)if(Pr[on.route.id]){jt=Pr[on.route.id];break}}if(et.signal.aborted){z.get(P)===Ae&&z.delete(P);return}if(Y.has(P)){if(qc(jt)||xs(jt)){Ne(P,Xa(void 0));return}}else{if(qc(jt))if(z.delete(P),O>or){Ne(P,Xa(void 0));return}else return q.add(P),Ne(P,gm(ke)),bi(et,jt,!1,{fetcherSubmission:ke,preventScrollReset:Se});if(xs(jt)){Be(P,L,jt.error);return}}let Hs=k.navigation.location||k.location,Ec=Cf(e.history,Hs,Ae.signal),am=l||o,Jo=k.navigation.state!=="idle"?dl(am,k.navigation.location,c):k.matches;it(Jo,"Didn't find any matches after fetcher action");let ta=++V;me.set(P,ta);let d1=gm(ke,jt.data);k.fetchers.set(P,d1);let{dsMatches:om,revalidatingFetchers:Cc}=wj(Ec,ue,i,a,e.history,k,Jo,ke,Hs,r,!1,j,F,Y,N,q,am,c,e.patchRoutesOnNavigation!=null,[gt.route.id,jt],Me);Cc.filter(on=>on.key!==P).forEach(on=>{let Qy=on.key,PO=k.fetchers.get(Qy),NW=gm(void 0,PO?PO.data:void 0);k.fetchers.set(Qy,NW),ar(Qy),on.controller&&z.set(Qy,on.controller)}),ye({fetchers:new Map(k.fetchers)});let Jy=()=>Cc.forEach(on=>ar(on.key));Ae.signal.addEventListener("abort",Jy);let{loaderResults:Xy,fetcherResults:bt}=await G(om,Cc,Ec,ue);if(Ae.signal.aborted)return;if(Ae.signal.removeEventListener("abort",Jy),me.delete(P),z.delete(P),Cc.forEach(on=>z.delete(on.key)),k.fetchers.has(P)){let on=Xa(jt.data);k.fetchers.set(P,on)}let _r=vv(Xy);if(_r)return bi(Ec,_r.result,!1,{preventScrollReset:Se});if(_r=vv(bt),_r)return q.add(_r.key),bi(Ec,_r.result,!1,{preventScrollReset:Se});let{loaderData:cf,errors:Rc}=Tj(k,Jo,Xy,void 0,Cc,bt);Si(ta),k.navigation.state==="loading"&&ta>O?(it(A,"Expected pending action"),$&&$.abort(),xt(k.navigation.location,{matches:Jo,loaderData:cf,errors:Rc,fetchers:new Map(k.fetchers)})):(ye({errors:Rc,loaderData:Aj(k.loaderData,cf,Jo,Rc),fetchers:new Map(k.fetchers)}),j=!1)}async function ea(P,L,H,Z,ue,Te,Pe,Se,ke){let Me=k.fetchers.get(P);Ne(P,gm(ke,Me?Me.data:void 0),{flushSync:Pe});let Qe=new AbortController,Ae=Cf(e.history,H,Qe.signal);if(Te){let jt=await Ba(Z,new URL(Ae.url).pathname,Ae.signal,P);if(jt.type==="aborted")return;if(jt.type==="error"){Be(P,L,jt.error,{flushSync:Pe});return}else if(jt.matches)Z=jt.matches;else{Be(P,L,Ws(404,{pathname:H}),{flushSync:Pe});return}}let et=lb(Z,H);z.set(P,Qe);let gt=V,or=fd(i,a,Ae,Z,et,r,ue),Pr=(await Ua(Ae,or,ue,P))[et.route.id];if(z.get(P)===Qe&&z.delete(P),!Ae.signal.aborted){if(Y.has(P)){Ne(P,Xa(void 0));return}if(qc(Pr))if(O>gt){Ne(P,Xa(void 0));return}else{q.add(P),await bi(Ae,Pr,!1,{preventScrollReset:Se});return}if(xs(Pr)){Be(P,L,Pr.error);return}Ne(P,Xa(Pr.data))}}async function bi(P,L,H,{submission:Z,fetcherSubmission:ue,preventScrollReset:Te,replace:Pe}={}){H||(I==null||I.resolve(),I=null),L.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Se=L.response.headers.get("Location");it(Se,"Expected a Location header on the redirect Response"),Se=Rj(Se,new URL(P.url),c,e.history);let ke=Jp(k.location,Se,{_isRedirect:!0});if(n){let or=!1;if(L.response.headers.has("X-Remix-Reload-Document"))or=!0;else if(FN(Se)){const Jn=n5(Se,!0);or=Jn.origin!==t.location.origin||hi(Jn.pathname,c)==null}if(or){Pe?t.location.replace(Se):t.location.assign(Se);return}}$=null;let Me=Pe===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Qe,formAction:Ae,formEncType:et}=k.navigation;!Z&&!ue&&Qe&&Ae&&et&&(Z=jj(k.navigation));let gt=Z||ue;if(uZ.has(L.response.status)&&gt&&kr(gt.formMethod))await Pn(Me,ke,{submission:{...gt,formAction:Se},preventScrollReset:Te||R,enableViewTransition:H?U:void 0});else{let or=e_(ke,Z);await Pn(Me,ke,{overrideNavigation:or,fetcherSubmission:ue,preventScrollReset:Te||R,enableViewTransition:H?U:void 0})}}async function Ua(P,L,H,Z){var Pe;let ue,Te={};try{ue=await xZ(f,P,L,Z,H,!1)}catch(Se){return L.filter(ke=>ke.shouldLoad).forEach(ke=>{Te[ke.route.id]={type:"error",error:Se}}),Te}if(P.signal.aborted)return Te;if(!kr(P.method))for(let Se of L){if(((Pe=ue[Se.route.id])==null?void 0:Pe.type)==="error")break;!ue.hasOwnProperty(Se.route.id)&&!k.loaderData.hasOwnProperty(Se.route.id)&&(!k.errors||!k.errors.hasOwnProperty(Se.route.id))&&Se.shouldCallHandler()&&(ue[Se.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Se.route.id}`)})}for(let[Se,ke]of Object.entries(ue))if(AZ(ke)){let Me=ke.result;Te[Se]={type:"redirect",response:kZ(Me,P,Se,L,c)}}else Te[Se]=await _Z(ke);return Te}async function G(P,L,H,Z){let ue=Ua(H,P,Z,null),Te=Promise.all(L.map(async ke=>{if(ke.matches&&ke.match&&ke.request&&ke.controller){let Qe=(await Ua(ke.request,ke.matches,Z,ke.key))[ke.match.route.id];return{[ke.key]:Qe}}else return Promise.resolve({[ke.key]:{type:"error",error:Ws(404,{pathname:ke.path})}})})),Pe=await ue,Se=(await Te).reduce((ke,Me)=>Object.assign(ke,Me),{});return{loaderResults:Pe,fetcherResults:Se}}function ce(){j=!0,N.forEach((P,L)=>{z.has(L)&&F.add(L),ar(L)})}function Ne(P,L,H={}){k.fetchers.set(P,L),ye({fetchers:new Map(k.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Be(P,L,H,Z={}){let ue=hl(k.matches,L);Yn(P),ye({errors:{[ue.route.id]:H},fetchers:new Map(k.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function ot(P){return J.set(P,(J.get(P)||0)+1),Y.has(P)&&Y.delete(P),k.fetchers.get(P)||fZ}function wr(P,L){ar(P,L==null?void 0:L.reason),Ne(P,Xa(null))}function Yn(P){let L=k.fetchers.get(P);z.has(P)&&!(L&&L.state==="loading"&&me.has(P))&&ar(P),N.delete(P),me.delete(P),q.delete(P),Y.delete(P),F.delete(P),k.fetchers.delete(P)}function gs(P){let L=(J.get(P)||0)-1;L<=0?(J.delete(P),Y.add(P)):J.set(P,L),ye({fetchers:new Map(k.fetchers)})}function ar(P,L){let H=z.get(P);H&&(H.abort(L),z.delete(P))}function xi(P){for(let L of P){let H=ot(L),Z=Xa(H.data);k.fetchers.set(L,Z)}}function $n(){let P=[],L=!1;for(let H of q){let Z=k.fetchers.get(H);it(Z,`Expected fetcher: ${H}`),Z.state==="loading"&&(q.delete(H),P.push(H),L=!0)}return xi(P),L}function Si(P){let L=[];for(let[H,Z]of me)if(Z<P){let ue=k.fetchers.get(H);it(ue,`Expected fetcher: ${H}`),ue.state==="loading"&&(ar(H),me.delete(H),L.push(H))}return xi(L),L.length>0}function Ir(P,L){let H=k.blockers.get(P)||pm;return le.get(P)!==L&&le.set(P,L),H}function wi(P){k.blockers.delete(P),le.delete(P)}function af(P,L){let H=k.blockers.get(P)||pm;it(H.state==="unblocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="proceeding"||H.state==="blocked"&&L.state==="unblocked"||H.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${L.state}`);let Z=new Map(k.blockers);Z.set(P,L),ye({blockers:Z})}function Yy({currentLocation:P,nextLocation:L,historyAction:H}){if(le.size===0)return;le.size>1&&pn(!1,"A router only supports one blocker at a time");let Z=Array.from(le.entries()),[ue,Te]=Z[Z.length-1],Pe=k.blockers.get(ue);if(!(Pe&&Pe.state==="proceeding")&&Te({currentLocation:P,nextLocation:L,historyAction:H}))return ue}function of(P){let L=Ws(404,{pathname:P}),H=l||o,{matches:Z,route:ue}=yv(H);return{notFoundMatches:Z,route:ue,error:L}}function Wy(P,L,H){if(p=P,S=L,v=H||null,!y&&k.navigation===Z1){y=!0;let Z=zn(k.location,k.matches);Z!=null&&ye({restoreScrollPosition:Z})}return()=>{p=null,S=null,v=null}}function Ye(P,L){return v&&v(P,L.map(Z=>r5(Z,k.loaderData)))||P.key}function _n(P,L){if(p&&S){let H=Ye(P,L);p[H]=S()}}function zn(P,L){if(p){let H=Ye(P,L),Z=p[H];if(typeof Z=="number")return Z}return null}function Wn(P,L,H){if(e.patchRoutesOnNavigation)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:Fm(L,H,c,!0)}}else return{active:!0,matches:Fm(L,H,c,!0)||[]};return{active:!1,matches:null}}async function Ba(P,L,H,Z){if(!e.patchRoutesOnNavigation)return{type:"success",matches:P};let ue=P;for(;;){let Te=l==null,Pe=l||o,Se=a;try{await e.patchRoutesOnNavigation({signal:H,path:L,matches:ue,fetcherKey:Z,patch:(Qe,Ae)=>{H.aborted||_j(Qe,Ae,Pe,Se,i,!1)}})}catch(Qe){return{type:"error",error:Qe,partialMatches:ue}}finally{Te&&!H.aborted&&(o=[...o])}if(H.aborted)return{type:"aborted"};let ke=dl(Pe,L,c),Me=null;if(ke){if(Object.keys(ke[0].params).length===0)return{type:"success",matches:ke};if(Me=Fm(Pe,L,c,!0),!(Me&&ue.length<Me.length&&kn(ue,Me.slice(0,ue.length))))return{type:"success",matches:ke}}if(Me||(Me=Fm(Pe,L,c,!0)),!Me||kn(ue,Me))return{type:"success",matches:null};ue=Me}}function kn(P,L){return P.length===L.length&&P.every((H,Z)=>H.route.id===L[Z].route.id)}function Xr(P){a={},l=Xp(P,i,void 0,a)}function lf(P,L,H=!1){let Z=l==null;_j(P,L,l||o,a,i,H),Z&&(o=[...o],ye({}))}return E={get basename(){return c},get future(){return u},get state(){return k},get routes(){return o},get window(){return t},initialize:te,subscribe:Ce,enableScrollRestoration:Wy,navigate:rn,fetch:im,revalidate:Bs,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:ot,resetFetcher:wr,deleteFetcher:gs,dispose:fe,getBlocker:Ir,deleteBlocker:wi,patchRoutes:lf,_internalFetchControllers:z,_internalSetRoutes:Xr,_internalSetStateDoNotUseOrYouWillBreakYourApp(P){ye(P)}},e.unstable_instrumentations&&(E=nZ(E,e.unstable_instrumentations.map(P=>P.router).filter(Boolean))),E}function mZ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function _E(e,t,n,r,s,i){let a,o;if(s){a=[];for(let c of t)if(a.push(c),c.route.id===s){o=c;break}}else a=t,o=t[t.length-1];let l=uS(r||".",cS(a),hi(e.pathname,n)||e.pathname,i==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&o){let c=HN(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(m=>m).forEach(m=>f.append("index",m));let h=f.toString();l.search=h?`?${h}`:""}}return n!=="/"&&(l.pathname=JQ({basename:n,pathname:l.pathname})),ka(l)}function Sj(e,t,n){if(!n||!mZ(n))return{path:t};if(n.formMethod&&!jZ(n.formMethod))return{path:t,error:Ws(405,{method:n.formMethod})};let r=()=>({path:t,error:Ws(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),a=x5(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!kr(i))return r();let u=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((h,[m,p])=>`${h}${m}=${p}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:u}}}else if(n.formEncType==="application/json"){if(!kr(i))return r();try{let u=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:u,text:void 0}}}catch{return r()}}}it(typeof FormData=="function","FormData is not available in this environment");let o,l;if(n.formData)o=CE(n.formData),l=n.formData;else if(n.body instanceof FormData)o=CE(n.body),l=n.body;else if(n.body instanceof URLSearchParams)o=n.body,l=Nj(o);else if(n.body==null)o=new URLSearchParams,l=new FormData;else try{o=new URLSearchParams(n.body),l=Nj(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(kr(c.formMethod))return{path:t,submission:c};let f=uc(t);return e&&f.search&&HN(f.search)&&o.append("index",""),f.search=`?${o}`,{path:ka(f),submission:c}}function wj(e,t,n,r,s,i,a,o,l,c,f,u,h,m,p,v,S,y,b,x,_){var B;let C=x?xs(x[1])?x[1].error:x[1].data:void 0,E=s.createURL(i.location),k=s.createURL(l),A;if(f&&i.errors){let j=Object.keys(i.errors)[0];A=a.findIndex(F=>F.route.id===j)}else if(x&&xs(x[1])){let j=x[0];A=a.findIndex(F=>F.route.id===j)-1}let I=x?x[1].statusCode:void 0,R=I&&I>=400,$={currentUrl:E,currentParams:((B=i.matches[0])==null?void 0:B.params)||{},nextUrl:k,nextParams:a[0].params,...o,actionResult:C,actionStatus:I},U=Yg(a),K=a.map((j,F)=>{let{route:z}=j,V=null;if(A!=null&&F>A?V=!1:z.lazy?V=!0:UN(z)?f?V=kE(z,i.loaderData,i.errors):pZ(i.loaderData,i.matches[F],j)&&(V=!0):V=!1,V!==null)return EE(n,r,e,U,j,c,t,V);let O=!1;typeof _=="boolean"?O=_:R?O=!1:(u||E.pathname+E.search===k.pathname+k.search||E.search!==k.search||gZ(i.matches[F],j))&&(O=!0);let me={...$,defaultShouldRevalidate:O},q=mp(j,me);return EE(n,r,e,U,j,c,t,q,me,_)}),W=[];return p.forEach((j,F)=>{if(f||!a.some(Y=>Y.route.id===j.routeId)||m.has(F))return;let z=i.fetchers.get(F),V=z&&z.state!=="idle"&&z.data===void 0,O=dl(S,j.path,y);if(!O){if(b&&V)return;W.push({key:F,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(v.has(F))return;let me=lb(O,j.path),q=new AbortController,N=Cf(s,j.path,q.signal),J=null;if(h.has(F))h.delete(F),J=fd(n,r,N,O,me,c,t);else if(V)u&&(J=fd(n,r,N,O,me,c,t));else{let Y;typeof _=="boolean"?Y=_:R?Y=!1:Y=u;let le={...$,defaultShouldRevalidate:Y};mp(me,le)&&(J=fd(n,r,N,O,me,c,t,le))}J&&W.push({key:F,routeId:j.routeId,path:j.path,matches:J,match:me,request:N,controller:q})}),{dsMatches:K,revalidatingFetchers:W}}function UN(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function kE(e,t,n){if(e.lazy)return!0;if(!UN(e))return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function pZ(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function gZ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function mp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _j(e,t,n,r,s,i){let a;if(e){let c=r[e];it(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),a=c.children}else a=n;let o=[],l=[];if(t.forEach(c=>{let f=a.find(u=>p5(c,u));f?l.push({existingRoute:f,newRoute:c}):o.push(c)}),o.length>0){let c=Xp(o,s,[e||"_","patch",String((a==null?void 0:a.length)||"0")],r);a.push(...c)}if(i&&l.length>0)for(let c=0;c<l.length;c++){let{existingRoute:f,newRoute:u}=l[c],h=f,[m]=Xp([u],s,[],{},!0);Object.assign(h,{element:m.element?m.element:h.element,errorElement:m.errorElement?m.errorElement:h.errorElement,hydrateFallbackElement:m.hydrateFallbackElement?m.hydrateFallbackElement:h.hydrateFallbackElement})}}function p5(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 s;return(s=t.children)==null?void 0:s.some(i=>p5(n,i))}):!1}var kj=new WeakMap,g5=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(it(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let a=kj.get(s);a||(a={},kj.set(s,a));let o=a[e];if(o)return o;let l=(async()=>{let c=DQ(e),u=s[e]!==void 0&&e!=="hasErrorBoundary";if(c)pn(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(u)pn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let h=await i();h!=null&&(Object.assign(s,{[e]:h}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(h=>h===void 0)&&(s.lazy=void 0))})();return a[e]=l,l},Ej=new WeakMap;function yZ(e,t,n,r,s){let i=n[e.id];if(it(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=Ej.get(i);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let u=(async()=>{it(typeof e.lazy=="function","No lazy route function found");let h=await e.lazy(),m={};for(let p in h){let v=h[p];if(v===void 0)continue;let S=PQ(p),b=i[p]!==void 0&&p!=="hasErrorBoundary";S?pn(!S,"Route property "+p+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?pn(!b,`Route "${i.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.`):m[p]=v}Object.assign(i,m),Object.assign(i,{...r(i),lazy:void 0})})();return Ej.set(i,u),u.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:u}}let a=Object.keys(e.lazy),o=[],l;for(let f of a){if(s&&s.includes(f))continue;let u=g5({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 Cj(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,i)=>{n[t[i].route.id]=s}),n}async function vZ(e){return e.matches.some(t=>t.route.middleware)?y5(e,()=>Cj(e)):Cj(e)}function y5(e,t){return bZ(e,t,r=>{if(MZ(r))throw r;return r},NZ,n);function n(r,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:r}}));{let{matches:a}=e,o=Math.min(Math.max(a.findIndex(c=>c.route.id===s),0),Math.max(a.findIndex(c=>c.shouldCallHandler()),0)),l=hl(a,a[o].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function bZ(e,t,n,r,s){let{matches:i,request:a,params:o,context:l,unstable_pattern:c}=e,f=i.flatMap(h=>h.route.middleware?h.route.middleware.map(m=>[h.route.id,m]):[]);return await v5({request:a,params:o,context:l,unstable_pattern:c},f,t,n,r,s)}async function v5(e,t,n,r,s,i,a=0){let{request:o}=e;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let l=t[a];if(!l)return await n();let[c,f]=l,u,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await v5(e,t,n,r,s,i,a+1)},u.value}catch(m){return u={value:await i(m,c,u)},u.value}};try{let m=await f(e,h),p=m!=null?r(m):void 0;return s(p)?p:u?p??u.value:(u={value:await h()},u.value)}catch(m){return await i(m,c,u)}}function b5(e,t,n,r,s){let i=g5({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),a=yZ(r.route,kr(n.method)?"action":"loader",t,e,s);return{middleware:i,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function EE(e,t,n,r,s,i,a,o,l=null,c){let f=!1,u=b5(e,t,n,s,i);return{...s,_lazyPromises:u,shouldLoad:o,shouldRevalidateArgs:l,shouldCallHandler(h){return f=!0,l?typeof c=="boolean"?mp(s,{...l,defaultShouldRevalidate:c}):typeof h=="boolean"?mp(s,{...l,defaultShouldRevalidate:h}):mp(s,l):o},resolve(h){let{lazy:m,loader:p,middleware:v}=s.route,S=f||o||h&&!kr(n.method)&&(m||p),y=v&&v.length>0&&!p&&!m;return S&&(kr(n.method)||!y)?SZ({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:h,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function fd(e,t,n,r,s,i,a,o=null){return r.map(l=>l.route.id!==s.route.id?{...l,shouldLoad:!1,shouldRevalidateArgs:o,shouldCallHandler:()=>!1,_lazyPromises:b5(e,t,n,l,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:EE(e,t,n,Yg(r),l,i,a,!0,o))}async function xZ(e,t,n,r,s,i){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 a={request:t,unstable_pattern:Yg(n),params:n[0].params,context:s,matches:n},l=await e({...a,fetcherKey:r,runClientMiddleware:c=>{let f=a;return y5(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 SZ({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:a}){let o,l,c=kr(e.method),f=c?"action":"loader",u=h=>{let m,p=new Promise((y,b)=>m=b);l=()=>m(),e.signal.addEventListener("abort",l);let v=y=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):h({request:e,unstable_pattern:t,params:n.params,context:a},...y!==void 0?[y]:[]),S=(async()=>{try{return{type:"data",result:await(i?i(b=>v(b)):v())}}catch(y){return{type:"error",result:y}}})();return Promise.race([S,p])};try{let h=c?n.route.action:n.route.loader;if(r||s)if(h){let m,[p]=await Promise.all([u(h).catch(v=>{m=v}),r,s]);if(m!==void 0)throw m;o=p}else{await r;let m=c?n.route.action:n.route.loader;if(m)[o]=await Promise.all([u(m),s]);else if(f==="action"){let p=new URL(e.url),v=p.pathname+p.search;throw Ws(405,{method:e.method,pathname:v,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(h)o=await u(h);else{let m=new URL(e.url),p=m.pathname+m.search;throw Ws(404,{pathname:p})}}catch(h){return{type:"error",result:h}}finally{l&&e.signal.removeEventListener("abort",l)}return o}async function wZ(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 _Z(e){var r,s,i,a,o;let{result:t,type:n}=e;if(BN(t)){let l;try{l=await wZ(t)}catch(c){return{type:"error",error:c}}return n==="error"?{type:"error",error:new Gg(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:"data",data:l,statusCode:t.status,headers:t.headers}}return n==="error"?Mj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:RZ(t),statusCode:Qp(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Qp(t)?t.status:void 0}:Mj(t)?{type:"data",data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function kZ(e,t,n,r,s){let i=e.headers.get("Location");if(it(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!FN(i)){let a=r.slice(0,r.findIndex(o=>o.route.id===n)+1);i=_E(new URL(t.url),a,s,i),e.headers.set("Location",i)}return e}function Rj(e,t,n,r){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(FN(e)){let i=e,a=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(s.includes(a.protocol))throw new Error("Invalid redirect location");let o=hi(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}try{let i=r.createURL(e);if(s.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Cf(e,t,n,r){let s=e.createURL(x5(t)).toString(),i={signal:n};if(r&&kr(r.formMethod)){let{formMethod:a,formEncType:o}=r;i.method=a.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(r.json)):o==="text/plain"?i.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?i.body=CE(r.formData):i.body=r.formData}return new Request(s,i)}function CE(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Nj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function EZ(e,t,n,r=!1,s=!1){let i={},a=null,o,l=!1,c={},f=n&&xs(n[1])?n[1].error:void 0;return e.forEach(u=>{if(!(u.route.id in t))return;let h=u.route.id,m=t[h];if(it(!qc(m),"Cannot handle redirect results in processLoaderData"),xs(m)){let p=m.error;if(f!==void 0&&(p=f,f=void 0),a=a||{},s)a[h]=p;else{let v=hl(e,h);a[v.route.id]==null&&(a[v.route.id]=p)}r||(i[h]=m5),l||(l=!0,o=Qp(m.error)?m.error.status:500),m.headers&&(c[h]=m.headers)}else i[h]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(c[h]=m.headers)}),f!==void 0&&n&&(a={[n[0]]:f},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:a,statusCode:o||200,loaderHeaders:c}}function Tj(e,t,n,r,s,i){let{loaderData:a,errors:o}=EZ(t,n,r);return s.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 h=i[c];if(it(h,"Did not find corresponding fetcher result"),xs(h)){let m=hl(e.matches,f==null?void 0:f.route.id);o&&o[m.route.id]||(o={...o,[m.route.id]:h.error}),e.fetchers.delete(c)}else if(qc(h))it(!1,"Unhandled fetcher revalidation redirect");else{let m=Xa(h.data);e.fetchers.set(c,m)}}),{loaderData:a,errors:o}}function Aj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==m5).reduce((i,[a,o])=>(i[a]=o,i),{});for(let i of n){let a=i.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&i.route.loader&&(s[a]=e[a]),r&&r.hasOwnProperty(a))break}return s}function Oj(e){return e?xs(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function hl(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 yv(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 Ws(e,{pathname:t,routeId:n,method:r,type:s,message:i}={}){let a="Unknown Server Error",o="Unknown @remix-run/router error";return e===400?(a="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.`:s==="invalid-body"&&(o="Unable to encode submission body")):e===403?(a="Forbidden",o=`Route "${n}" does not match URL "${t}"`):e===404?(a="Not Found",o=`No route matches URL "${t}"`):e===405&&(a="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 Gg(e||500,a,new Error(o),!0)}function vv(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(qc(s))return{key:r,result:s}}}function x5(e){let t=typeof e=="string"?uc(e):e;return ka({...t,hash:""})}function CZ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function RZ(e){var t,n;return new Gg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function NZ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&TZ(n))}function TZ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function AZ(e){return BN(e.result)&&d5.has(e.result.status)}function xs(e){return e.type==="error"}function qc(e){return(e&&e.type)==="redirect"}function Mj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function BN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function OZ(e){return d5.has(e)}function MZ(e){return BN(e)&&OZ(e.status)&&e.headers.has("Location")}function jZ(e){return cZ.has(e.toUpperCase())}function kr(e){return oZ.has(e.toUpperCase())}function HN(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function lb(e,t){let n=typeof t=="string"?uc(t).search:t.search;if(e[e.length-1].route.index&&HN(n||""))return e[e.length-1];let r=o5(e);return r[r.length-1]}function jj(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,json:a}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function e_(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 DZ(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 gm(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 IZ(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 Xa(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 PZ(e,t){try{let n=e.sessionStorage.getItem(h5);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function $Z(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(h5,JSON.stringify(n))}catch(r){pn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Dj(){let e,t,n=new Promise((r,s)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Uu=g.createContext(null);Uu.displayName="DataRouter";var Wg=g.createContext(null);Wg.displayName="DataRouterState";var S5=g.createContext(!1);function zZ(){return g.useContext(S5)}var qN=g.createContext({isTransitioning:!1});qN.displayName="ViewTransition";var w5=g.createContext(new Map);w5.displayName="Fetchers";var LZ=g.createContext(null);LZ.displayName="Await";var Fs=g.createContext(null);Fs.displayName="Navigation";var fS=g.createContext(null);fS.displayName="Location";var yi=g.createContext({outlet:null,matches:[],isDataRoute:!1});yi.displayName="Route";var VN=g.createContext(null);VN.displayName="RouteError";var _5="REACT_ROUTER_ERROR",FZ="REDIRECT",UZ="ROUTE_ERROR_RESPONSE";function BZ(e){if(e.startsWith(`${_5}:${FZ}:{`))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 HZ(e){if(e.startsWith(`${_5}:${UZ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gg(t.status,t.statusText,t.data)}catch{}}function qZ(e,{relative:t}={}){it(kh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=g.useContext(Fs),{hash:s,pathname:i,search:a}=Jg(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:ba([n,i])),r.createHref({pathname:o,search:a,hash:s})}function kh(){return g.useContext(fS)!=null}function ja(){return it(kh(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(fS).location}var k5="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function E5(e){g.useContext(Fs).static||g.useLayoutEffect(e)}function hs(){let{isDataRoute:e}=g.useContext(yi);return e?iee():VZ()}function VZ(){it(kh(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(Uu),{basename:t,navigator:n}=g.useContext(Fs),{matches:r}=g.useContext(yi),{pathname:s}=ja(),i=JSON.stringify(cS(r)),a=g.useRef(!1);return E5(()=>{a.current=!0}),g.useCallback((l,c={})=>{if(pn(a.current,k5),!a.current)return;if(typeof l=="number"){n.go(l);return}let f=uS(l,JSON.parse(i),s,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ba([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,i,s,e])}var KZ=g.createContext(null);function GZ(e){let t=g.useContext(yi).outlet;return g.useMemo(()=>t&&g.createElement(KZ.Provider,{value:e},t),[t,e])}function KN(){let{matches:e}=g.useContext(yi),t=e[e.length-1];return t?t.params:{}}function Jg(e,{relative:t}={}){let{matches:n}=g.useContext(yi),{pathname:r}=ja(),s=JSON.stringify(cS(n));return g.useMemo(()=>uS(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function YZ(e,t,n,r,s){it(kh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=g.useContext(Fs),{matches:a}=g.useContext(yi),o=a[a.length-1],l=o?o.params:{},c=o?o.pathname:"/",f=o?o.pathnameBase:"/",u=o&&o.route;{let b=u&&u.path||"";N5(c,!u||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${b}">) 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="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let h=ja(),m;m=h;let p=m.pathname||"/",v=p;if(f!=="/"){let b=f.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let S=dl(e,{pathname:v});return pn(u||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),pn(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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.`),ZZ(S&&S.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:ba([f,i.encodeLocation?i.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?f:ba([f,i.encodeLocation?i.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),a,n,r,s)}function WZ(){let e=see(),t=Qp(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)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:i},"ErrorBoundary")," or"," ",g.createElement("code",{style:i},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:s},n):null,a)}var JZ=g.createElement(WZ,null),C5=class extends g.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=HZ(e.digest);n&&(e=n)}let t=e!==void 0?g.createElement(yi.Provider,{value:this.props.routeContext},g.createElement(VN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(XZ,{error:e},t):t}};C5.contextType=S5;var t_=new WeakMap;function XZ({children:e,error:t}){let{basename:n}=g.useContext(Fs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=BZ(t.digest);if(r){let s=t_.get(t);if(s)throw s;let i=c5(r.location,n);if(l5&&!t_.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw t_.set(t,a),a}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function QZ({routeContext:e,match:t,children:n}){let r=g.useContext(Uu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(yi.Provider,{value:e},n)}function ZZ(e,t=[],n=null,r=null,s=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 i=e,a=n==null?void 0:n.errors;if(a!=null){let f=i.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);it(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let o=!1,l=-1;if(n)for(let f=0;f<i.length;f++){let u=i[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=f),u.route.id){let{loaderData:h,errors:m}=n,p=u.route.loader&&!h.hasOwnProperty(u.route.id)&&(!m||m[u.route.id]===void 0);if(u.route.lazy||p){o=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}let c=n&&r?(f,u)=>{var h,m;r(f,{location:n.location,params:((m=(h=n.matches)==null?void 0:h[0])==null?void 0:m.params)??{},unstable_pattern:Yg(n.matches),errorInfo:u})}:void 0;return i.reduceRight((f,u,h)=>{let m,p=!1,v=null,S=null;n&&(m=a&&u.route.id?a[u.route.id]:void 0,v=u.route.errorElement||JZ,o&&(l<0&&h===0?(N5("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,S=null):l===h&&(p=!0,S=u.route.hydrateFallbackElement||null)));let y=t.concat(i.slice(0,h+1)),b=()=>{let x;return m?x=v:p?x=S:u.route.Component?x=g.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=f,g.createElement(QZ,{match:u,routeContext:{outlet:f,matches:y,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?g.createElement(C5,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:c}):b()},null)}function GN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eee(e){let t=g.useContext(Uu);return it(t,GN(e)),t}function R5(e){let t=g.useContext(Wg);return it(t,GN(e)),t}function tee(e){let t=g.useContext(yi);return it(t,GN(e)),t}function YN(e){let t=tee(e),n=t.matches[t.matches.length-1];return it(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nee(){return YN("useRouteId")}function ree(){let{matches:e,loaderData:t}=R5("useMatches");return g.useMemo(()=>e.map(n=>r5(n,t)),[e,t])}function see(){var r;let e=g.useContext(VN),t=R5("useRouteError"),n=YN("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function iee(){let{router:e}=eee("useNavigate"),t=YN("useNavigate"),n=g.useRef(!1);return E5(()=>{n.current=!0}),g.useCallback(async(s,i={})=>{pn(n.current,k5),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Ij={};function N5(e,t,n){!t&&!Ij[e]&&(Ij[e]=!0,pn(!1,n))}var Pj={};function $j(e,t){!e&&!Pj[t]&&(Pj[t]=!0,console.warn(t))}var aee="useOptimistic",zj=q0[aee],oee=()=>{};function lee(e){return zj?zj(e):[e,oee]}function cee(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&pn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:g.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&pn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&pn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var uee=["HydrateFallback","hydrateFallbackElement"],fee=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 dee({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=zZ()||r;let[i,a]=g.useState(e.state),[o,l]=lee(i),[c,f]=g.useState(),[u,h]=g.useState({isTransitioning:!1}),[m,p]=g.useState(),[v,S]=g.useState(),[y,b]=g.useState(),x=g.useRef(new Map),_=g.useCallback((A,{deletedFetchers:I,newErrors:R,flushSync:$,viewTransitionOpts:U})=>{R&&n&&Object.values(R).forEach(W=>{var B;return n(W,{location:A.location,params:((B=A.matches[0])==null?void 0:B.params)??{},unstable_pattern:Yg(A.matches)})}),A.fetchers.forEach((W,B)=>{W.data!==void 0&&x.current.set(B,W.data)}),I.forEach(W=>x.current.delete(W)),$j($===!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 K=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if($j(U==null||K,"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."),!U||!K){t&&$?t(()=>a(A)):r===!1?a(A):g.startTransition(()=>{r===!0&&l(W=>Lj(W,A)),a(A)});return}if(t&&$){t(()=>{v&&(m==null||m.resolve(),v.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let W=e.window.document.startViewTransition(()=>{t(()=>a(A))});W.finished.finally(()=>{t(()=>{p(void 0),S(void 0),f(void 0),h({isTransitioning:!1})})}),t(()=>S(W));return}v?(m==null||m.resolve(),v.skipTransition(),b({state:A,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(f(A),h({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,t,v,m,r,l,n]);g.useLayoutEffect(()=>e.subscribe(_),[e,_]),g.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new fee)},[u]),g.useEffect(()=>{if(m&&c&&e.window){let A=c,I=m.promise,R=e.window.document.startViewTransition(async()=>{r===!1?a(A):g.startTransition(()=>{r===!0&&l($=>Lj($,A)),a(A)}),await I});R.finished.finally(()=>{p(void 0),S(void 0),f(void 0),h({isTransitioning:!1})}),S(R)}},[c,m,e.window,r,l]),g.useEffect(()=>{m&&c&&o.location.key===c.location.key&&m.resolve()},[m,v,o.location,c]),g.useEffect(()=>{!u.isTransitioning&&y&&(f(y.state),h({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),b(void 0))},[u.isTransitioning,y]);let C=g.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,I,R)=>e.navigate(A,{state:I,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(A,I,R)=>e.navigate(A,{replace:!0,state:I,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[e]),E=e.basename||"/",k=g.useMemo(()=>({router:e,navigator:C,static:!1,basename:E,onError:n}),[e,C,E,n]);return g.createElement(g.Fragment,null,g.createElement(Uu.Provider,{value:k},g.createElement(Wg.Provider,{value:o},g.createElement(w5.Provider,{value:x.current},g.createElement(qN.Provider,{value:u},g.createElement(yee,{basename:E,location:o.location,navigationType:o.historyAction,navigator:C,unstable_useTransitions:r},g.createElement(hee,{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 hee=g.memo(mee);function mee({routes:e,future:t,state:n,onError:r}){return YZ(e,void 0,n,r,t)}function pee({to:e,replace:t,state:n,relative:r}){it(kh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=g.useContext(Fs);pn(!s,"<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:i}=g.useContext(yi),{pathname:a}=ja(),o=hs(),l=uS(e,cS(i),a,r==="path"),c=JSON.stringify(l);return g.useEffect(()=>{o(JSON.parse(c),{replace:t,state:n,relative:r})},[o,c,r,t,n]),null}function gee(e){return GZ(e.context)}function yee({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:a}){it(!kh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),l=g.useMemo(()=>({basename:o,navigator:s,static:i,unstable_useTransitions:a,future:{}}),[o,s,i,a]);typeof n=="string"&&(n=uc(n));let{pathname:c="/",search:f="",hash:u="",state:h=null,key:m="default"}=n,p=g.useMemo(()=>{let v=hi(c,o);return v==null?null:{location:{pathname:v,search:f,hash:u,state:h,key:m},navigationType:r}},[o,c,f,u,h,m,r]);return pn(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:g.createElement(Fs.Provider,{value:l},g.createElement(fS.Provider,{children:t,value:p}))}var cb="get",ub="application/x-www-form-urlencoded";function dS(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vee(e){return dS(e)&&e.tagName.toLowerCase()==="button"}function bee(e){return dS(e)&&e.tagName.toLowerCase()==="form"}function xee(e){return dS(e)&&e.tagName.toLowerCase()==="input"}function See(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wee(e,t){return e.button===0&&(!t||t==="_self")&&!See(e)}function RE(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(s=>[n,s]):[[n,r]])},[]))}function _ee(e,t){let n=RE(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var bv=null;function kee(){if(bv===null)try{new FormData(document.createElement("form"),0),bv=!1}catch{bv=!0}return bv}var Eee=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function n_(e){return e!=null&&!Eee.has(e)?(pn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ub}"`),null):e}function Cee(e,t){let n,r,s,i,a;if(bee(e)){let o=e.getAttribute("action");r=o?hi(o,t):null,n=e.getAttribute("method")||cb,s=n_(e.getAttribute("enctype"))||ub,i=new FormData(e)}else if(vee(e)||xee(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?hi(l,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||cb,s=n_(e.getAttribute("formenctype"))||n_(o.getAttribute("enctype"))||ub,i=new FormData(o,e),!kee()){let{name:c,type:f,value:u}=e;if(f==="image"){let h=c?`${c}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else c&&i.append(c,u)}}else{if(dS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=cb,r=null,s=ub,a=e}return i&&s==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function WN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ree(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&hi(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function Nee(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 Tee(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 Aee(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let a=await Nee(i,n);return a.links?a.links():[]}return[]}));return Dee(r.flat(1).filter(Tee).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Fj(e,t,n,r,s,i){let a=(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 i==="assets"?t.filter((l,c)=>a(l,c)||o(l,c)):i==="data"?t.filter((l,c)=>{var u;let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(a(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.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 h=="boolean")return h}return!0}):[]}function Oee(e,t,{includeHydrateFallback:n}={}){return Mee(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function Mee(e){return[...new Set(e)]}function jee(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Dee(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(jee(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function T5(){let e=g.useContext(Uu);return WN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Iee(){let e=g.useContext(Wg);return WN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var JN=g.createContext(void 0);JN.displayName="FrameworkContext";function A5(){let e=g.useContext(JN);return WN(e,"You must render this element inside a <HydratedRouter> element"),e}function Pee(e,t){let n=g.useContext(JN),[r,s]=g.useState(!1),[i,a]=g.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=t,h=g.useRef(null);g.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let v=y=>{y.forEach(b=>{a(b.isIntersecting)})},S=new IntersectionObserver(v,{threshold:.5});return h.current&&S.observe(h.current),()=>{S.disconnect()}}},[e]),g.useEffect(()=>{if(r){let v=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(v)}}},[r]);let m=()=>{s(!0)},p=()=>{s(!1),a(!1)};return n?e!=="intent"?[i,h,{}]:[i,h,{onFocus:ym(o,m),onBlur:ym(l,p),onMouseEnter:ym(c,m),onMouseLeave:ym(f,p),onTouchStart:ym(u,m)}]:[!1,h,{}]}function ym(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $ee({page:e,...t}){let{router:n}=T5(),r=g.useMemo(()=>dl(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?g.createElement(Lee,{page:e,matches:r,...t}):null}function zee(e){let{manifest:t,routeModules:n}=A5(),[r,s]=g.useState([]);return g.useEffect(()=>{let i=!1;return Aee(e,t,n).then(a=>{i||s(a)}),()=>{i=!0}},[e,t,n]),r}function Lee({page:e,matches:t,...n}){let r=ja(),{future:s,manifest:i,routeModules:a}=A5(),{basename:o}=T5(),{loaderData:l,matches:c}=Iee(),f=g.useMemo(()=>Fj(e,t,c,i,r,"data"),[e,t,c,i,r]),u=g.useMemo(()=>Fj(e,t,c,i,r,"assets"),[e,t,c,i,r]),h=g.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,S=!1;if(t.forEach(b=>{var _;let x=i.routes[b.route.id];!x||!x.hasLoader||(!f.some(C=>C.route.id===b.route.id)&&b.route.id in l&&((_=a[b.route.id])!=null&&_.shouldRevalidate)||x.hasClientLoader?S=!0:v.add(b.route.id))}),v.size===0)return[];let y=Ree(e,o,s.unstable_trailingSlashAwareDataRequests,"data");return S&&v.size>0&&y.searchParams.set("_routes",t.filter(b=>v.has(b.route.id)).map(b=>b.route.id).join(",")),[y.pathname+y.search]},[o,s.unstable_trailingSlashAwareDataRequests,l,r,i,f,t,e,a]),m=g.useMemo(()=>Oee(u,i),[u,i]),p=zee(u);return g.createElement(g.Fragment,null,h.map(v=>g.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),m.map(v=>g.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),p.map(({key:v,link:S})=>g.createElement("link",{key:v,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function Fee(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Uee=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Uee&&(window.__reactRouterVersion="7.13.0")}catch{}function Bee(e,t){return hZ({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:AQ({window:t==null?void 0:t.window}),hydrationData:Hee(),routes:e,mapRouteProperties:cee,hydrationRouteProperties:uee,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 Hee(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:qee(e.errors)}),e}function qee(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Gg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let a=new i(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var O5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gs=g.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:a,state:o,target:l,to:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:h,...m},p){let{basename:v,unstable_useTransitions:S}=g.useContext(Fs),y=typeof c=="string"&&O5.test(c),b=c5(c,v);c=b.to;let x=qZ(c,{relative:s}),[_,C,E]=Pee(r,m),k=Yee(c,{replace:a,state:o,target:l,preventScrollReset:f,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:S});function A(R){t&&t(R),R.defaultPrevented||k(R)}let I=g.createElement("a",{...m,...E,href:b.absoluteURL||x,onClick:b.isExternal||i?t:A,ref:Fee(p,C),target:l,"data-discover":!y&&n==="render"?"true":void 0});return _&&!y?g.createElement(g.Fragment,null,I,g.createElement($ee,{page:x})):I});Gs.displayName="Link";var Vee=g.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:a,viewTransition:o,children:l,...c},f){let u=Jg(a,{relative:c.relative}),h=ja(),m=g.useContext(Wg),{navigator:p,basename:v}=g.useContext(Fs),S=m!=null&&Zee(u)&&o===!0,y=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,b=h.pathname,x=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(b=b.toLowerCase(),x=x?x.toLowerCase():null,y=y.toLowerCase()),x&&v&&(x=hi(x,v)||x);const _=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let C=b===y||!s&&b.startsWith(y)&&b.charAt(_)==="/",E=x!=null&&(x===y||!s&&x.startsWith(y)&&x.charAt(y.length)==="/"),k={isActive:C,isPending:E,isTransitioning:S},A=C?t:void 0,I;typeof r=="function"?I=r(k):I=[r,C?"active":null,E?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let R=typeof i=="function"?i(k):i;return g.createElement(Gs,{...c,"aria-current":A,className:I,ref:f,style:R,to:a,viewTransition:o},typeof l=="function"?l(k):l)});Vee.displayName="NavLink";var Kee=g.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:a=cb,action:o,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:h,...m},p)=>{let{unstable_useTransitions:v}=g.useContext(Fs),S=Xee(),y=Qee(o,{relative:c}),b=a.toLowerCase()==="get"?"get":"post",x=typeof o=="string"&&O5.test(o),_=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let E=C.nativeEvent.submitter,k=(E==null?void 0:E.getAttribute("formmethod"))||a,A=()=>S(E||C.currentTarget,{fetcherKey:t,method:k,navigate:n,replace:s,state:i,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:h});v&&n!==!1?g.startTransition(()=>A()):A()};return g.createElement("form",{ref:p,method:b,action:y,onSubmit:r?l:_,...m,"data-discover":!x&&e==="render"?"true":void 0})});Kee.displayName="Form";function Gee(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M5(e){let t=g.useContext(Uu);return it(t,Gee(e)),t}function Yee(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:a,unstable_defaultShouldRevalidate:o,unstable_useTransitions:l}={}){let c=hs(),f=ja(),u=Jg(e,{relative:i});return g.useCallback(h=>{if(wee(h,t)){h.preventDefault();let m=n!==void 0?n:ka(f)===ka(u),p=()=>c(e,{replace:m,state:r,preventScrollReset:s,relative:i,viewTransition:a,unstable_defaultShouldRevalidate:o});l?g.startTransition(()=>p()):p()}},[f,c,u,n,r,t,e,s,i,a,o,l])}function hS(e){pn(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=g.useRef(RE(e)),n=g.useRef(!1),r=ja(),s=g.useMemo(()=>_ee(r.search,n.current?null:t.current),[r.search]),i=hs(),a=g.useCallback((o,l)=>{const c=RE(typeof o=="function"?o(new URLSearchParams(s)):o);n.current=!0,i("?"+c,l)},[i,s]);return[s,a]}var Wee=0,Jee=()=>`__${String(++Wee)}__`;function Xee(){let{router:e}=M5("useSubmit"),{basename:t}=g.useContext(Fs),n=nee(),r=e.fetch,s=e.navigate;return g.useCallback(async(i,a={})=>{let{action:o,method:l,encType:c,formData:f,body:u}=Cee(i,t);if(a.navigate===!1){let h=a.fetcherKey||Jee();await r(h,n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:u,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync})}else await s(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:u,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,s,t,n])}function Qee(e,{relative:t}={}){let{basename:n}=g.useContext(Fs),r=g.useContext(yi);it(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...Jg(e||".",{relative:t})},a=ja();if(e==null){i.search=a.search;let o=new URLSearchParams(i.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();i.search=f?`?${f}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ba([n,i.pathname])),ka(i)}function Zee(e,{relative:t}={}){let n=g.useContext(qN);it(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=M5("useViewTransitionState"),s=Jg(e,{relative:t});if(!n.isTransitioning)return!1;let i=hi(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=hi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return vx(s.pathname,a)!=null||vx(s.pathname,i)!=null}const ss={dockerDismissed:"codecommit-docker-dismissed",grantedDismissed:"codecommit-granted-dismissed",theme:"codecommit-theme",desktopNotifications:"codecommit:desktopNotifications",reminders:"codecommit:reminders",reminderInterval:"codecommit:reminderInterval"},j5=g.createContext({theme:"system",setTheme:()=>{}}),ete=()=>{const e=localStorage.getItem(ss.theme);return e==="dark"||e==="light"||e==="system"?e:"system"};function tte({children:e}){const[t,n]=g.useState(ete),r=g.useCallback(s=>{localStorage.setItem(ss.theme,s),n(s)},[]);return g.useEffect(()=>{const s=document.documentElement,i=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;s.classList.remove("dark","light"),s.classList.add(i)},[t]),g.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>{const a=document.documentElement;a.classList.remove("dark","light"),a.classList.add(s.matches?"dark":"light")};return s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[t]),d.jsx(j5,{value:{theme:t,setTheme:r},children:e})}function D5(){return g.useContext(j5)}const nte=e=>typeof e=="function",T=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(s){return t(s,n)}};case 3:return function(n,r,s){return arguments.length>=3?t(n,r,s):function(i){return t(i,n,r)}};case 4:return function(n,r,s,i){return arguments.length>=4?t(n,r,s,i):function(a){return t(a,n,r,s)}};case 5:return function(n,r,s,i,a){return arguments.length>=5?t(n,r,s,i,a):function(o){return t(o,n,r,s,i)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},Oe=e=>e,Xg=e=>()=>e,NE=Xg(!0),Ml=Xg(!1),rte=Xg(null),I5=Xg(void 0),zd=I5;function D(e,t,n,r,s,i,a,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 s(r(n(t(e))));case 6:return i(s(r(n(t(e)))));case 7:return a(i(s(r(n(t(e))))));case 8:return o(a(i(s(r(n(t(e)))))));case 9:return l(o(a(i(s(r(n(t(e))))))));default:{let c=arguments[0];for(let f=1;f<arguments.length;f++)c=arguments[f](c);return c}}}const xv="effect/GlobalValue";let vm;const Fe=(e,t)=>(vm||(globalThis[xv]??(globalThis[xv]=new Map),vm=globalThis[xv]),vm.has(e)||vm.set(e,t()),vm.get(e)),$s=e=>typeof e=="string",jo=e=>typeof e=="number",Ld=e=>typeof e=="boolean",mS=e=>typeof e=="bigint",TE=e=>typeof e=="symbol",Eh=nte,ste=e=>e===void 0,ite=e=>e!==void 0,r_=e=>e!==null,ate=e=>!1,XN=e=>typeof e=="object"&&e!==null,Ui=e=>XN(e)||Eh(e),De=T(2,(e,t)=>Ui(e)&&t in e),QN=T(2,(e,t)=>De(e,"_tag")&&e._tag===t),df=e=>e==null,ote=e=>e!=null,lte=e=>e instanceof Uint8Array,P5=e=>e instanceof Date,$5=e=>typeof e=="string"||De(e,Symbol.iterator),cte=e=>XN(e)&&!Array.isArray(e),ute=e=>De(e,"then")&&Eh(e.then),pS=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;let z5=class L5{constructor(t){w(this,"self");w(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 L5(this.self)}};const fte=335903614,dte=4150755663,hte=1481765933,mte=1284865837,pte=9007199254740992,gte=134217728;class yte{constructor(t,n,r,s){w(this,"_state");return df(n)&&df(t)?(n=Math.random()*4294967295>>>0,t=0):df(n)&&(n=t,t=0),df(s)&&df(r)?(s=this._state?this._state[3]:dte,r=this._state?this._state[2]:fte):df(s)&&(s=r,r=0),this._state=new Int32Array([0,0,r>>>0,((s||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*gte+n)/pte}_next(){const t=this._state[0]>>>0,n=this._state[1]>>>0;vte(this._state,t,n,hte,mte),Uj(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,s=(n>>>18|t<<14)>>>0;r=(r^t)>>>0,s=(s^n)>>>0;const i=(s>>>27|r<<5)>>>0,a=t>>>27,o=(-a>>>0&31)>>>0;return(i>>>a|i<<o)>>>0}}function vte(e,t,n,r,s){let i=(n>>>16)*(s&65535)>>>0,a=(n&65535)*(s>>>16)>>>0,o=(n&65535)*(s&65535)>>>0,l=(n>>>16)*(s>>>16)+((a>>>16)+(i>>>16))>>>0;a=a<<16>>>0,o=o+a>>>0,o>>>0<a>>>0&&(l=l+1>>>0),i=i<<16>>>0,o=o+i>>>0,o>>>0<i>>>0&&(l=l+1>>>0),l=l+Math.imul(n,r)>>>0,l=l+Math.imul(t,s)>>>0,e[0]=l,e[1]=o}function Uj(e,t,n,r,s){let i=t+r>>>0;const a=n+s>>>0;a>>>0<n>>>0&&(i=i+1|0),e[0]=i,e[1]=a}const AE=Symbol.for("effect/Utils/YieldWrap");var jg;class Qg{constructor(t){h1(this,jg);ev(this,jg,t)}[AE](){return Zy(this,jg)}}jg=new WeakMap;function bte(e){if(typeof e=="object"&&e!==null&&AE in e)return e[AE]();throw new Error(pS("yieldWrapGet"))}const qs=Fe("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),F5={effect_internal_function:e=>e()},xte={effect_internal_function:e=>{try{return e()}finally{}}};var Tz;const Ste=((Tz=F5.effect_internal_function(()=>new Error().stack))==null?void 0:Tz.includes("effect_internal_function"))===!0,hr=Ste?F5.effect_internal_function:xte.effect_internal_function,s_=Fe(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),Ve=Symbol.for("effect/Hash"),be=e=>{if(qs.enabled===!0)return 0;switch(typeof e){case"number":return eT(e);case"bigint":return Wt(e.toString(10));case"boolean":return Wt(String(e));case"symbol":return Wt(String(e));case"string":return Wt(e);case"undefined":return Wt("undefined");case"function":case"object":return e===null?Wt("null"):e instanceof Date?Number.isNaN(e.getTime())?Wt("Invalid Date"):be(e.toISOString()):e instanceof URL?be(e.href):wte(e)?e[Ve]():ZN(e);default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},ZN=e=>(s_.has(e)||s_.set(e,eT(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),s_.get(e)),Ge=e=>t=>t*53^e,gS=e=>e&3221225471|e>>>1&1073741824,wte=e=>De(e,Ve),eT=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 gS(t)},Wt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return gS(t)},_te=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=D(Wt(t[r]),Ge(be(e[t[r]])));return gS(n)},U5=e=>_te(e,Object.keys(e)),Ch=e=>{let t=6151;for(let n=0;n<e.length;n++)t=D(t,Ge(be(e[n])));return gS(t)},Ot=function(){if(arguments.length===1){const n=arguments[0];return function(r){return Object.defineProperty(n,Ve,{value(){return r},enumerable:!1}),r}}const e=arguments[0],t=arguments[1];return Object.defineProperty(e,Ve,{value(){return t},enumerable:!1}),t},Ke=Symbol.for("effect/Equal");function Re(){return arguments.length===1?e=>bx(e,arguments[0]):bx(arguments[0],arguments[1])}function bx(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(Zp(e)&&Zp(t))return be(e)===be(t)&&e[Ke](t)?!0:qs.enabled&&qs.tester?qs.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){const r=e.getTime(),s=t.getTime();return r===s||Number.isNaN(r)&&Number.isNaN(s)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(qs.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,s)=>bx(r,t[s]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(e),s=Object.keys(t);if(r.length===s.length){for(const i of r)if(!(i in t&&bx(e[i],t[i])))return qs.tester?qs.tester(e,t):!1;return!0}}return qs.tester?qs.tester(e,t):!1}}return qs.enabled&&qs.tester?qs.tester(e,t):!1}const Zp=e=>De(e,Ke),tT=()=>Re,pt=Symbol.for("nodejs.util.inspect.custom"),nn=e=>{try{if(De(e,"toJSON")&&Eh(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(nn)}catch{return{}}return nT(e)},i_="[Circular]";function B5(e){try{return e.toISOString()}catch{return"Invalid Date"}}function kte(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function yS(e){return $s(e)?JSON.stringify(e):String(e)}function Bo(e,t){const n=new WeakSet,r=(a,o)=>{const l=a==null?void 0:a.constructor;return l&&l!==Object.prototype.constructor&&l.name?`${l.name}(${o})`:o},s=a=>{try{return Reflect.ownKeys(a)}catch{return["[ownKeys threw]"]}};function i(a,o=0){if(Array.isArray(a))return n.has(a)?i_:(n.add(a),`[${a.map(l=>i(l,o)).join(",")}]`);if(P5(a))return B5(a);if(De(a,"toString")&&Eh(a.toString)&&a.toString!==Object.prototype.toString&&a.toString!==Array.prototype.toString){const l=kte(a);return a instanceof Error&&a.cause?`${l} (cause: ${i(a.cause,o)})`:l}if($s(a))return JSON.stringify(a);if(jo(a)||a==null||Ld(a)||TE(a))return String(a);if(mS(a))return String(a)+"n";if(a instanceof Set||a instanceof Map)return n.has(a)?i_:(n.add(a),`${a.constructor.name}(${i(Array.from(a),o)})`);if(Ui(a)){if(n.has(a))return i_;n.add(a);const l=s(a);{const c=`{${l.map(f=>`${yS(f)}:${i(a[f],o)}`).join(",")}}`;return r(a,c)}}return String(a)}return i(e,0)}const zt=e=>JSON.stringify(e,null,2),vS={toJSON(){return nn(this)},[pt](){return this.toJSON()},toString(){return zt(this.toJSON())}};let Ete=class{[pt](){return this.toJSON()}toString(){return zt(this.toJSON())}};const Fd=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?H5(e,t):String(e)}catch{return String(e)}},H5=(e,t)=>{let n=[];const r=JSON.stringify(e,(s,i)=>typeof i=="object"&&i!==null?n.includes(i)?void 0:n.push(i)&&(tu.fiberRefs!==void 0&&q5(i)?i[bS](tu.fiberRefs):i):i,t);return n=void 0,r},bS=Symbol.for("effect/Inspectable/Redactable"),q5=e=>typeof e=="object"&&e!==null&&bS in e,tu=Fe("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),Cte=(e,t)=>{const n=tu.fiberRefs;tu.fiberRefs=e;try{return t()}finally{tu.fiberRefs=n}},nT=e=>q5(e)&&tu.fiberRefs!==void 0?e[bS](tu.fiberRefs):e,xe=(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,s=t.length;r<s;r++)n=t[r](n);return n}}},pp="Async",xS="Commit",rr="Failure",fb="OnFailure",xx="OnSuccess",Sx="OnSuccessAndFailure",sr="Success",V5="Sync",Rte="Tag",Rh="UpdateRuntimeFlags",wx="While",gp="Iterator",K5="WithRuntime",db="Yield",rT="RevertFlags";let Nte="3.19.19";const sT=()=>Nte,Tte=Symbol.for("effect/Effect"),Ate=Symbol.for("effect/Stream"),Ote=Symbol.for("effect/Sink"),Mte=Symbol.for("effect/Channel"),Ud={_R:e=>e,_E:e=>e,_A:e=>e,_V:sT()},jte={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},Dte={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Zg={[Tte]:Ud,[Ate]:Ud,[Ote]:jte,[Mte]:Dte,[Ke](e){return this===e},[Ve](){return Ot(this,ZN(this))},[Symbol.iterator](){return new z5(new Qg(this))},pipe(){return xe(this,arguments)}},ey={[Ve](){return Ot(this,U5(this))},[Ke](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&&Re(this[r],e[r])))return!1;return!0}},ty={...Zg,_op:xS},Ite={...ty,...ey},Pte=function(){function e(){}return e.prototype=ty,e}(),G5=Symbol.for("effect/Option"),Y5={...Zg,[G5]:{_A:e=>e},[pt](){return this.toJSON()},toString(){return zt(this.toJSON())}},$te=Object.assign(Object.create(Y5),{_tag:"Some",_op:"Some",[Ke](e){return iT(e)&&W5(e)&&Re(this.value,e.value)},[Ve](){return Ot(this,Ge(be(this._tag))(be(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:nn(this.value)}}}),zte=be("None"),Lte=Object.assign(Object.create(Y5),{_tag:"None",_op:"None",[Ke](e){return iT(e)&&aT(e)},[Ve](){return zte},toJSON(){return{_id:"Option",_tag:this._tag}}}),iT=e=>De(e,G5),aT=e=>e._tag==="None",W5=e=>e._tag==="Some",Bd=Object.create(Lte),fo=e=>{const t=Object.create($te);return t.value=e,t},J5=Symbol.for("effect/Context/Tag"),_x=Symbol.for("effect/Context/Reference"),Fte="effect/STM",Ute=Symbol.for(Fte),oT={...Zg,_op:"Tag",[Ute]:Ud,[J5]:{_Service:e=>e,_Identifier:e=>e},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[pt](){return this.toJSON()},of(e){return e},context(e){return Z5(this,e)}},Bte={...oT,[_x]:_x},Hte=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;const r=Object.create(oT);return Object.defineProperty(r,"stack",{get(){return n.stack}}),r.key=e,r},qte=e=>()=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,oT),r.key=e,Object.defineProperty(r,"stack",{get(){return n.stack}}),r},Vte=()=>(e,t)=>{const n=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=n;function s(){}return Object.setPrototypeOf(s,Bte),s.key=e,s.defaultValue=t.defaultValue,Object.defineProperty(s,"stack",{get(){return r.stack}}),s},X5=Symbol.for("effect/Context"),Kte={[X5]:{_Services:e=>e},[Ke](e){if(Q5(e)&&this.unsafeMap.size===e.unsafeMap.size){for(const t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!Re(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[Ve](){return Ot(this,eT(this.unsafeMap.size))},pipe(){return xe(this,arguments)},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(nn)}},[pt](){return this.toJSON()}},Yl=e=>{const t=Object.create(Kte);return t.unsafeMap=e,t},Gte=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},Q5=e=>De(e,X5),Yte=e=>De(e,J5),Wte=e=>De(e,_x),Jte=Yl(new Map),Xte=()=>Jte,Z5=(e,t)=>Yl(new Map([[e.key,t]])),Qte=T(3,(e,t,n)=>{const r=new Map(e.unsafeMap);return r.set(t.key,n),Yl(r)}),a_=Fe("effect/Context/defaultValueCache",()=>new Map),lT=e=>{if(a_.has(e.key))return a_.get(e.key);const t=e.defaultValue();return a_.set(e.key,t),t},Zte=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):lT(t),eU=T(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(_x in t)return lT(t);throw Gte(t)}return e.unsafeMap.get(t.key)}),ene=eU,tne=T(2,(e,t)=>e.unsafeMap.has(t.key)?fo(e.unsafeMap.get(t.key)):Wte(t)?fo(lT(t)):Bd),nne=T(2,(e,t)=>{const n=new Map(e.unsafeMap);for(const[r,s]of t.unsafeMap)n.set(r,s);return Yl(n)}),rne=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((r,s)=>{t.set(s,r)});return Yl(t)},fc=Hte,sne=Yl,ine=Q5,tU=Yte,Ea=Xte,cT=Z5,ii=Qte,_o=ene,nU=eU,Nh=tne,us=nne,ane=rne,uT=qte,Th=Vte,SS=e=>(t,n)=>t===n||e(t,n),one=(e,t)=>e===t,lne=()=>one,cne=lne(),rU=T(2,(e,t)=>SS((n,r)=>e(t(n),t(r)))),une=rU(cne,e=>e.getTime()),fne=e=>SS((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}),fT=Symbol.for("effect/Either"),sU={...Zg,[fT]:{_R:e=>e},[pt](){return this.toJSON()},toString(){return zt(this.toJSON())}},dne=Object.assign(Object.create(sU),{_tag:"Right",_op:"Right",[Ke](e){return dT(e)&&iU(e)&&Re(this.right,e.right)},[Ve](){return Ge(be(this._tag))(be(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:nn(this.right)}}}),hne=Object.assign(Object.create(sU),{_tag:"Left",_op:"Left",[Ke](e){return dT(e)&&hT(e)&&Re(this.left,e.left)},[Ve](){return Ge(be(this._tag))(be(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:nn(this.left)}}}),dT=e=>De(e,fT),hT=e=>e._tag==="Left",iU=e=>e._tag==="Right",aU=e=>{const t=Object.create(hne);return t.left=e,t},oU=e=>{const t=Object.create(dne);return t.right=e,t},mne=e=>hT(e)?Bd:fo(e.right),pne=T(2,(e,t)=>aT(e)?aU(t()):oU(e.value)),gne=fT,ze=oU,Le=aU,yne=pne,vne=e=>{if(Eh(e))try{return ze(e())}catch(t){return Le(t)}else try{return ze(e.try())}catch(t){return Le(e.catch(t))}},lU=dT,Qn=hT,da=iU,bne=T(2,(e,{onLeft:t,onRight:n})=>Qn(e)?Le(t(e.left)):ze(n(e.right))),xne=T(2,(e,t)=>Qn(e)?Le(t(e.left)):ze(e.right)),Sne=T(2,(e,t)=>da(e)?ze(t(e.right)):Le(e.left)),as=T(2,(e,{onLeft:t,onRight:n})=>Qn(e)?t(e.left):n(e.right)),wne=as({onLeft:Oe,onRight:Oe}),cU=T(2,(e,t)=>{if(da(e))return e.right;throw t(e.left)}),uU=cU(()=>new Error("getOrThrow called on a Left")),fU=e=>e.length>0,dU=e=>(t,n)=>t===n?0:e(t,n),_ne=dU((e,t)=>e<t?-1:1),hU=T(2,(e,t)=>dU((n,r)=>e(t(n),t(r)))),kne=e=>T(2,(t,n)=>e(t,n)===1),Ene=Symbol.for("effect/Option"),re=()=>Bd,ie=fo,Cne=iT,Qt=aT,Bt=W5,Ft=T(2,(e,{onNone:t,onSome:n})=>Qt(e)?t():n(e.value)),Rne=mne,Kt=T(2,(e,t)=>Qt(e)?t():e.value),$i=T(2,(e,t)=>Qt(e)?t():e),Nne=T(2,(e,t)=>Qt(e)?ie(t()):e),Ah=e=>e==null?re():ie(e),Tne=Kt(rte),Zs=Kt(I5),Ane=e=>(...t)=>{try{return ie(e(...t))}catch{return re()}},mU=T(2,(e,t)=>{if(Bt(e))return e.value;throw t()}),One=mU(()=>new Error("getOrThrow called on a None")),os=T(2,(e,t)=>Qt(e)?re():ie(t(e.value))),Ho=T(2,(e,t)=>Qt(e)?re():t(e.value)),pU=T(2,(e,t)=>Qt(e)?re():Ah(t(e.value))),Mne=Ho,Rf=T(2,(e,t)=>Mne(e,n=>t(n)?fo(n):Bd)),jne=e=>SS((t,n)=>Qt(t)?Qt(n):Qt(n)?!1:e(t.value,n.value)),Dne=e=>T(2,(t,n)=>Qt(t)?!1:e(t.value,n)),Ine=tT(),Pne=Dne(Ine),$ne=T(2,(e,t)=>Qt(e)?!1:t(e.value)),zne=(...e)=>e,Lne=()=>({}),Fne=e=>gU(e).length===0,Jf=T(2,(e,t)=>{const n={...e};for(const r of gU(e))n[r]=t(e[r],r);return n}),gU=e=>Object.keys(e),Une=T(3,(e,t,n)=>({...e,[t]:n})),wS=e=>new Array(e),Bne=T(2,(e,t)=>{const n=Math.max(1,Math.floor(e)),r=new Array(n);for(let s=0;s<n;s++)r[s]=t(s);return r}),kt=e=>Array.isArray(e)?e:Array.from(e),Hne=e=>Array.isArray(e)?e:[e],qne=T(2,(e,{onEmpty:t,onNonEmpty:n})=>gn(e)?n(qr(e),mu(e)):t()),kx=T(2,(e,t)=>[t,...e]),Vne=T(2,(e,t)=>[...e,t]),mT=T(2,(e,t)=>kt(e).concat(kt(t))),Kne=Array.isArray,Gne=e=>e.length===0,Yne=Gne,dd=fU,gn=fU,yU=(e,t)=>e<0||e>=t.length,Wne=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),Jne=T(2,(e,t)=>{const n=Math.floor(t);return yU(n,e)?re():ie(e[n])}),vU=T(2,(e,t)=>{const n=Math.floor(t);if(yU(n,e))throw new Error(`Index ${n} out of bounds`);return e[n]}),yp=Jne(0),qr=vU(0),Xne=e=>gn(e)?ie(bU(e)):re(),bU=e=>e[e.length-1],mu=e=>e.slice(1),Qne=(e,t)=>{let n=0;for(const r of e){if(!t(r,n))break;n++}return n},Zne=T(2,(e,t)=>xU(e,Qne(e,t))),ere=T(2,(e,t)=>{const n=kt(e);return n.slice(Wne(t,n),n.length)}),Bj=e=>Array.from(e).reverse(),eg=T(2,(e,t)=>{const n=Array.from(e);return n.sort(t),n}),Hj=T(2,(e,t)=>tre(e,t,zne)),tre=T(3,(e,t,n)=>{const r=kt(e),s=kt(t);if(gn(r)&&gn(s)){const i=[n(qr(r),qr(s))],a=Math.min(r.length,s.length);for(let o=1;o<a;o++)i[o]=n(r[o],s[o]);return i}return[]}),nre=tT(),xU=T(2,(e,t)=>{const n=Array.from(e),r=Math.floor(t);return gn(n)?r>=1?rre(n,r):[[],n]:[n,[]]}),rre=T(2,(e,t)=>{const n=Math.max(1,Math.floor(t));return n>=e.length?[Um(e),[]]:[kx(e.slice(1,n),qr(e)),e.slice(n)]}),Um=e=>e.slice(),sre=T(3,(e,t,n)=>{const r=kt(e),s=kt(t);return gn(r)?gn(s)?wU(n)(mT(r,s)):r:s}),hb=T(2,(e,t)=>sre(e,t,nre)),Wl=()=>[],Ti=e=>[e],nu=T(2,(e,t)=>e.map(t)),Ex=T(2,(e,t)=>{if(Yne(e))return[];const n=[];for(let r=0;r<e.length;r++){const s=t(e[r],r);for(let i=0;i<s.length;i++)n.push(s[i])}return n}),SU=Ex(Oe),ire=T(2,(e,t)=>{const n=kt(e),r=[];for(let s=0;s<n.length;s++){const i=t(n[s],s);Bt(i)&&r.push(i.value)}return r}),are=T(2,(e,t)=>{const n=kt(e),r=[];for(let s=0;s<n.length;s++)t(n[s],s)&&r.push(n[s]);return r}),pT=T(3,(e,t,n)=>kt(e).reduce((r,s,i)=>n(r,s,i),t)),qj=(e,t)=>{const n=[];let r=e,s;for(;Bt(s=t(r));){const[i,a]=s.value;n.push(i),r=a}return n},_S=fne,wU=T(2,(e,t)=>{const n=kt(e);if(gn(n)){const r=[qr(n)],s=mu(n);for(const i of s)r.every(a=>!t(i,a))&&r.push(i);return r}return[]}),ore=e=>wU(e,tT()),Oh=T(2,(e,t)=>kt(e).join(t)),_U=Symbol.for("effect/Chunk");function lre(e,t,n,r,s){for(let i=t;i<Math.min(e.length,t+s);i++)n[r+i-t]=e[i];return n}const kU=[],EU=e=>SS((t,n)=>t.length===n.length&&Vr(t).every((r,s)=>e(r,jl(n,s)))),cre=EU(Re),ure={[_U]:{_A:e=>e},toString(){return zt(this.toJSON())},toJSON(){return{_id:"Chunk",values:Vr(this).map(nn)}},[pt](){return this.toJSON()},[Ke](e){return kS(e)&&cre(this,e)},[Ve](){return Ot(this,Ch(Vr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return kU[Symbol.iterator]();default:return Vr(this)[Symbol.iterator]()}},pipe(){return xe(this,arguments)}},un=e=>{const t=Object.create(ure);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=Ai,t.right=Ai;break}case"ISingleton":{t.length=1,t.depth=0,t.left=Ai,t.right=Ai;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=Ai,t.right=Ai;break}}return t},kS=e=>De(e,_U),Ai=un({_tag:"IEmpty"}),Vn=()=>Ai,o_=(...e)=>hre(e),Dn=e=>un({_tag:"ISingleton",a:e}),Do=e=>kS(e)?e:Lr(kt(e)),OE=(e,t,n)=>{switch(e.backing._tag){case"IArray":{lre(e.backing.array,0,t,n,e.length);break}case"IConcat":{OE(e.left,t,n),OE(e.right,t,n+e.left.length);break}case"ISingleton":{t[n]=e.backing.a;break}case"ISlice":{let r=0,s=n;for(;r<e.length;)t[s]=jl(e,r),r+=1,s+=1;break}}},fre=e=>{switch(e.backing._tag){case"IEmpty":return kU;case"IArray":return e.backing.array;default:{const t=new Array(e.length);return OE(e,t,0),e.backing={_tag:"IArray",array:t},e.left=Ai,e.right=Ai,e.depth=0,t}}},Vr=fre,dre=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return un({_tag:"IArray",array:Bj(e.backing.array)});case"IConcat":return un({_tag:"IConcat",left:Io(e.backing.right),right:Io(e.backing.left)});case"ISlice":return Lr(Bj(Vr(e)))}},Io=dre,CU=T(2,(e,t)=>t<0||t>=e.length?re():ie(jl(e,t))),Lr=e=>e.length===0?Vn():e.length===1?Dn(e[0]):un({_tag:"IArray",array:e}),hre=e=>Lr(e),jl=T(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?jl(e.left,t):jl(e.right,t-e.left.length);case"ISlice":return jl(e.backing.chunk,t+e.backing.offset)}}),ME=T(2,(e,t)=>On(e,Dn(t))),Mr=T(2,(e,t)=>On(Dn(t),e)),Cx=T(2,(e,t)=>{if(t<=0)return Ai;if(t>=e.length)return e;switch(e.backing._tag){case"ISlice":return un({_tag:"ISlice",chunk:e.backing.chunk,length:t,offset:e.backing.offset});case"IConcat":return t>e.left.length?un({_tag:"IConcat",left:e.left,right:Cx(e.right,t-e.left.length)}):Cx(e.left,t);default:return un({_tag:"ISlice",chunk:e,offset:0,length:t})}}),xl=T(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return Ai;switch(e.backing._tag){case"ISlice":return un({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":return t>e.left.length?xl(e.right,t-e.left.length):un({_tag:"IConcat",left:xl(e.left,t),right:e.right});default:return un({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}}),On=T(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 un({_tag:"IConcat",left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){const r=On(e.right,t);return un({_tag:"IConcat",left:e.left,right:r})}else{const r=On(e.right.right,t);if(r.depth===e.depth-3){const s=un({_tag:"IConcat",left:e.right.left,right:r});return un({_tag:"IConcat",left:e.left,right:s})}else{const s=un({_tag:"IConcat",left:e.left,right:e.right.left});return un({_tag:"IConcat",left:s,right:r})}}else if(t.right.depth>=t.left.depth){const r=On(e,t.left);return un({_tag:"IConcat",left:r,right:t.right})}else{const r=On(e,t.left.left);if(r.depth===t.depth-3){const s=un({_tag:"IConcat",left:r,right:t.left.right});return un({_tag:"IConcat",left:s,right:t.right})}else{const s=un({_tag:"IConcat",left:t.left.right,right:t.right});return un({_tag:"IConcat",left:r,right:s})}}}),gT=T(2,(e,t)=>Lr(are(e,t))),ES=e=>e.length===0,Po=e=>e.length>0,yT=CU(0),vT=e=>jl(e,0),ha=vT,mre=e=>CU(e,e.length-1),pre=T(2,(e,t)=>e.backing._tag==="ISingleton"?Dn(t(e.backing.a,0)):Lr(D(Vr(e),nu((n,r)=>t(n,r))))),ho=e=>xl(e,1),gre=T(2,(e,t)=>xl(e,e.length-t)),yre=pT,pu=5,bT=Math.pow(2,pu),vre=bT-1,bre=bT/2,xre=bT/4;function Sre(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 Hd(e,t){return t>>>e&vre}function Xf(e){return 1<<e}function RU(e,t){return Sre(e&t-1)}const wre=(e,t)=>({value:e,previous:t});function hd(e,t,n,r){let s=r;if(!e){const i=r.length;s=new Array(i);for(let a=0;a<i;++a)s[a]=r[a]}return s[t]=n,s}function NU(e,t,n){const r=n.length-1;let s=0,i=0,a=n;if(e)s=i=t;else for(a=new Array(r);s<t;)a[i++]=n[s++];for(++s;s<=r;)a[i++]=n[s++];return e&&(a.length=r),a}function _re(e,t,n,r){const s=r.length;if(e){let l=s;for(;l>=t;)r[l--]=r[l];return r[t]=n,r}let i=0,a=0;const o=new Array(s+1);for(;i<t;)o[a++]=r[i++];for(o[t]=n;i<s;)o[++a]=r[i++];return o}class Jl{constructor(){w(this,"_tag","EmptyNode")}modify(t,n,r,s,i,a){const o=r(re());return Qt(o)?new Jl:(++a.value,new ru(t,s,i,o))}}function Ii(e){return QN(e,"EmptyNode")}function kre(e){return Ii(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function CS(e,t){return Ii(e)?!1:t===e.edit}class ru{constructor(t,n,r,s){w(this,"edit");w(this,"hash");w(this,"key");w(this,"value");w(this,"_tag","LeafNode");this.edit=t,this.hash=n,this.key=r,this.value=s}modify(t,n,r,s,i,a){if(Re(i,this.key)){const l=r(this.value);return l===this.value?this:Qt(l)?(--a.value,new Jl):CS(this,t)?(this.value=l,this):new ru(t,s,i,l)}const o=r(re());return Qt(o)?this:(++a.value,TU(t,n,this.hash,this,s,new ru(t,s,i,o)))}}class xT{constructor(t,n,r){w(this,"edit");w(this,"hash");w(this,"children");w(this,"_tag","CollisionNode");this.edit=t,this.hash=n,this.children=r}modify(t,n,r,s,i,a){if(s===this.hash){const l=CS(this,t),c=this.updateCollisionList(l,t,this.hash,this.children,r,i,a);return c===this.children?this:c.length>1?new xT(t,this.hash,c):c[0]}const o=r(re());return Qt(o)?this:(++a.value,TU(t,n,this.hash,this,s,new ru(t,s,i,o)))}updateCollisionList(t,n,r,s,i,a,o){const l=s.length;for(let f=0;f<l;++f){const u=s[f];if("key"in u&&Re(a,u.key)){const h=u.value,m=i(h);return m===h?s:Qt(m)?(--o.value,NU(t,f,s)):hd(t,f,new ru(n,r,a,m),s)}}const c=i(re());return Qt(c)?s:(++o.value,hd(t,l,new ru(n,r,a,c),s))}}class qd{constructor(t,n,r){w(this,"edit");w(this,"mask");w(this,"children");w(this,"_tag","IndexedNode");this.edit=t,this.mask=n,this.children=r}modify(t,n,r,s,i,a){const o=this.mask,l=this.children,c=Hd(n,s),f=Xf(c),u=RU(o,f),h=o&f,m=CS(this,t);if(!h){const b=new Jl().modify(t,n+pu,r,s,i,a);return b?l.length>=bre?Cre(t,c,b,o,l):new qd(t,o|f,_re(m,u,b,l)):this}const p=l[u],v=p.modify(t,n+pu,r,s,i,a);if(p===v)return this;let S=o,y;if(Ii(v)){if(S&=~f,!S)return new Jl;if(l.length<=2&&kre(l[u^1]))return l[u^1];y=NU(m,u,l)}else y=hd(m,u,v,l);return m?(this.mask=S,this.children=y,this):new qd(t,S,y)}}class ST{constructor(t,n,r){w(this,"edit");w(this,"size");w(this,"children");w(this,"_tag","ArrayNode");this.edit=t,this.size=n,this.children=r}modify(t,n,r,s,i,a){let o=this.size;const l=this.children,c=Hd(n,s),f=l[c],u=(f||new Jl).modify(t,n+pu,r,s,i,a);if(f===u)return this;const h=CS(this,t);let m;if(Ii(f)&&!Ii(u))++o,m=hd(h,c,u,l);else if(!Ii(f)&&Ii(u)){if(--o,o<=xre)return Ere(t,o,c,l);m=hd(h,c,new Jl,l)}else m=hd(h,c,u,l);return h?(this.size=o,this.children=m,this):new ST(t,o,m)}}function Ere(e,t,n,r){const s=new Array(t-1);let i=0,a=0;for(let o=0,l=r.length;o<l;++o)if(o!==n){const c=r[o];c&&!Ii(c)&&(s[i++]=c,a|=1<<o)}return new qd(e,a,s)}function Cre(e,t,n,r,s){const i=[];let a=r,o=0;for(let l=0;a;++l)a&1&&(i[l]=s[o++]),a>>>=1;return i[t]=n,new ST(e,o+1,i)}function Rre(e,t,n,r,s,i){if(n===s)return new xT(e,n,[i,r]);const a=Hd(t,n),o=Hd(t,s);if(a===o)return l=>new qd(e,Xf(a)|Xf(o),[l]);{const l=a<o?[r,i]:[i,r];return new qd(e,Xf(a)|Xf(o),l)}}function TU(e,t,n,r,s,i){let a,o=t;for(;;){const l=Rre(e,o,n,r,s,i);if(typeof l=="function")a=wre(l,a),o=o+pu;else{let c=l;for(;a!=null;)c=a.value(c),a=a.previous;return c}}}const AU="effect/HashMap",jE=Symbol.for(AU),Nre={[jE]:jE,[Symbol.iterator](){return new RS(this,(e,t)=>[e,t])},[Ve](){let e=be(AU);for(const t of this)e^=D(be(t[0]),Ge(be(t[1])));return Ot(this,e)},[Ke](e){if(Ore(e)){if(e._size!==this._size)return!1;for(const t of this){const n=D(e,_T(t[0],be(t[0])));if(Qt(n))return!1;if(!Re(t[1],n.value))return!1}return!0}return!1},toString(){return zt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(nn)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},wT=(e,t,n,r)=>{const s=Object.create(Nre);return s._editable=e,s._edit=t,s._root=n,s._size=r,s};class RS{constructor(t,n){w(this,"map");w(this,"f");w(this,"v");this.map=t,this.f=n,this.v=OU(this.map._root,this.f,void 0)}next(){if(Qt(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Rx(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new RS(this.map,this.f)}}const Rx=e=>e?MU(e[0],e[1],e[2],e[3],e[4]):re(),OU=(e,t,n=void 0)=>{switch(e._tag){case"LeafNode":return Bt(e.value)?ie({value:t(e.key,e.value.value),cont:n}):Rx(n);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const r=e.children;return MU(r.length,r,0,t,n)}default:return Rx(n)}},MU=(e,t,n,r,s)=>{for(;n<e;){const i=t[n++];if(i&&!Ii(i))return OU(i,r,[e,t,n,r,s])}return Rx(s)},Tre=wT(!1,0,new Jl,0),NS=()=>Tre,Are=e=>{const t=DU(NS());for(const n of e)tg(t,n[0],n[1]);return Pre(t)},Ore=e=>De(e,jE),Mre=e=>e&&Ii(e._root),jre=T(2,(e,t)=>_T(e,t,be(t))),_T=T(3,(e,t,n)=>{let r=e._root,s=0;for(;;)switch(r._tag){case"LeafNode":return Re(t,r.key)?r.value:re();case"CollisionNode":{if(n===r.hash){const i=r.children;for(let a=0,o=i.length;a<o;++a){const l=i[a];if("key"in l&&Re(t,l.key))return l.value}}return re()}case"IndexedNode":{const i=Hd(s,n),a=Xf(i);if(r.mask&a){r=r.children[RU(r.mask,a)],s+=pu;break}return re()}case"ArrayNode":{if(r=r.children[Hd(s,n)],r){s+=pu;break}return re()}default:return re()}}),Dre=T(2,(e,t)=>Bt(_T(e,t,be(t)))),tg=T(3,(e,t,n)=>kT(e,t,()=>ie(n))),Ire=T(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:wT(e._editable,e._edit,t,n)),jU=e=>new RS(e,t=>t),DE=e=>e._size,DU=e=>wT(!0,e._edit+1,e._root,e._size),Pre=e=>(e._editable=!1,e),kT=T(3,(e,t,n)=>$re(e,t,be(t),n)),$re=T(4,(e,t,n,r)=>{const s={value:e._size},i=e._root.modify(e._editable?e._edit:NaN,0,r,n,t,s);return D(e,Ire(i,s.value))}),Vj=T(2,(e,t)=>kT(e,t,re)),zre=T(2,(e,t)=>TS(e,NS(),(n,r,s)=>tg(n,s,t(r,s)))),IU=T(2,(e,t)=>TS(e,void 0,(n,r,s)=>t(r,s))),TS=T(3,(e,t,n)=>{const r=e._root;if(r._tag==="LeafNode")return Bt(r.value)?n(t,r.value.value,r.key):t;if(r._tag==="EmptyNode")return t;const s=[r.children];let i;for(;i=s.pop();)for(let a=0,o=i.length;a<o;){const l=i[a++];l&&!Ii(l)&&(l._tag==="LeafNode"?Bt(l.value)&&(t=n(t,l.value.value,l.key)):s.push(l.children))}return t}),PU="effect/HashSet",IE=Symbol.for(PU),Lre={[IE]:IE,[Symbol.iterator](){return jU(this._keyMap)},[Ve](){return Ot(this,Ge(be(this._keyMap))(be(PU)))},[Ke](e){return Fre(e)?DE(this._keyMap)===DE(e._keyMap)&&Re(this._keyMap,e._keyMap):!1},toString(){return zt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(nn)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},AS=e=>{const t=Object.create(Lre);return t._keyMap=e,t},Fre=e=>De(e,IE),Ure=AS(NS()),OS=()=>Ure,Bre=e=>{const t=ET(OS());for(const n of e)ng(t,n);return CT(t)},Hre=(...e)=>{const t=ET(OS());for(const n of e)ng(t,n);return CT(t)},qre=T(2,(e,t)=>Dre(e._keyMap,t)),Vre=e=>DE(e._keyMap),ET=e=>AS(DU(e._keyMap)),CT=e=>(e._keyMap._editable=!1,e),$U=T(2,(e,t)=>{const n=ET(e);return t(n),CT(n)}),ng=T(2,(e,t)=>e._keyMap._editable?(tg(t,!0)(e._keyMap),e):AS(tg(t,!0)(e._keyMap))),zU=T(2,(e,t)=>e._keyMap._editable?(Vj(t)(e._keyMap),e):AS(Vj(t)(e._keyMap))),Kre=T(2,(e,t)=>$U(e,n=>{for(const r of t)zU(n,r)})),Gre=T(2,(e,t)=>$U(OS(),n=>{Yre(e,r=>ng(n,r));for(const r of t)ng(n,r)})),Yre=T(2,(e,t)=>IU(e._keyMap,(n,r)=>t(r))),Wre=T(3,(e,t,n)=>TS(e._keyMap,t,(r,s,i)=>n(r,i))),gu=OS,Jre=Bre,RT=Hre,LU=qre,NT=Vre,vp=ng,FU=zU,Kj=Kre,rg=Gre,sg=Wre,Bu="Die",yu="Empty",Hu="Fail",Mh="Interrupt",Vd="Parallel",Kd="Sequential",UU="effect/Cause",BU=Symbol.for(UU),Xre={_E:e=>e},jh={[BU]:Xre,[Ve](){return D(be(UU),Ge(be(cse(this))),Ot(this))},[Ke](e){return Qre(e)&&lse(this,e)},pipe(){return xe(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:nn(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:nn(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:nn(this.left),right:nn(this.right)}}},toString(){return Dh(this)},[pt](){return this.toJSON()}},Xl=(()=>{const e=Object.create(jh);return e._tag=yu,e})(),vu=e=>{const t=Object.create(jh);return t._tag=Hu,t.error=e,t},ci=e=>{const t=Object.create(jh);return t._tag=Bu,t.defect=e,t},Mi=e=>{const t=Object.create(jh);return t._tag=Mh,t.fiberId=e,t},Ql=(e,t)=>{const n=Object.create(jh);return n._tag=Vd,n.left=e,n.right=t,n},Cr=(e,t)=>{const n=Object.create(jh);return n._tag=Kd,n.left=e,n.right=t,n},Qre=e=>De(e,BU),Zre=e=>e._tag===yu,ese=e=>e._tag===Hu,HU=e=>e._tag===Bu,tse=e=>e._tag===yu?!0:Gd(e,!0,(t,n)=>{switch(n._tag){case yu:return ie(t);case Bu:case Hu:case Mh:return ie(!1);default:return re()}}),qU=e=>Bt(sse(e)),MS=e=>DS(void 0,fse)(e),nse=e=>Io(Gd(e,Vn(),(t,n)=>n._tag===Hu?ie(D(t,Mr(n.error))):re())),VU=e=>Io(Gd(e,Vn(),(t,n)=>n._tag===Bu?ie(D(t,Mr(n.defect))):re())),TT=e=>Gd(e,gu(),(t,n)=>n._tag===Mh?ie(D(t,vp(n.fiberId))):re()),AT=e=>jS(e,t=>t._tag===Hu?ie(t.error):re()),KU=e=>{const t=AT(e);switch(t._tag){case"None":return ze(e);case"Some":return Le(t.value)}},rse=e=>jS(e,t=>t._tag===Bu?ie(t.defect):re()),sse=e=>jS(e,t=>t._tag===Mh?ie(t.fiberId):re()),Gj=e=>OT(e,{onEmpty:Xl,onFail:()=>Xl,onDie:ci,onInterrupt:Mi,onSequential:Cr,onParallel:Ql}),ise=e=>OT(e,{onEmpty:Xl,onFail:ci,onDie:ci,onInterrupt:Mi,onSequential:Cr,onParallel:Ql}),ase=T(2,(e,t)=>ose(e,n=>vu(t(n)))),ose=T(2,(e,t)=>OT(e,{onEmpty:Xl,onFail:n=>t(n),onDie:n=>ci(n),onInterrupt:n=>Mi(n),onSequential:(n,r)=>Cr(n,r),onParallel:(n,r)=>Ql(n,r)})),lse=(e,t)=>{let n=Dn(e),r=Dn(t);for(;Po(n)&&Po(r);){const[s,i]=D(ha(n),Gd([gu(),Vn()],([l,c],f)=>{const[u,h]=PE(f);return ie([D(l,rg(u)),D(c,On(h))])})),[a,o]=D(ha(r),Gd([gu(),Vn()],([l,c],f)=>{const[u,h]=PE(f);return ie([D(l,rg(u)),D(c,On(h))])}));if(!Re(s,a))return!1;n=i,r=o}return!0},cse=e=>use(Dn(e),Vn()),use=(e,t)=>{for(;;){const[n,r]=D(e,pT([gu(),Vn()],([i,a],o)=>{const[l,c]=PE(o);return[D(i,rg(l)),D(a,On(c))]})),s=NT(n)>0?D(t,Mr(n)):t;if(ES(r))return Io(s);e=r,t=s}throw new Error(pS("Cause.flattenCauseLoop"))},jS=T(2,(e,t)=>{const n=[e];for(;n.length>0;){const r=n.pop(),s=t(r);switch(s._tag){case"None":{switch(r._tag){case Kd:case Vd:{n.push(r.right),n.push(r.left);break}}break}case"Some":return s}}return re()}),PE=e=>{let t=e;const n=[];let r=gu(),s=Vn();for(;t!==void 0;)switch(t._tag){case yu:{if(n.length===0)return[r,s];t=n.pop();break}case Hu:{if(r=vp(r,o_(t._tag,t.error)),n.length===0)return[r,s];t=n.pop();break}case Bu:{if(r=vp(r,o_(t._tag,t.defect)),n.length===0)return[r,s];t=n.pop();break}case Mh:{if(r=vp(r,o_(t._tag,t.fiberId)),n.length===0)return[r,s];t=n.pop();break}case Kd:{switch(t.left._tag){case yu:{t=t.right;break}case Kd:{t=Cr(t.left.left,Cr(t.left.right,t.right));break}case Vd:{t=Ql(Cr(t.left.left,t.right),Cr(t.left.right,t.right));break}default:{s=Mr(s,t.right),t=t.left;break}}break}case Vd:{n.push(t.right),t=t.left;break}}throw new Error(pS("Cause.evaluateCauseLoop"))},fse={emptyCase:NE,failCase:Ml,dieCase:Ml,interruptCase:NE,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},Yj="SequentialCase",Wj="ParallelCase",OT=T(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:s,onParallel:i,onSequential:a})=>DS(e,void 0,{emptyCase:()=>n,failCase:(o,l)=>r(l),dieCase:(o,l)=>t(l),interruptCase:(o,l)=>s(l),sequentialCase:(o,l,c)=>a(l,c),parallelCase:(o,l,c)=>i(l,c)})),Gd=T(3,(e,t,n)=>{let r=t,s=e;const i=[];for(;s!==void 0;){const a=n(r,s);switch(r=Bt(a)?a.value:r,s._tag){case Kd:{i.push(s.right),s=s.left;break}case Vd:{i.push(s.right),s=s.left;break}default:{s=void 0;break}}s===void 0&&i.length>0&&(s=i.pop())}return r}),DS=T(3,(e,t,n)=>{const r=[e],s=[];for(;r.length>0;){const a=r.pop();switch(a._tag){case yu:{s.push(ze(n.emptyCase(t)));break}case Hu:{s.push(ze(n.failCase(t,a.error)));break}case Bu:{s.push(ze(n.dieCase(t,a.defect)));break}case Mh:{s.push(ze(n.interruptCase(t,a.fiberId)));break}case Kd:{r.push(a.right),r.push(a.left),s.push(Le({_tag:Yj}));break}case Vd:{r.push(a.right),r.push(a.left),s.push(Le({_tag:Wj}));break}}}const i=[];for(;s.length>0;){const a=s.pop();switch(a._tag){case"Left":{switch(a.left._tag){case Yj:{const o=i.pop(),l=i.pop(),c=n.sequentialCase(t,o,l);i.push(c);break}case Wj:{const o=i.pop(),l=i.pop(),c=n.parallelCase(t,o,l);i.push(c);break}}break}case"Right":{i.push(a.right);break}}}if(i.length===0)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return i.pop()}),Dh=(e,t)=>MS(e)?"All fibers interrupted without errors.":YU(e).map(function(n){return(t==null?void 0:t.renderErrorCause)!==!0||n.cause===void 0?n.stack:`${n.stack} {
65
+ ${GU(n.cause," ")}
66
+ }`}).join(`
67
+ `),GU=(e,t)=>{const n=e.stack.split(`
68
+ `);let r=`${t}[cause]: ${n[0]}`;for(let s=1,i=n.length;s<i;s++)r+=`
69
+ ${t}${n[s]}`;return e.cause&&(r+=` {
70
+ ${GU(e.cause,`${t} `)}
71
+ ${t}}`),r};class Nx extends globalThis.Error{constructor(n){const r=typeof n=="object"&&n!==null,s=Error.stackTraceLimit;Error.stackTraceLimit=1;super(dse(n),r&&"cause"in n&&typeof n.cause<"u"?{cause:new Nx(n.cause)}:void 0);w(this,"span");this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=s,this.name=n instanceof Error?n.name:"Error",r&&(Yd in n&&(this.span=n[Yd]),Object.keys(n).forEach(i=>{i in this||(this[i]=n[i])})),this.stack=mse(`${this.name}: ${this.message}`,n instanceof Error&&n.stack?n.stack:"",this.span)}}const dse=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(De(e,"toString")&&Eh(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return H5(e)},hse=/\((.*)\)/g,Tx=Fe("effect/Tracer/spanToTrace",()=>new WeakMap),mse=(e,t,n)=>{const r=[e],s=t.startsWith(e)?t.slice(e.length).split(`
72
+ `):t.split(`
73
+ `);for(let i=1;i<s.length;i++){if(s[i].includes(" at new BaseEffectError")||s[i].includes(" at new YieldableError")){i++;continue}if(s[i].includes("Generator.next")||s[i].includes("effect_internal_function"))break;r.push(s[i].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(n){let i=n,a=0;for(;i&&i._tag==="Span"&&a<10;){const o=Tx.get(i);if(typeof o=="function"){const l=o();if(typeof l=="string"){const c=l.matchAll(hse);let f=!1;for(const[,u]of c)f=!0,r.push(` at ${i.name} (${u})`);f||r.push(` at ${i.name} (${l.replace(/^at /,"")})`)}else r.push(` at ${i.name}`)}else r.push(` at ${i.name}`);i=Zs(i.parent),a++}}return r.join(`
74
+ `)},Yd=Symbol.for("effect/SpanAnnotation"),YU=e=>DS(e,void 0,{emptyCase:()=>[],dieCase:(t,n)=>[new Nx(n)],failCase:(t,n)=>[new Nx(n)],interruptCase:()=>[],parallelCase:(t,n,r)=>[...n,...r],sequentialCase:(t,n,r)=>[...n,...r]}),$E=Symbol.for("effect/Duration"),WU=BigInt(0),Jj=BigInt(24),Sv=BigInt(60),zE=BigInt(1e3),Xj=BigInt(1e6),Qj=BigInt(1e9),pse=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,mi=e=>{if(JU(e))return e;if(jo(e))return bu(e);if(mS(e))return l_(e);if(Array.isArray(e)&&e.length===2&&e.every(jo))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?Wd:e[0]===1/0||e[1]===1/0?bse:l_(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if($s(e)){const t=pse.exec(e);if(t){const[n,r,s]=t,i=Number(r);switch(s){case"nano":case"nanos":return l_(BigInt(r));case"micro":case"micros":return xse(BigInt(r));case"milli":case"millis":return bu(i);case"second":case"seconds":return QU(i);case"minute":case"minutes":return Sse(i);case"hour":case"hours":return wse(i);case"day":case"days":return _se(i);case"week":case"weeks":return kse(i)}}}throw new Error("Invalid DurationInput")},Zj={_tag:"Millis",millis:0},gse={_tag:"Infinity"},yse={[$E]:$E,[Ve](){return Ot(this,U5(this.value))},[Ke](e){return JU(e)&&Ose(this,e)},toString(){return`Duration(${jse(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:Rse(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},Da=e=>{const t=Object.create(yse);return jo(e)?isNaN(e)||e<=0?t.value=Zj:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=gse:e<=WU?t.value=Zj:t.value={_tag:"Nanos",nanos:e},t},JU=e=>De(e,$E),XU=e=>e.value._tag!=="Infinity",vse=e=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===WU;case"Infinity":return!1}},Wd=Da(0),bse=Da(1/0),l_=e=>Da(e),xse=e=>Da(e*zE),bu=e=>Da(e),QU=e=>Da(e*1e3),Sse=e=>Da(e*6e4),wse=e=>Da(e*36e5),_se=e=>Da(e*864e5),kse=e=>Da(e*6048e5),Ax=e=>ZU(e,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),Ese=e=>ZU(e,{onMillis:t=>t/36e5,onNanos:t=>Number(t)/36e11}),Cse=e=>{const t=mi(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))}},Rse=e=>{const t=mi(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/Qj),Number(t.value.nanos%Qj)];case"Millis":return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},ZU=T(2,(e,t)=>{const n=mi(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)}}),MT=T(3,(e,t,n)=>{const r=mi(e),s=mi(t);if(r.value._tag==="Infinity"||s.value._tag==="Infinity")return n.onMillis(Ax(r),Ax(s));if(r.value._tag==="Nanos"||s.value._tag==="Nanos"){const i=r.value._tag==="Nanos"?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),a=s.value._tag==="Nanos"?s.value.nanos:BigInt(Math.round(s.value.millis*1e6));return n.onNanos(i,a)}return n.onMillis(r.value.millis,s.value.millis)}),Nse=(e,t)=>MT(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r}),Tse=T(2,(e,t)=>MT(e,t,{onMillis:(n,r)=>n<=r,onNanos:(n,r)=>n<=r})),Ase=T(2,(e,t)=>MT(e,t,{onMillis:(n,r)=>n>=r,onNanos:(n,r)=>n>=r})),Ose=T(2,(e,t)=>Nse(mi(e),mi(t))),Mse=e=>{const t=mi(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=Cse(t),r=n/Xj,s=r/zE,i=s/Sv,a=i/Sv,o=a/Jj;return{days:Number(o),hours:Number(a%Jj),minutes:Number(i%Sv),seconds:Number(s%Sv),millis:Number(r%zE),nanos:Number(n%Xj)}},jse=e=>{const t=mi(e);if(t.value._tag==="Infinity")return"Infinity";if(vse(t))return"0";const n=Mse(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(" ")},eD=Symbol.for("effect/MutableRef"),Dse={[eD]:eD,toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:nn(this.current)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},ny=e=>{const t=Object.create(Dse);return t.current=e,t},Ise=T(3,(e,t,n)=>Re(t,e.current)?(e.current=n,!0):!1),Fn=e=>e.current,ry=T(2,(e,t)=>(e.current=t,e)),IS="effect/FiberId",xu=Symbol.for(IS),Jd="None",LE="Runtime",FE="Composite",Pse=Wt(`${IS}-${Jd}`);var Az;let $se=class{constructor(){w(this,Az,xu);w(this,"_tag",Jd);w(this,"id",-1);w(this,"startTimeMillis",-1)}[(Az=xu,Ve)](){return Pse}[Ke](t){return jT(t)&&t._tag===Jd}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[pt](){return this.toJSON()}};var Oz;class e6{constructor(t,n){w(this,"id");w(this,"startTimeMillis");w(this,Oz,xu);w(this,"_tag",LE);this.id=t,this.startTimeMillis=n}[(Oz=xu,Ve)](){return Ot(this,Wt(`${IS}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[Ke](t){return jT(t)&&t._tag===LE&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[pt](){return this.toJSON()}}var Mz;let zse=class{constructor(t,n){w(this,"left");w(this,"right");w(this,Mz,xu);w(this,"_tag",FE);w(this,"_hash");this.left=t,this.right=n}[(Mz=xu,Ve)](){return D(Wt(`${IS}-${this._tag}`),Ge(be(this.left)),Ge(be(this.right)),Ot(this))}[Ke](t){return jT(t)&&t._tag===FE&&Re(this.left,t.left)&&Re(this.right,t.right)}toString(){return zt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:nn(this.left),right:nn(this.right)}}[pt](){return this.toJSON()}};const t6=new $se,jT=e=>De(e,xu),n6=T(2,(e,t)=>e._tag===Jd?t:t._tag===Jd?e:new zse(e,t)),Lse=e=>D(e,sg(t6,(t,n)=>n6(n)(t))),Ox=e=>{switch(e._tag){case Jd:return gu();case LE:return RT(e.id);case FE:return D(Ox(e.left),rg(Ox(e.right)))}},tD=Fe(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>ny(0)),Fse=(e,t)=>new e6(e,t),r6=e=>Array.from(Ox(e)).map(n=>`#${n}`).join(","),Use=()=>{const e=Fn(tD);return D(tD,ry(e+1)),new e6(e,Date.now())},Os=t6,bp=n6,Bse=Lse,s6=Ox,Hse=Fse,qse=r6,i6=Use,PS=NS,Vse=Are,Kse=Mre,a6=jre,o6=tg,l6=jU,Gse=kT,Yse=zre,Wse=IU,c6=TS,ig=Symbol.for("effect/List"),UE=e=>kt(e),Jse=e=>rU(_S(e),UE),Xse=Jse(Re),Qse={[ig]:ig,_tag:"Cons",toString(){return zt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:UE(this).map(nn)}},[pt](){return this.toJSON()},[Ke](e){return f6(e)&&this._tag===e._tag&&Xse(this,e)},[Ve](){return Ot(this,Ch(UE(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 xe(this,arguments)}},Mx=(e,t)=>{const n=Object.create(Qse);return n.head=e,n.tail=t,n},Zse=Wt("Nil"),eie={[ig]:ig,_tag:"Nil",toString(){return zt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[pt](){return this.toJSON()},[Ve](){return Zse},[Ke](e){return f6(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return xe(this,arguments)}},u6=Object.create(eie),f6=e=>De(e,ig),ko=e=>e._tag==="Nil",tie=e=>e._tag==="Cons",nie=()=>u6,Su=(e,t)=>Mx(e,t),Xd=nie,DT=e=>Mx(e,u6),rie=T(2,(e,t)=>iie(t,e)),sie=T(2,(e,t)=>Su(t,e)),iie=T(2,(e,t)=>{if(ko(e))return t;if(ko(t))return e;{const n=Mx(t.head,e);let r=n,s=t.tail;for(;!ko(s);){const i=Mx(s.head,e);r.tail=i,r=i,s=s.tail}return n}}),aie=T(3,(e,t,n)=>{let r=t,s=e;for(;!ko(s);)r=n(r,s.head),s=s.tail;return r}),oie=e=>{let t=Xd(),n=e;for(;!ko(n);)t=sie(t,n.head),n=n.tail;return t},lie=Object.assign(Object.create(Array.prototype),{[Ve](){return Ot(this,Ch(this))},[Ke](e){return Array.isArray(e)&&this.length===e.length?this.every((t,n)=>Re(t,e[n])):!1}}),sy=function(){function e(t){t&&Object.assign(this,t)}return e.prototype=ey,e}(),cie=e=>Object.assign(Object.create(ey),e),uie=Symbol.for("effect/DifferContextPatch");function nD(e){return e}const iy={...sy.prototype,[uie]:{_Value:nD,_Patch:nD}},fie=Object.assign(Object.create(iy),{_tag:"Empty"}),die=Object.create(fie),d6=()=>die,hie=Object.assign(Object.create(iy),{_tag:"AndThen"}),mie=(e,t)=>{const n=Object.create(hie);return n.first=e,n.second=t,n},pie=Object.assign(Object.create(iy),{_tag:"AddService"}),gie=(e,t)=>{const n=Object.create(pie);return n.key=e,n.service=t,n},yie=Object.assign(Object.create(iy),{_tag:"RemoveService"}),vie=e=>{const t=Object.create(yie);return t.key=e,t},bie=Object.assign(Object.create(iy),{_tag:"UpdateService"}),xie=(e,t)=>{const n=Object.create(bie);return n.key=e,n.update=t,n},Sie=(e,t)=>{const n=new Map(e.unsafeMap);let r=d6();for(const[s,i]of t.unsafeMap.entries())if(n.has(s)){const a=n.get(s);n.delete(s),Re(a,i)||(r=mb(xie(s,()=>i))(r))}else n.delete(s),r=mb(gie(s,i))(r);for(const[s]of n.entries())r=mb(vie(s))(r);return r},mb=T(2,(e,t)=>mie(e,t)),wie=T(2,(e,t)=>{if(e._tag==="Empty")return t;let n=!1,r=Dn(e);const s=new Map(t.unsafeMap);for(;Po(r);){const a=ha(r),o=ho(r);switch(a._tag){case"Empty":{r=o;break}case"AddService":{s.set(a.key,a.service),r=o;break}case"AndThen":{r=Mr(Mr(o,a.second),a.first);break}case"RemoveService":{s.delete(a.key),r=o;break}case"UpdateService":{s.set(a.key,a.update(s.get(a.key))),n=!0,r=o;break}}}if(!n)return Yl(s);const i=new Map;for(const[a]of t.unsafeMap)s.has(a)&&(i.set(a,s.get(a)),s.delete(a));for(const[a,o]of s)i.set(a,o);return Yl(i)}),_ie=Symbol.for("effect/DifferHashSetPatch");function c_(e){return e}const $S={...sy.prototype,[_ie]:{_Value:c_,_Key:c_,_Patch:c_}},kie=Object.assign(Object.create($S),{_tag:"Empty"}),Eie=Object.create(kie),h6=()=>Eie,Cie=Object.assign(Object.create($S),{_tag:"AndThen"}),Rie=(e,t)=>{const n=Object.create(Cie);return n.first=e,n.second=t,n},Nie=Object.assign(Object.create($S),{_tag:"Add"}),Tie=e=>{const t=Object.create(Nie);return t.value=e,t},Aie=Object.assign(Object.create($S),{_tag:"Remove"}),Oie=e=>{const t=Object.create(Aie);return t.value=e,t},Mie=(e,t)=>{const[n,r]=sg([e,h6()],([s,i],a)=>LU(a)(s)?[FU(a)(s),i]:[s,BE(Tie(a))(i)])(t);return sg(r,(s,i)=>BE(Oie(i))(s))(n)},BE=T(2,(e,t)=>Rie(e,t)),jie=T(2,(e,t)=>{if(e._tag==="Empty")return t;let n=t,r=Dn(e);for(;Po(r);){const s=ha(r),i=ho(r);switch(s._tag){case"Empty":{r=i;break}case"AndThen":{r=Mr(s.first)(Mr(s.second)(i));break}case"Add":{n=vp(s.value)(n),r=i;break}case"Remove":n=FU(s.value)(n),r=i}}return n}),Die=Symbol.for("effect/DifferReadonlyArrayPatch");function rD(e){return e}const ay={...sy.prototype,[Die]:{_Value:rD,_Patch:rD}},Iie=Object.assign(Object.create(ay),{_tag:"Empty"}),Pie=Object.create(Iie),m6=()=>Pie,$ie=Object.assign(Object.create(ay),{_tag:"AndThen"}),zie=(e,t)=>{const n=Object.create($ie);return n.first=e,n.second=t,n},Lie=Object.assign(Object.create(ay),{_tag:"Append"}),Fie=e=>{const t=Object.create(Lie);return t.values=e,t},Uie=Object.assign(Object.create(ay),{_tag:"Slice"}),Bie=(e,t)=>{const n=Object.create(Uie);return n.from=e,n.until=t,n},Hie=Object.assign(Object.create(ay),{_tag:"Update"}),qie=(e,t)=>{const n=Object.create(Hie);return n.index=e,n.patch=t,n},Vie=e=>{let t=0,n=m6();for(;t<e.oldValue.length&&t<e.newValue.length;){const r=e.oldValue[t],s=e.newValue[t],i=e.differ.diff(r,s);Re(i,e.differ.empty)||(n=pb(n,qie(t,i))),t=t+1}return t<e.oldValue.length&&(n=pb(n,Bie(0,t))),t<e.newValue.length&&(n=pb(n,Fie(ere(t)(e.newValue)))),n},pb=T(2,(e,t)=>zie(e,t)),Kie=T(3,(e,t,n)=>{if(e._tag==="Empty")return t;let r=t.slice(),s=Ti(e);for(;dd(s);){const i=qr(s),a=mu(s);switch(i._tag){case"Empty":{s=a;break}case"AndThen":{a.unshift(i.first,i.second),s=a;break}case"Append":{for(const o of i.values)r.push(o);s=a;break}case"Slice":{r=r.slice(i.from,i.until),s=a;break}case"Update":{r[i.index]=n.patch(i.patch,r[i.index]),s=a;break}}}return r}),Gie=Symbol.for("effect/Differ"),Yie={[Gie]:{_P:Oe,_V:Oe},pipe(){return xe(this,arguments)}},Ih=e=>{const t=Object.create(Yie);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},Wie=()=>Ih({empty:d6(),combine:(e,t)=>mb(t)(e),diff:(e,t)=>Sie(e,t),patch:(e,t)=>wie(t)(e)}),Jie=()=>Ih({empty:h6(),combine:(e,t)=>BE(t)(e),diff:(e,t)=>Mie(e,t),patch:(e,t)=>jie(t)(e)}),Xie=e=>Ih({empty:m6(),combine:(t,n)=>pb(t,n),diff:(t,n)=>Vie({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>Kie(t,n,e)}),p6=()=>Qie((e,t)=>t),Qie=e=>Ih({empty:Oe,combine:(t,n)=>t===Oe?n:n===Oe?t:r=>n(t(r)),diff:(t,n)=>Re(t,n)?Oe:Xg(n),patch:(t,n)=>e(n,t(n))}),ag=255,g6=8,HE=e=>e&ag,qE=e=>e>>g6&ag,oy=(e,t)=>(e&ag)+((t&e&ag)<<g6),Zie=oy(0,0),eae=e=>oy(e,e),tae=e=>oy(e,0),nae=T(2,(e,t)=>oy(HE(e)&~t,qE(e))),rae=T(2,(e,t)=>e|t),sae=e=>~e>>>0&ag,iae=0,qu=1,aae=2,y6=4,VE=16,v6=32,oae=e=>zS(e,v6),lae=T(2,(e,t)=>e&~t),cae=T(2,(e,t)=>e|t),al=e=>b6(e)&&!fae(e),b6=e=>zS(e,qu),zS=T(2,(e,t)=>(e&t)!==0),x6=(...e)=>e.reduce((t,n)=>t|n,0),uae=x6(iae),sD=e=>zS(e,y6),fae=e=>zS(e,VE),Dl=T(2,(e,t)=>oy(e^t,t)),md=T(2,(e,t)=>e&(sae(HE(t))|qE(t))|HE(t)&qE(t)),iD=Ih({empty:Zie,diff:(e,t)=>Dl(e,t),combine:(e,t)=>rae(t)(e),patch:(e,t)=>md(t,e)}),dae=eae,S6=tae,aD=nae,w6=(e,t)=>({_tag:"Par",left:e,right:t}),wv=(e,t)=>({_tag:"Seq",left:e,right:t}),hae=e=>{let t=DT(e),n=Xd();for(;;){const[r,s]=aie(t,[_6(),Xd()],([i,a],o)=>{const[l,c]=mae(o);return[bae(i,l),rie(a,c)]});if(n=pae(n,r),ko(s))return oie(n);t=s}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},mae=e=>{let t=e,n=_6(),r=Xd(),s=Xd();for(;;)switch(t._tag){case"Empty":{if(ko(r))return[n,s];t=r.head,r=r.tail;break}case"Par":{r=Su(t.right,r),t=t.left;break}case"Seq":{const i=t.left,a=t.right;switch(i._tag){case"Empty":{t=a;break}case"Par":{const o=i.left,l=i.right;t=w6(wv(o,a),wv(l,a));break}case"Seq":{const o=i.left,l=i.right;t=wv(o,wv(l,a));break}case"Single":{t=i,s=Su(a,s);break}}break}case"Single":{if(n=vae(n,t),ko(r))return[n,s];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")},pae=(e,t)=>{if(ko(e))return DT(u_(t));if(xae(t))return e;const n=Cae(e.head),r=Sae(t);return n.length===1&&r.length===1&&Re(n[0],r[0])?Su(Eae(e.head,u_(t)),e.tail):Su(u_(t),e)},gae=Symbol.for("effect/RequestBlock/RequestBlockParallel"),yae={_R:e=>e};var jz;jz=gae;class IT{constructor(t){w(this,"map");w(this,jz,yae);this.map=t}}const _6=()=>new IT(PS()),vae=(e,t)=>new IT(Gse(e.map,t.dataSource,n=>Nne(os(n,ME(t.blockedRequest)),()=>Dn(t.blockedRequest)))),bae=(e,t)=>new IT(c6(e.map,t.map,(n,r,s)=>o6(n,s,Ft(a6(n,s),{onNone:()=>r,onSome:i=>On(r,i)})))),xae=e=>Kse(e.map),Sae=e=>Array.from(l6(e.map)),u_=e=>kae(Yse(e.map,t=>Dn(t))),wae=Symbol.for("effect/RequestBlock/RequestBlockSequential"),_ae={_R:e=>e};var Dz;Dz=wae;class k6{constructor(t){w(this,"map");w(this,Dz,_ae);this.map=t}}const kae=e=>new k6(e),Eae=(e,t)=>new k6(c6(t.map,e.map,(n,r,s)=>o6(n,s,Ft(a6(n,s),{onNone:()=>Vn(),onSome:i=>On(i,r)})))),Cae=e=>Array.from(l6(e.map)),Rae=e=>Array.from(e.map),ly="Pending",LS="Done",Nae="effect/Deferred",Tae=Symbol.for(Nae),Aae={_E:e=>e,_A:e=>e},Oae=e=>({_tag:ly,joiners:e}),E6=e=>({_tag:LS,effect:e});class cy{constructor(t){w(this,"self");w(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 cy(this.self)}}const C6=(e,t)=>{const n=new In("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},Mae=e=>{const t=new In("RunBlocked");return t.effect_instruction_i0=e,t},wu=Symbol.for("effect/Effect");class jae{constructor(t,n){w(this,"patch");w(this,"op");w(this,"_op",rT);this.patch=t,this.op=n}}var Iz;class In{constructor(t){w(this,"_op");w(this,"effect_instruction_i0");w(this,"effect_instruction_i1");w(this,"effect_instruction_i2");w(this,"trace");w(this,Iz,Ud);this._op=t}[(Iz=wu,Ke)](t){return this===t}[Ve](){return Ot(this,ZN(this))}pipe(){return xe(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:nn(this.effect_instruction_i0),effect_instruction_i1:nn(this.effect_instruction_i1),effect_instruction_i2:nn(this.effect_instruction_i2)}}toString(){return zt(this.toJSON())}[pt](){return this.toJSON()}[Symbol.iterator](){return new cy(new Qg(this))}}var Pz;class R6{constructor(t){w(this,"_op");w(this,"effect_instruction_i0");w(this,"effect_instruction_i1");w(this,"effect_instruction_i2");w(this,"trace");w(this,Pz,Ud);this._op=t,this._tag=t}[(Pz=wu,Ke)](t){return WS(t)&&t._op==="Failure"&&Re(this.effect_instruction_i0,t.effect_instruction_i0)}[Ve](){return D(Wt(this._tag),Ge(be(this.effect_instruction_i0)),Ot(this))}get cause(){return this.effect_instruction_i0}pipe(){return xe(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return zt(this.toJSON())}[pt](){return this.toJSON()}[Symbol.iterator](){return new cy(new Qg(this))}}var $z;class N6{constructor(t){w(this,"_op");w(this,"effect_instruction_i0");w(this,"effect_instruction_i1");w(this,"effect_instruction_i2");w(this,"trace");w(this,$z,Ud);this._op=t,this._tag=t}[($z=wu,Ke)](t){return WS(t)&&t._op==="Success"&&Re(this.effect_instruction_i0,t.effect_instruction_i0)}[Ve](){return D(Wt(this._tag),Ge(be(this.effect_instruction_i0)),Ot(this))}get value(){return this.effect_instruction_i0}pipe(){return xe(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:nn(this.value)}}toString(){return zt(this.toJSON())}[pt](){return this.toJSON()}[Symbol.iterator](){return new cy(new Qg(this))}}const qo=e=>De(e,wu),vt=e=>{const t=new In(K5);return t.effect_instruction_i0=e,t},T6=T(3,(e,t,n)=>Hi(r=>ne(e,s=>ne(Il(Je(()=>r(t(s)))),i=>Je(()=>n(s,i)).pipe(pi({onFailure:a=>{switch(i._tag){case rr:return Kn(Cr(i.effect_instruction_i0,a));case sr:return Kn(a)}},onSuccess:()=>i})))))),Gr=T(2,(e,t)=>ne(e,()=>ge(t))),vi=e=>Gr(e,void 0),A6=function(){const e=new In(xS);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(pS("you're not supposed to end up here"))}return e},jx=(e,t=Os)=>{const n=new In(pp);let r;return n.effect_instruction_i0=s=>{r=e(s)},n.effect_instruction_i1=t,fy(n,s=>qo(r)?r:At)},Sl=(e,t=Os)=>Je(()=>jx(e,t)),Bi=(e,t=Os)=>A6(e,function(){let n,r;function s(l){n?n(l):r===void 0&&(r=l)}const i=new In(pp);i.effect_instruction_i0=l=>{n=l,r&&l(r)},i.effect_instruction_i1=t;let a,o;return this.effect_instruction_i0.length!==1?(o=new AbortController,a=hr(()=>this.effect_instruction_i0(s,o.signal))):a=hr(()=>this.effect_instruction_i0(s)),a||o?fy(i,l=>(o&&o.abort(),a??At)):i}),O6=T(2,(e,t)=>{const n=new In(fb);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),og=T(2,(e,t)=>Zl(e,{onFailure:t,onSuccess:ge})),oD=Symbol.for("effect/OriginalAnnotation"),PT=(e,t)=>Bt(t)?new Proxy(e,{has(n,r){return r===Yd||r===oD||r in n},get(n,r){return r===Yd?t.value:r===oD?e:n[r]}}):e,wl=e=>Ui(e)&&!(Yd in e)?vt(t=>Kn(ci(PT(e,QT(t))))):Kn(ci(e)),M6=e=>j6(()=>ci(new doe(e))),Qd=e=>Zl(e,{onFailure:t=>ge(Le(t)),onSuccess:t=>ge(ze(t))}),Il=e=>D6(e,{onFailure:Rt,onSuccess:Tt}),yn=e=>Ui(e)&&!(Yd in e)?vt(t=>Kn(vu(PT(e,QT(t))))):Kn(vu(e)),FS=e=>ne(oe(e),yn),Kn=e=>{const t=new R6(rr);return t.effect_instruction_i0=e,t},j6=e=>ne(oe(e),Kn),US=vt(e=>ge(e.id())),uy=e=>vt(t=>e(t.id())),ne=T(2,(e,t)=>{const n=new In(xx);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Dae=e=>{const t=new In("OnStep");return t.effect_instruction_i0=e,t},BS=e=>ne(e,Oe),D6=T(2,(e,t)=>pi(e,{onFailure:n=>ge(t.onFailure(n)),onSuccess:n=>ge(t.onSuccess(n))})),pi=T(2,(e,t)=>{const n=new In(Sx);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),Zl=T(2,(e,t)=>pi(e,{onFailure:n=>{if(VU(n).length>0)return Kn(ise(n));const s=nse(n);return s.length>0?t.onFailure(vT(s)):Kn(n)},onSuccess:t.onSuccess})),mo=T(2,(e,t)=>Je(()=>{const n=kt(e),r=wS(n.length);let s=0;return Gr(UT({while:()=>s<n.length,body:()=>t(n[s],s),step:i=>{r[s++]=i}}),r)})),HS=T(2,(e,t)=>Je(()=>{const n=kt(e);let r=0;return UT({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),Za=ne(US,e=>I6(e)),I6=e=>Kn(Mi(e)),$T=e=>{const t=new In(Rh);return t.effect_instruction_i0=dae(qu),t.effect_instruction_i1=()=>e,t},P6=T(2,(e,t)=>Hi(n=>ne(Il(n(e)),r=>Q6(t,r)))),nt=T(2,(e,t)=>ne(e,n=>oe(()=>t(n)))),zT=T(2,(e,t)=>Zl(e,{onFailure:n=>FS(()=>t.onFailure(n)),onSuccess:n=>oe(()=>t.onSuccess(n))})),qS=T(2,(e,t)=>pi(e,{onFailure:n=>{const r=KU(n);switch(r._tag){case"Left":return FS(()=>t(r.left));case"Right":return Kn(r.right)}},onSuccess:ge})),_u=T(2,(e,t)=>Hi(n=>pi(n(e),{onFailure:r=>{const s=Rt(r);return pi(t(s),{onFailure:i=>Rt(Cr(r,i)),onSuccess:()=>s})},onSuccess:r=>{const s=Tt(r);return dn(t(s),s)}}))),fy=T(2,(e,t)=>_u(e,JS({onFailure:n=>MS(n)?vi(t(TT(n))):At,onSuccess:()=>At}))),Iae=e=>Pae(e,Oe),Pae=T(2,(e,t)=>Zl(e,{onFailure:n=>wl(t(n)),onSuccess:ge})),$ae=vt((e,t)=>ge(t.runtimeFlags)),ge=e=>{const t=new N6(sr);return t.effect_instruction_i0=e,t},Je=e=>{const t=new In(xS);return t.commit=e,t},oe=e=>{const t=new In(V5);return t.effect_instruction_i0=e,t},LT=T(e=>e.length===3||e.length===2&&!(Ui(e[1])&&"onlyEffect"in e[1]),(e,t)=>ne(e,n=>{const r=typeof t=="function"?t(n):t;return qo(r)?Gr(r,n):ute(r)?jx(s=>{r.then(i=>s(ge(n)),i=>s(yn(new GT(i,"An unknown error occurred in Effect.tap"))))}):ge(n)})),zae=e=>vt(t=>{const n=t.getFiberRef(YE),r=D(n,Kt(()=>t.scope()));return e(Ph(YE,ie(r)))}),dy=e=>{const t=new In(Rh);return t.effect_instruction_i0=S6(qu),t.effect_instruction_i1=()=>e,t},Hi=e=>A6(e,function(){const t=new In(Rh);return t.effect_instruction_i0=S6(qu),t.effect_instruction_i1=n=>b6(n)?hr(()=>this.effect_instruction_i0($T)):hr(()=>this.effect_instruction_i0(dy)),t}),At=ge(void 0),$6=e=>{const t=new In(Rh);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},FT=T(2,(e,t)=>ne(t,n=>n?D(e,nt(ie)):ge(re()))),UT=e=>{const t=new In(wx);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},KE=e=>Je(()=>{const t=new In(gp);return t.effect_instruction_i0=e(),t}),z6=function(){const e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return KE(()=>e(D))},L6=(e,...t)=>Object.defineProperty(t.length===0?function(...n){return KE(()=>e.apply(this,n))}:function(...n){let r=KE(()=>e.apply(this,n));for(const s of t)r=s(r,...n);return r},"length",{value:e.length,configurable:!0}),Lae=T(2,(e,t)=>{const n=new In(Rh);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),BT=e=>{const t=new In(db);return typeof(e==null?void 0:e.priority)<"u"?roe(t,e.priority):t},VS=T(2,(e,t)=>ne(e,n=>nt(t,r=>[n,r]))),KS=T(2,(e,t)=>ne(e,n=>Gr(t,n))),dn=T(2,(e,t)=>ne(e,()=>t)),F6=T(3,(e,t,n)=>ne(e,r=>nt(t,s=>n(r,s)))),Fae=Sl(()=>{const e=setInterval(()=>{},2147483647);return oe(()=>clearInterval(e))}),HT=e=>ne(US,t=>D(e,lg(t))),lg=T(2,(e,t)=>ne(e.interruptAsFork(t),()=>e.await)),Uae={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return xe(this,arguments)}},Bae={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:5e4,pipe(){return xe(this,arguments)}},Hae={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return xe(this,arguments)}},U6={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return xe(this,arguments)}},B6={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return xe(this,arguments)}},H6={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return xe(this,arguments)}},qae={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return xe(this,arguments)}},Vae={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return xe(this,arguments)}},Kae="effect/FiberRef",Gae=Symbol.for(Kae),Yae={_A:e=>e},qT=e=>vt(t=>Tt(t.getFiberRef(e))),GS=T(2,(e,t)=>ne(qT(e),t)),lD=T(2,(e,t)=>Wae(e,()=>[void 0,t])),Wae=T(2,(e,t)=>vt(n=>{const[r,s]=t(n.getFiberRef(e));return n.setFiberRef(e,s),ge(r)})),Ph=T(3,(e,t,n)=>T6(KS(qT(t),lD(t,n)),()=>e,r=>lD(t,r))),Jae=T(3,(e,t,n)=>GS(t,r=>Ph(e,t,n(r)))),Gn=(e,t)=>$h(e,{differ:p6(),fork:(t==null?void 0:t.fork)??Oe,join:t==null?void 0:t.join}),Xae=e=>{const t=Jie();return $h(e,{differ:t,fork:t.empty})},Qae=e=>{const t=Xie(p6());return $h(e,{differ:t,fork:t.empty})},q6=e=>{const t=Wie();return $h(e,{differ:t,fork:t.empty})},$h=(e,t)=>({...ty,[Gae]:Yae,initial:e,commit(){return qT(this)},diff:(r,s)=>t.differ.diff(r,s),combine:(r,s)=>t.differ.combine(r,s),patch:r=>s=>t.differ.patch(r,s),fork:t.fork,join:t.join??((r,s)=>s)}),Zae=e=>$h(e,{differ:iD,fork:iD.empty}),Ia=Fe(Symbol.for("effect/FiberRef/currentContext"),()=>q6(Ea())),zh=Fe(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Gn(0)),V6=Fe(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Gn(2048)),eoe=Fe(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Gn(PS())),toe=Fe(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Gn(B6)),noe=Fe(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Gn(Xd())),roe=T(2,(e,t)=>Ph(e,zh,t)),soe=Fe(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Gn("unbounded")),ioe=Fe(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Gn(!0)),aoe=Fe(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Gn(ie(H6))),ooe=Fe(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Gn(ie(U6))),GE=Fe(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>Qae(Wl())),YE=Fe(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Gn(re(),{fork:()=>re(),join:(e,t)=>e})),_v=Fe(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Gn(Xl,{fork:()=>Xl,join:(e,t)=>e})),K6=Fe(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Gn(!0)),G6=Fe(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Gn(!0)),loe=Fe(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Gn(PS())),coe=Fe(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Gn(Vn())),cD=Symbol.for("effect/Scope"),uD=Symbol.for("effect/CloseableScope"),Y6=(e,t)=>e.addFinalizer(()=>vi(t)),Dx=(e,t)=>e.addFinalizer(t),WE=(e,t)=>e.close(t),ao=(e,t)=>e.fork(t),uoe=e=>foe(Oe)(e),foe=T(2,(e,t)=>{const n=D(e,AT,os(t));switch(n._tag){case"None":return D(VU(e),yT,Ft({onNone:()=>{const r=kt(TT(e)).flatMap(s=>kt(s6(s)).map(i=>`#${i}`));return new hoe(r?`Interrupted by fibers: ${r.join(", ")}`:void 0)},onSome:Oe}));case"Some":return n.value}}),VT=function(){class e extends globalThis.Error{commit(){return yn(this)}toJSON(){const n={...this};return this.message&&(n.message=this.message),this.cause&&(n.cause=this.cause),n}[pt](){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?Dh(vu(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,Ite),e}(),KT=(e,t)=>{class n extends VT{constructor(){super(...arguments);w(this,"_tag",t)}}return Object.assign(n.prototype,e),n.prototype.name=t,n},fD=Symbol.for("effect/Cause/errors/RuntimeException"),doe=KT({[fD]:fD},"RuntimeException"),JE=Symbol.for("effect/Cause/errors/InterruptedException"),hoe=KT({[JE]:JE},"InterruptedException"),moe=e=>De(e,JE),dD=Symbol.for("effect/Cause/errors/NoSuchElement"),YS=KT({[dD]:dD},"NoSuchElementException"),hD=Symbol.for("effect/Cause/errors/UnknownException"),GT=function(){class e extends VT{constructor(r,s){super(s??"An unknown error occurred",{cause:r});w(this,"_tag","UnknownException");w(this,"error");this.error=r}}return Object.assign(e.prototype,{[hD]:hD,name:"UnknownException"}),e}(),WS=e=>qo(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure"),W6=e=>e._tag==="Failure",poe=e=>e._tag==="Success",gb=T(2,(e,t)=>{switch(e._tag){case rr:return Rt(e.effect_instruction_i0);case sr:return Tt(t)}}),f_=e=>gb(e,void 0),pd=(e,t)=>xoe(e,t!=null&&t.parallel?Ql:Cr),J6=e=>Rt(ci(e)),cg=e=>Rt(vu(e)),Rt=e=>{const t=new R6(rr);return t.effect_instruction_i0=e,t},goe=T(2,(e,t)=>{switch(e._tag){case rr:return Rt(e.effect_instruction_i0);case sr:return t(e.effect_instruction_i0)}}),yoe=e=>D(e,goe(Oe)),voe=e=>Rt(Mi(e)),yb=T(2,(e,t)=>{switch(e._tag){case rr:return Rt(e.effect_instruction_i0);case sr:return Tt(t(e.effect_instruction_i0))}}),JS=T(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case rr:return t(e.effect_instruction_i0);case sr:return n(e.effect_instruction_i0)}}),XE=T(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case rr:return t(e.effect_instruction_i0);case sr:return n(e.effect_instruction_i0)}}),Tt=e=>{const t=new N6(sr);return t.effect_instruction_i0=e,t},Rr=Tt(void 0),boe=T(2,(e,t)=>YT(e,t,{onSuccess:(n,r)=>[n,r],onFailure:Cr})),X6=T(2,(e,t)=>YT(e,t,{onSuccess:(n,r)=>r,onFailure:Cr})),YT=T(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case rr:switch(t._tag){case sr:return Rt(e.effect_instruction_i0);case rr:return Rt(n(e.effect_instruction_i0,t.effect_instruction_i0))}case sr:switch(t._tag){case sr:return Tt(r(e.effect_instruction_i0,t.effect_instruction_i0));case rr:return Rt(t.effect_instruction_i0)}}}),xoe=(e,t)=>{const n=Do(e);return Po(n)?D(ho(n),pT(D(ha(n),yb(Dn)),(r,s)=>D(r,YT(s,{onSuccess:(i,a)=>D(i,Mr(a)),onFailure:t}))),yb(Io),yb(r=>Vr(r)),ie):re()},XS=e=>({...ty,[Tae]:Aae,state:ny(Oae([])),commit(){return ec(this)},blockingOn:e}),QS=()=>ne(US,e=>Soe(e)),Soe=e=>oe(()=>XS(e)),ec=e=>Sl(t=>{const n=Fn(e.state);switch(n._tag){case LS:return t(n.effect);case ly:return n.joiners.push(t),_oe(e,t)}},e.blockingOn),ZS=T(2,(e,t)=>oe(()=>{const n=Fn(e.state);switch(n._tag){case LS:return!1;case ly:{ry(e.state,E6(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t);return!0}}})),Q6=T(2,(e,t)=>ZS(e,t)),Z6=T(2,(e,t)=>ZS(e,Kn(t))),eB=T(2,(e,t)=>ZS(e,I6(t))),woe=e=>oe(()=>Fn(e.state)._tag===LS),WT=T(2,(e,t)=>ZS(e,ge(t))),ew=(e,t)=>{const n=Fn(e.state);if(n._tag===ly){ry(e.state,E6(t));for(let r=0,s=n.joiners.length;r<s;r++)n.joiners[r](t)}},_oe=(e,t)=>oe(()=>{const n=Fn(e.state);if(n._tag===ly){const r=n.joiners.indexOf(t);r>=0&&n.joiners.splice(r,1)}}),koe=vt(e=>Tt(e.currentContext)),JT=()=>koe,Vu=e=>ne(JT(),e),tw=T(2,(e,t)=>Ph(Ia,t)(e)),XT=T(2,(e,t)=>Jae(Ia,n=>us(n,t))(e)),tB=T(2,(e,t)=>Vu(n=>tw(e,t(n)))),QT=e=>{const t=e.currentSpan;return t!==void 0&&t._tag==="Span"?ie(t):re()},Eoe={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:Rr},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},Coe=e=>Object.assign(Object.create(Eoe),e),Roe="effect/Clock",mD=Symbol.for(Roe),Lh=fc("effect/Clock"),Noe=2**31-1,pD={unsafeSchedule(e,t){const n=Ax(t);if(n>Noe)return Ml;let r=!1;const s=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(s),!r)}},gD=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)))}(),Toe=function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return gD;const t=gD()-e.bigint();return()=>t+e.bigint()}();var zz;zz=mD;class Aoe{constructor(){w(this,zz,mD);w(this,"currentTimeMillis",oe(()=>this.unsafeCurrentTimeMillis()));w(this,"currentTimeNanos",oe(()=>this.unsafeCurrentTimeNanos()))}unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Toe()}scheduler(){return ge(pD)}sleep(t){return Bi(n=>{const r=pD.unsafeSchedule(()=>n(At),t);return vi(oe(r))})}}const Ooe=()=>new Aoe,Zd=_ne,Moe=e=>{if(e==="NaN")return fo(NaN);if(e==="Infinity")return fo(1/0);if(e==="-Infinity")return fo(-1/0);if(e.trim()==="")return Bd;const t=Number(e);return Number.isNaN(t)?Bd:fo(t)},Ix=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),nB="And",rB="Or",sB="InvalidData",iB="MissingData",aB="SourceUnavailable",oB="Unsupported",joe="effect/ConfigError",yD=Symbol.for(joe),Fh={_tag:"ConfigError",[yD]:yD},lB=(e,t)=>{const n=Object.create(Fh);return n._op=nB,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},cB=(e,t)=>{const n=Object.create(Fh);return n._op=rB,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},Doe=(e,t,n={pathDelim:"."})=>{const r=Object.create(Fh);return r._op=sB,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Invalid data at ${D(this.path,Oh(n.pathDelim))}: "${this.message}")`}}),r},ku=(e,t,n={pathDelim:"."})=>{const r=Object.create(Fh);return r._op=iB,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Missing data at ${D(this.path,Oh(n.pathDelim))}: "${this.message}")`}}),r},Ioe=(e,t,n,r={pathDelim:"."})=>{const s=Object.create(Fh);return s._op=aB,s.path=e,s.message=t,s.cause=n,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${D(this.path,Oh(r.pathDelim))}: "${this.message}")`}}),s},Poe=(e,t,n={pathDelim:"."})=>{const r=Object.create(Fh);return r._op=oB,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${D(this.path,Oh(n.pathDelim))}: "${this.message}")`}}),r},Vc=T(2,(e,t)=>{switch(e._op){case nB:return lB(Vc(e.left,t),Vc(e.right,t));case rB:return cB(Vc(e.left,t),Vc(e.right,t));case sB:return Doe([...t,...e.path],e.message);case iB:return ku([...t,...e.path],e.message);case aB:return Ioe([...t,...e.path],e.message,e.cause);case oB:return Poe([...t,...e.path],e.message)}}),$oe={_tag:"Empty"},d_=T(2,(e,t)=>{let n=DT(t),r=e;for(;tie(n);){const s=n.head;switch(s._tag){case"Empty":{n=n.tail;break}case"AndThen":{n=Su(s.first,Su(s.second,n.tail));break}case"MapName":{r=nu(r,s.f),n=n.tail;break}case"Nested":{r=kx(r,s.name),n=n.tail;break}case"Unnested":{if(D(yp(r),Pne(s.name)))r=mu(r),n=n.tail;else return Le(ku(r,`Expected ${s.name} to be in path in ConfigProvider#unnested`));break}}}return ze(r)}),zoe="Constant",Loe="Fail",Foe="Fallback",Uoe="Described",Boe="Lazy",Hoe="MapOrFail",qoe="Nested",Voe="Primitive",Koe="Sequence",Goe="HashMap",Yoe="ZipWith";var vD={};const Px=(e,t)=>[...e,...t],Woe="effect/ConfigProvider",bD=Symbol.for(Woe),Joe=fc("effect/ConfigProvider"),Xoe="effect/ConfigProviderFlat",xD=Symbol.for(Xoe),Qoe=e=>({[bD]:bD,pipe(){return xe(this,arguments)},...e}),Zoe=e=>({[xD]:xD,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),ele=e=>Qoe({load:t=>ne(Vs(e,Wl(),t,!1),n=>Ft(yp(n),{onNone:()=>yn(ku(Wl(),`Expected a single value having structure: ${t}`)),onSome:ge})),flattened:e}),tle=e=>{const{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:"_",seqDelim:","},e),r=l=>D(l,Oh(t)),s=l=>l.split(t),i=()=>typeof process<"u"&&"env"in process&&typeof vD=="object"?vD:{};return ele(Zoe({load:(l,c,f=!0)=>{const u=r(l),h=i(),m=u in h?ie(h[u]):re();return D(m,qS(()=>ku(l,`Expected ${u} to exist in the process context`)),ne(p=>ale(p,l,c,n,f)))},enumerateChildren:l=>oe(()=>{const c=i(),h=Object.keys(c).map(m=>s(m.toUpperCase())).filter(m=>{for(let p=0;p<l.length;p++){const v=D(l,vU(p)),S=m[p];if(S===void 0||v!==S)return!1}return!0}).flatMap(m=>m.slice(l.length,l.length+1));return Jre(h)}),patch:$oe}))},nle=(e,t,n,r)=>{const s=qj(n.length,l=>l>=r.length?re():ie([e(l),l+1])),i=qj(r.length,l=>l>=n.length?re():ie([t(l),l+1])),a=Px(n,s),o=Px(r,i);return[a,o]},rle=(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},Vs=(e,t,n,r)=>{const s=n;switch(s._tag){case zoe:return ge(Ti(s.value));case Uoe:return Je(()=>Vs(e,t,s.config,r));case Loe:return yn(ku(t,s.message));case Foe:return D(Je(()=>Vs(e,t,s.first,r)),og(i=>s.condition(i)?D(Vs(e,t,s.second,r),og(a=>yn(cB(i,a)))):yn(i)));case Boe:return Je(()=>Vs(e,t,s.config(),r));case Hoe:return Je(()=>D(Vs(e,t,s.original,r),ne(mo(i=>D(s.mapOrFail(i),qS(Vc(rle(t,s.original))))))));case qoe:return Je(()=>Vs(e,Px(t,Ti(s.name)),s.config,r));case Voe:return D(d_(t,e.patch),ne(i=>D(e.load(i,s,r),ne(a=>{if(a.length===0){const o=D(Xne(i),Kt(()=>"<n/a>"));return yn(ku([],`Expected ${s.description} with name ${o}`))}return ge(a)}))));case Koe:return D(d_(t,e.patch),ne(i=>D(e.enumerateChildren(i),ne(lle),ne(a=>a.length===0?Je(()=>nt(Vs(e,t,s.config,!0),Ti)):D(mo(a,o=>Vs(e,Vne(t,`[${o}]`),s.config,!0)),nt(o=>{const l=SU(o);return l.length===0?Ti(Wl()):Ti(l)}))))));case Goe:return Je(()=>D(d_(t,e.patch),ne(i=>D(e.enumerateChildren(i),ne(a=>D(a,mo(o=>Vs(e,Px(i,Ti(o)),s.valueConfig,r)),nt(o=>o.length===0?Ti(PS()):D(ole(o),nu(l=>Vse(Hj(kt(a),l)))))))))));case Yoe:return Je(()=>D(Vs(e,t,s.left,r),Qd,ne(i=>D(Vs(e,t,s.right,r),Qd,ne(a=>{if(Qn(i)&&Qn(a))return yn(lB(i.left,a.left));if(Qn(i)&&da(a))return yn(i.left);if(da(i)&&Qn(a))return yn(a.left);if(da(i)&&da(a)){const o=D(t,Oh(".")),l=sle(t,o),[c,f]=nle(l,l,D(i.right,nu(ze)),D(a.right,nu(ze)));return D(c,Hj(f),mo(([u,h])=>D(VS(u,h),nt(([m,p])=>s.zip(m,p)))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},sle=(e,t)=>n=>Le(ku(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),ile=(e,t)=>e.split(new RegExp(`\\s*${Ix(t)}\\s*`)),ale=(e,t,n,r,s)=>s?D(ile(e,r),mo(i=>n.parse(i.trim())),qS(Vc(t))):D(n.parse(e),zT({onFailure:Vc(t),onSuccess:Ti})),ole=e=>Object.keys(e[0]).map(t=>e.map(n=>n[t])),lle=e=>D(mo(e,ule),zT({onFailure:()=>Wl(),onSuccess:eg(Zd)}),Qd,nt(wne)),cle=/^(\[(\d+)\])$/,ule=e=>{const t=e.match(cle);if(t!==null){const n=t[2];return D(n!==void 0&&n.length>0?ie(n):re(),Ho(fle))}return re()},fle=e=>{const t=Number.parseInt(e);return Number.isNaN(t)?re():ie(t)},SD=Symbol.for("effect/Console"),uB=fc("effect/Console"),dle={[SD]:SD,assert(e,...t){return oe(()=>{console.assert(e,...t)})},clear:oe(()=>{console.clear()}),count(e){return oe(()=>{console.count(e)})},countReset(e){return oe(()=>{console.countReset(e)})},debug(...e){return oe(()=>{console.debug(...e)})},dir(e,t){return oe(()=>{console.dir(e,t)})},dirxml(...e){return oe(()=>{console.dirxml(...e)})},error(...e){return oe(()=>{console.error(...e)})},group(e){return e!=null&&e.collapsed?oe(()=>console.groupCollapsed(e==null?void 0:e.label)):oe(()=>console.group(e==null?void 0:e.label))},groupEnd:oe(()=>{console.groupEnd()}),info(...e){return oe(()=>{console.info(...e)})},log(...e){return oe(()=>{console.log(...e)})},table(e,t){return oe(()=>{console.table(e,t)})},time(e){return oe(()=>console.time(e))},timeEnd(e){return oe(()=>console.timeEnd(e))},timeLog(e,...t){return oe(()=>{console.timeLog(e,...t)})},trace(...e){return oe(()=>{console.trace(...e)})},warn(...e){return oe(()=>{console.warn(...e)})},unsafe:console},hle="effect/Random",wD=Symbol.for(hle),mle=fc("effect/Random");var Lz;Lz=wD;class ple{constructor(t){w(this,"seed");w(this,Lz,wD);w(this,"PRNG");this.seed=t,this.PRNG=new yte(t)}get next(){return oe(()=>this.PRNG.number())}get nextBoolean(){return nt(this.next,t=>t>.5)}get nextInt(){return oe(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(t,n){return nt(this.next,r=>(n-t)*r+t)}nextIntBetween(t,n){return oe(()=>this.PRNG.integer(n-t)+t)}shuffle(t){return gle(t,n=>this.nextIntBetween(0,n))}}const gle=(e,t)=>Je(()=>D(oe(()=>Array.from(e)),ne(n=>{const r=[];for(let s=n.length;s>=2;s=s-1)r.push(s);return D(r,HS(s=>D(t(s),nt(i=>yle(n,s-1,i)))),Gr(Do(n)))}))),yle=(e,t,n)=>{const r=e[t];return e[t]=e[n],e[n]=r,e},vle=e=>new ple(be(e)),_D=Symbol.for("effect/Tracer"),ble=e=>({[_D]:_D,...e}),ZT=fc("effect/Tracer"),nw=fc("effect/ParentSpan"),kD=function(){const e="abcdef0123456789",t=e.length;return function(n){let r="";for(let s=0;s<n;s++)r+=e.charAt(Math.floor(Math.random()*t));return r}}();class xle{constructor(t,n,r,s,i,a){w(this,"name");w(this,"parent");w(this,"context");w(this,"startTime");w(this,"kind");w(this,"_tag","Span");w(this,"spanId");w(this,"traceId","native");w(this,"sampled",!0);w(this,"status");w(this,"attributes");w(this,"events",[]);w(this,"links");this.name=t,this.parent=n,this.context=r,this.startTime=i,this.kind=a,this.status={_tag:"Started",startTime:i},this.attributes=new Map,this.traceId=n._tag==="Some"?n.value.traceId:kD(32),this.spanId=kD(16),this.links=Array.from(s)}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 Sle=ble({span:(e,t,n,r,s,i)=>new xle(e,t,n,r,s,i),context:e=>e()}),wle=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 s=n.stack.split(`
78
+ `);if(s[3]!==void 0)return r=s[3].trim(),r}}}},QE=Th()("effect/Tracer/DisablePropagation",{defaultValue:Ml}),_le=D(Ea(),ii(Lh,Ooe()),ii(uB,dle),ii(mle,vle(Math.random())),ii(Joe,tle()),ii(ZT,Sle)),eh=Fe(Symbol.for("effect/DefaultServices/currentServices"),()=>q6(_le)),kle=e=>{const t=mi(e);return fB(n=>n.sleep(t))},Ele=e=>vt(t=>e(t.currentDefaultServices)),fB=e=>Ele(t=>e(t.unsafeMap.get(Lh.key))),Cle=fB(e=>e.currentTimeMillis),Rle=Zg,Nle=Pte;let Uh=class extends Nle{};const dB="Sequential",hB="Parallel",Tle="ParallelN",su={_tag:dB},ZE={_tag:hB},Ale=e=>({_tag:Tle,parallelism:e}),Ole=e=>e._tag===dB,Mle=e=>e._tag===hB,$x=su,eC=ZE,tC=Ale;function jle(e){return new tc(e)}function Dle(){return jle(new Map)}const ED=Symbol.for("effect/FiberRefs");var Fz;Fz=ED;class tc{constructor(t){w(this,"locals");w(this,Fz,ED);this.locals=t}pipe(){return xe(this,arguments)}}const Ile=(e,t,n,r=!1)=>{const s=e;let i=t,a=n,o=r,l;for(;l===void 0;)if(gn(i)&&gn(a)){const c=qr(i)[0],f=mu(i),u=qr(a)[0],h=qr(a)[1],m=mu(a);c.startTimeMillis<u.startTimeMillis?(a=m,o=!0):c.startTimeMillis>u.startTimeMillis?i=f:c.id<u.id?(a=m,o=!0):c.id>u.id?i=f:l=[h,o]}else l=[s.initial,!0];return l},Ple=T(3,(e,t,n)=>{const r=new Map(e.locals);return n.locals.forEach((s,i)=>{const a=s[0][1];if(!s[0][0][Ke](t)){if(!r.has(i)){if(Re(a,i.initial))return;r.set(i,[[t,i.join(i.initial,a)]]);return}const o=r.get(i),[l,c]=Ile(i,o,s);if(c){const f=i.diff(l,a),u=o[0][1],h=i.join(u,i.patch(f)(u));if(!Re(u,h)){let m;const p=o[0][0];p[Ke](t)?m=[[p,h],...o.slice(1)]:m=[[t,h],...o],r.set(i,m)}}}}),new tc(r)}),$le=T(2,(e,t)=>{const n=new Map;return mB(e,n,t),new tc(n)}),mB=(e,t,n)=>{e.locals.forEach((r,s)=>{const i=r[0][1],a=s.patch(s.fork)(i);Re(i,a)?t.set(s,r):t.set(s,[[n,a],...r])})},pB=T(2,(e,t)=>{const n=new Map(e.locals);return n.delete(t),new tc(n)}),gB=T(2,(e,t)=>e.locals.has(t)?ie(qr(e.locals.get(t))[1]):re()),ug=T(2,(e,t)=>D(gB(e,t),Kt(()=>t.initial))),nC=T(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new tc(new Map([[n,[[t,r]]]]));const s=new Map(e.locals);return rC(s,t,n,r),new tc(s)}),rC=(e,t,n,r)=>{const s=e.get(n)??[];let i;if(gn(s)){const[a,o]=qr(s);if(a[Ke](t)){if(Re(o,r))return;i=[[t,r],...s.slice(1)]}else i=[[t,r],...s]}else i=[[t,r]];e.set(n,i)},zle=T(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new tc(new Map(t));const r=new Map(e.locals);return n!==void 0&&mB(e,r,n),t.forEach(([s,i])=>{i.length===1?rC(r,i[0][0],s,i[0][1]):i.forEach(([a,o])=>{rC(r,a,s,o)})}),new tc(r)}),CD=gB,yB=ug,Lle=zle,Fle=Dle,vB="Empty",bB="Add",xB="Remove",SB="Update",wB="AndThen",Ule={_tag:vB},eA=(e,t)=>{const n=new Map(e.locals);let r=Ule;for(const[s,i]of t.locals.entries()){const a=qr(i)[1],o=n.get(s);if(o!==void 0){const l=qr(o)[1];Re(l,a)||(r=h_({_tag:SB,fiberRef:s,patch:s.diff(l,a)})(r))}else r=h_({_tag:bB,fiberRef:s,value:a})(r);n.delete(s)}for(const[s]of n.entries())r=h_({_tag:xB,fiberRef:s})(r);return r},h_=T(2,(e,t)=>({_tag:wB,first:e,second:t})),_B=T(3,(e,t,n)=>{let r=n,s=Ti(e);for(;gn(s);){const i=qr(s),a=mu(s);switch(i._tag){case vB:{s=a;break}case bB:{r=nC(r,{fiberId:t,fiberRef:i.fiberRef,value:i.value}),s=a;break}case xB:{r=pB(r,i.fiberRef),s=a;break}case SB:{const o=ug(r,i.fiberRef);r=nC(r,{fiberId:t,fiberRef:i.fiberRef,value:i.fiberRef.patch(i.patch)(o)}),s=a;break}case wB:{s=kx(i.first)(kx(i.second)(a));break}}}return r}),fg=eA,dg=_B,rw="effect/FiberStatus",Eu=Symbol.for(rw),zx="Done",RD="Running",ND="Suspended",Ble=Wt(`${rw}-${zx}`);var Uz;let Hle=class{constructor(){w(this,Uz,Eu);w(this,"_tag",zx)}[(Uz=Eu,Ve)](){return Ble}[Ke](t){return tA(t)&&t._tag===zx}};var Bz;class qle{constructor(t){w(this,"runtimeFlags");w(this,Bz,Eu);w(this,"_tag",RD);this.runtimeFlags=t}[(Bz=Eu,Ve)](){return D(be(rw),Ge(be(this._tag)),Ge(be(this.runtimeFlags)),Ot(this))}[Ke](t){return tA(t)&&t._tag===RD&&this.runtimeFlags===t.runtimeFlags}}var Hz;class Vle{constructor(t,n){w(this,"runtimeFlags");w(this,"blockingOn");w(this,Hz,Eu);w(this,"_tag",ND);this.runtimeFlags=t,this.blockingOn=n}[(Hz=Eu,Ve)](){return D(be(rw),Ge(be(this._tag)),Ge(be(this.runtimeFlags)),Ge(be(this.blockingOn)),Ot(this))}[Ke](t){return tA(t)&&t._tag===ND&&this.runtimeFlags===t.runtimeFlags&&Re(this.blockingOn,t.blockingOn)}}const Kle=new Hle,Gle=e=>new qle(e),Yle=(e,t)=>new Vle(e,t),tA=e=>De(e,Eu),Wle=e=>e._tag===zx,Jle=Kle,kB=Gle,Xle=Yle,Qle=Wle,Zle=Uae,ece=Bae,tce=Hae,nce=U6,rce=B6,sce=H6,ice=qae,ace=Vae,oce=D(Zd,hU(e=>e.ordinal)),lce=kne(oce),cce=e=>{switch(e){case"All":return Zle;case"Debug":return sce;case"Error":return tce;case"Fatal":return ece;case"Info":return rce;case"Trace":return ice;case"None":return ace;case"Warning":return nce}},uce=Symbol.for("effect/Micro"),Lx=Symbol.for("effect/Micro/MicroExit"),TD=Symbol.for("effect/Micro/MicroCause"),fce={_E:Oe};var qz;class EB extends globalThis.Error{constructor(n,r,s){const i=`MicroCause.${n}`;let a,o,l;if(r instanceof globalThis.Error){a=`(${i}) ${r.name}`,o=r.message;const c=o.split(`
79
+ `).length;l=r.stack?`(${i}) ${r.stack.split(`
80
+ `).slice(0,c+3).join(`
81
+ `)}`:`${a}: ${o}`}else a=i,o=Fd(r,0),l=`${a}: ${o}`;s.length>0&&(l+=`
82
+ ${s.join(`
83
+ `)}`);super(o);w(this,"_tag");w(this,"traces");w(this,qz);this._tag=n,this.traces=s,this[TD]=fce,this.name=a,this.stack=l}pipe(){return xe(this,arguments)}toString(){return this.stack}[(qz=TD,pt)](){return this.stack}}class dce extends EB{constructor(n,r=[]){super("Die",n,r);w(this,"defect");this.defect=n}}const hce=(e,t=[])=>new dce(e,t);let mce=class extends EB{constructor(t=[]){super("Interrupt","interrupted",t)}};const pce=(e=[])=>new mce(e),gce=e=>e._tag==="Interrupt",AD=Symbol.for("effect/Micro/MicroFiber"),yce={_A:Oe,_E:Oe};var Vz;Vz=AD;class vce{constructor(t,n=!0){w(this,"context");w(this,"interruptible");w(this,Vz);w(this,"_stack",[]);w(this,"_observers",[]);w(this,"_exit");w(this,"_children");w(this,"currentOpCount",0);w(this,"_interrupted",!1);w(this,"_yielded");this.context=t,this.interruptible=n,this[AD]=yce}getRef(t){return Zte(this.context,t)}addObserver(t){return this._exit?(t(this._exit),zd):(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(aA))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(this._yielded!==void 0){const s=this._yielded;this._yielded=void 0,s()}const n=this.runLoop(t);if(n===kv)return;const r=OD.interruptChildren&&OD.interruptChildren(this);if(r!==void 0)return this.evaluate(Ux(r,()=>n));this._exit=n;for(let s=0;s<this._observers.length;s++)this._observers[s](n);this._observers.length=0}runLoop(t){let n=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!n&&this.getRef(oA).shouldYield(this)){n=!0;const s=r;r=Ux(_ce,()=>s)}if(r=r[sC](this),r===kv){const s=this._yielded;return Lx in s?(this._yielded=void 0,s):kv}}}catch(s){return De(r,sC)?iC(s):iC(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[Fx]&&n[Fx](this);if(r)return{[t]:r};if(n[t])return n}}yieldWith(t){return this._yielded=t,kv}children(){return this._children??(this._children=new Set)}}const OD=Fe("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0})),CB=Symbol.for("effect/Micro/identifier"),Un=Symbol.for("effect/Micro/args"),sC=Symbol.for("effect/Micro/evaluate"),th=Symbol.for("effect/Micro/successCont"),gd=Symbol.for("effect/Micro/failureCont"),Fx=Symbol.for("effect/Micro/ensureCont"),kv=Symbol.for("effect/Micro/Yield"),bce={_A:Oe,_E:Oe,_R:Oe},xce={...Rle,_op:"Micro",[uce]:bce,pipe(){return xe(this,arguments)},[Symbol.iterator](){return new z5(new Qg(this))},toJSON(){return{_id:"Micro",op:this[CB],...Un in this?{args:this[Un]}:void 0}},toString(){return zt(this)},[pt](){return zt(this)}};function Sce(e){return iC("Micro.evaluate: Not implemented")}const sw=e=>({...xce,[CB]:e.op,[sC]:e.eval??Sce,[th]:e.contA,[gd]:e.contE,[Fx]:e.ensure}),nA=e=>{const t=sw(e);return function(){const n=Object.create(t);return n[Un]=e.single===!1?arguments:arguments[0],n}},RB=e=>{const t={...sw(e),[Lx]:Lx,_tag:e.op,get[e.prop](){return this[Un]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[Un]}},[Ke](n){return Cce(n)&&n._tag===e.op&&Re(this[Un],n[Un])},[Ve](){return Ot(this,Ge(Wt(e.op))(be(this[Un])))}};return function(n){const r=Object.create(t);return r[Un]=n,r[th]=void 0,r[gd]=void 0,r[Fx]=void 0,r}},rA=RB({op:"Success",prop:"value",eval(e){const t=e.getCont(th);return t?t[th](this[Un],e):e.yieldWith(this)}}),NB=RB({op:"Failure",prop:"cause",eval(e){let t=e.getCont(gd);for(;gce(this[Un])&&t&&e.interruptible;)t=e.getCont(gd);return t?t[gd](this[Un],e):e.yieldWith(this)}}),wce=nA({op:"Yield",eval(e){let t=!1;return e.getRef(oA).scheduleTask(()=>{t||e.evaluate(Rce)},this[Un]??0),e.yieldWith(()=>{t=!0})}}),_ce=wce(0),kce=rA(void 0),sA=nA({op:"WithMicroFiber",eval(e){return this[Un](e)}}),Ux=T(2,(e,t)=>{const n=Object.create(Ece);return n[Un]=e,n[th]=t,n}),Ece=sw({op:"OnSuccess",eval(e){return e._stack.push(this),this[Un]}}),Cce=e=>De(e,Lx),TB=rA,iA=NB,aA=iA(pce()),iC=e=>iA(hce(e)),Rce=TB(void 0),Nce="setImmediate"in globalThis?globalThis.setImmediate:e=>setTimeout(e,0);class AB{constructor(){w(this,"tasks",[]);w(this,"running",!1);w(this,"afterScheduled",()=>{this.running=!1,this.runTasks()})}scheduleTask(t,n){this.tasks.push(t),this.running||(this.running=!0,Nce(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(Oce)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const Tce=T(2,(e,t)=>sA(n=>{const r=n.context;return n.context=t(r),Dce(e,()=>(n.context=r,kce))})),Ace=T(2,(e,t)=>Tce(e,us(t)));class Oce extends Th()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class oA extends Th()("effect/Micro/currentScheduler",{defaultValue:()=>new AB}){}const Mce=T(2,(e,t)=>{const n=Object.create(jce);return n[Un]=e,n[th]=t.onSuccess,n[gd]=t.onFailure,n}),jce=sw({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[Un]}}),Dce=T(2,(e,t)=>Pce(n=>Mce(n(e),{onFailure:r=>Ux(t(iA(r)),()=>NB(r)),onSuccess:r=>Ux(t(TB(r)),()=>rA(r))}))),OB=nA({op:"SetInterruptible",ensure(e){if(e.interruptible=this[Un],e._interrupted&&e.interruptible)return()=>aA}}),Ice=e=>sA(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(OB(!1)),t._interrupted?aA:e)),Pce=e=>sA(t=>t.interruptible?(t.interruptible=!1,t._stack.push(OB(!0)),e(Ice)):e(Oe)),$ce=(e,t)=>{const n=new vce(oA.context(new AB));return n.evaluate(e),n},Bx=Symbol.for("effect/Readable"),MB=Symbol.for("effect/Ref"),jB={_A:e=>e};var Kz,Gz,Yz;class zce extends(Yz=Uh,Gz=MB,Kz=Bx,Yz){constructor(n){super();w(this,"ref");w(this,Gz,jB);w(this,Kz,Bx);w(this,"get");this.ref=n,this.get=oe(()=>Fn(this.ref))}commit(){return this.get}modify(n){return oe(()=>{const r=Fn(this.ref),[s,i]=n(r);return r!==i&&ry(i)(this.ref),s})}}const lA=e=>new zce(ny(e)),Hx=e=>oe(()=>lA(e)),xa=e=>e.get,yd=T(2,(e,t)=>e.modify(()=>[void 0,t])),Lce=T(2,(e,t)=>e.modify(n=>[n,t])),DB=T(2,(e,t)=>e.modify(t)),qx=T(2,(e,t)=>e.modify(n=>[void 0,t(n)])),cA=Hx,Fce=xa,Uce=Lce,bm=DB,Bce=yd,Hce=qx;class IB{constructor(){w(this,"buckets",[])}scheduleTask(t,n){const r=this.buckets.length;let s,i=0;for(;i<r&&this.buckets[i][0]<=n;i++)s=this.buckets[i];s&&s[0]===n?s[1].push(t):i===r?this.buckets.push([n,[t]]):this.buckets.splice(i,0,[n,[t]])}}class qce{constructor(t){w(this,"maxNextTickBeforeTimer");w(this,"running",!1);w(this,"tasks",new IB);this.maxNextTickBeforeTimer=t}starveInternal(t){const n=this.tasks.buckets;this.tasks.buckets=[];for(const[r,s]of n)for(let i=0;i<s.length;i++)s[i]();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(V6)?t.getFiberRef(zh):!1}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running||(this.running=!0,this.starve())}}const PB=Fe(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new qce(2048));class uA{constructor(){w(this,"tasks",new IB);w(this,"deferred",!1)}scheduleTask(t,n){this.deferred?PB.scheduleTask(t,n):this.tasks.scheduleTask(t,n)}shouldYield(t){return t.currentOpCount>t.getFiberRef(V6)?t.getFiberRef(zh):!1}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[n,r]of t)for(let s=0;s<r.length;s++)r[s]()}this.deferred=!0}}const fA=Fe(Symbol.for("effect/FiberRef/currentScheduler"),()=>Gn(PB)),$B=Fe(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Gn(new Map)),MD=(e,t,n,r)=>{switch(e){case void 0:return t();case"unbounded":return n();case"inherit":return GS(soe,s=>s==="unbounded"?n():s>1?r(s):t());default:return e>1?r(e):t()}},Vce=kle,Kce=Cle,Gce=Lh,zB=e=>e.replace(/[\s="]/g,"_"),Yce=e=>t=>`${zB(t.label)}=${e-t.startTime}ms`,LB="effect/MetricLabel",aC=Symbol.for(LB);var Wz;class Wce{constructor(t,n){w(this,"key");w(this,"value");w(this,Wz,aC);w(this,"_hash");this.key=t,this.value=n,this._hash=Wt(LB+this.key+this.value)}[(Wz=aC,Ve)](){return this._hash}[Ke](t){return Xce(t)&&this.key===t.key&&this.value===t.value}pipe(){return xe(this,arguments)}}const Jce=(e,t)=>new Wce(e,t),Xce=e=>De(e,aC),Qce=e=>nt(e,ie),FB=e=>{let t,n;return typeof e=="function"?t=e:(t=e.try,n=e.catch),Je(()=>{try{return ge(hr(t))}catch(r){return yn(n?hr(()=>n(r)):new GT(r,"An unknown error occurred in Effect.try"))}})},Zce=e=>VB(e,BB,eA),eue=e=>VB(e,VS(BB,$ae),([t,n],[r,s])=>[eA(t,r),Dl(n,s)]),UB=T(2,(e,t)=>Zl(e,{onFailure:n=>ge(t.onFailure(n)),onSuccess:n=>ge(t.onSuccess(n))})),BB=vt(e=>ge(e.getFiberRefs())),tue=e=>UB(e,{onFailure:zd,onSuccess:zd}),jD=T(2,(e,t)=>pi(e,{onFailure:n=>j6(()=>t(n)),onSuccess:ge})),nue=e=>D(QS(),ne(t=>D(eue(e),P6(t),sue,nt(n=>dn(n,D(ec(t),ne(([r,s])=>Gr(VS(HB(r[0]),$6(r[1])),s)))))))),rue=e=>nt(e,t=>!t),sue=e=>nt(cA(!0),t=>vi(FT(e,Uce(t,!1)))),HB=e=>fue((t,n)=>D(e,_B(t,n))),iue=e=>e.length>=1?Bi((t,n)=>{try{e(n).then(r=>t(ge(r)),r=>t(wl(r)))}catch(r){t(wl(r))}}):Bi(t=>{try{e().then(n=>t(ge(n)),n=>t(wl(n)))}catch(n){t(wl(n))}}),qB=T(3,(e,t,n)=>Vu(r=>tw(e,ii(r,t,n)))),DD=T(3,(e,t,n)=>Vu(r=>ne(n,s=>tw(e,D(r,ii(t,s)))))),aue=Vce,oue=ge(re()),VB=T(3,(e,t,n)=>ne(t,r=>ne(e,s=>nt(t,i=>[n(r,i),s])))),lue=T(2,(e,t)=>pi(e,{onFailure:n=>dn(t(n),Kn(n)),onSuccess:ge})),cue=e=>{let t,n;typeof e=="function"?t=e:(t=e.try,n=e.catch);const r=s=>n?FS(()=>n(s)):yn(new GT(s,"An unknown error occurred in Effect.tryPromise"));return t.length>=1?Bi((s,i)=>{try{t(i).then(a=>s(ge(a)),a=>s(r(a)))}catch(a){s(r(a))}}):Bi(s=>{try{t().then(i=>s(ge(i)),i=>s(r(i)))}catch(i){s(r(i))}})},uue=T(2,(e,t)=>ne(e,n=>FB({try:()=>t.try(n),catch:t.catch}))),fue=e=>vt(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),At)),due=T(2,(e,t)=>Je(()=>t()?nt(e,ie):ge(re()))),hue=e=>new Proxy({},{get(t,n,r){return(...s)=>ne(e,i=>i[n](...s))}}),KB=BigInt(0),GB=Ho(e=>_o(e.context,QE)?e._tag==="Span"?GB(e.parent):re():ie(e)),mue=(e,t,n)=>{const r=!e.getFiberRef(K6)||n.context&&_o(n.context,QE),s=e.getFiberRef(Ia),i=n.parent?ie(n.parent):n.root?re():GB(Nh(s,nw));let a;if(r)a=Coe({name:t,parent:i,context:ii(n.context??Ea(),QE,!0)});else{const o=e.getFiberRef(eh),l=_o(o,ZT),c=_o(o,Gce),f=e.getFiberRef(G6),u=e.getFiberRefs(),h=CD(u,loe),m=CD(u,coe),p=m._tag==="Some"?n.links!==void 0?[...Vr(m.value),...n.links??[]]:Vr(m.value):n.links??Wl();a=l.span(t,i,n.context??Ea(),p,f?c.unsafeCurrentTimeNanos():KB,n.kind??"internal",n),h._tag==="Some"&&Wse(h.value,(v,S)=>a.attribute(S,v)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([v,S])=>a.attribute(v,S))}return typeof n.captureStackTrace=="function"&&Tx.set(a,n.captureStackTrace),a},pue=(e,t,n,r)=>oe(()=>{e.status._tag!=="Ended"&&(W6(t)&&Tx.has(e)&&e.attribute("code.stacktrace",Tx.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():KB,t))}),gue=(e,...t)=>{const n=wle(t.length===1?void 0:t[0]),r=t[t.length-1];return vt(s=>{const i=mue(s,e,n),a=s.getFiberRef(G6),o=_o(s.getFiberRef(eh),Lh);return _u(r(i),l=>pue(i,l,o,a))})},yue=T(2,(e,t)=>qB(e,nw,t)),dA=W6,YB=poe,vue=pd,bue=J6,Vx=cg,Nr=Rt,xue=yoe,Sue=yb,po=JS,Es=Tt,hA=Rr,ID=boe,hg=X6,mA="InterruptSignal",pA="Stateful",gA="Resume",yA="YieldNow",m_=e=>({_tag:mA,cause:e}),vb=e=>({_tag:pA,onFiber:e}),hf=e=>({_tag:gA,effect:e}),wue=()=>({_tag:yA}),_ue="effect/FiberScope",Kx=Symbol.for(_ue);var Jz;Jz=Kx;class kue{constructor(){w(this,Jz,Kx);w(this,"fiberId",Os);w(this,"roots",new Set)}add(t,n){this.roots.add(n),n.addObserver(()=>{this.roots.delete(n)})}}var Xz;Xz=Kx;class Eue{constructor(t,n){w(this,"fiberId");w(this,"parent");w(this,Xz,Kx);this.fiberId=t,this.parent=n}add(t,n){this.parent.tell(vb(r=>{r.addChild(n),n.addObserver(()=>{r.removeChild(n)})}))}}const Cue=e=>new Eue(e.id(),e),iw=Fe(Symbol.for("effect/FiberScope/Global"),()=>new kue),Rue="effect/Fiber",Nue=Symbol.for(Rue),Tue={_E:e=>e,_A:e=>e},Aue="effect/Fiber",Oue=Symbol.for(Aue),Mue=e=>e.await,jue=e=>e.inheritAll,mg=e=>KS(BS(e.await),e.inheritAll);({...ty});const tl="effect/FiberCurrent",Due=()=>Ah(globalThis[tl]),Iue="effect/Logger",Pue=Symbol.for(Iue),$ue={_Message:e=>e,_Output:e=>e},vA=e=>({[Pue]:$ue,log:e,pipe(){return xe(this,arguments)}}),zue=/^[^\s"=]*$/,Lue=(e,t)=>({annotations:n,cause:r,date:s,fiberId:i,logLevel:a,message:o,spans:l})=>{const c=p=>p.match(zue)?p:e(p),f=(p,v)=>`${zB(p)}=${c(v)}`,u=(p,v)=>" "+f(p,v);let h=f("timestamp",s.toISOString());h+=u("level",a.label),h+=u("fiber",r6(i));const m=Hne(o);for(let p=0;p<m.length;p++)h+=u("message",Fd(m[p],t));Zre(r)||(h+=u("cause",Dh(r,{renderErrorCause:!0})));for(const p of l)h+=" "+Yce(s.getTime())(p);for(const[p,v]of n)h+=u(p,Fd(v,t));return h},Fue=e=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,Uue=vA(Lue(Fue)),Bue=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;Bue&&process.stdout.isTTY;const WB="effect/MetricBoundaries",oC=Symbol.for(WB);var Qz;class Hue{constructor(t){w(this,"values");w(this,Qz,oC);w(this,"_hash");this.values=t,this._hash=D(Wt(WB),Ge(Ch(this.values)))}[(Qz=oC,Ve)](){return this._hash}[Ke](t){return que(t)&&Re(this.values,t.values)}pipe(){return xe(this,arguments)}}const que=e=>De(e,oC),Vue=e=>{const t=D(e,mT(Dn(Number.POSITIVE_INFINITY)),ore);return new Hue(t)},Kue=e=>D(Bne(e.count-1,t=>e.start*Math.pow(e.factor,t)),Lr,Vue),Gue="effect/MetricKeyType",JB=Symbol.for(Gue),XB="effect/MetricKeyType/Counter",lC=Symbol.for(XB),Yue="effect/MetricKeyType/Frequency",Wue=Symbol.for(Yue),Jue="effect/MetricKeyType/Gauge",Xue=Symbol.for(Jue),QB="effect/MetricKeyType/Histogram",cC=Symbol.for(QB),Que="effect/MetricKeyType/Summary",Zue=Symbol.for(Que),ZB={_In:e=>e,_Out:e=>e};var Zz,eL;class efe{constructor(t,n){w(this,"incremental");w(this,"bigint");w(this,eL,ZB);w(this,Zz,lC);w(this,"_hash");this.incremental=t,this.bigint=n,this._hash=Wt(XB)}[(eL=JB,Zz=lC,Ve)](){return this._hash}[Ke](t){return e8(t)}pipe(){return xe(this,arguments)}}var tL,nL;class tfe{constructor(t){w(this,"boundaries");w(this,nL,ZB);w(this,tL,cC);w(this,"_hash");this.boundaries=t,this._hash=D(Wt(QB),Ge(be(this.boundaries)))}[(nL=JB,tL=cC,Ve)](){return this._hash}[Ke](t){return t8(t)&&Re(this.boundaries,t.boundaries)}pipe(){return xe(this,arguments)}}const nfe=e=>new efe((e==null?void 0:e.incremental)??!1,(e==null?void 0:e.bigint)??!1),rfe=e=>new tfe(e),e8=e=>De(e,lC),sfe=e=>De(e,Wue),ife=e=>De(e,Xue),t8=e=>De(e,cC),afe=e=>De(e,Zue),ofe="effect/MetricKey",n8=Symbol.for(ofe),lfe={_Type:e=>e},cfe=_S(Re);var rL;class bA{constructor(t,n,r,s=[]){w(this,"name");w(this,"keyType");w(this,"description");w(this,"tags");w(this,rL,lfe);w(this,"_hash");this.name=t,this.keyType=n,this.description=r,this.tags=s,this._hash=D(Wt(this.name+this.description),Ge(be(this.keyType)),Ge(Ch(this.tags)))}[(rL=n8,Ve)](){return this._hash}[Ke](t){return ufe(t)&&this.name===t.name&&Re(this.keyType,t.keyType)&&Re(this.description,t.description)&&cfe(this.tags,t.tags)}pipe(){return xe(this,arguments)}}const ufe=e=>De(e,n8),ffe=(e,t)=>new bA(e,nfe(t),Ah(t==null?void 0:t.description)),dfe=(e,t,n)=>new bA(e,rfe(t),Ah(n)),hfe=T(2,(e,t)=>t.length===0?e:new bA(e.name,e.keyType,e.description,hb(e.tags,t))),PD=Symbol.for("effect/MutableHashMap"),mfe={[PD]:PD,[Symbol.iterator](){return new xA(this)},toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(nn)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}};class xA{constructor(t){w(this,"self");w(this,"referentialIterator");w(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 pfe(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new xA(this.self)}}class pfe{constructor(t){w(this,"backing");w(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 uC=()=>{const e=Object.create(mfe);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},so=T(2,(e,t)=>{if(Zp(t)===!1)return e.referential.has(t)?ie(e.referential.get(t)):re();const n=t[Ve](),r=e.buckets.get(n);return r===void 0?re():gfe(e,r,t)}),gfe=(e,t,n,r=!1)=>{for(let s=0,i=t.length;s<i;s++)if(n[Ke](t[s][0])){const a=t[s][1];return r&&(t.splice(s,1),e.bucketsSize--),ie(a)}return re()},xm=T(2,(e,t)=>Bt(so(e,t))),Fc=T(3,(e,t,n)=>{if(Zp(t)===!1)return e.referential.set(t,n),e;const r=t[Ve](),s=e.buckets.get(r);return s===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(r8(e,s,t),s.push([t,n]),e.bucketsSize++,e)}),r8=(e,t,n)=>{for(let r=0,s=t.length;r<s;r++)if(n[Ke](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},yfe=T(2,(e,t)=>{if(Zp(t)===!1)return e.referential.delete(t),e;const n=t[Ve](),r=e.buckets.get(n);return r===void 0||(r8(e,r,t),r.length===0&&e.buckets.delete(n)),e}),vfe="effect/MetricState",hy=Symbol.for(vfe),s8="effect/MetricState/Counter",fC=Symbol.for(s8),i8="effect/MetricState/Frequency",dC=Symbol.for(i8),a8="effect/MetricState/Gauge",hC=Symbol.for(a8),o8="effect/MetricState/Histogram",mC=Symbol.for(o8),l8="effect/MetricState/Summary",pC=Symbol.for(l8),my={_A:e=>e};var sL,iL;class bfe{constructor(t){w(this,"count");w(this,iL,my);w(this,sL,fC);this.count=t}[(iL=hy,sL=fC,Ve)](){return D(be(s8),Ge(be(this.count)),Ot(this))}[Ke](t){return Afe(t)&&this.count===t.count}pipe(){return xe(this,arguments)}}const xfe=_S(Re);var aL,oL;class Sfe{constructor(t){w(this,"occurrences");w(this,oL,my);w(this,aL,dC);w(this,"_hash");this.occurrences=t}[(oL=hy,aL=dC,Ve)](){return D(Wt(i8),Ge(Ch(kt(this.occurrences.entries()))),Ot(this))}[Ke](t){return Ofe(t)&&xfe(kt(this.occurrences.entries()),kt(t.occurrences.entries()))}pipe(){return xe(this,arguments)}}var lL,cL;class wfe{constructor(t){w(this,"value");w(this,cL,my);w(this,lL,hC);this.value=t}[(cL=hy,lL=hC,Ve)](){return D(be(a8),Ge(be(this.value)),Ot(this))}[Ke](t){return Mfe(t)&&this.value===t.value}pipe(){return xe(this,arguments)}}var uL,fL;class _fe{constructor(t,n,r,s,i){w(this,"buckets");w(this,"count");w(this,"min");w(this,"max");w(this,"sum");w(this,fL,my);w(this,uL,mC);this.buckets=t,this.count=n,this.min=r,this.max=s,this.sum=i}[(fL=hy,uL=mC,Ve)](){return D(be(o8),Ge(be(this.buckets)),Ge(be(this.count)),Ge(be(this.min)),Ge(be(this.max)),Ge(be(this.sum)),Ot(this))}[Ke](t){return jfe(t)&&Re(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return xe(this,arguments)}}var dL,hL;class kfe{constructor(t,n,r,s,i,a){w(this,"error");w(this,"quantiles");w(this,"count");w(this,"min");w(this,"max");w(this,"sum");w(this,hL,my);w(this,dL,pC);this.error=t,this.quantiles=n,this.count=r,this.min=s,this.max=i,this.sum=a}[(hL=hy,dL=pC,Ve)](){return D(be(l8),Ge(be(this.error)),Ge(be(this.quantiles)),Ge(be(this.count)),Ge(be(this.min)),Ge(be(this.max)),Ge(be(this.sum)),Ot(this))}[Ke](t){return Dfe(t)&&this.error===t.error&&Re(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return xe(this,arguments)}}const Efe=e=>new bfe(e),Cfe=e=>new Sfe(e),Rfe=e=>new wfe(e),Nfe=e=>new _fe(e.buckets,e.count,e.min,e.max,e.sum),Tfe=e=>new kfe(e.error,e.quantiles,e.count,e.min,e.max,e.sum),Afe=e=>De(e,fC),Ofe=e=>De(e,dC),Mfe=e=>De(e,hC),jfe=e=>De(e,mC),Dfe=e=>De(e,pC),Ife="effect/MetricHook",Pfe=Symbol.for(Ife),$fe={_In:e=>e,_Out:e=>e},py=e=>({[Pfe]:$fe,pipe(){return xe(this,arguments)},...e}),$D=BigInt(0),zfe=e=>{let t=e.keyType.bigint?$D:0;const n=e.keyType.incremental?e.keyType.bigint?s=>s>=$D:s=>s>=0:s=>!0,r=s=>{n(s)&&(t=t+s)};return py({get:()=>Efe(t),update:r,modify:r})},Lfe=e=>{const t=new Map;for(const r of e.keyType.preregisteredWords)t.set(r,0);const n=r=>{const s=t.get(r)??0;t.set(r,s+1)};return py({get:()=>Cfe(t),update:n,modify:n})},Ffe=(e,t)=>{let n=t;return py({get:()=>Rfe(n),update:r=>{n=r},modify:r=>{n=n+r}})},Ufe=e=>{const t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),s=new Float64Array(n);let i=0,a=0,o=Number.MAX_VALUE,l=Number.MIN_VALUE;D(t,eg(Zd),nu((u,h)=>{s[h]=u}));const c=u=>{let h=0,m=n;for(;h!==m;){const p=Math.floor(h+(m-h)/2),v=s[p];u<=v?m=p:h=p,m===h+1&&(u<=s[h]?m=h:h=m)}r[h]=r[h]+1,i=i+1,a=a+u,u<o&&(o=u),u>l&&(l=u)},f=()=>{const u=wS(n);let h=0;for(let m=0;m<n;m++){const p=s[m],v=r[m];h=h+v,u[m]=[p,h]}return u};return py({get:()=>Nfe({buckets:f(),count:i,min:o,max:l,sum:a}),update:c,modify:c})},Bfe=e=>{const{error:t,maxAge:n,maxSize:r,quantiles:s}=e.keyType,i=D(s,eg(Zd)),a=wS(r);let o=0,l=0,c=0,f=0,u=0;const h=p=>{const v=[];let S=0;for(;S!==r-1;){const y=a[S];if(y!=null){const[b,x]=y,_=bu(p-b);Ase(_,Wd)&&Tse(_,n)&&v.push(x)}S=S+1}return Hfe(t,i,eg(v,Zd))},m=(p,v)=>{if(r>0){o=o+1;const S=o%r;a[S]=[v,p]}f=l===0?p:Math.min(f,p),u=l===0?p:Math.max(u,p),l=l+1,c=c+p};return py({get:()=>Tfe({error:t,quantiles:h(Date.now()),count:l,min:f,max:u,sum:c}),update:([p,v])=>m(p,v),modify:([p,v])=>m(p,v)})},Hfe=(e,t,n)=>{const r=n.length;if(!gn(t))return Wl();const s=t[0],i=t.slice(1),a=zD(e,r,re(),0,s,n),o=Ti(a);return i.forEach(l=>{o.push(zD(e,r,a.value,a.consumed,l,a.rest))}),nu(o,l=>[l.quantile,l.value])},zD=(e,t,n,r,s,i)=>{let a=e,o=t,l=n,c=r,f=s,u=i,h=e,m=t,p=n,v=r,S=s,y=i;for(;;){if(!gn(u))return{quantile:f,value:re(),consumed:c,rest:[]};if(f===1)return{quantile:f,value:ie(bU(u)),consumed:c+u.length,rest:[]};const b=qr(u),x=Zne(u,A=>A===b),_=f*o,C=a/2*_,E=c+x[0].length,k=Math.abs(E-_);if(E<_-C){h=a,m=o,p=yp(u),v=E,S=f,y=x[1],a=h,o=m,l=p,c=v,f=S,u=y;continue}if(E>_+C){const A=Qt(l)?ie(b):l;return{quantile:f,value:A,consumed:c,rest:u}}switch(l._tag){case"None":{h=a,m=o,p=yp(u),v=E,S=f,y=x[1],a=h,o=m,l=p,c=v,f=S,u=y;continue}case"Some":{const A=Math.abs(_-l.value);if(k<A){h=a,m=o,p=yp(u),v=E,S=f,y=x[1],a=h,o=m,l=p,c=v,f=S,u=y;continue}return{quantile:f,value:ie(l.value),consumed:c,rest:u}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},qfe="effect/MetricPair",Vfe=Symbol.for(qfe),Kfe={_Type:e=>e},Gfe=(e,t)=>({[Vfe]:Kfe,metricKey:e,metricState:t,pipe(){return xe(this,arguments)}}),Yfe="effect/MetricRegistry",LD=Symbol.for(Yfe);var mL;mL=LD;class Wfe{constructor(){w(this,mL,LD);w(this,"map",uC())}snapshot(){const t=[];for(const[n,r]of this.map)t.push(Gfe(n,r.get()));return t}get(t){const n=D(this.map,so(t),Zs);if(n==null){if(e8(t.keyType))return this.getCounter(t);if(ife(t.keyType))return this.getGauge(t);if(sfe(t.keyType))return this.getFrequency(t);if(t8(t.keyType))return this.getHistogram(t);if(afe(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=D(this.map,so(t),Zs);if(n==null){const r=zfe(t);D(this.map,xm(t))||D(this.map,Fc(t,r)),n=r}return n}getFrequency(t){let n=D(this.map,so(t),Zs);if(n==null){const r=Lfe(t);D(this.map,xm(t))||D(this.map,Fc(t,r)),n=r}return n}getGauge(t){let n=D(this.map,so(t),Zs);if(n==null){const r=Ffe(t,t.keyType.bigint?BigInt(0):0);D(this.map,xm(t))||D(this.map,Fc(t,r)),n=r}return n}getHistogram(t){let n=D(this.map,so(t),Zs);if(n==null){const r=Ufe(t);D(this.map,xm(t))||D(this.map,Fc(t,r)),n=r}return n}getSummary(t){let n=D(this.map,so(t),Zs);if(n==null){const r=Bfe(t);D(this.map,xm(t))||D(this.map,Fc(t,r)),n=r}return n}}const Jfe=()=>new Wfe,Xfe="effect/Metric",Qfe=Symbol.for(Xfe),Zfe={_Type:e=>e,_In:e=>e,_Out:e=>e},FD=Fe(Symbol.for("effect/Metric/globalMetricRegistry"),()=>Jfe()),c8=function(e,t,n,r){const s=Object.assign(i=>LT(i,a=>rde(s,a)),{[Qfe]:Zfe,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return xe(this,arguments)}});return s},aw=(e,t)=>u8(ffe(e,t)),u8=e=>{let t;const n=new WeakMap,r=s=>{if(s.length===0)return t!==void 0||(t=FD.get(e)),t;let i=n.get(s);return i!==void 0||(i=FD.get(hfe(e,s)),n.set(s,i)),i};return c8(e.keyType,(s,i)=>r(i).update(s),s=>r(s).get(),(s,i)=>r(i).modify(s))},ede=(e,t,n)=>u8(dfe(e,t,n)),tde=T(3,(e,t,n)=>nde(e,[Jce(t,n)])),nde=T(2,(e,t)=>c8(e.keyType,(n,r)=>e.unsafeUpdate(n,hb(t,r)),n=>e.unsafeValue(hb(t,n)),(n,r)=>e.unsafeModify(n,hb(t,r)))),rde=T(2,(e,t)=>GS(GE,n=>oe(()=>e.unsafeUpdate(t,n))));({...ey});const sde=T(2,(e,t)=>GS($B,n=>oe(()=>{if(n.has(e)){const r=n.get(e);r.state.completed||(r.state.completed=!0,ew(r.result,t))}}))),ide="effect/Supervisor",ow=Symbol.for(ide),SA={_T:e=>e};var pL;pL=ow;const jO=class jO{constructor(t,n){w(this,"underlying");w(this,"value0");w(this,pL,SA);this.underlying=t,this.value0=n}get value(){return this.value0}onStart(t,n,r,s){this.underlying.onStart(t,n,r,s)}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 jO(this,D(this.value,nt(t)))}zip(t){return new Yx(this,t)}};let Gx=jO;var gL;gL=ow;const DO=class DO{constructor(t,n){w(this,"left");w(this,"right");w(this,"_tag","Zip");w(this,gL,SA);this.left=t,this.right=n}get value(){return VS(this.left.value,this.right.value)}onStart(t,n,r,s){this.left.onStart(t,n,r,s),this.right.onStart(t,n,r,s)}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 Gx(this,D(this.value,nt(t)))}zip(t){return new DO(this,t)}};let Yx=DO;const f8=e=>De(e,ow)&&QN(e,"Zip");var yL;yL=ow;class ade{constructor(t){w(this,"effect");w(this,yL,SA);this.effect=t}get value(){return this.effect}onStart(t,n,r,s){}onEnd(t,n){}onEffect(t,n){}onSuspend(t){}onResume(t){}map(t){return new Gx(this,D(this.value,nt(t)))}zip(t){return new Yx(this,t)}onRun(t,n){return t()}}const ode=e=>new ade(e),lw=Fe("effect/Supervisor/none",()=>ode(At)),lde=Ih,d8="Empty",h8="AddSupervisor",m8="RemoveSupervisor",p8="AndThen",xp={_tag:d8},bb=(e,t)=>({_tag:p8,first:e,second:t}),cde=(e,t)=>ude(t,Dn(e)),ude=(e,t)=>{let n=e,r=t;for(;Po(r);){const s=ha(r);switch(s._tag){case d8:{r=ho(r);break}case h8:{n=n.zip(s.supervisor),r=ho(r);break}case m8:{n=gC(n,s.supervisor),r=ho(r);break}case p8:{r=Mr(s.first)(Mr(s.second)(ho(r)));break}}}return n},gC=(e,t)=>Re(e,t)?lw:f8(e)?gC(e.left,t).zip(gC(e.right,t)):e,Wx=e=>Re(e,lw)?gu():f8(e)?D(Wx(e.left),rg(Wx(e.right))):RT(e),fde=(e,t)=>{if(Re(e,t))return xp;const n=Wx(e),r=Wx(t),s=D(r,Kj(n),sg(xp,(a,o)=>bb(a,{_tag:h8,supervisor:o}))),i=D(n,Kj(r),sg(xp,(a,o)=>bb(a,{_tag:m8,supervisor:o})));return bb(s,i)},dde=lde({empty:xp,patch:cde,combine:bb,diff:fde}),hde=aw("effect_fiber_started",{incremental:!0}),UD=aw("effect_fiber_active"),mde=aw("effect_fiber_successes",{incremental:!0}),pde=aw("effect_fiber_failures",{incremental:!0}),gde=tde(ede("effect_fiber_lifetimes",Kue({start:.5,factor:2,count:35})),"time_unit","milliseconds"),Sm="Continue",yde="Done",BD="Yield",vde={_E:e=>e,_A:e=>e},Ev=e=>{throw new Error(`BUG: FiberRuntime - ${Fd(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},Ga=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),Ya=Fe("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),wm={[xx]:(e,t,n)=>hr(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>Tt(Tt(n)),[Sx]:(e,t,n)=>hr(()=>t.effect_instruction_i2(n)),[rT]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),al(e.currentRuntimeFlags)&&e.isInterrupted()?Rt(e.getInterruptedCause()):Tt(n)),[wx]:(e,t,n)=>(hr(()=>t.effect_instruction_i2(n)),hr(()=>t.effect_instruction_i0())?(e.pushStack(t),hr(()=>t.effect_instruction_i1())):At),[gp]:(e,t,n)=>{for(;;){const r=hr(()=>t.effect_instruction_i0.next(n));if(r.done)return Tt(r.value);const s=bte(r.value);if(WS(s)){if(s._tag==="Failure")return s}else return e.pushStack(t),s;n=s.value}}},bde={[mA]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),al(t)?Rt(r.cause):n),[gA]:(e,t,n,r)=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[pA]:(e,t,n,r)=>(r.onFiber(e,kB(t)),n),[yA]:(e,t,n,r)=>ne(BT(),()=>n)},xde=e=>HS(hae(e),t=>Sa(Rae(t),([n,r])=>{const s=new Map,i=[];for(const o of r){i.push(Vr(o));for(const l of o)s.set(l.request,l)}const a=i.flat();return Ph(Hde(n.runAll(i),a,()=>a.forEach(o=>{o.listeners.interrupted=!0})),$B,s)},!1,!1)),Sde=sT();var vL,bL;class g8 extends Uh{constructor(n,r,s){super();w(this,bL,Tue);w(this,vL,vde);w(this,"_fiberRefs");w(this,"_fiberId");w(this,"_queue",new Array);w(this,"_children",null);w(this,"_observers",new Array);w(this,"_running",!1);w(this,"_stack",[]);w(this,"_asyncInterruptor",null);w(this,"_asyncBlockingOn",null);w(this,"_exitValue",null);w(this,"_steps",[]);w(this,"_isYielding",!1);w(this,"currentRuntimeFlags");w(this,"currentOpCount",0);w(this,"currentSupervisor");w(this,"currentScheduler");w(this,"currentTracer");w(this,"currentSpan");w(this,"currentContext");w(this,"currentDefaultServices");w(this,"run",()=>{this.drainQueueOnCurrentThread()});if(this.currentRuntimeFlags=s,this._fiberId=n,this._fiberRefs=r,sD(s)){const i=this.getFiberRef(GE);hde.unsafeUpdate(1,i),UD.unsafeUpdate(1,i)}this.refreshRefCache()}commit(){return mg(this)}id(){return this._fiberId}resume(n){this.tell(hf(n))}get status(){return this.ask((n,r)=>r)}get runtimeFlags(){return this.ask((n,r)=>Qle(r)?n.currentRuntimeFlags:r.runtimeFlags)}scope(){return Cue(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(_v)}fiberRefs(){return this.ask(n=>n.getFiberRefs())}ask(n){return Je(()=>{const r=XS(this._fiberId);return this.tell(vb((s,i)=>{ew(r,oe(()=>n(s,i)))})),ec(r)})}tell(n){this._queue.push(n),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Bi(n=>{const r=s=>n(ge(s));if(this._exitValue!==null){r(this._exitValue);return}return this.tell(vb((s,i)=>{s._exitValue!==null?r(this._exitValue):s.addObserver(r)})),oe(()=>this.tell(vb((s,i)=>{s.removeObserver(r)})))},this.id())}get inheritAll(){return vt((n,r)=>{const s=n.id(),i=n.getFiberRefs(),a=r.runtimeFlags,o=this.getFiberRefs(),l=Ple(i,s,o);n.setFiberRefs(l);const c=n.getFiberRef(KD),f=D(Dl(a,c),aD(qu),aD(VE));return $6(f)})}get poll(){return oe(()=>Ah(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(n){return oe(()=>this.tell(m_(Mi(n))))}unsafeInterruptAsFork(n){this.tell(m_(Mi(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(KD,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(n){this._fiberRefs=pB(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=nC(this._fiberRefs,{fiberId:this._fiberId,fiberRef:n,value:r}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(eh),this.currentTracer=this.currentDefaultServices.unsafeMap.get(ZT.key),this.currentSupervisor=this.getFiberRef(Fde),this.currentScheduler=this.getFiberRef(fA),this.currentContext=this.getFiberRef(Ia),this.currentSpan=this.currentContext.unsafeMap.get(nw.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 s of r)s._exitValue===null&&n.add(this.currentRuntimeFlags,s)}drainQueueOnCurrentThread(){let n=!0;for(;n;){let r=Sm;const s=globalThis[tl];globalThis[tl]=this;try{for(;r===Sm;)r=this._queue.length===0?yde:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[tl]=s}this._queue.length>0&&!this._running?(this._running=!0,r===BD?(this.drainQueueLaterOnExecutor(),n=!1):n=!0):n=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(zh))}drainQueueWhileRunning(n,r){let s=r;for(;this._queue.length>0;){const i=this._queue.splice(0,1)[0];s=bde[i._tag](this,n,s,i)}return s}isInterrupted(){return!tse(this.getFiberRef(_v))}addInterruptedCause(n){const r=this.getFiberRef(_v);this.setFiberRef(_v,Cr(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(m_(Mi(this.id()))),n=!0;return n}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const n=this._children.values();this._children=null;let r=!1;return UT({while:()=>!r,body:()=>{const i=n.next();return i.done?oe(()=>{r=!0}):vi(i.value.await)},step:()=>{}})}return null}reportExitValue(n){if(sD(this.currentRuntimeFlags)){const r=this.getFiberRef(GE),s=this.id().startTimeMillis,i=Date.now();switch(gde.unsafeUpdate(i-s,r),UD.unsafeUpdate(-1,r),n._tag){case sr:{mde.unsafeUpdate(1,r);break}case rr:{pde.unsafeUpdate(1,r);break}}}if(n._tag==="Failure"){const r=this.getFiberRef(aoe);!MS(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(Cde)}log(n,r,s){const i=Bt(s)?s.value:this.getFiberRef(toe),a=this.getFiberRef(wde);if(lce(a,i))return;const o=this.getFiberRef(noe),l=this.getFiberRef(eoe),c=this.getLoggers(),f=this.getFiberRefs();if(NT(c)>0){const u=_o(this.getFiberRef(eh),Lh),h=new Date(u.unsafeCurrentTimeMillis());Cte(f,()=>{for(const m of c)m.log({fiberId:this.id(),logLevel:i,message:n,cause:r,context:f,spans:o,annotations:l,date:h})})}}evaluateMessageWhileSuspended(n){switch(n._tag){case yA:return BD;case mA:return this.processNewInterruptSignal(n.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(Rt(n.cause)),this._asyncInterruptor=null),Sm;case gA:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(n.effect),Sm;case pA:return n.onFiber(this,this._exitValue!==null?Jle:Xle(this.currentRuntimeFlags,this._asyncBlockingOn)),Sm;default:return Ev(n)}}evaluateEffect(n){this.currentSupervisor.onResume(this);try{let r=al(this.currentRuntimeFlags)&&this.isInterrupted()?Rt(this.getInterruptedCause()):n;for(;r!==null;){const s=r,i=this.runLoop(s);if(i===Ga){const a=Ya.currentOp;Ya.currentOp=null,a._op===db?oae(this.currentRuntimeFlags)?(this.tell(wue()),this.tell(hf(Rr)),r=null):r=Rr:a._op===pp&&(r=null)}else{this.currentRuntimeFlags=D(this.currentRuntimeFlags,cae(VE));const a=this.interruptAllChildren();a!==null?r=ne(a,()=>i):(this._queue.length===0?this.setExitValue(i):this.tell(hf(i)),r=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(n){if(this._running)this.tell(hf(n));else{this._running=!0;const r=globalThis[tl];globalThis[tl]=this;try{this.evaluateEffect(n)}finally{this._running=!1,globalThis[tl]=r,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(n){this.tell(hf(n))}patchRuntimeFlags(n,r){const s=md(n,r);return globalThis[tl]=this,this.currentRuntimeFlags=s,s}initiateAsync(n,r){let s=!1;const i=a=>{s||(s=!0,this.tell(hf(a)))};al(n)&&(this._asyncInterruptor=i);try{r(i)}catch(a){i(Kn(ci(a)))}}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!==fb)return n;n=this.popStack()}}getNextFailCont(){let n=this.popStack();for(;n;){if(n._op!==xx&&n._op!==wx&&n._op!==gp)return n;n=this.popStack()}}[(bL=Nue,vL=Oue,Rte)](n){return oe(()=>nU(this.currentContext,n))}Left(n){return yn(n.left)}None(n){return yn(new YS)}Right(n){return Tt(n.right)}Some(n){return Tt(n.value)}Micro(n){return jx(r=>{let s=r;const i=$ce(Ace(n,this.currentContext));return i.addObserver(a=>{if(a._tag==="Success")return s(Tt(a.value));switch(a.cause._tag){case"Interrupt":return s(Rt(Mi(Os)));case"Fail":return s(yn(a.cause.error));case"Die":return s(wl(a.cause.defect))}}),jx(a=>{s=o=>{a(At)},i.unsafeInterrupt()})})}[V5](n){const r=hr(()=>n.effect_instruction_i0()),s=this.getNextSuccessCont();return s!==void 0?(s._op in wm||Ev(s),wm[s._op](this,s,r)):(Ya.currentOp=Tt(r),Ga)}[sr](n){const r=n,s=this.getNextSuccessCont();return s!==void 0?(s._op in wm||Ev(s),wm[s._op](this,s,r.effect_instruction_i0)):(Ya.currentOp=r,Ga)}[rr](n){const r=n.effect_instruction_i0,s=this.getNextFailCont();if(s!==void 0)switch(s._op){case fb:case Sx:return al(this.currentRuntimeFlags)&&this.isInterrupted()?Rt(Gj(r)):hr(()=>s.effect_instruction_i1(r));case"OnStep":return al(this.currentRuntimeFlags)&&this.isInterrupted()?Rt(Gj(r)):Tt(Rt(r));case rT:return this.patchRuntimeFlags(this.currentRuntimeFlags,s.patch),al(this.currentRuntimeFlags)&&this.isInterrupted()?Rt(Cr(r,this.getInterruptedCause())):Rt(r);default:Ev(s)}else return Ya.currentOp=Rt(r),Ga}[K5](n){return hr(()=>n.effect_instruction_i0(this,kB(this.currentRuntimeFlags)))}Blocked(n){const r=this.getFiberRefs(),s=this.currentRuntimeFlags;if(this._steps.length>0){const i=[],a=this._steps[this._steps.length-1];let o=this.popStack();for(;o&&o._op!=="OnStep";)i.push(o),o=this.popStack();this.setFiberRefs(a.refs),this.currentRuntimeFlags=a.flags;const l=fg(a.refs,r),c=Dl(a.flags,s);return Tt(C6(n.effect_instruction_i0,vt(f=>{for(;i.length>0;)f.pushStack(i.pop());return f.setFiberRefs(dg(f.id(),f.getFiberRefs())(l)),f.currentRuntimeFlags=md(c)(f.currentRuntimeFlags),n.effect_instruction_i1})))}return Hi(i=>ne(wA(Mae(n.effect_instruction_i0)),()=>i(n.effect_instruction_i1)))}RunBlocked(n){return xde(n.effect_instruction_i0)}[Rh](n){const r=n.effect_instruction_i0,s=this.currentRuntimeFlags,i=md(s,r);if(al(i)&&this.isInterrupted())return Rt(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,r),n.effect_instruction_i1){const a=Dl(i,s);return this.pushStack(new jae(a,n)),hr(()=>n.effect_instruction_i1(s))}else return Rr}[xx](n){return this.pushStack(n),n.effect_instruction_i0}OnStep(n){return this.pushStack(n),n.effect_instruction_i0}[fb](n){return this.pushStack(n),n.effect_instruction_i0}[Sx](n){return this.pushStack(n),n.effect_instruction_i0}[pp](n){return this._asyncBlockingOn=n.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,n.effect_instruction_i0),Ya.currentOp=n,Ga}[db](n){return this._isYielding=!1,Ya.currentOp=n,Ga}[wx](n){const r=n.effect_instruction_i0,s=n.effect_instruction_i1;return r()?(this.pushStack(n),s()):Rr}[gp](n){return wm[gp](this,n,void 0)}[xS](n){return hr(()=>n.commit())}runLoop(n){let r=n;for(this.currentOpCount=0;;){if(this.currentRuntimeFlags&aae&&this.currentSupervisor.onEffect(this,r),this._queue.length>0&&(r=this.drainQueueWhileRunning(this.currentRuntimeFlags,r)),!this._isYielding){this.currentOpCount+=1;const s=this.currentScheduler.shouldYield(this);if(s!==!1){this._isYielding=!0,this.currentOpCount=0;const i=r;r=ne(BT({priority:s}),()=>i)}}try{if(r=this.currentTracer.context(()=>{if(Sde!==r[wu]._V){const s=this.getFiberRef(ooe);if(s._tag==="Some"){const i=r[wu]._V;this.log(`Executing an Effect versioned ${i} with a Runtime of version ${sT()}, 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`,Xl,s)}}return this[r._op](r)},this),r===Ga){const s=Ya.currentOp;return s._op===db||s._op===pp?Ga:(Ya.currentOp=null,s._op===sr||s._op===rr?s:Rt(ci(s)))}}catch(s){r!==Ga&&!De(r,"_op")||!(r._op in this)?r=M6(`Not a valid effect: ${Fd(r)}`):moe(s)?r=Rt(Cr(ci(s),Mi(Os))):r=wl(s)}}}}const wde=Fe("effect/FiberRef/currentMinimumLogLevel",()=>Gn(cce("Info"))),_de=e=>vA(t=>{const n=yB(t.context,eh);_o(n,uB).unsafe.log(e.log(t))}),kde=Fe(Symbol.for("effect/Logger/defaultLogger"),()=>_de(Uue)),Ede=Fe(Symbol.for("effect/Logger/tracerLogger"),()=>vA(({annotations:e,cause:t,context:n,fiberId:r,logLevel:s,message:i})=>{const a=Nh(ug(n,Ia),nw);if(a._tag==="None"||a.value._tag==="ExternalSpan")return;const o=nU(ug(n,eh),Lh),l={};for(const[c,f]of e)l[c]=f;l["effect.fiberId"]=qse(r),l["effect.logLevel"]=s.label,t!==null&&t._tag!=="Empty"&&(l["effect.cause"]=Dh(t,{renderErrorCause:!0})),a.value.event(Fd(Array.isArray(i)&&i.length===1?i[0]:i),o.unsafeCurrentTimeNanos(),l)})),Cde=Fe(Symbol.for("effect/FiberRef/currentLoggers"),()=>Xae(RT(kde,Ede))),Rde=T(e=>qo(e[0]),(e,t)=>dy(LT(e,n=>Nde(r=>t(n,r))))),Nde=e=>vt(t=>{const n=t.getFiberRefs(),r=lae(t.currentRuntimeFlags,qu);return ne(w8,s=>Dx(s,i=>vt(a=>{const o=a.getFiberRefs(),l=a.currentRuntimeFlags,c=fg(o,n),f=Dl(l,r),u=fg(n,o);return a.setFiberRefs(dg(c,a.id(),n)),pg(Lae(e(i),f),oe(()=>{a.setFiberRefs(dg(u,a.id(),a.getFiberRefs()))}))})))}),Tde=e=>{if(Array.isArray(e)||$5(e))return[e,re()];const t=Object.keys(e),n=t.length;return[t.map(r=>e[r]),ie(r=>{const s={};for(let i=0;i<n;i++)s[t[i]]=r[i];return s})]},Ade=(e,t,n)=>{const r=[];for(const s of e)r.push(Qd(s));return ne(nh(r,Oe,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),s=>{const i=re(),a=s.length,o=new Array(a),l=new Array(a);let c=!1;for(let f=0;f<a;f++){const u=s[f];u._tag==="Left"?(o[f]=ie(u.left),c=!0):(l[f]=u.right,o[f]=i)}return c?t._tag==="Some"?yn(t.value(o)):yn(o):n!=null&&n.discard?At:t._tag==="Some"?ge(t.value(l)):ge(l)})},Ode=(e,t,n)=>{const r=[];for(const s of e)r.push(Qd(s));return n!=null&&n.discard?nh(r,Oe,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,discard:!0,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}):nt(nh(r,Oe,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),s=>t._tag==="Some"?t.value(s):s)},y8=(e,t)=>{const[n,r]=Tde(e);return(t==null?void 0:t.mode)==="validate"?Ade(n,r,t):(t==null?void 0:t.mode)==="either"?Ode(n,r,t):(t==null?void 0:t.discard)!==!0&&r._tag==="Some"?nt(nh(n,Oe,t),r.value):nh(n,Oe,t)},nh=T(e=>$5(e[0]),(e,t,n)=>vt(r=>{const s=(n==null?void 0:n.batching)===!0||(n==null?void 0:n.batching)==="inherit"&&r.getFiberRef(ioe);return n!=null&&n.discard?MD(n.concurrency,()=>mf($x,n==null?void 0:n.concurrentFinalizers)(i=>s?Sa(e,(a,o)=>i(t(a,o)),!0,!1,1):HS(e,(a,o)=>i(t(a,o)))),()=>mf(eC,n==null?void 0:n.concurrentFinalizers)(i=>Sa(e,(a,o)=>i(t(a,o)),s,!1)),i=>mf(tC(i),n==null?void 0:n.concurrentFinalizers)(a=>Sa(e,(o,l)=>a(t(o,l)),s,!1,i))):MD(n==null?void 0:n.concurrency,()=>mf($x,n==null?void 0:n.concurrentFinalizers)(i=>s?yC(e,1,(a,o)=>i(t(a,o)),!0):mo(e,(a,o)=>i(t(a,o)))),()=>mf(eC,n==null?void 0:n.concurrentFinalizers)(i=>v8(e,(a,o)=>i(t(a,o)),s)),i=>mf(tC(i),n==null?void 0:n.concurrentFinalizers)(a=>yC(e,i,(o,l)=>a(t(o,l)),s)))})),v8=(e,t,n)=>Je(()=>{const r=kt(e),s=new Array(r.length);return dn(Sa(r,(a,o)=>ne(t(a,o),l=>oe(()=>s[o]=l)),n,!1),ge(s))}),Sa=(e,t,n,r,s)=>Hi(i=>zae(a=>vt(o=>{let l=Array.from(e).reverse(),c=l.length;if(c===0)return At;let f=0,u=!1;const h=s?Math.min(l.length,s):l.length,m=new Set,p=new Array,v=()=>m.forEach(A=>{A.currentScheduler.scheduleTask(()=>{A.unsafeInterruptAsFork(o.id())},0)}),S=new Array,y=new Array,b=new Array,x=()=>{const A=p.filter(({exit:I})=>I._tag==="Failure").sort((I,R)=>I.index<R.index?-1:I.index===R.index?0:1).map(({exit:I})=>I);return A.length===0&&A.push(Rr),A},_=(A,I=!1)=>{const R=dy(a(A)),$=Mde(R,o,o.currentRuntimeFlags,iw);return o.currentScheduler.scheduleTask(()=>{I&&$.unsafeInterruptAsFork(o.id()),$.resume(R)},0),$},C=()=>{r||(c-=l.length,l=[]),u=!0,v()},E=n?Dae:Il,k=_(Bi(A=>{const I=($,U)=>{$._op==="Blocked"?b.push($):(p.push({index:U,exit:$}),$._op==="Failure"&&!u&&C())},R=()=>{if(l.length>0){const $=l.pop();let U=f++;const K=()=>{const F=l.pop();return U=f++,ne(BT(),()=>ne(E(i(t(F,U))),W))},W=F=>l.length>0&&(I(F,U),l.length>0)?K():ge(F),B=ne(E(i(t($,U))),W),j=_(B);S.push(j),m.add(j),u&&j.currentScheduler.scheduleTask(()=>{j.unsafeInterruptAsFork(o.id())},0),j.addObserver(F=>{let z;if(F._op==="Failure"?z=F:z=F.effect_instruction_i0,y.push(j),m.delete(j),I(z,U),p.length===c)A(ge(Kt(pd(x(),{parallel:!0}),()=>Rr)));else if(b.length+p.length===c){const V=x(),O=b.map(me=>me.effect_instruction_i0).reduce(w6);A(ge(C6(O,Sa([Kt(pd(V,{parallel:!0}),()=>Rr),...b.map(me=>me.effect_instruction_i1)],me=>me,n,!0,s))))}else R()})}};for(let $=0;$<h;$++)R()}));return vi(_u(BS(i(mg(k))),JS({onFailure:A=>{C();const I=b.length+1,R=Math.min(typeof s=="number"?s:b.length,b.length),$=Array.from(b);return Bi(U=>{let K=0,W=0;const B=(F,z)=>V=>{K++,K===I&&U(Tt(Rt(A))),$.length>0&&z&&j()},j=()=>{_($.pop(),!0).addObserver(B(W,!0)),W++};k.addObserver(B(W,!1)),W++;for(let F=0;F<R;F++)j()})},onSuccess:()=>mo(y,A=>A.inheritAll)})))}))),yC=(e,t,n,r)=>Je(()=>{const s=kt(e),i=new Array(s.length);return dn(Sa(s,(o,l)=>nt(n(o,l),c=>i[l]=c),r,!1,t),ge(i))}),wA=e=>jde(e,iw),b8=(e,t,n,r=null)=>{const s=Jx(e,t,n,r);return s.resume(e),s},Mde=(e,t,n,r=null)=>Jx(e,t,n,r),Jx=(e,t,n,r=null)=>{const s=i6(),i=t.getFiberRefs(),a=$le(i,s),o=new g8(s,a,n),l=ug(a,Ia),c=o.currentSupervisor;return c.onStart(l,e,ie(t),o),o.addObserver(u=>c.onEnd(u,o)),(r!==null?r:D(t.getFiberRef(YE),Kt(()=>t.scope()))).add(n,o),o},jde=(e,t)=>vt((n,r)=>ge(b8(e,n,r.runtimeFlags,t))),HD=e=>Vu(t=>Ft(Nh(t,dc),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return ne(ao(n,eC),r=>yy(e,r))}}})),qD=e=>t=>Vu(n=>Ft(Nh(n,dc),{onNone:()=>t,onSome:r=>r.strategy._tag==="ParallelN"&&r.strategy.parallelism===e?t:ne(ao(r,tC(e)),s=>yy(t,s))})),mf=(e,t)=>n=>Vu(r=>Ft(Nh(r,dc),{onNone:()=>n(Oe),onSome:s=>{if(t===!0){const i=e._tag==="Parallel"?HD:e._tag==="Sequential"?VD:qD(e.parallelism);switch(s.strategy._tag){case"Parallel":return i(n(HD));case"Sequential":return i(n(VD));case"ParallelN":return i(n(qD(s.strategy.parallelism)))}}else return n(Oe)}})),x8=e=>ne(dc,e),S8=e=>ne(_A(),t=>_u(e(t),n=>t.close(n))),VD=e=>Vu(t=>Ft(Nh(t,dc),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return ne(ao(n,$x),r=>yy(e,r))}}})),Dde=T(e=>qo(e[1]),(e,t,n)=>gy(e,t,(r,s)=>[r,s],n)),Ide=T(e=>qo(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?KS(e,t):gy(e,t,(r,s)=>r,n)),Pde=T(e=>qo(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?dn(e,t):gy(e,t,(r,s)=>s,n)),gy=T(e=>qo(e[1]),(e,t,n,r)=>nt(y8([e,t],{concurrency:r!=null&&r.concurrent?2:1,batching:r==null?void 0:r.batching,concurrentFinalizers:r==null?void 0:r.concurrentFinalizers}),([s,i])=>n(s,i))),dc=fc("effect/Scope"),w8=dc,$de=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.set({},t)},zde={[cD]:cD,[uD]:uD,pipe(){return xe(this,arguments)},fork(e){return oe(()=>{const t=_8(e);if(this.state._tag==="Closed")return t.state=this.state,t;const n={},r=s=>t.close(s);return this.state.finalizers.set(n,r),$de(t,s=>oe(()=>{this.state._tag==="Open"&&this.state.finalizers.delete(n)})),t})},close(e){return Je(()=>{if(this.state._tag==="Closed")return At;const t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:e},t.length===0?At:Ole(this.strategy)?D(mo(t,n=>Il(n(e))),ne(n=>D(pd(n),os(f_),Kt(()=>Rr)))):Mle(this.strategy)?D(v8(t,n=>Il(n(e)),!1),ne(n=>D(pd(n,{parallel:!0}),os(f_),Kt(()=>Rr)))):D(yC(t,this.strategy.parallelism,n=>Il(n(e)),!1),ne(n=>D(pd(n,{parallel:!0}),os(f_),Kt(()=>Rr))))})},addFinalizer(e){return Je(()=>this.state._tag==="Closed"?e(this.state.exit):(this.state.finalizers.set({},e),At))}},_8=(e=su)=>{const t=Object.create(zde);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},_A=(e=su)=>oe(()=>_8(e)),yy=T(2,(e,t)=>tB(e,us(cT(dc,t)))),Lde=e=>$h(e,{differ:dde,fork:xp}),KD=Zae(uae),Fde=Lde(lw),k8=T(3,(e,t,n)=>Bde(e,t,{onSelfWin:(r,s)=>ne(r.await,i=>{switch(i._tag){case sr:return ne(r.inheritAll,()=>n.onSelfDone(i,s));case rr:return n.onSelfDone(i,s)}}),onOtherWin:(r,s)=>ne(r.await,i=>{switch(i._tag){case sr:return ne(r.inheritAll,()=>n.onOtherDone(i,s));case rr:return n.onOtherDone(i,s)}})})),Ude=T(2,(e,t)=>uy(n=>k8(e,t,{onSelfDone:(r,s)=>XE(r,{onFailure:i=>D(mg(s),jD(a=>Ql(i,a))),onSuccess:i=>D(s,lg(n),Gr(i))}),onOtherDone:(r,s)=>XE(r,{onFailure:i=>D(mg(s),jD(a=>Ql(a,i))),onSuccess:i=>D(s,lg(n),Gr(i))})}))),Bde=T(3,(e,t,n)=>vt((r,s)=>{const i=s.runtimeFlags,a=ny(!0),o=Jx(e,r,i,n.selfScope),l=Jx(t,r,i,n.otherScope);return Bi(c=>{o.addObserver(()=>GD(o,l,n.onSelfWin,a,c)),l.addObserver(()=>GD(l,o,n.onOtherWin,a,c)),o.startFork(e),l.startFork(t)},bp(o.id(),l.id()))})),GD=(e,t,n,r,s)=>{Ise(!0,!1)(r)&&s(n(e,t))},pg=T(2,(e,t)=>Hi(n=>pi(n(e),{onFailure:r=>pi(t,{onFailure:s=>Kn(Cr(r,s)),onSuccess:()=>Kn(r)}),onSuccess:r=>Gr(t,r)}))),Hde=(e,t,n)=>uy(r=>ne(ne(wA($T(e)),s=>Bi(i=>{const a=t.map(c=>c.listeners.count),o=()=>{a.every(c=>c===0)&&t.every(c=>c.result.state.current._tag==="Pending"?!0:!!(c.result.state.current._tag==="Done"&&WS(c.result.state.current.effect)&&c.result.state.current.effect._tag==="Failure"&&qU(c.result.state.current.effect.cause)))&&(l.forEach(c=>c()),n==null||n(),i(HT(s)))};s.addObserver(c=>{l.forEach(f=>f()),i(c)});const l=t.map((c,f)=>{const u=h=>{a[f]=h,o()};return c.listeners.addObserver(u),()=>c.listeners.removeObserver(u)});return o(),oe(()=>{l.forEach(c=>c())})})),()=>Je(()=>{const s=t.flatMap(i=>i.state.completed?[]:[i]);return HS(s,i=>sde(i.request,voe(r)))}))),qde=Xl,E8=vu,vC=ci,C8=Mi,Vde=Ql,Kde=ese,Gde=HU,Xx=qU,Yde=MS,Wde=TT,Jde=AT,Xde=KU,Qde=rse,Zde=ase,kA=uoe,ehe=DS,Bh=YS,the=Dh,nhe="effect/ScheduleInterval",Qx=Symbol.for(nhe),R8={[Qx]:Qx,startMillis:0,endMillis:0},N8=(e,t)=>e>t?R8:{[Qx]:Qx,startMillis:e,endMillis:t},rhe=T(2,(e,t)=>she(e,t)===e),she=T(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),ihe=e=>e.startMillis>=e.endMillis,ahe=T(2,(e,t)=>{const n=Math.max(e.startMillis,t.startMillis),r=Math.min(e.endMillis,t.endMillis);return N8(n,r)}),ohe=e=>N8(e,Number.POSITIVE_INFINITY),T8=R8,lhe=rhe,che=ihe,uhe=ahe,fhe=ohe,dhe="effect/ScheduleIntervals",YD=Symbol.for(dhe),A8=e=>({[YD]:YD,intervals:e}),hhe=T(2,(e,t)=>mhe(e.intervals,t.intervals,Vn())),mhe=(e,t,n)=>{let r=e,s=t,i=n;for(;Po(r)&&Po(s);){const a=D(ha(r),uhe(ha(s))),o=che(a)?i:D(i,Mr(a));D(ha(r),lhe(ha(s)))?r=ho(r):s=ho(s),i=o}return A8(Io(i))},bC=e=>D(e.intervals,yT,Kt(()=>T8)).startMillis,phe=e=>D(e.intervals,yT,Kt(()=>T8)).endMillis,ghe=T(2,(e,t)=>bC(e)<bC(t)),yhe=e=>Po(e.intervals),vhe=A8,bhe=hhe,xhe=bC,WD=phe,She=ghe,whe=yhe,EA="Continue",O8="Done",_he=e=>({_tag:EA,intervals:e}),khe=e=>({_tag:EA,intervals:vhe(Dn(e))}),Ehe={_tag:O8},Che=e=>e._tag===EA,Rhe=e=>e._tag===O8,Nhe=_he,The=khe,gg=Ehe,JD=Che,Zx=Rhe,Ahe=dc,e0=Y6,Ohe=Dx,t0=WE,Mhe=yy,M8=ao,j8=_A;class jhe{constructor(t){w(this,"permits");w(this,"waiters",new Set);w(this,"taken",0);w(this,"take",t=>Sl(n=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),n(Je(()=>this.free<t?this.take(t):(this.taken+=t,ge(t)))))};return this.waiters.add(r),oe(()=>{this.waiters.delete(r)})}n(Je(()=>this.free<t?this.take(t):(this.taken+=t,ge(t))))}));w(this,"resize",t=>vi(vt(n=>(this.permits=t,this.free<0?At:this.updateTakenUnsafe(n,r=>r)))));w(this,"release",t=>this.updateTaken(n=>n-t));w(this,"releaseAll",this.updateTaken(t=>0));w(this,"withPermits",t=>n=>Hi(r=>ne(r(this.take(t)),s=>pg(r(n),this.release(s)))));w(this,"withPermitsIfAvailable",t=>n=>Hi(r=>Je(()=>this.free<t?oue:(this.taken+=t,pg(r(Qce(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(fA).scheduleTask(()=>{const r=this.waiters.values();let s=r.next();for(;s.done===!1&&this.free>0;)s.value(),s=r.next()},t.getFiberRef(zh)),ge(this.free)}updateTaken(t){return vt(n=>this.updateTakenUnsafe(n,t))}}const CA=e=>new jhe(e),Dhe=e=>oe(()=>CA(e));class Ihe extends Uh{constructor(n){super();w(this,"isOpen");w(this,"waiters",[]);w(this,"scheduled",!1);w(this,"flushWaiters",()=>{this.scheduled=!1;const n=this.waiters;this.waiters=[];for(let r=0;r<n.length;r++)n[r](Rr)});w(this,"open",vt(n=>this.isOpen?At:(this.isOpen=!0,this.unsafeSchedule(n))));w(this,"release",vt(n=>this.isOpen?At:this.unsafeSchedule(n)));w(this,"await",Sl(n=>this.isOpen?n(At):(this.waiters.push(n),oe(()=>{const r=this.waiters.indexOf(n);r!==-1&&this.waiters.splice(r,1)}))));w(this,"close",oe(()=>{this.isOpen=!1}));w(this,"whenOpen",n=>dn(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(zh))),At}unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}unsafeClose(){this.isOpen=!1}}const Phe=e=>new Ihe(e??!1),$he=T(2,(e,t)=>vt((n,r)=>{const s=t,i=b8(e,n,r.runtimeFlags,iw);if(s.state._tag==="Open"){const a=()=>uy(l=>Re(l,i.id())?At:vi(HT(i))),o={};s.state.finalizers.set(o,a),i.addObserver(()=>{s.state._tag!=="Closed"&&s.state.finalizers.delete(o)})}else i.unsafeInterruptAsFork(n.id());return ge(i)})),zhe="effect/Ref/SynchronizedRef",Lhe=Symbol.for(zhe),Fhe={_A:e=>e};var xL,SL,wL,_L;class Uhe extends(_L=Uh,wL=Lhe,SL=MB,xL=Bx,_L){constructor(n,r){super();w(this,"ref");w(this,"withLock");w(this,wL,Fhe);w(this,SL,jB);w(this,xL,Bx);w(this,"get");this.ref=n,this.withLock=r,this.get=xa(this.ref)}commit(){return this.get}modify(n){return this.modifyEffect(r=>ge(n(r)))}modifyEffect(n){return this.withLock(D(ne(xa(this.ref),n),ne(([r,s])=>Gr(yd(this.ref,s),r))))}}const Bhe=e=>oe(()=>D8(e)),D8=e=>{const t=lA(e),n=CA(1);return new Uhe(t,n.withPermits(1))},Hhe=Symbol.for("effect/ManagedRuntime"),qhe="Fresh",Vhe="FromEffect",Khe="Scoped",Ghe="Suspend",Yhe="Provide",I8="ProvideMerge",Whe="MergeAll",P8=Mue,Jhe=Due,XD=jue,Pl=HT,RA=lg,QD=mg,Hh=e=>function(){if(arguments.length===1){const t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},vy=Hh((e,t,n)=>{const r=i6(),s=[[Ia,[[r,e.context]]]];n!=null&&n.scheduler&&s.push([fA,[[r,n.scheduler]]]);let i=Lle(e.fiberRefs,{entries:s,forkAs:r});n!=null&&n.updateRefs&&(i=n.updateRefs(i,r));const a=new g8(r,i,e.runtimeFlags);let o=t;n!=null&&n.scope&&(o=ne(M8(n.scope,su),c=>dn(Y6(c,uy(f=>Re(f,a.id())?At:lg(a,f))),_u(t,f=>t0(c,f)))));const l=a.currentSupervisor;return l!==lw&&(l.onStart(e.context,o,re(),a),a.addObserver(c=>l.onEnd(c,a))),iw.add(e.runtimeFlags,a),(n==null?void 0:n.immediate)===!1?a.resume(o):a.start(o),a}),$8=Hh((e,t,n={})=>{const r=vy(e,t,n);return n.onExit&&r.addObserver(s=>{n.onExit(s)}),(s,i)=>$8(e)(D(r,RA(s??Os)),{...i,onExit:i!=null&&i.onExit?a=>i.onExit(xue(a)):void 0})}),z8=Hh((e,t)=>{const n=eme(e)(t);if(n._tag==="Failure")throw L8(n.effect_instruction_i0);return n.effect_instruction_i0});class Xhe 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`);w(this,"fiber");w(this,"_tag","AsyncFiberException");this.fiber=n,this.name=this._tag,this.stack=this.message}}const Qhe=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Xhe(e);return Error.stackTraceLimit=t,n},p_=Symbol.for("effect/Runtime/FiberFailure"),Cv=Symbol.for("effect/Runtime/FiberFailure/Cause");var kL,EL;class Zhe extends Error{constructor(n){const r=YU(n)[0];super((r==null?void 0:r.message)||"An error has occurred");w(this,EL);w(this,kL);this[p_]=p_,this[Cv]=n,this.name=r?`(FiberFailure) ${r.name}`:"FiberFailure",r!=null&&r.stack&&(this.stack=r.stack)}toJSON(){return{_id:"FiberFailure",cause:this[Cv].toJSON()}}toString(){return"(FiberFailure) "+Dh(this[Cv],{renderErrorCause:!0})}[(EL=p_,kL=Cv,pt)](){return this.toString()}}const L8=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Zhe(e);return Error.stackTraceLimit=t,n},F8=e=>{const t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return cg(t.left);case"Right":return Tt(t.right);case"Some":return Tt(t.value);case"None":return cg(new YS)}},eme=Hh((e,t)=>{const n=F8(t);if(n)return n;const r=new uA,s=vy(e)(t,{scheduler:r});r.flush();const i=s.unsafePoll();return i||J6(PT(Qhe(s),QT(s)))}),tme=Hh((e,t,n)=>U8(e,t,n).then(r=>{switch(r._tag){case sr:return r.effect_instruction_i0;case rr:throw L8(r.effect_instruction_i0)}})),U8=Hh((e,t,n)=>new Promise(r=>{const s=F8(t);s&&r(s);const i=vy(e)(t);i.addObserver(a=>{r(a)}),(n==null?void 0:n.signal)!==void 0&&(n.signal.aborted?i.unsafeInterruptAsFork(i.id()):n.signal.addEventListener("abort",()=>{i.unsafeInterruptAsFork(i.id())},{once:!0}))}));class B8{constructor(t,n,r){w(this,"context");w(this,"runtimeFlags");w(this,"fiberRefs");this.context=t,this.runtimeFlags=n,this.fiberRefs=r}pipe(){return xe(this,arguments)}}const H8=e=>new B8(e.context,e.runtimeFlags,e.fiberRefs),nme=()=>vt((e,t)=>ge(new B8(e.getFiberRef(Ia),t.runtimeFlags,e.getFiberRefs()))),rme=x6(qu,v6,y6),Cu=H8({context:Ea(),runtimeFlags:rme,fiberRefs:Fle()}),sme=vy(Cu),ime=tme(Cu),ame=U8(Cu),ome=z8(Cu),lme=T(2,(e,t)=>e.modifyEffect(t)),cme="effect/Layer",q8=Symbol.for(cme),ume={_RIn:e=>e,_E:e=>e,_ROut:e=>e},Ru={[q8]:ume,pipe(){return xe(this,arguments)}},fme="effect/Layer/MemoMap",g_=Symbol.for(fme),dme=Th()("effect/Layer/CurrentMemoMap",{defaultValue:()=>pme()}),hme=e=>De(e,q8),mme=e=>e._op_layer===qhe;var CL;CL=g_;class V8{constructor(t){w(this,"ref");w(this,CL);this.ref=t,this[g_]=g_}getOrElseMemoize(t,n){return D(lme(this.ref,r=>{const s=r.get(t);if(s!==void 0){const[i,a]=s,o=D(i,ne(([l,c])=>D(HB(l),Gr(c))),_u(JS({onFailure:()=>At,onSuccess:()=>Dx(n,a)})));return ge([o,r])}return D(Hx(0),ne(i=>D(QS(),ne(a=>D(Hx(()=>At),nt(o=>{const l=Hi(f=>D(_A(),ne(u=>D(f(ne(W8(t,u,!0),h=>Zce(h(this)))),Il,ne(h=>{switch(h._tag){case rr:return D(Z6(a,h.effect_instruction_i0),dn(WE(u,h)),dn(Kn(h.effect_instruction_i0)));case sr:return D(yd(o,m=>D(WE(u,m),FT(DB(i,p=>[p===1,p-1])),vi)),dn(qx(i,m=>m+1)),dn(Dx(n,m=>D(oe(()=>r.delete(t)),dn(xa(o)),ne(p=>p(m))))),dn(WT(a,h.effect_instruction_i0)),Gr(h.effect_instruction_i0[1]))}}))))),c=[D(ec(a),_u(XE({onFailure:()=>At,onSuccess:()=>qx(i,f=>f+1)}))),f=>D(xa(o),ne(u=>u(f)))];return[l,mme(t)?r:r.set(t,c)]}))))))}),BS)}}const K8=Je(()=>nt(Bhe(new Map),e=>new V8(e))),pme=()=>new V8(D8(new Map)),G8=T(2,(e,t)=>ne(K8,n=>Y8(e,n,t))),Y8=T(3,(e,t,n)=>ne(W8(e,n),r=>qB(r(t),dme,t))),W8=(e,t,n=!1)=>{const r=e;switch(r._op_layer){case"Locally":return oe(()=>s=>r.f(s.getOrElseMemoize(r.self,t)));case"ExtendScope":return oe(()=>s=>x8(i=>s.getOrElseMemoize(r.layer,i)));case"Fold":return oe(()=>s=>D(s.getOrElseMemoize(r.layer,t),pi({onFailure:i=>s.getOrElseMemoize(r.failureK(i),t),onSuccess:i=>s.getOrElseMemoize(r.successK(i),t)})));case"Fresh":return oe(()=>s=>D(r.layer,G8(t)));case"FromEffect":return oe(n?()=>s=>r.effect:()=>s=>s.getOrElseMemoize(e,t));case"Provide":return oe(()=>s=>D(s.getOrElseMemoize(r.first,t),ne(i=>D(s.getOrElseMemoize(r.second,t),tw(i)))));case"Scoped":return oe(n?()=>s=>yy(r.effect,t):()=>s=>s.getOrElseMemoize(e,t));case"Suspend":return oe(()=>s=>s.getOrElseMemoize(r.evaluate(),t));case"ProvideMerge":return oe(()=>s=>D(s.getOrElseMemoize(r.first,t),F6(s.getOrElseMemoize(r.second,t),r.zipK)));case"ZipWith":return z6(function*(){const s=yield*ao(t,ZE),i=yield*ao(s,su),a=yield*ao(s,su);return o=>D(o.getOrElseMemoize(r.first,i),gy(o.getOrElseMemoize(r.second,a),r.zipK,{concurrent:!0}))});case"MergeAll":{const s=r.layers;return nt(ao(t,ZE),i=>a=>{const o=new Array(s.length);return nt(Sa(s,L6(function*(l,c){const f=yield*ao(i,su),u=yield*a.getOrElseMemoize(l,f);o[c]=u}),!1,!1),()=>ane(...o))})}}},gme=()=>J8(JT()),yme=T(2,(e,t)=>{const n=tU(e),r=n?e:t;return J8(nt(n?t:e,i=>cT(r,i)))});function J8(e){const t=Object.create(Ru);return t._op_layer=Vhe,t.effect=e,t}const X8=(...e)=>{const t=Object.create(Ru);return t._op_layer=Whe,t.layers=e,t},vme=T(2,(e,t)=>{const n=tU(e),r=n?e:t;return bme(nt(n?t:e,i=>cT(r,i)))}),bme=e=>{const t=Object.create(Ru);return t._op_layer=Khe,t.effect=e,t},xme=e=>{const t=Object.create(Ru);return t._op_layer=Ghe,t.evaluate=e,t},Q8=T(2,(e,t)=>xme(()=>{const n=Object.create(Ru);return n._op_layer=Yhe,n.first=Object.create(Ru,{_op_layer:{value:I8,enumerable:!0},first:{value:gme(),enumerable:!0},second:{value:Array.isArray(t)?X8(...t):t},zipK:{value:(r,s)=>D(r,us(s))}}),n.second=e,n})),Sme=T(2,(e,t)=>{const n=Object.create(Ru);return n._op_layer=I8,n.first=t,n.second=Q8(e,t),n.zipK=(r,s)=>D(r,us(s)),n}),ZD=T(2,(e,t)=>S8(n=>ne(G8(t,n),r=>XT(e,r)))),eI=T(2,(e,t)=>{const n=fg(Cu.fiberRefs,t.fiberRefs),r=Dl(Cu.runtimeFlags,t.runtimeFlags);return Hi(s=>vt(i=>{const a=i.getFiberRef(Ia),o=i.getFiberRefs(),l=dg(i.id(),o)(n),c=i.currentRuntimeFlags,f=md(r)(c),u=fg(l,o),h=Dl(f,c);return i.setFiberRefs(l),i.currentRuntimeFlags=f,pg(XT(s(e),us(a,t.context)),vt(m=>(m.setFiberRefs(dg(m.id(),m.getFiberRefs())(u)),m.currentRuntimeFlags=md(h)(m.currentRuntimeFlags),At)))}))}),wme=T(2,(e,t)=>Array.isArray(t)?ZD(e,X8(...t)):hme(t)?ZD(e,t):ine(t)?XT(e,t):Hhe in t?ne(t.runtimeEffect,n=>eI(e,n)):eI(e,t)),Bm=cie,tI=e=>_me(e.slice(0)),_me=e=>Object.setPrototypeOf(e,lie),kme=e=>t=>{const n=t===void 0?Object.create(ey):Bm(t);return n._tag=e,n},NA=sy,Eme=sy,Cme=()=>new Proxy({},{get(e,t,n){return t==="$is"?QN:t==="$match"?Rme:kme(t)}});function Rme(){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 TA=function(){const e=Symbol.for("effect/Data/Error/plainArgs");return{BaseEffectError:class extends VT{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}(),Nme=e=>{const t={BaseEffectError:class extends TA{constructor(){super(...arguments);w(this,"_tag",e)}}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},Tme="effect/Schedule",Z8=Symbol.for(Tme),Ame=e=>De(e,Z8),Ome="effect/ScheduleDriver",Mme=Symbol.for(Ome),xC={start:0,now:0,input:void 0,output:void 0,elapsed:Wd,elapsedSincePrevious:Wd,recurrence:0},nI=Th()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>xC}),jme={_Out:e=>e,_In:e=>e,_R:e=>e},Dme={_Out:e=>e,_In:e=>e,_R:e=>e};var RL;RL=Z8;class Ime{constructor(t,n){w(this,"initial");w(this,"step");w(this,RL,jme);this.initial=t,this.step=n}pipe(){return xe(this,arguments)}}const rI=(e,t,n,r)=>qx(e,s=>s.recurrence===0?{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:Wd,elapsedSincePrevious:Wd,start:t}:{now:t,input:n,output:r,recurrence:s.recurrence+1,elapsed:bu(t-s.start),elapsedSincePrevious:bu(t-s.now),start:s.start});var NL;NL=Mme;class Pme{constructor(t,n){w(this,"schedule");w(this,"ref");w(this,NL,Dme);w(this,"iterationMeta",lA(xC));this.schedule=t,this.ref=n}get state(){return nt(xa(this.ref),t=>t[1])}get last(){return ne(xa(this.ref),([t,n])=>{switch(t._tag){case"None":return FS(()=>new YS);case"Some":return ge(t.value)}})}get reset(){return yd(this.ref,[re(),this.schedule.initial]).pipe(KS(yd(this.iterationMeta,xC)))}next(t){return D(nt(xa(this.ref),n=>n[1]),ne(n=>D(Kce,ne(r=>D(Je(()=>this.schedule.step(r,t,n)),ne(([s,i,a])=>{const o=yd(this.ref,[ie(i),s]);if(Zx(a))return o.pipe(dn(yn(re())));const l=xhe(a.intervals)-r;if(l<=0)return o.pipe(dn(rI(this.iterationMeta,r,t,i)),Gr(i));const c=bu(l);return D(o,dn(rI(this.iterationMeta,r,t,i)),dn(aue(c)),Gr(i))}))))))}}const by=(e,t)=>new Ime(e,t),$me=T(2,(e,t)=>AA(e,(n,r)=>oe(()=>t(n,r)))),AA=T(2,(e,t)=>by(e.initial,(n,r,s)=>ne(e.step(n,r,s),([i,a,o])=>Zx(o)?ge([i,a,gg]):nt(t(r,a),l=>l?[i,a,o]:[i,a,gg])))),zme=e=>D(Hx([re(),e.initial]),nt(t=>new Pme(e,t))),Lme=T(2,(e,t)=>Fme(e,t,bhe)),Fme=T(3,(e,t,n)=>by([e.initial,t.initial],(r,s,i)=>D(F6(e.step(r,s,i[0]),t.step(r,s,i[1]),(a,o)=>[a,o]),ne(([[a,o,l],[c,f,u]])=>JD(l)&&JD(u)?SC(e,t,s,a,o,l.intervals,c,f,u.intervals,n):ge([[a,c],[o,f],gg]))))),SC=(e,t,n,r,s,i,a,o,l,c)=>{const f=c(i,l);return whe(f)?ge([[r,a],[s,o],Nhe(f)]):D(i,She(l))?ne(e.step(WD(i),n,r),([u,h,m])=>Zx(m)?ge([[u,a],[h,o],gg]):SC(e,t,n,u,h,m.intervals,a,o,l,c)):ne(t.step(WD(l),n,a),([u,h,m])=>Zx(m)?ge([[r,u],[s,h],gg]):SC(e,t,n,r,s,i,u,h,m.intervals,c))},Ume=T(2,(e,t)=>Bme(e,n=>oe(()=>t(n)))),Bme=T(2,(e,t)=>by(e.initial,(n,r,s)=>ne(e.step(n,r,s),([i,a,o])=>nt(t(a),l=>[i,l,o])))),Hme=e=>by(e.initial,(t,n,r)=>D(e.step(t,n,r),nt(([s,i,a])=>[s,n,a]))),qme=e=>Yme(tH,t=>t<e),Vme=(e,t)=>by(e,(n,r,s)=>oe(()=>[t(s),s,The(fhe(n))])),Kme=T(2,(e,t)=>AA(e,(n,r)=>rue(t(n)))),Gme=T(2,(e,t)=>AA(e,(n,r)=>t(n))),Yme=T(2,(e,t)=>$me(e,(n,r)=>t(r))),xb=Symbol.for("effect/Schedule/ScheduleDefect");var TL;TL=xb;class Wme{constructor(t){w(this,"error");w(this,TL);this.error=t,this[xb]=xb}}const Jme=e=>De(e,xb),sI=e=>og(e,t=>wl(new Wme(t))),Xme=e=>Ft(jS(e,t=>HU(t)&&Jme(t.defect)?ie(t.defect):re()),{onNone:()=>e,onSome:t=>vu(t.error)}),Qme=e=>O6(e,t=>Kn(Xme(t))),iI=T(2,(e,t)=>epe(e,t,(n,r)=>yn(n))),Zme=T(2,(e,t)=>{if(Ame(t))return iI(e,t);const n=t.schedule??Hme(tH),r=t.while?Gme(n,a=>{const o=t.while(a);return typeof o=="boolean"?ge(o):sI(o)}):n,s=t.until?Kme(r,a=>{const o=t.until(a);return typeof o=="boolean"?ge(o):sI(o)}):r,i=t.times?Lme(s,qme(t.times)).pipe(Ume(a=>a[0])):s;return Qme(iI(e,i))}),epe=T(3,(e,t,n)=>ne(zme(t),r=>Zl(e,{onFailure:s=>n(s,re()),onSuccess:s=>eH(DD(e,nI,xa(r.iterationMeta)),r,(i,a)=>DD(n(i,a),nI,xa(r.iterationMeta)),s)}))),eH=(e,t,n,r)=>Zl(t.next(r),{onFailure:()=>Iae(t.last),onSuccess:s=>Zl(e,{onFailure:i=>n(i,ie(s)),onSuccess:i=>eH(e,t,n,i)})}),tH=Vme(0,e=>e+1),ma=QS,Ur=ec,tpe=Q6,npe=Z6,wC=woe,go=WT,rpe=ew,aI=Symbol.for("effect/MutableList"),spe={[aI]:aI,[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 zt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(nn)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},ipe=e=>({value:e,removed:!1,prev:void 0,next:void 0}),ape=()=>{const e=Object.create(spe);return e.head=void 0,e.tail=void 0,e._length=0,e},nH=e=>OA(e)===0,OA=e=>e._length,ope=T(2,(e,t)=>{const n=ipe(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}),lpe=e=>{const t=e.head;if(t!==void 0)return cpe(e,t),t.value},cpe=(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))},oI=Symbol.for("effect/MutableQueue"),is=Symbol.for("effect/mutable/MutableQueue/Empty"),upe={[oI]:oI,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return zt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(nn)}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},rH=e=>{const t=Object.create(upe);return t.queue=ape(),t.capacity=e,t},fpe=e=>rH(e),MA=()=>rH(void 0),jA=e=>OA(e.queue),_C=e=>nH(e.queue),dpe=e=>e.capacity===void 0?1/0:e.capacity,yg=T(2,(e,t)=>{const n=OA(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(ope(t)(e.queue),!0)}),sH=T(2,(e,t)=>{const n=t[Symbol.iterator]();let r,s=Vn(),i=!0;for(;i&&(r=n.next())&&!r.done;)i=yg(r.value)(e);for(;r!=null&&!r.done;)s=Mr(r.value)(s),r=n.next();return Io(s)}),$l=T(2,(e,t)=>nH(e.queue)?t:lpe(e.queue)),DA=T(2,(e,t)=>{let n=Vn(),r=0;for(;r<t;){const s=$l(is)(e);if(s===is)break;n=Mr(s)(n),r+=1}return Io(n)}),kC=wu,hc=qo,y_=nue,hpe=y8,wa=nh,n0=Bi,r0=vt,Pa=yn,zi=Kn,mpe=M6,vd=z6,v_=Fae,ppe=iue,Jt=ge,vn=Je,Pt=oe,ht=At,iH=og,IA=O6,gpe=tue,ype=FB,vpe=uue,Sp=cue,Lc=Za,ji=$T,bpe=fy,Hm=dy,s0=Hi,b_=Gr,PA=vi,Et=nt,xpe=zT,$A=qS,i0=Rde,Spe=T6,Qf=pg,cw=w8,wpe=x8,EC=S8,_pe=uy,kpe=wA,iu=$he,aH=JT,oH=tB,a0=wme,Epe=hue,pf=Qd,yr=Il,lH=P6,Cpe=due,je=ne,Nf=BS,x_=Ude,cH=k8,uH=LT,fH=lue,lI=Zme,Rpe=Ph,Npe=UB,CC=D6,Di=pi,xy=nme,Tpe=CA,Ape=Dhe,Ope=Phe,zA=sme,Mpe=ime,jpe=ame,ui=ome,o0=Dde,LA=Ide,mr=Pde,uw=gy,Dpe=gue,Ipe=yue,dH=L6,fw=vy,Ppe=z8,$pe=$8,dw=Cu,FA=H8,RC=Symbol.for("effect/FiberHandle"),zpe=e=>De(e,RC),Lpe={[RC]:RC,toString(){return zt(this.toJSON())},toJSON(){return{_id:"FiberHandle",state:this.state}},[pt](){return this.toJSON()},pipe(){return xe(this,arguments)}},Fpe=e=>{const t=Object.create(Lpe);return t.state={_tag:"Open",fiber:void 0},t.deferred=e,t},Upe=()=>i0(Et(ma(),e=>Fpe(e)),e=>r0(t=>{const n=e.state;return n._tag==="Closed"?ht:(e.state={_tag:"Closed"},n.fiber?lH(PA(RA(n.fiber,bp(t.id(),Sb))),e.deferred):tpe(e.deferred,hA))})),Bpe=()=>je(Upe(),e=>Vpe(e)()),hH=-1,Sb=Hse(hH,0),Hpe=ehe(void 0,{emptyCase:Ml,failCase:Ml,dieCase:Ml,interruptCase:(e,t)=>LU(s6(t),hH),sequentialCase:(e,t,n)=>t||n,parallelCase:(e,t,n)=>t||n}),qpe=T(e=>zpe(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(bp((n==null?void 0:n.interruptAs)??Os,Sb));return}else if(e.state.fiber!==void 0){if((n==null?void 0:n.onlyIfMissing)===!0){t.unsafeInterruptAsFork(bp((n==null?void 0:n.interruptAs)??Os,Sb));return}else if(e.state.fiber===t)return;e.state.fiber.unsafeInterruptAsFork(bp((n==null?void 0:n.interruptAs)??Os,Sb)),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),dA(r)&&((n==null?void 0:n.propagateInterruption)===!0?!Hpe(r.cause):!Yde(r.cause))&&rpe(e.deferred,r)})}),cI=function(){let e;return()=>(e===void 0&&(e=zA(Lc)),e)}(),Vpe=e=>()=>Et(xy(),t=>{const n=fw(t);return(r,s)=>{if(e.state._tag==="Closed")return cI();if(e.state.fiber!==void 0&&(s==null?void 0:s.onlyIfMissing)===!0)return cI();const i=n(r,s);return qpe(e,i,s),i}}),Kpe=yme,mH=vme,pH=Q8,S_=Sme,Gpe=K8,uI=Y8,UA=Gn,gH=Ia,Ype=K6,Wpe="effect/QueueEnqueue",Jpe=Symbol.for(Wpe),Xpe="effect/QueueDequeue",Qpe=Symbol.for(Xpe),Zpe="effect/QueueStrategy",yH=Symbol.for(Zpe),ege="effect/BackingQueue",tge=Symbol.for(ege),vH={_A:e=>e},nge={_A:e=>e},rge={_In:e=>e},sge={_Out:e=>e};var AL,OL,ML;class ige extends(ML=Uh,OL=Jpe,AL=Qpe,ML){constructor(n,r,s,i,a){super();w(this,"queue");w(this,"takers");w(this,"shutdownHook");w(this,"shutdownFlag");w(this,"strategy");w(this,OL,rge);w(this,AL,sge);this.queue=n,this.takers=r,this.shutdownHook=s,this.shutdownFlag=i,this.strategy=a}pipe(){return xe(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return Je(()=>og(this.unsafeSize(),()=>Za))}unsafeSize(){return Fn(this.shutdownFlag)?re():ie(this.queue.length()-jA(this.takers)+this.strategy.surplusSize())}get isEmpty(){return nt(this.size,n=>n<=0)}get isFull(){return nt(this.size,n=>n>=this.capacity())}get shutdown(){return dy(vt(n=>(D(this.shutdownFlag,ry(!0)),D(Sa(bd(this.takers),r=>eB(r,n.id()),!1,!1),dn(this.strategy.shutdown),FT(WT(this.shutdownHook,void 0)),vi))))}get isShutdown(){return oe(()=>Fn(this.shutdownFlag))}get awaitShutdown(){return ec(this.shutdownHook)}isActive(){return!Fn(this.shutdownFlag)}unsafeOffer(n){if(Fn(this.shutdownFlag))return!1;let r;if(this.queue.length()===0){const i=D(this.takers,$l(is));i!==is?(au(i,n),r=!0):r=!1}else r=!1;if(r)return!0;const s=this.queue.offer(n);return Zf(this.strategy,this.queue,this.takers),s}offer(n){return Je(()=>{if(Fn(this.shutdownFlag))return Za;let r;if(this.queue.length()===0){const i=D(this.takers,$l(is));i!==is?(au(i,n),r=!0):r=!1}else r=!1;if(r)return ge(!0);const s=this.queue.offer(n);return Zf(this.strategy,this.queue,this.takers),s?ge(!0):this.strategy.handleSurplus([n],this.queue,this.takers,this.shutdownFlag)})}offerAll(n){return Je(()=>{if(Fn(this.shutdownFlag))return Za;const r=kt(n),s=this.queue.length()===0?kt(Sge(this.takers,r.length)):Wl,[i,a]=D(r,xU(s.length));for(let l=0;l<s.length;l++){const c=s[l],f=i[l];au(c,f)}if(a.length===0)return ge(!0);const o=this.queue.offerAll(a);return Zf(this.strategy,this.queue,this.takers),ES(o)?ge(!0):this.strategy.handleSurplus(o,this.queue,this.takers,this.shutdownFlag)})}get take(){return vt(n=>{if(Fn(this.shutdownFlag))return Za;const r=this.queue.poll(is);if(r!==is)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),ge(r);{const s=XS(n.id());return D(Je(()=>(D(this.takers,yg(s)),Zf(this.strategy,this.queue,this.takers),Fn(this.shutdownFlag)?Za:ec(s))),fy(()=>oe(()=>wge(this.takers,s))))}})}get takeAll(){return Je(()=>Fn(this.shutdownFlag)?Za:oe(()=>{const n=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Do(n)}))}takeUpTo(n){return Je(()=>Fn(this.shutdownFlag)?Za:oe(()=>{const r=this.queue.pollUpTo(n);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Do(r)}))}takeBetween(n,r){return Je(()=>bH(this,n,r,Vn()))}}const bH=(e,t,n,r)=>n<t?ge(r):D(pge(e,n),ne(s=>{const i=t-s.length;return i===1?D(NC(e),nt(a=>D(r,On(s),ME(a)))):i>1?D(NC(e),ne(a=>bH(e,i-1,n-s.length-1,D(r,On(s),ME(a))))):ge(D(r,On(s)))})),age=e=>D(oe(()=>fpe(e)),ne(t=>xH(SH(t),yge()))),oge=()=>D(oe(()=>MA()),ne(e=>xH(SH(e),vge()))),lge=(e,t,n,r,s)=>new ige(e,t,n,r,s),xH=(e,t)=>D(QS(),nt(n=>lge(e,MA(),n,ny(!1),t)));var jL;jL=tge;class cge{constructor(t){w(this,"mutable");w(this,jL,nge);this.mutable=t}poll(t){return $l(this.mutable,t)}pollUpTo(t){return DA(this.mutable,t)}offerAll(t){return sH(this.mutable,t)}offer(t){return yg(this.mutable,t)}capacity(){return dpe(this.mutable)}length(){return jA(this.mutable)}}const SH=e=>new cge(e),uge=e=>e.size,fge=e=>e.isShutdown,dge=e=>e.shutdown,hge=T(2,(e,t)=>e.offer(t)),mge=T(2,(e,t)=>e.unsafeOffer(t)),NC=e=>e.take,pge=T(2,(e,t)=>e.takeUpTo(t)),gge=T(3,(e,t,n)=>e.takeBetween(t,n)),yge=()=>new bge,vge=()=>new xge;var DL;DL=yH;class bge{constructor(){w(this,DL,vH);w(this,"putters",MA())}surplusSize(){return jA(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!_C(this.putters)&&!_C(t);){const n=$l(t,void 0),r=$l(this.putters,void 0);r[2]&&au(r[1],!0),au(n,r[0])}}get shutdown(){return D(US,ne(t=>D(oe(()=>bd(this.putters)),ne(n=>Sa(n,([r,s,i])=>i?D(eB(s,t),vi):At,!1,!1)))))}handleSurplus(t,n,r,s){return vt(i=>{const a=XS(i.id());return D(Je(()=>(this.unsafeOffer(t,a),this.unsafeOnQueueEmptySpace(n,r),Zf(this,n,r),Fn(s)?Za:ec(a))),fy(()=>oe(()=>this.unsafeRemove(a))))})}unsafeOnQueueEmptySpace(t,n){let r=!0;for(;r&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const s=D(this.putters,$l(is));if(s===is)r=!1;else{const i=t.offer(s[0]);i&&s[2]?au(s[1],!0):i||l0(this.putters,D(bd(this.putters),Mr(s))),Zf(this,t,n)}}}unsafeOffer(t,n){const r=kt(t);for(let s=0;s<r.length;s++){const i=r[s];s===r.length-1?D(this.putters,yg([i,n,!0])):D(this.putters,yg([i,n,!1]))}}unsafeRemove(t){l0(this.putters,D(bd(this.putters),gT(([,n])=>n!==t)))}}var IL;IL=yH;class xge{constructor(){w(this,IL,vH)}surplusSize(){return 0}get shutdown(){return At}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,r,s){return ge(!1)}unsafeOnQueueEmptySpace(t,n){}}const au=(e,t)=>ew(e,ge(t)),l0=(e,t)=>D(e,sH(t)),bd=e=>D(e,DA(Number.POSITIVE_INFINITY)),Sge=(e,t)=>D(e,DA(t)),wge=(e,t)=>{l0(e,D(bd(e),gT(n=>t!==n)))},Zf=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){const s=D(n,$l(is));if(s!==is){const i=t.poll(is);i!==is?(au(s,i),e.unsafeOnQueueEmptySpace(t,n)):l0(n,D(bd(n),Mr(s))),r=!0}else r=!1}r&&t.length()===0&&!_C(n)&&e.onCompleteTakersWithEmptyQueue(n)},_ge=T(2,(e,t)=>e.publish(t)),kge=_ge,wH=age,Ege=oge,Cge=uge,Rge=fge,c0=dge,gf=hge,Nge=mge,fI=NC,Tge=gge,_H="Continue",Age="Close",Oge="Yield",Mge="effect/ChannelChildExecutorDecision",dI=Symbol.for(Mge),jge={[dI]:dI},kH=e=>{const t=Object.create(jge);return t._tag=_H,t},wb="ContinuationK",Dge="ContinuationFinalizer",EH=Symbol.for("effect/ChannelContinuation"),CH={_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 PL;PL=EH;class RH{constructor(t,n){w(this,"onSuccess");w(this,"onHalt");w(this,"_tag",wb);w(this,PL,CH);this.onSuccess=t,this.onHalt=n}onExit(t){return dA(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}var $L;$L=EH;class Ige{constructor(t){w(this,"finalizer");w(this,"_tag",Dge);w(this,$L,CH);this.finalizer=t}}const NH="PullAfterNext",Pge="PullAfterAllEnqueued",$ge="effect/ChannelUpstreamPullStrategy",zge=Symbol.for($ge),Lge={_A:e=>e},Fge={[zge]:Lge},TH=e=>{const t=Object.create(Fge);return t._tag=NH,t.emitSeparator=e,t},AH="BracketOut",OH="Bridge",BA="ConcatAll",MH="Emit",jH="Ensuring",DH="Fail",IH="Fold",PH="FromEffect",$H="PipeTo",Uge="Provide",zH="Read",LH="Succeed",FH="SucceedNow",UH="Suspend",Bge="effect/Channel",BH=Symbol.for(Bge),Hge={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},ms={[BH]:Hge,pipe(){return xe(this,arguments)}},HH=e=>De(e,BH)||hc(e),qge=T(2,(e,t)=>{const n=Object.create(ms);return n._tag=AH,n.acquire=()=>e,n.finalizer=t,n}),qH=(e,t,n)=>{const r=Object.create(ms);return r._tag=BA,r.combineInners=t,r.combineAll=n,r.onPull=()=>TH(re()),r.onEmit=()=>kH,r.value=()=>e,r.k=Oe,r},Vge=T(4,(e,t,n,r)=>{const s=Object.create(ms);return s._tag=BA,s.combineInners=n,s.combineAll=r,s.onPull=()=>TH(re()),s.onEmit=()=>kH,s.value=()=>e,s.k=t,s}),VH=T(2,(e,t)=>{const n=Object.create(ms);return n._tag=OH,n.input=t,n.channel=e,n}),Kge=T(2,(e,t)=>{const n=Object.create(ms);return n._tag=jH,n.channel=e,n.finalizer=t,n}),HA=e=>Ms(E8(e)),Ms=e=>Gge(()=>e),Gge=e=>{const t=Object.create(ms);return t._tag=DH,t.error=e,t},Mn=T(2,(e,t)=>{const n=Object.create(ms);return n._tag=IH,n.channel=e,n.k=new RH(t,Ms),n}),Fr=e=>{const t=Object.create(ms);return t._tag=PH,t.effect=()=>e,t},Li=T(2,(e,t)=>{const n=Object.create(ms);return n._tag=$H,n.left=()=>e,n.right=()=>t,n}),KH=e=>qh({onInput:e.onInput,onFailure:t=>as(Xde(t),{onLeft:e.onFailure,onRight:Ms}),onDone:e.onDone}),qh=e=>{const t=Object.create(ms);return t._tag=zH,t.more=e.onInput,t.done=new RH(e.onDone,e.onFailure),t},GH=e=>VA(()=>e),vg=e=>{const t=Object.create(ms);return t._tag=FH,t.terminal=e,t},qA=e=>{const t=Object.create(ms);return t._tag=UH,t.channel=e,t},VA=e=>{const t=Object.create(ms);return t._tag=LH,t.evaluate=e,t},Vo=vg(void 0),br=e=>{const t=Object.create(ms);return t._tag=MH,t.out=e,t},Sy="Done",wy="Emit",Vh="FromEffect",_y="Read",Yge=Symbol.for("effect/ChannelState"),Wge={_E:e=>e,_R:e=>e},hw={[Yge]:Wge},yf=()=>{const e=Object.create(hw);return e._tag=Sy,e},w_=()=>{const e=Object.create(hw);return e._tag=wy,e},_m=e=>{const t=Object.create(hw);return t._tag=Vh,t.effect=e,t},__=(e,t,n,r)=>{const s=Object.create(hw);return s._tag=_y,s.upstream=e,s.onEffect=t,s.onEmit=n,s.onDone=r,s},u0=e=>e._tag===Vh,Jge=e=>u0(e)?e.effect:ht,hI=e=>u0(e)?gpe(e.effect):void 0,YH="PullFromChild",TC="PullFromUpstream",AC="DrainChildExecutors",WH="Emit";class Rv{constructor(t,n,r){w(this,"childExecutor");w(this,"parentSubexecutor");w(this,"onEmit");w(this,"_tag",YH);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?uw(yr(n),yr(r),(s,i)=>D(s,hg(i))):n!==void 0?n:r!==void 0?r:void 0}enqueuePullFromChild(t){return this}}class Uc{constructor(t,n,r,s,i,a,o,l){w(this,"upstreamExecutor");w(this,"createChild");w(this,"lastDone");w(this,"activeChildExecutors");w(this,"combineChildResults");w(this,"combineWithChildResult");w(this,"onPull");w(this,"onEmit");w(this,"_tag",TC);this.upstreamExecutor=t,this.createChild=n,this.lastDone=r,this.activeChildExecutors=s,this.combineChildResults=i,this.combineWithChildResult=a,this.onPull=o,this.onEmit=l}close(t){const n=this.upstreamExecutor.close(t),s=[...this.activeChildExecutors.map(i=>i!==void 0?i.childExecutor.close(t):void 0),n].reduce((i,a)=>i!==void 0&&a!==void 0?uw(i,yr(a),(o,l)=>hg(o,l)):i!==void 0?i:a!==void 0?yr(a):void 0,void 0);return s}enqueuePullFromChild(t){return new Uc(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class ed{constructor(t,n,r,s,i,a,o){w(this,"upstreamExecutor");w(this,"lastDone");w(this,"activeChildExecutors");w(this,"upstreamDone");w(this,"combineChildResults");w(this,"combineWithChildResult");w(this,"onPull");w(this,"_tag",AC);this.upstreamExecutor=t,this.lastDone=n,this.activeChildExecutors=r,this.upstreamDone=s,this.combineChildResults=i,this.combineWithChildResult=a,this.onPull=o}close(t){const n=this.upstreamExecutor.close(t),s=[...this.activeChildExecutors.map(i=>i!==void 0?i.childExecutor.close(t):void 0),n].reduce((i,a)=>i!==void 0&&a!==void 0?uw(i,yr(a),(o,l)=>hg(o,l)):i!==void 0?i:a!==void 0?yr(a):void 0,void 0);return s}enqueuePullFromChild(t){return new ed(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class k_{constructor(t,n){w(this,"value");w(this,"next");w(this,"_tag",WH);this.value=t,this.next=n}close(t){const n=this.next.close(t);return n}enqueuePullFromChild(t){return this}}const Xge="Pulled",Qge="NoUpstream",Zge="effect/ChannelUpstreamPullRequest",eye=Symbol.for(Zge),tye={_A:e=>e},JH={[eye]:tye},mI=e=>{const t=Object.create(JH);return t._tag=Xge,t.value=e,t},nye=e=>{const t=Object.create(JH);return t._tag=Qge,t.activeDownstreamCount=e,t};class Kc{constructor(t,n,r){w(this,"_activeSubexecutor");w(this,"_cancelled");w(this,"_closeLastSubstream");w(this,"_currentChannel");w(this,"_done");w(this,"_doneStack",[]);w(this,"_emitted");w(this,"_executeCloseLastSubstream");w(this,"_input");w(this,"_inProgressFinalizer");w(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=yf();else switch(hc(this._currentChannel)&&(this._currentChannel=Fr(this._currentChannel)),this._currentChannel._tag){case AH:{t=this.runBracketOut(this._currentChannel);break}case OH:{const n=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,this._input!==void 0){const r=this._input;this._input=void 0;const s=()=>je(n.awaitRead(),()=>vn(()=>{const i=r.run();switch(i._tag){case Sy:return po(r.getDone(),{onFailure:a=>n.error(a),onSuccess:a=>n.done(a)});case wy:return je(n.emit(r.getEmit()),()=>s());case Vh:return Di(i.effect,{onFailure:a=>n.error(a),onSuccess:()=>s()});case _y:return KA(i,()=>s(),a=>n.error(a))}}));t=_m(je(kpe(ji(s())),i=>Pt(()=>this.addFinalizer(a=>je(Pl(i),()=>vn(()=>{const o=this.restorePipe(a,r);return o!==void 0?o:ht}))))))}break}case BA:{const n=new Kc(this._currentChannel.value(),this._providedEnv,s=>Pt(()=>{const i=this._closeLastSubstream===void 0?ht:this._closeLastSubstream;this._closeLastSubstream=D(i,mr(s))}));n._input=this._input;const r=this._currentChannel;this._activeSubexecutor=new Uc(n,s=>r.k(s),void 0,[],(s,i)=>r.combineInners(s,i),(s,i)=>r.combineAll(s,i),s=>r.onPull(s),s=>r.onEmit(s)),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case MH:{this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor!==void 0?void 0:Vo,t=w_();break}case jH:{this.runEnsuring(this._currentChannel);break}case DH:{t=this.doneHalt(this._currentChannel.error());break}case IH:{this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break}case PH:{const n=this._providedEnv===void 0?this._currentChannel.effect():D(this._currentChannel.effect(),a0(this._providedEnv));t=_m(Di(n,{onFailure:r=>{const s=this.doneHalt(r);return s!==void 0&&u0(s)?s.effect:ht},onSuccess:r=>{const s=this.doneSucceed(r);return s!==void 0&&u0(s)?s.effect:ht}}));break}case $H:{const n=this._input,r=new Kc(this._currentChannel.left(),this._providedEnv,s=>this._executeCloseLastSubstream(s));r._input=n,this._input=r,this.addFinalizer(s=>{const i=this.restorePipe(s,n);return i!==void 0?i:ht}),this._currentChannel=this._currentChannel.right();break}case Uge:{const n=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>Pt(()=>{this._providedEnv=n}));break}case zH:{const n=this._currentChannel;t=__(this._input,Oe,r=>{try{this._currentChannel=n.more(r)}catch(s){this._currentChannel=n.done.onExit(bue(s))}},r=>{const s=i=>n.done.onExit(i);this._currentChannel=s(r)});break}case LH:{t=this.doneSucceed(this._currentChannel.evaluate());break}case FH:{t=this.doneSucceed(this._currentChannel.terminal);break}case UH:{this._currentChannel=this._currentChannel.channel();break}}}catch(n){this._currentChannel=Ms(vC(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 s=n.length===0?ht:C_(n,t);return this.storeInProgressFinalizer(s),s}popNextFinalizers(){const t=[];for(;this._doneStack.length!==0;){const n=this._doneStack[this._doneStack.length-1];if(n._tag===wb)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):ht}close(t){let n;const r=this._inProgressFinalizer;r!==void 0&&(n=D(r,Qf(Pt(()=>this.clearInProgressFinalizer()))));let s;const i=this.popAllFinalizers(t);i!==void 0&&(s=D(i,Qf(Pt(()=>this.clearInProgressFinalizer()))));const a=this._activeSubexecutor===void 0?void 0:this._activeSubexecutor.close(t);if(!(a===void 0&&n===void 0&&s===void 0))return D(yr(E_(a)),o0(yr(E_(n))),o0(yr(E_(s))),Et(([[o,l],c])=>D(o,hg(l),hg(c))),Hm,je(o=>vn(()=>o)))}doneSucceed(t){if(this._doneStack.length===0)return this._done=Es(t),this._currentChannel=void 0,yf();const n=this._doneStack[this._doneStack.length-1];if(n._tag===wb){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=Es(t),this._currentChannel=void 0,yf();const s=C_(r.map(a=>a.finalizer),Es(t));this.storeInProgressFinalizer(s);const i=D(s,Qf(Pt(()=>this.clearInProgressFinalizer())),Hm,je(()=>Pt(()=>this.doneSucceed(t))));return _m(i)}doneHalt(t){if(this._doneStack.length===0)return this._done=Nr(t),this._currentChannel=void 0,yf();const n=this._doneStack[this._doneStack.length-1];if(n._tag===wb){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(a){this._currentChannel=Ms(vC(a))}return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=Nr(t),this._currentChannel=void 0,yf();const s=C_(r.map(a=>a.finalizer),Nr(t));this.storeInProgressFinalizer(s);const i=D(s,Qf(Pt(()=>this.clearInProgressFinalizer())),Hm,je(()=>Pt(()=>this.doneHalt(t))));return _m(i)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,yf()}runBracketOut(t){const n=Hm(Di(this.provide(t.acquire()),{onFailure:r=>Pt(()=>{this._currentChannel=Ms(r)}),onSuccess:r=>Pt(()=>{this.addFinalizer(s=>this.provide(t.finalizer(r,s))),this._currentChannel=br(r)})}));return _m(n)}provide(t){return this._providedEnv===void 0?t:D(t,a0(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new Ige(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case YH:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case TC:return this.pullFromUpstream(t);case AC:return this.drainChildExecutors(t);case WH:return this._emitted=t.value,this._activeSubexecutor=t.next,w_()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const n=po(t,{onFailure:r=>this.doneHalt(r),onSuccess:r=>this.doneSucceed(r)});return this._activeSubexecutor=void 0,n===void 0?ht:Jge(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer(()=>D(n,wa(s=>D(Pt(()=>s(t)),je(i=>i!==void 0?i:ht)),{discard:!0})));const r=D(t,po({onFailure:s=>this.doneHalt(s),onSuccess:s=>this.doneSucceed(s)}));return this._activeSubexecutor=void 0,r}applyUpstreamPullStrategy(t,n,r){switch(r._tag){case NH:{const s=!t||n.some(i=>i!==void 0);return[r.emitSeparator,s?[void 0,...n]:n]}case Pge:{const s=!t||n.some(i=>i!==void 0);return[r.emitSeparator,s?[...n,void 0]:n]}}}pullFromChild(t,n,r,s){return __(t,Oe,i=>{const a=r(i);switch(a._tag){case _H:break;case Age:{this.finishWithDoneValue(t,n,a.value);break}case Oge:{const o=n.enqueuePullFromChild(s);this.replaceSubexecutor(o);break}}this._activeSubexecutor=new k_(i,this._activeSubexecutor)},po({onFailure:i=>{const a=this.handleSubexecutorFailure(t,n,i);return a===void 0?void 0:hI(a)},onSuccess:i=>{this.finishWithDoneValue(t,n,i)}}))}finishWithDoneValue(t,n,r){const s=n;switch(s._tag){case TC:{const i=new Uc(s.upstreamExecutor,s.createChild,s.lastDone!==void 0?s.combineChildResults(s.lastDone,r):r,s.activeChildExecutors,s.combineChildResults,s.combineWithChildResult,s.onPull,s.onEmit);this._closeLastSubstream=t.close(Es(r)),this.replaceSubexecutor(i);break}case AC:{const i=new ed(s.upstreamExecutor,s.lastDone!==void 0?s.combineChildResults(s.lastDone,r):r,s.activeChildExecutors,s.upstreamDone,s.combineChildResults,s.combineWithChildResult,s.onPull);this._closeLastSubstream=t.close(Es(r)),this.replaceSubexecutor(i);break}}}handleSubexecutorFailure(t,n,r){return this.finishSubexecutorWithCloseEffect(Nr(r),s=>n.close(s),s=>t.close(s))}pullFromUpstream(t){if(t.activeChildExecutors.length===0)return this.performPullFromUpstream(t);const n=t.activeChildExecutors[0],r=new Uc(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 Rv(n.childExecutor,r,n.onEmit))}performPullFromUpstream(t){return __(t.upstreamExecutor,n=>{const r=this._closeLastSubstream===void 0?ht:this._closeLastSubstream;return this._closeLastSubstream=void 0,D(this._executeCloseLastSubstream(r),mr(n))},n=>{if(this._closeLastSubstream!==void 0){const a=this._closeLastSubstream;return this._closeLastSubstream=void 0,D(this._executeCloseLastSubstream(a),Et(()=>{const o=new Kc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);o._input=this._input;const[l,c]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(mI(n)));this._activeSubexecutor=new Rv(o,new Uc(t.upstreamExecutor,t.createChild,t.lastDone,c,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Bt(l)&&(this._activeSubexecutor=new k_(l.value,this._activeSubexecutor))}))}const r=new Kc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;const[s,i]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(mI(n)));this._activeSubexecutor=new Rv(r,new Uc(t.upstreamExecutor,t.createChild,t.lastDone,i,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Bt(s)&&(this._activeSubexecutor=new k_(s.value,this._activeSubexecutor))},n=>{if(t.activeChildExecutors.some(i=>i!==void 0)){const i=new ed(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==void 0){const a=this._closeLastSubstream;return this._closeLastSubstream=void 0,D(this._executeCloseLastSubstream(a),Et(()=>this.replaceSubexecutor(i)))}this.replaceSubexecutor(i);return}const r=this._closeLastSubstream,s=this.finishSubexecutorWithCloseEffect(D(n,Sue(i=>t.combineWithChildResult(t.lastDone,i))),()=>r,i=>t.upstreamExecutor.close(i));return s===void 0?void 0:hI(s)})}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const i=this._closeLastSubstream;return i!==void 0&&this.addFinalizer(()=>Jt(i)),this.finishSubexecutorWithCloseEffect(t.upstreamDone,()=>i,a=>t.upstreamExecutor.close(a))}const n=t.activeChildExecutors[0],r=t.activeChildExecutors.slice(1);if(n===void 0){const[i,a]=this.applyUpstreamPullStrategy(!0,r,t.onPull(nye(r.reduce((o,l)=>l!==void 0?o+1:o,0))));return this.replaceSubexecutor(new ed(t.upstreamExecutor,t.lastDone,a,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),Bt(i)?(this._emitted=i.value,w_()):void 0}const s=new ed(t.upstreamExecutor,t.lastDone,r,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new Rv(n.childExecutor,s,n.onEmit))}}const E_=e=>e!==void 0?e:ht,C_=(e,t)=>D(wa(e,n=>yr(n(t))),Et(n=>D(vue(n),Kt(()=>hA))),je(n=>vn(()=>n))),KA=(e,t,n)=>{const r=[e],s=()=>{const i=r.pop();if(i===void 0||i.upstream===void 0)return mpe("Unexpected end of input for channel execution");const a=i.upstream.run();switch(a._tag){case wy:{const o=i.onEmit(i.upstream.getEmit());return r.length===0?o===void 0?vn(t):D(o,Di({onFailure:n,onSuccess:t})):o===void 0?vn(()=>s()):D(o,Di({onFailure:n,onSuccess:()=>s()}))}case Sy:{const o=i.onDone(i.upstream.getDone());return r.length===0?o===void 0?vn(t):D(o,Di({onFailure:n,onSuccess:t})):o===void 0?vn(()=>s()):D(o,Di({onFailure:n,onSuccess:()=>s()}))}case Vh:return r.push(i),D(i.onEffect(a.effect),IA(o=>vn(()=>{const l=i.onDone(Nr(o));return l===void 0?ht:l})),Di({onFailure:n,onSuccess:()=>s()}));case _y:return r.push(i),r.push(a),vn(()=>s())}};return s()},rye=T(2,(e,t)=>{const n=(r,s,i)=>Spe(Pt(()=>new Kc(e,void 0,Oe)),a=>vn(()=>_b(a.run(),a).pipe(lH(r),mr(Ur(r)),LA(Ur(s)))),(a,o)=>{const l=a.close(o);return l===void 0?ht:fH(l,c=>e0(i,zi(c)))});return s0(r=>hpe([M8(t,$x),ma(),ma()]).pipe(je(([s,i,a])=>r(n(i,a,s)).pipe(iu(t),je(o=>t.addFinalizer(l=>{const c=dA(l)?Wde(l.cause):void 0;return wC(i).pipe(je(f=>f?go(a,void 0).pipe(mr(P8(o)),mr(XD(o))):go(a,void 0).pipe(mr(c&&NT(c)>0?RA(o,Bse(c)):Pl(o)),mr(XD(o)))))}).pipe(mr(r(Ur(i)))))))))}),_b=(e,t)=>{const n=e;switch(n._tag){case Vh:return D(n.effect,je(()=>_b(t.run(),t)));case wy:return _b(t.run(),t);case Sy:return vn(()=>t.getDone());case _y:return KA(n,()=>_b(t.run(),t),zi)}},sye="Done",iye="Await",aye="effect/ChannelMergeDecision",oye=Symbol.for(aye),lye={[oye]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}},pI=e=>{const t=Object.create(lye);return t._tag=iye,t.f=e,t},XH="BothRunning",QH="LeftDone",ZH="RightDone",cye="effect/ChannelMergeState",gI=Symbol.for(cye),GA={[gI]:gI},R_=(e,t)=>{const n=Object.create(GA);return n._tag=XH,n.left=e,n.right=t,n},yI=e=>{const t=Object.create(GA);return t._tag=QH,t.f=e,t},vI=e=>{const t=Object.create(GA);return t._tag=ZH,t.f=e,t},e9="BackPressure",t9="BufferSliding",uye="effect/ChannelMergeStrategy",bI=Symbol.for(uye),n9={[bI]:bI},fye=e=>{const t=Object.create(n9);return t._tag=e9,t},dye=e=>{const t=Object.create(n9);return t._tag=t9,t},hye=T(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case e9:return t();case t9:return n()}}),Tf="Empty",qm="Emit",Vm="Error",Km="Done",r9=e=>({_tag:Tf,notifyProducer:e}),N_=e=>({_tag:qm,notifyConsumers:e}),mye=e=>({_tag:Vm,cause:e}),pye=e=>({_tag:Km,done:e});class gye{constructor(t){w(this,"ref");this.ref=t}awaitRead(){return Nf(bm(this.ref,t=>t._tag===Tf?[Ur(t.notifyProducer),t]:[ht,t]))}get close(){return _pe(t=>this.error(C8(t)))}done(t){return Nf(bm(this.ref,n=>{switch(n._tag){case Tf:return[Ur(n.notifyProducer),n];case qm:return[wa(n.notifyConsumers,r=>go(r,Le(t)),{discard:!0}),pye(t)];case Vm:return[Lc,n];case Km:return[Lc,n]}}))}emit(t){return je(ma(),n=>Nf(bm(this.ref,r=>{switch(r._tag){case Tf:return[Ur(r.notifyProducer),r];case qm:{const s=r.notifyConsumers[0],i=r.notifyConsumers.slice(1);if(s!==void 0)return[go(s,ze(t)),i.length===0?r9(n):N_(i)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Vm:return[Lc,r];case Km:return[Lc,r]}})))}error(t){return Nf(bm(this.ref,n=>{switch(n._tag){case Tf:return[Ur(n.notifyProducer),n];case qm:return[wa(n.notifyConsumers,r=>npe(r,t),{discard:!0}),mye(t)];case Vm:return[Lc,n];case Km:return[Lc,n]}}))}get take(){return this.takeWith(t=>Nr(Zde(t,Le)),t=>Es(t),t=>Vx(ze(t)))}takeWith(t,n,r){return je(ma(),s=>Nf(bm(this.ref,i=>{switch(i._tag){case Tf:return[mr(go(i.notifyProducer,void 0),CC(Ur(s),{onFailure:t,onSuccess:as({onLeft:r,onRight:n})})),N_([s])];case qm:return[CC(Ur(s),{onFailure:t,onSuccess:as({onLeft:r,onRight:n})}),N_([...i.notifyConsumers,s])];case Vm:return[Jt(t(i.cause)),i];case Km:return[Jt(r(i.done)),i]}})))}}const s9=()=>D(ma(),je(e=>cA(r9(e))),Et(e=>new gye(e))),OC=T(2,(e,t)=>Vge(e,t,()=>{},()=>{})),yye=e=>{const t=qh({onInput:()=>t,onFailure:Ms,onDone:GH});return Li(e,t)},i9=T(2,(e,t)=>Kge(e,()=>t)),vye=e=>Mn(e,Oe),YA=e=>zl(e.takeWith(Ms,t=>Mn(br(t),()=>YA(e)),GH)),a9=T(2,(e,t)=>Mn(e,n=>VA(()=>t(n)))),o9=T(2,(e,t)=>{const n=KH({onInput:r=>Mn(br(t(r)),()=>n),onFailure:HA,onDone:vg});return Li(e,n)}),bye=e=>t=>xye(e)(t,zd),xye=({bufferSize:e=16,concurrency:t,mergeStrategy:n=fye()})=>(r,s)=>f9(i=>vd(function*(){const a=t==="unbounded"?Number.MAX_SAFE_INTEGER:t,o=yield*s9(),l=YA(o),c=yield*wH(e);yield*e0(i,c0(c));const f=yield*Ege();yield*e0(i,c0(f));const u=yield*cA(re()),h=yield*ma(),m=(yield*Ape(a)).withPermits,p=yield*xd(Li(l,r),i);function v(y){return y.pipe(je(as({onLeft:b=>Jt(ie(b)),onRight:b=>b_(gf(c,Jt(ze(b))),re())})),lI({until:b=>Bt(b)}),je(b=>Hce(u,Ft({onNone:()=>ie(b.value),onSome:x=>ie(s(x,b.value))}))),IA(b=>Xx(b)?zi(b):gf(c,zi(b)).pipe(mr(go(h,void 0)),PA)))}yield*p.pipe(Di({onFailure:y=>gf(c,zi(y)).pipe(mr(Jt(!1))),onSuccess:as({onLeft:y=>cH(ji(Ur(h)),ji(m(a)(ht)),{onSelfDone:(b,x)=>b_(Pl(x),!1),onOtherDone:(b,x)=>mr(Pl(x),Fce(u).pipe(je(Ft({onNone:()=>gf(c,Jt(Le(y))),onSome:_=>gf(c,Jt(Le(s(_,y))))})),b_(!1)))}),onRight:y=>hye(n,{onBackPressure:()=>vd(function*(){const b=yield*ma(),x=EC(C=>xd(Li(l,y),C).pipe(je(E=>x_(yr(v(E)),yr(ji(Ur(h))))),je(Oe)));return yield*go(b,void 0).pipe(mr(x),m(1),iu(i)),yield*Ur(b),!(yield*wC(h))}),onBufferSliding:()=>vd(function*(){const b=yield*ma(),x=yield*ma(),_=yield*Cge(f);yield*fI(f).pipe(je(k=>go(k,void 0)),Cpe(()=>_>=a)),yield*gf(f,b);const C=EC(k=>xd(Li(l,y),k).pipe(je(A=>yr(v(A)).pipe(x_(yr(ji(Ur(h)))),x_(yr(ji(Ur(b)))))),je(Oe)));return yield*go(x,void 0).pipe(mr(C),m(1),iu(i)),yield*Ur(x),!(yield*wC(h))})})})}),lI({while:y=>y}),iu(i));const S=D(fI(c),Nf,CC({onFailure:Ms,onSuccess:as({onLeft:vg,onRight:y=>Mn(br(y),()=>S)})}),zl);return VH(S,o)})),l9=T(3,(e,t,n)=>bye(n)(o9(e,t))),Sye=T(2,(e,t)=>{function n(r){return vd(function*(){const s=yield*s9(),i=YA(s),a=yield*xd(Li(i,e),r),o=yield*xd(Li(i,t.other),r);function l(f,u,h){return(m,p,v)=>{function S(y){const b=y;return b._tag===sye?Jt(Fr(mr(Pl(u),b.effect))):Et(P8(u),po({onFailure:x=>Fr(b.f(Nr(x))),onSuccess:as({onLeft:x=>Fr(b.f(Es(x))),onRight:x=>WA(br(x),c(v(b.f)))})}))}return po(f,{onFailure:y=>S(m(Nr(y))),onSuccess:as({onLeft:y=>S(m(Es(y))),onRight:y=>Jt(Mn(br(y),()=>Mn(Fr(iu(ji(h),r)),b=>c(p(b,u)))))})})}}function c(f){switch(f._tag){case XH:{const u=ji(QD(f.left)),h=ji(QD(f.right));return zl(cH(u,h,{onSelfDone:(m,p)=>mr(Pl(p),l(m,f.right,a)(t.onSelfDone,R_,v=>yI(v))),onOtherDone:(m,p)=>mr(Pl(p),l(m,f.left,o)(t.onOtherDone,(v,S)=>R_(S,v),v=>vI(v)))}))}case QH:return zl(Et(yr(o),po({onFailure:u=>Fr(f.f(Nr(u))),onSuccess:as({onLeft:u=>Fr(f.f(Es(u))),onRight:u=>Mn(br(u),()=>c(yI(f.f)))})})));case ZH:return zl(Et(yr(a),po({onFailure:u=>Fr(f.f(Nr(u))),onSuccess:as({onLeft:u=>Fr(f.f(Es(u))),onRight:u=>Mn(br(u),()=>c(vI(f.f)))})})))}}return Fr(r0(f=>{const u=r0(p=>(p.transferChildren(f.scope()),ht)),h=ji(a).pipe(Qf(u),iu(r)),m=ji(o).pipe(Qf(u),iu(r));return uw(h,m,(p,v)=>R_(p,v))})).pipe(Mn(c),VH(s))})}return f9(n)}),wye=T(2,(e,t)=>qA(()=>{let n;const r=KH({onInput:i=>Mn(br(i),()=>r),onFailure:i=>(n=Nye(i),Ms(vC(n))),onDone:vg}),s=qh({onInput:i=>D(br(i),Mn(()=>s)),onFailure:i=>Gde(i)&&Tye(i.defect)&&Re(i.defect,n)?HA(i.defect.error):Ms(i),onDone:vg});return Li(Li(Li(e,r),t),s)})),_ye=e=>EC(t=>rye(e,t)),c9=e=>_ye(yye(e)),u9=e=>zl(s0(t=>Et(j8(),n=>qge(fH(t(Mhe(e,n)),r=>t0(n,Nr(r))),(r,s)=>t0(n,s))))),kye=e=>Cye(Et(cw,t=>Mn(Fr(e(t)),br))),Eye=e=>je(cw,t=>xd(e,t)),xd=T(2,(e,t)=>o0(Pt(()=>new Kc(e,void 0,Oe)),xy()).pipe(uH(([n,r])=>Ohe(t,s=>{const i=n.close(s);return i!==void 0?a0(i,r):ht})),Hm,Et(([n])=>vn(()=>MC(n.run(),n))))),MC=(e,t)=>{const n=e;switch(n._tag){case Sy:return po(t.getDone(),{onFailure:zi,onSuccess:r=>Jt(Le(r))});case wy:return Jt(ze(t.getEmit()));case Vh:return D(n.effect,je(()=>MC(t.run(),t)));case _y:return KA(n,()=>MC(t.run(),t),r=>zi(r))}},zl=e=>vye(Fr(e)),Cye=e=>qH(u9(e),(t,n)=>t,(t,n)=>t),f9=e=>qH(kye(e),(t,n)=>t,(t,n)=>t),d9=e=>h9(0,e.length,e),h9=(e,t,n)=>e===t?Vo:D(br(D(n,jl(e))),Mn(()=>h9(e+1,t,n))),Rye=T(e=>HH(e[1]),(e,t,n)=>n!=null&&n.concurrent?Sye(e,{other:t,onSelfDone:r=>pI(s=>vn(()=>ID(r,s))),onOtherDone:r=>pI(s=>vn(()=>ID(s,r)))}):Mn(e,r=>a9(t,s=>[r,s]))),WA=T(e=>HH(e[1]),(e,t,n)=>n!=null&&n.concurrent?a9(Rye(e,t,{concurrent:!0}),r=>r[1]):Mn(e,()=>t)),jC=Symbol.for("effect/Channel/ChannelException"),Nye=e=>({_tag:"ChannelException",[jC]:jC,error:e}),Tye=e=>De(e,jC),Aye=Symbol.for("effect/Sink"),Oye={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e};var zL;zL=Aye;class JA{constructor(t){w(this,"channel");w(this,zL,Oye);this.channel=t}pipe(){return xe(this,arguments)}}const Mye=e=>{const t=qh({onInput:n=>D(Fr(wa(n,r=>e(r),{discard:!0})),Mn(()=>t)),onFailure:Ms,onDone:()=>Vo});return new JA(t)},jye=e=>{const t=qh({onInput:n=>D(Fr(e(n)),Mn(()=>t)),onFailure:Ms,onDone:()=>Vo});return new JA(t)},Dye=e=>new JA(Fr(e)),m9=e=>hc(e)?m9(Dye(e)):e.channel,Iye=()=>Pa(re()),Pye=e=>$A(zi(e),ie),$ye="effect/Stream",XA=Symbol.for($ye),zye={_R:e=>e,_E:e=>e,_A:e=>e};var LL;LL=XA;class qi{constructor(t){w(this,"channel");w(this,LL,zye);this.channel=t}pipe(){return xe(this,arguments)}}const mw=e=>De(e,XA)||hc(e),Lye=4096,p9=T(2,(e,t)=>new qi(D(ai(e),i9(t)))),Fye=e=>v9(Pa(ie(e))),Uye=e=>y9(zi(e)),Bye=T(2,(e,t)=>Yye(e,gT(t))),g9=T(e=>mw(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.bufferSize)??16;return n!=null&&n.switch?xI(n==null?void 0:n.concurrency,()=>SI(e,1,r,t),s=>SI(e,s,r,t)):xI(n==null?void 0:n.concurrency,()=>new qi(OC(ai(e),s=>D(s,pre(i=>ai(t(i))),yre(Vo,(i,a)=>D(i,WA(a)))))),s=>new qi(D(ai(e),OC(d9),l9(i=>ai(t(i)),n))))}),xI=(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()}},SI=T(4,(e,t,n,r)=>new qi(D(ai(e),OC(d9),l9(s=>ai(r(s)),{concurrency:t,mergeStrategy:dye(),bufferSize:n})))),Hye=T(e=>mw(e[0]),(e,t)=>g9(e,Oe,t)),qye=e=>new qi(e),ai=e=>{if("channel"in e)return e.channel;if(hc(e))return ai(y9(e));throw new TypeError("Expected a Stream.")},Vye=e=>new qi(ES(e)?Vo:br(e)),y9=e=>D(e,$A(ie),v9),v9=e=>new qi(zl(Npe(e,{onFailure:Ft({onNone:()=>Vo,onSome:HA}),onSuccess:t=>br(Dn(t))}))),Kye=(e,t)=>D(Tge(e,1,(t==null?void 0:t.maxChunkSize)??Lye),IA(n=>D(Rge(e),je(r=>r&&Xx(n)?Iye():Pye(n)))),b9,t!=null&&t.shutdown?p9(c0(e)):Oe),Gye=(...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 w9(Et(i0(Pt(()=>t().getReader()),s=>r?Pt(()=>s.releaseLock()):ppe(()=>s.cancel())),s=>Wye(je(Sp({try:()=>s.read(),catch:i=>ie(n(i))}),({done:i,value:a})=>i?Pa(re()):Jt(a)))))},Yye=T(2,(e,t)=>new qi(D(ai(e),o9(t)))),b9=e=>nve(e,t=>D(Et(t,n=>ie([n,t])),iH(Ft({onNone:()=>Jt(re()),onSome:Pa})))),Wye=e=>b9(D(e,Et(Dn))),x9=T(2,(e,t)=>ai(e).pipe(wye(m9(t)),c9)),Jye=T(2,(e,t)=>x9(e,Mye(t))),Xye=T(2,(e,t)=>x9(e,jye(t))),Qye=e=>new qi(i9(u9(D(e,Et(Dn))),ht)),Zye=e=>Vye(Dn(e)),S9=e=>new qi(qA(()=>ai(e()))),eve=T(e=>mw(e[0]),(e,t)=>Et(xy(),n=>tve(e,n,t))),tve=T(e=>mw(e[0]),(e,t,n)=>{const r=fw(t);let s,i;const a=Ope(!1);return new ReadableStream({start(o){i=r(Xye(e,l=>l.length===0?ht:a.whenOpen(Pt(()=>{a.unsafeClose();for(const c of l)o.enqueue(c);s(),s=void 0})))),i.addObserver(l=>{try{l._tag==="Failure"?o.error(kA(l.cause)):o.close()}catch{}})},pull(){return new Promise(o=>{s=o,ui(a.open)})},cancel(){if(i)return Mpe(PA(Pl(i)))}},n==null?void 0:n.strategy)}),nve=(e,t)=>S9(()=>{const n=r=>zl(Et(t(r),Ft({onNone:()=>Vo,onSome:([s,i])=>Mn(br(s),()=>n(i))})));return new qi(n(e))}),w9=e=>Hye(Qye(e)),wI=Symbol.for("effect/Mailbox"),_I=Symbol.for("effect/Mailbox/ReadonlyMailbox"),Bc=Vn(),kI=Tt(Bc),Nv=Tt(!1),Tv=Tt(!0),EI=[Bc,!0];var FL,UL;class rve extends Uh{constructor(n,r,s){super();w(this,"scheduler");w(this,"capacity");w(this,"strategy");w(this,UL,wI);w(this,FL,_I);w(this,"state",{_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set});w(this,"messages",[]);w(this,"messagesChunk",Vn());w(this,"shutdown",oe(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=Bc;const n=this.state.offers;if(this.finalize(this.state._tag==="Open"?Rr:this.state.exit),n.size>0){for(const r of n)r._tag==="Single"?r.resume(Nv):r.resume(Tt(Lr(r.remaining.slice(r.offset))));n.clear()}return!0}));w(this,"end",this.done(Rr));w(this,"clear",Je(()=>{if(this.state._tag==="Done")return gb(this.state.exit,Bc);const n=this.unsafeTakeAll();return this.releaseCapacity(),ge(n)}));w(this,"takeAll",Je(()=>{if(this.state._tag==="Done")return gb(this.state.exit,EI);const n=this.unsafeTakeAll();return n.length===0?dn(this.awaitTake,this.takeAll):ge([n,this.releaseCapacity()])}));w(this,"take",Je(()=>this.unsafeTake()??dn(this.awaitTake,this.take)));w(this,"await",Sl(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.awaiters.add(n),oe(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(n)}))));w(this,"size",oe(()=>this.unsafeSize()));w(this,"awaitTake",Sl(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.takers.add(n),oe(()=>{this.state._tag!=="Done"&&this.state.takers.delete(n)}))));w(this,"scheduleRunning",!1);w(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(Rr),this.messages.length+this.messagesChunk.length===0)break}});this.scheduler=n,this.capacity=r,this.strategy=s}offer(n){return Je(()=>{if(this.state._tag!=="Open")return Nv;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return Nv;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(n),this.releaseTaker(),Tv):this.offerRemainingSingle(n);case"sliding":return this.unsafeTake(),this.messages.push(n),Tv}return this.messages.push(n),this.scheduleReleaseTaker(),Tv})}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 Je(()=>{if(this.state._tag!=="Open")return ge(Do(n));const r=this.unsafeOfferAllArray(n);return r.length===0?kI:this.strategy==="dropping"?ge(Lr(r)):this.offerRemainingArray(r)})}unsafeOfferAll(n){return Lr(this.unsafeOfferAllArray(n))}unsafeOfferAllArray(n){if(this.state._tag!=="Open")return kt(n);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=On(this.messagesChunk,Lr(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(On(Do(n)),gre(this.capacity)):kS(n)?this.messagesChunk=On(this.messagesChunk,n):this.messages=kt(n),this.scheduleReleaseTaker(),[];const r=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(r===0)return kt(n);const s=[];let i=0;for(const a of n)i<r?this.messages.push(a):s.push(a),i++;return this.scheduleReleaseTaker(),s}fail(n){return this.done(cg(n))}failCause(n){return this.done(Rt(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 oe(()=>this.unsafeDone(n))}takeN(n){return Je(()=>{if(this.state._tag==="Done")return gb(this.state.exit,EI);if(n<=0)return ge([Bc,!1]);n=Math.min(n,this.capacity);let r;if(n<=this.messagesChunk.length)r=Cx(this.messagesChunk,n),this.messagesChunk=xl(this.messagesChunk,n);else if(n<=this.messages.length+this.messagesChunk.length)this.messagesChunk=On(this.messagesChunk,Lr(this.messages)),this.messages=[],r=Cx(this.messagesChunk,n),this.messagesChunk=xl(this.messagesChunk,n);else return dn(this.awaitTake,this.takeN(n));return ge([r,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return X6(this.state.exit,cg(new Bh));let n;if(this.messagesChunk.length>0)n=vT(this.messagesChunk),this.messagesChunk=xl(this.messagesChunk,1);else if(this.messages.length>0)n=this.messages[0],this.messagesChunk=xl(Lr(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?Tt(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),Tt(n)}unsafeSize(){const n=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?re():ie(n)}commit(){return this.takeAll}pipe(){return xe(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return zt(this)}[(UL=wI,FL=_I,pt)](){return zt(this)}offerRemainingSingle(n){return Sl(r=>{if(this.state._tag!=="Open")return r(Nv);const s={_tag:"Single",message:n,resume:r};return this.state.offers.add(s),oe(()=>{this.state._tag==="Open"&&this.state.offers.delete(s)})})}offerRemainingArray(n){return Sl(r=>{if(this.state._tag!=="Open")return r(Tt(Lr(n)));const s={_tag:"Array",remaining:n,offset:0,resume:r};return this.state.offers.add(s),oe(()=>{this.state._tag==="Open"&&this.state.offers.delete(s)})})}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(Tv),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(kI),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?On(this.messagesChunk,Lr(this.messages)):this.messagesChunk;return this.messagesChunk=Bc,this.messages=[],n}else if(this.messages.length>0){const n=Lr(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,Dn(this.messages.pop());return Bc}finalize(n){if(this.state._tag==="Done")return;const r=this.state;this.state={_tag:"Done",exit:n};for(const s of r.takers)s(n);r.takers.clear();for(const s of r.awaiters)s(n);r.awaiters.clear()}}const sve=e=>vt(t=>ge(new rve(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"))),ive=e=>{const t=Mn(e.takeAll,([n,r])=>r?n.length===0?Vo:br(n):WA(br(n),t));return t},ave=e=>qye(ive(e)),ove=sve,lve=ave,T_=XA,_9=p9,cve=Fye,uve=Uye,fve=Bye,dve=g9,k9=ai,hve=Kye,mve=Gye,pve=Jye,gve=Zye,yve=S9,vve=eve,E9=w9;class ky extends uT("@effect/experimental/Reactivity")(){}const bve=Pt(()=>{const e=new Map,t=o=>{if(Array.isArray(o))for(let l=0;l<o.length;l++){const c=e.get(DC(o[l]));if(c!==void 0)for(const f of c)f()}else{const l=o;for(const c in l){const f=R9(c,l[c]);for(let h=0;h<f.length;h++){const m=e.get(f[h]);if(m!==void 0)for(const p of m)p()}const u=e.get(c);if(u!==void 0)for(const h of u)h()}}},n=o=>Pt(()=>t(o)),r=(o,l)=>LA(l,n(o)),s=(o,l)=>{const c=Array.isArray(o)?o.map(DC):Sve(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])}}},i=(o,l)=>vd(function*(){const c=yield*cw,f=yield*ove(),u=yield*Bpe();let h=!1,m=!1;const p=y=>{y._tag==="Failure"?f.unsafeDone(Nr(y.cause)):f.unsafeOffer(y.value),m?(m=!1,u(l).addObserver(p)):h=!1};function v(){if(h){m=!0;return}h=!0,u(l).addObserver(p)}const S=s(o,v);return yield*e0(c,Pt(S)),v(),f}),a=(o,l)=>i(o,l).pipe(Et(lve),E9);return ky.of({mutation:r,query:i,stream:a,unsafeInvalidate:t,invalidate:n,unsafeRegister:s})}),C9=T(2,(e,t)=>je(ky,n=>n.mutation(t,e))),xve=e=>je(ky,t=>t.invalidate(e)),A_=mH(ky,bve);function DC(e){return typeof e=="string"?e:be(e)}const R9=(e,t)=>{const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=`${e}:${DC(t[r])}`;return n},Sve=e=>{const t=[];for(const n in e){t.push(n);for(const r of R9(n,e[n]))t.push(r)}return t},N9="effect/Redacted",kb=Fe("effect/Redacted/redactedRegistry",()=>new WeakMap),T9=Symbol.for(N9),wve={[T9]:{_A:e=>e},pipe(){return xe(this,arguments)},toString(){return"<redacted>"},toJSON(){return"<redacted>"},[pt](){return"<redacted>"},[Ve](){return D(be(N9),Ge(be(kb.get(this))),Ot(this))},[Ke](e){return _ve(e)&&Re(kb.get(this),kb.get(e))}},_ve=e=>De(e,T9),kve=e=>{const t=Object.create(wve);return kb.set(t,e),t},A9=(e,t)=>{switch(t._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return A9(e,t.from)}},O9=e=>{let t=!1,n;return()=>(t||(n=e(),t=!0),n)},QA=e=>Array.isArray(e),Eve=e=>!Array.isArray(e),CI=e=>`[${yS(e)}]`,M9=e=>QA(e)?e.map(CI).join(""):CI(e),mc=(e,t,n,r)=>{let s=e;return n&&gn(n)&&(s+=`
84
+ at path: ${M9(n)}`),t!==void 0&&(s+=`
85
+ details: ${t}`),r&&(s+=`
86
+ schema (${r._tag}): ${r}`),s},j9=(e,t,n)=>mc("Unsupported schema or overlapping types",`cannot extend ${e} with ${t}`,n),Cve=e=>mc("Unsupported key schema",void 0,void 0,e),Rve=e=>mc("Unsupported literal",`literal value: ${Bo(e)}`),RI=e=>mc("Duplicate index signature",`${e} index signature`),Nve=mc("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),Tve=mc("Invalid element","A required element cannot follow an optional element. ts(1257)"),NI=e=>mc("Duplicate property signature transformation",`Duplicate key ${Bo(e)}`),D9=e=>mc("Duplicate property signature",`Duplicate key ${Bo(e)}`),Ave=Symbol.for("effect/SchemaId/DateFromSelf"),Ove=Symbol.for("effect/SchemaId/GreaterThanOrEqualTo"),Mve=Symbol.for("effect/SchemaId/Between"),jve=Symbol.for("effect/annotation/TypeConstructor"),I9=Symbol.for("effect/annotation/Brand"),Dve=Symbol.for("effect/annotation/SchemaId"),P9=Symbol.for("effect/annotation/Message"),ZA=Symbol.for("effect/annotation/MissingMessage"),Ey=Symbol.for("effect/annotation/Identifier"),Ji=Symbol.for("effect/annotation/Title"),Sd=Symbol.for("effect/annotation/AutoTitle"),Ku=Symbol.for("effect/annotation/Description"),$9=Symbol.for("effect/annotation/Examples"),z9=Symbol.for("effect/annotation/Default"),L9=Symbol.for("effect/annotation/JSONSchema"),F9=Symbol.for("effect/annotation/Arbitrary"),U9=Symbol.for("effect/annotation/Pretty"),B9=Symbol.for("effect/annotation/Equivalence"),Ive=Symbol.for("effect/annotation/Documentation"),H9=Symbol.for("effect/annotation/Concurrency"),q9=Symbol.for("effect/annotation/Batching"),V9=Symbol.for("effect/annotation/ParseIssueTitle"),K9=Symbol.for("effect/annotation/ParseOptions"),G9=Symbol.for("effect/annotation/DecodingFallback"),f0=Symbol.for("effect/annotation/Surrogate"),Pve=Symbol.for("effect/annotation/StableFilter"),Wr=T(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?ie(e.annotations[t]):re()),Y9=Wr(I9),$ve=Wr(P9),zve=Wr(ZA),W9=Wr(Ji),J9=Wr(Sd),pw=Wr(Ey),X9=Wr(Ku),Lve=Wr(H9),Fve=Wr(q9),Uve=Wr(V9),Bve=Wr(K9),Hve=Wr(G9),Q9=Wr(f0),qve=Wr(Pve),Vve=e=>$ne(qve(e),t=>t===!0),Z9=Symbol.for("effect/annotation/JSONIdentifier"),Kve=Wr(Z9),Gve=e=>$i(Kve(e),()=>pw(e)),Yve=Symbol.for("effect/schema/ParseJson");class gw{constructor(t,n,r,s={}){w(this,"typeParameters");w(this,"decodeUnknown");w(this,"encodeUnknown");w(this,"annotations");w(this,"_tag","Declaration");this.typeParameters=t,this.decodeUnknown=n,this.encodeUnknown=r,this.annotations=s}toString(){return Kt(Ca(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(t=>t.toJSON()),annotations:Sn(this.annotations)}}}const Xi=e=>t=>t._tag===e;let d0=class{constructor(t,n={}){w(this,"literal");w(this,"annotations");w(this,"_tag","Literal");this.literal=t,this.annotations=n}toString(){return Kt(Ca(this),()=>Bo(this.literal))}toJSON(){return{_tag:this._tag,literal:mS(this.literal)?String(this.literal):this.literal,annotations:Sn(this.annotations)}}};const wp=Xi("Literal"),Wve=new d0(null);class Jve{constructor(t,n={}){w(this,"symbol");w(this,"annotations");w(this,"_tag","UniqueSymbol");this.symbol=t,this.annotations=n}toString(){return Kt(Ca(this),()=>Bo(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:Sn(this.annotations)}}}class Xve{constructor(t={}){w(this,"annotations");w(this,"_tag","UndefinedKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const IC=new Xve({[Ji]:"undefined"});class Qve{constructor(t={}){w(this,"annotations");w(this,"_tag","VoidKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const Zve=new Qve({[Ji]:"void"}),ebe=Xi("VoidKeyword");class tbe{constructor(t={}){w(this,"annotations");w(this,"_tag","NeverKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const e2=new tbe({[Ji]:"never"}),nbe=Xi("NeverKeyword");class rbe{constructor(t={}){w(this,"annotations");w(this,"_tag","UnknownKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const e7=new rbe({[Ji]:"unknown"});class sbe{constructor(t={}){w(this,"annotations");w(this,"_tag","AnyKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const ibe=new sbe({[Ji]:"any"});class abe{constructor(t={}){w(this,"annotations");w(this,"_tag","StringKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const PC=new abe({[Ji]:"string",[Ku]:"a string"}),$C=Xi("StringKeyword");class obe{constructor(t={}){w(this,"annotations");w(this,"_tag","NumberKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const zC=new obe({[Ji]:"number",[Ku]:"a number"}),TI=Xi("NumberKeyword");class lbe{constructor(t={}){w(this,"annotations");w(this,"_tag","BooleanKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const LC=new lbe({[Ji]:"boolean",[Ku]:"a boolean"}),AI=Xi("BooleanKeyword");class cbe{constructor(t={}){w(this,"annotations");w(this,"_tag","SymbolKeyword");this.annotations=t}toString(){return Ko(this)}toJSON(){return{_tag:this._tag,annotations:Sn(this.annotations)}}}const ube=new cbe({[Ji]:"symbol",[Ku]:"a symbol"}),fbe=Xi("SymbolKeyword");let yw=class{constructor(t,n={}){w(this,"type");w(this,"annotations");this.type=t,this.annotations=n}toJSON(){return{type:this.type.toJSON(),annotations:Sn(this.annotations)}}toString(){return String(this.type)}};class Gu extends yw{constructor(n,r,s={}){super(n,s);w(this,"isOptional");this.isOptional=r}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:Sn(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}}const t7=e=>e.map(t=>t.type);class t2{constructor(t,n,r,s={}){w(this,"elements");w(this,"rest");w(this,"isReadonly");w(this,"annotations");w(this,"_tag","TupleType");this.elements=t,this.rest=n,this.isReadonly=r,this.annotations=s;let i=!1,a=!1;for(const o of t)if(o.isOptional)i=!0;else if(i){a=!0;break}if(a||i&&n.length>1)throw new Error(Tve)}toString(){return Kt(Ca(this),()=>dbe(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(t=>t.toJSON()),rest:this.rest.map(t=>t.toJSON()),isReadonly:this.isReadonly,annotations:Sn(this.annotations)}}}const dbe=e=>{const t=e.elements.map(String).join(", ");return qne(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{const s=String(n),i=s.includes(" | ")?`(${s})`:s;if(r.length>0){const a=r.map(String).join(", ");return e.elements.length>0?`readonly [${t}, ...${i}[], ${a}]`:`readonly [...${i}[], ${a}]`}else return e.elements.length>0?`readonly [${t}, ...${i}[]]`:`ReadonlyArray<${s}>`}})};class fr extends Gu{constructor(n,r,s,i,a){super(r,s,a);w(this,"name");w(this,"isReadonly");this.name=n,this.isReadonly=i}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:Sn(this.annotations)}}}const n7=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return n7(e.from)}return!1};class vw{constructor(t,n,r){w(this,"type");w(this,"isReadonly");w(this,"parameter");if(this.type=n,this.isReadonly=r,n7(t))this.parameter=t;else throw new Error(Nve)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class Ll{constructor(t,n,r={}){w(this,"annotations");w(this,"_tag","TypeLiteral");w(this,"propertySignatures");w(this,"indexSignatures");this.annotations=r;const s={};for(let a=0;a<t.length;a++){const o=t[a].name;if(Object.prototype.hasOwnProperty.call(s,o))throw new Error(D9(o));s[o]=null}const i={string:!1,symbol:!1};for(let a=0;a<n.length;a++){const o=c7(n[a].parameter);if($C(o)){if(i.string)throw new Error(RI("string"));i.string=!0}else if(fbe(o)){if(i.symbol)throw new Error(RI("symbol"));i.symbol=!0}}this.propertySignatures=t,this.indexSignatures=n}toString(){return Kt(Ca(this),()=>hbe(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(t=>t.toJSON()),indexSignatures:this.indexSignatures.map(t=>t.toJSON()),annotations:Sn(this.annotations)}}}const OI=e=>e.map(String).join("; "),hbe=e=>{if(e.propertySignatures.length>0){const t=e.propertySignatures.map(String).join("; ");return e.indexSignatures.length>0?`{ ${t}; ${OI(e.indexSignatures)} }`:`{ ${t} }`}else return e.indexSignatures.length>0?`{ ${OI(e.indexSignatures)} }`:"{}"},MI=Xi("TypeLiteral"),mbe=eg(hU(Zd,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})),pbe={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"},r7=e=>Ex(e,t=>bw(t)?r7(t.types):[t]),gbe=e=>{const t=mbe(e),n=[],r={},s=[];for(const i of t)switch(i._tag){case"NeverKeyword":break;case"AnyKeyword":return[ibe];case"UnknownKeyword":return[e7];case"ObjectKeyword":case"UndefinedKeyword":case"VoidKeyword":case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":{r[i._tag]||(r[i._tag]=i,n.push(i));break}case"Literal":{const a=typeof i.literal;switch(a){case"string":case"number":case"bigint":case"boolean":{const o=pbe[a];!r[o]&&!s.includes(i.literal)&&(s.push(i.literal),n.push(i));break}case"object":{s.includes(i.literal)||(s.push(i.literal),n.push(i));break}}break}case"UniqueSymbol":{!r.SymbolKeyword&&!s.includes(i.symbol)&&(s.push(i.symbol),n.push(i));break}case"TupleType":{r.ObjectKeyword||n.push(i);break}case"TypeLiteral":{i.propertySignatures.length===0&&i.indexSignatures.length===0?r["{}"]||(r["{}"]=i,n.push(i)):r.ObjectKeyword||n.push(i);break}default:n.push(i)}return n};var oo;let ws=(oo=class{constructor(t,n={}){w(this,"types");w(this,"annotations");w(this,"_tag","Union");this.types=t,this.annotations=n}toString(){return Kt(Ca(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map(t=>t.toJSON()),annotations:Sn(this.annotations)}}},w(oo,"make",(t,n)=>n2(t)?new oo(t,n):t.length===1?t[0]:e2),w(oo,"unify",(t,n)=>oo.make(gbe(r7(t)),n)),oo);const ybe=(e,t)=>e.map(t),n2=e=>e.length>1,bw=Xi("Union"),O_=Fe(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);class bg{constructor(t,n={}){w(this,"f");w(this,"annotations");w(this,"_tag","Suspend");this.f=t,this.annotations=n,this.f=O9(t)}toString(){return Ca(this).pipe($i(()=>Ho(Ane(this.f)(),t=>Ca(t))),Kt(()=>"<suspended schema>"))}toJSON(){const t=this.f();let n=O_.get(t);return n||(O_.set(t,{_tag:this._tag}),n={_tag:this._tag,ast:t.toJSON(),annotations:Sn(this.annotations)},O_.set(t,n),n)}}let r2=class{constructor(t,n,r={}){w(this,"from");w(this,"filter");w(this,"annotations");w(this,"_tag","Refinement");this.from=t,this.filter=n,this.annotations=r}toString(){return pw(this).pipe(Kt(()=>Ft(u7(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:t=>wd(this.from)?String(this.from)+" & "+t:t})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:Sn(this.annotations)}}};const wd=Xi("Refinement"),M_={};let Gc=class{constructor(t,n,r,s={}){w(this,"from");w(this,"to");w(this,"transformation");w(this,"annotations");w(this,"_tag","Transformation");this.from=t,this.to=n,this.transformation=r,this.annotations=s}toString(){return Kt(Ca(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:Sn(this.annotations)}}};const vbe=Xi("Transformation");class s7{constructor(t,n){w(this,"decode");w(this,"encode");w(this,"_tag","FinalTransformation");this.decode=t,this.encode=n}}const bbe=e=>t=>t._tag===e;class xbe{constructor(){w(this,"_tag","ComposeTransformation")}}const i7=new xbe;let Sbe=class{constructor(t,n,r,s){w(this,"from");w(this,"to");w(this,"decode");w(this,"encode");this.from=t,this.to=n,this.decode=r,this.encode=s}};class FC{constructor(t){w(this,"propertySignatureTransformations");w(this,"_tag","TypeLiteralTransformation");this.propertySignatureTransformations=t;const n={},r={};for(const s of t){const i=s.from;if(n[i])throw new Error(NI(i));n[i]=!0;const a=s.to;if(r[a])throw new Error(NI(a));r[a]=!0}}}const jI=bbe("TypeLiteralTransformation"),Kh=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[Ey];const s={...r,...t},i=Q9(e);return Bt(i)&&(s[f0]=Kh(i.value,t)),n.annotations.value=s,Object.create(Object.getPrototypeOf(e),n)},wbe="[\\s\\S]*?",_be="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",a7=(e,t)=>{switch(e._tag){case"Literal":return Ix(String(e.literal));case"StringKeyword":return wbe;case"NumberKeyword":return _be;case"TemplateLiteral":return o7(e);case"Union":return e.types.map(n=>a7(n)).join("|")}},kbe=(e,t,n,r)=>bw(e)?`(${t})`:t,o7=(e,t,n)=>{let r="";if(e.head!==""){const s=Ix(e.head);r+=s}for(const s of e.spans){const i=a7(s.type);if(r+=kbe(s.type,i),s.literal!==""){const a=Ix(s.literal);r+=a}}return r},Ebe=e=>new RegExp(`^${o7(e)}$`),DI=(e,t)=>{const n=[],r=[],s=i=>{switch(i._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":r.push(new vw(i,t,!0));break;case"Literal":if($s(i.literal)||jo(i.literal))n.push(new fr(i.literal,t,!1,!0));else throw new Error(Rve(i.literal));break;case"Enums":{for(const[a,o]of i.enums)n.push(new fr(o,t,!1,!0));break}case"UniqueSymbol":n.push(new fr(i.symbol,t,!1,!0));break;case"Union":i.types.forEach(s);break;default:throw new Error(Cve(i))}};return s(e),{propertySignatures:n,indexSignatures:r}},l7=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},Cbe=e=>t=>{const n={...t.annotations};for(const r of e)delete n[r];return n},Rbe=l7([$9,z9,L9,F9,U9,B9]),Rn=e=>{switch(e._tag){case"Declaration":{const t=ei(e.typeParameters,Rn);return t===e.typeParameters?e:new gw(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case"TupleType":{const t=ei(e.elements,s=>{const i=Rn(s.type);return i===s.type?s:new Gu(i,s.isOptional)}),n=t7(e.rest),r=ei(n,Rn);return t===e.elements&&r===n?e:new t2(t,r.map(s=>new yw(s)),e.isReadonly,e.annotations)}case"TypeLiteral":{const t=ei(e.propertySignatures,r=>{const s=Rn(r.type);return s===r.type?r:new fr(r.name,s,r.isOptional,r.isReadonly)}),n=ei(e.indexSignatures,r=>{const s=Rn(r.type);return s===r.type?r:new vw(r.parameter,s,r.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new Ll(t,n,e.annotations)}case"Union":{const t=ei(e.types,Rn);return t===e.types?e:ws.make(t,e.annotations)}case"Suspend":return new bg(()=>Rn(e.f()),e.annotations);case"Refinement":{const t=Rn(e.from);return t===e.from?e:new r2(t,e.filter,e.annotations)}case"Transformation":{const t=Rbe(e);return Rn(t!==void 0?Kh(e.to,t):e.to)}}return e};function ei(e,t){let n=!1;const r=wS(e.length);for(let s=0;s<e.length;s++){const i=e[s],a=t(i);a!==i&&(n=!0),r[s]=a}return n?r:e}const ra=(e,t)=>{switch(e._tag){case"Declaration":{const n=ei(e.typeParameters,r=>ra(r));return n===e.typeParameters?e:new gw(n,e.decodeUnknown,e.encodeUnknown)}case"TupleType":{const n=ei(e.elements,i=>{const a=ra(i.type);return a===i.type?i:new Gu(a,i.isOptional)}),r=t7(e.rest),s=ei(r,i=>ra(i));return n===e.elements&&s===r?e:new t2(n,s.map(i=>new yw(i)),e.isReadonly)}case"TypeLiteral":{const n=ei(e.propertySignatures,s=>{const i=ra(s.type);return i===s.type?s:new fr(s.name,i,s.isOptional,s.isReadonly)}),r=ei(e.indexSignatures,s=>{const i=ra(s.type);return i===s.type?s:new vw(s.parameter,i,s.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new Ll(n,r)}case"Union":{const n=ei(e.types,r=>ra(r));return n===e.types?e:ws.make(n)}case"Suspend":{let n;const r=Gve(e);if(Bt(r)){const s="";n={[Z9]:`${r.value}Encoded${s}`}}return new bg(()=>ra(e.f()),n)}case"Refinement":return ra(e.from);case"Transformation":return ra(e.from)}return e},h0=e=>ra(e),Sn=e=>{const t={};for(const n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},c7=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return e;case"Refinement":return c7(e.from)}},Nbe=(e,t)=>new Gc(e,t,i7),Ko=e=>Kt(Ca(e),()=>e._tag);function Tbe(e){return Ft(Y9(e),{onNone:()=>"",onSome:t=>t.map(n=>` & Brand<${Bo(n)}>`).join("")})}const u7=e=>W9(e).pipe($i(()=>X9(e)),$i(()=>J9(e)),os(t=>t+Tbe(e))),Ca=e=>$i(pw(e),()=>u7(e));class lr{constructor(t,n,r){w(this,"path");w(this,"actual");w(this,"issue");w(this,"_tag","Pointer");this.path=t,this.actual=n,this.issue=r}}class II{constructor(t,n){w(this,"actual");w(this,"message");w(this,"_tag","Unexpected");this.actual=t,this.message=n}}class km{constructor(t,n){w(this,"ast");w(this,"message");w(this,"_tag","Missing");w(this,"actual");this.ast=t,this.message=n}}class cn{constructor(t,n,r,s){w(this,"ast");w(this,"actual");w(this,"issues");w(this,"output");w(this,"_tag","Composite");this.ast=t,this.actual=n,this.issues=r,this.output=s}}class j_{constructor(t,n,r,s){w(this,"ast");w(this,"actual");w(this,"kind");w(this,"issue");w(this,"_tag","Refinement");this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class D_{constructor(t,n,r,s){w(this,"ast");w(this,"actual");w(this,"kind");w(this,"issue");w(this,"_tag","Transformation");this.ast=t,this.actual=n,this.kind=r,this.issue=s}}class hn{constructor(t,n,r){w(this,"ast");w(this,"actual");w(this,"message");w(this,"_tag","Type");this.ast=t,this.actual=n,this.message=r}}class UC{constructor(t,n,r){w(this,"ast");w(this,"actual");w(this,"message");w(this,"_tag","Forbidden");this.ast=t,this.actual=n,this.message=r}}const PI=Symbol.for("effect/Schema/ParseErrorTypeId");var BL;class Abe extends Nme("ParseError"){constructor(){super(...arguments);w(this,BL,PI)}get message(){return this.toString()}toString(){return kp.formatIssueSync(this.issue)}toJSON(){return{_id:"ParseError",message:this.toString()}}[(BL=PI,pt)](){return this.toJSON()}}const s2=e=>new Abe({issue:e}),Tr=ze,yo=Le,m0=vne,Obe=yne,Er=lU,Pi=T(2,(e,t)=>Er(e)?as(e,{onLeft:Le,onRight:t}):je(e,t)),dr=T(2,(e,t)=>Er(e)?Sne(e,t):Et(e,t)),_p=T(2,(e,t)=>Er(e)?xne(e,t):$A(e,t)),Mbe=T(2,(e,t)=>Er(e)?bne(e,{onLeft:t.onFailure,onRight:t.onSuccess}):xpe(e,t)),f7=T(2,(e,t)=>Er(e)?as(e,{onLeft:t,onRight:ze}):iH(e,t)),xw=(e,t)=>t===void 0||jo(t)?e:e===void 0?t:{...e,...t},d7=(e,t,n)=>{const r=Xn(e,t);return(s,i)=>r(s,xw(n,i))},h7=(e,t,n)=>{const r=d7(e,t,n);return(s,i)=>cU(r(s,i),s2)},jbe=(e,t,n)=>{const r=d7(e,t,n);return(s,i)=>Rne(r(s,i))},m7=(e,t,n)=>{const r=Xn(e,t);return(s,i)=>r(s,{...xw(n,i),isEffectAllowed:!0})},p7=(e,t)=>h7(e.ast,!0,t),Dbe=(e,t)=>jbe(e.ast,!0,t),i2=(e,t)=>m7(e.ast,!0,t),Sw=(e,t)=>m7(e.ast,!1,t),g7=p7,Ibe=Dbe,ww=(e,t)=>h7(Rn(e.ast),!0,t),Pbe=(e,t)=>{const n=Xn(Rn(e.ast),!0);return(r,s)=>da(n(r,{exact:!0,...xw(t,s)}))},$be=Fe(Symbol.for("effect/ParseResult/decodeMemoMap"),()=>new WeakMap),zbe=Fe(Symbol.for("effect/ParseResult/encodeMemoMap"),()=>new WeakMap),Xn=(e,t)=>{const n=t?$be:zbe,r=n.get(e);if(r)return r;const s=Lbe(e,t),i=Bve(e),a=Bt(i)?(c,f)=>s(c,xw(f,i.value)):s,o=Hve(e),l=t&&Bt(o)?(c,f)=>Ym(f7(a(c,f),o.value),e,c,f):a;return n.set(e,l),l},I_=e=>Zs(Lve(e)),P_=e=>Zs(Fve(e)),Lbe=(e,t)=>{switch(e._tag){case"Refinement":if(t){const n=Xn(e.from,!0);return(r,s)=>{s=s??M_;const i=(s==null?void 0:s.errors)==="all",a=Pi(f7(n(r,s),o=>{const l=new j_(e,r,"From",o);return i&&Vve(e)&&x7(o)?Ft(e.filter(r,s,e),{onNone:()=>Le(l),onSome:c=>Le(new cn(e,r,[l,new j_(e,r,"Predicate",c)]))}):Le(l)}),o=>Ft(e.filter(o,s,e),{onNone:()=>ze(o),onSome:l=>Le(new j_(e,r,"Predicate",l))}));return Ym(a,e,r,s)}}else{const n=Xn(Rn(e),!0),r=Xn(y7(e.from),!1);return(s,i)=>Ym(Pi(n(s,i),a=>r(a,i)),e,s,i)}case"Transformation":{const n=Bbe(e.transformation,t),r=t?Xn(e.from,!0):Xn(e.to,!1),s=t?Xn(e.to,!0):Xn(e.from,!1);return(i,a)=>Ym(Pi(_p(r(i,a),o=>new D_(e,i,t?"Encoded":"Type",o)),o=>Pi(_p(n(o,a??M_,e,i),l=>new D_(e,i,"Transformation",l)),l=>_p(s(l,a),c=>new D_(e,i,t?"Type":"Encoded",c)))),e,i,a)}case"Declaration":{const n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(r,s)=>Ym(n(r,s??M_,e),e,r,s)}case"Literal":return ys(e,n=>n===e.literal);case"UniqueSymbol":return ys(e,n=>n===e.symbol);case"UndefinedKeyword":return ys(e,ste);case"NeverKeyword":return ys(e,ate);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return ze;case"StringKeyword":return ys(e,$s);case"NumberKeyword":return ys(e,jo);case"BooleanKeyword":return ys(e,Ld);case"BigIntKeyword":return ys(e,mS);case"SymbolKeyword":return ys(e,TE);case"ObjectKeyword":return ys(e,Ui);case"Enums":return ys(e,n=>e.enums.some(([r,s])=>s===n));case"TemplateLiteral":{const n=Ebe(e);return ys(e,r=>$s(r)&&n.test(r))}case"TupleType":{const n=e.elements.map(c=>Xn(c.type,t)),r=e.rest.map(c=>Xn(c.type,t));let s=e.elements.filter(c=>!c.isOptional);e.rest.length>0&&(s=s.concat(e.rest.slice(1)));const i=s.length,a=e.elements.length>0?e.elements.map((c,f)=>f).join(" | "):"never",o=I_(e),l=P_(e);return(c,f)=>{if(!Kne(c))return Le(new hn(e,c));const u=(f==null?void 0:f.errors)==="all",h=[];let m=0;const p=[],v=c.length;for(let x=v;x<=i-1;x++){const _=new lr(x,c,new km(s[x-v]));if(u){h.push([m++,_]);continue}else return Le(new cn(e,c,_,p))}if(e.rest.length===0)for(let x=e.elements.length;x<=v-1;x++){const _=new lr(x,c,new II(c[x],`is unexpected, expected: ${a}`));if(u){h.push([m++,_]);continue}else return Le(new cn(e,c,_,p))}let S=0,y;for(;S<n.length;S++)if(v<S+1){if(e.elements[S].isOptional)continue}else{const x=n[S],_=x(c[S],f);if(Er(_)){if(Qn(_)){const C=new lr(S,c,_.left);if(u){h.push([m++,C]);continue}else return Le(new cn(e,c,C,ki(p)))}p.push([m++,_.right])}else{const C=m++,E=S;y||(y=[]),y.push(({es:k,output:A})=>je(pf(_),I=>{if(Qn(I)){const R=new lr(E,c,I.left);return u?(k.push([C,R]),ht):Le(new cn(e,c,R,ki(A)))}return A.push([C,I.right]),ht}))}}if(gn(r)){const[x,..._]=r;for(;S<v-_.length;S++){const C=x(c[S],f);if(Er(C))if(Qn(C)){const E=new lr(S,c,C.left);if(u){h.push([m++,E]);continue}else return Le(new cn(e,c,E,ki(p)))}else p.push([m++,C.right]);else{const E=m++,k=S;y||(y=[]),y.push(({es:A,output:I})=>je(pf(C),R=>{if(Qn(R)){const $=new lr(k,c,R.left);return u?(A.push([E,$]),ht):Le(new cn(e,c,$,ki(I)))}else return I.push([E,R.right]),ht}))}}for(let C=0;C<_.length;C++)if(S+=C,!(v<S+1)){const E=_[C](c[S],f);if(Er(E)){if(Qn(E)){const k=new lr(S,c,E.left);if(u){h.push([m++,k]);continue}else return Le(new cn(e,c,k,ki(p)))}p.push([m++,E.right])}else{const k=m++,A=S;y||(y=[]),y.push(({es:I,output:R})=>je(pf(E),$=>{if(Qn($)){const U=new lr(A,c,$.left);return u?(I.push([k,U]),ht):Le(new cn(e,c,U,ki(R)))}return R.push([k,$.right]),ht}))}}}const b=({es:x,output:_})=>dd(x)?Le(new cn(e,c,ki(x),ki(_))):ze(ki(_));if(y&&y.length>0){const x=y;return vn(()=>{const _={es:Um(h),output:Um(p)};return je(wa(x,C=>C(_),{concurrency:o,batching:l,discard:!0}),()=>b(_))})}return b({output:p,es:h})}}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return ys(e,ote);const n=[],r={},s=[];for(const f of e.propertySignatures)n.push([Xn(f.type,t),f]),r[f.name]=null,s.push(f.name);const i=e.indexSignatures.map(f=>[Xn(f.parameter,t),Xn(f.type,t),f.parameter]),a=ws.make(e.indexSignatures.map(f=>f.parameter).concat(s.map(f=>TE(f)?new Jve(f):new d0(f)))),o=Xn(a,t),l=I_(e),c=P_(e);return(f,u)=>{if(!cte(f))return Le(new hn(e,f));const h=(u==null?void 0:u.errors)==="all",m=[];let p=0;const v=(u==null?void 0:u.onExcessProperty)==="error",S=(u==null?void 0:u.onExcessProperty)==="preserve",y={};let b;if(v||S){b=Reflect.ownKeys(f);for(const E of b){const k=o(E,u);if(Er(k)&&Qn(k))if(v){const A=new lr(E,f,new II(f[E],`is unexpected, expected: ${String(a)}`));if(h){m.push([p++,A]);continue}else return Le(new cn(e,f,A,y))}else y[E]=f[E]}}let x;const _=(u==null?void 0:u.exact)===!0;for(let E=0;E<n.length;E++){const k=n[E][1],A=k.name,I=Object.prototype.hasOwnProperty.call(f,A);if(!I){if(k.isOptional)continue;if(_){const U=new lr(A,f,new km(k));if(h){m.push([p++,U]);continue}else return Le(new cn(e,f,U,y))}}const R=n[E][0],$=R(f[A],u);if(Er($)){if(Qn($)){const U=new lr(A,f,I?$.left:new km(k));if(h){m.push([p++,U]);continue}else return Le(new cn(e,f,U,y))}y[A]=$.right}else{const U=p++,K=A;x||(x=[]),x.push(({es:W,output:B})=>je(pf($),j=>{if(Qn(j)){const F=new lr(K,f,I?j.left:new km(k));return h?(W.push([U,F]),ht):Le(new cn(e,f,F,B))}return B[K]=j.right,ht}))}}for(let E=0;E<i.length;E++){const k=i[E],A=k[0],I=k[1],R=A9(f,k[2]);for(const $ of R){const U=A($,u);if(Er(U)&&da(U)){const K=I(f[$],u);if(Er(K))if(Qn(K)){const W=new lr($,f,K.left);if(h){m.push([p++,W]);continue}else return Le(new cn(e,f,W,y))}else Object.prototype.hasOwnProperty.call(r,$)||(y[$]=K.right);else{const W=p++,B=$;x||(x=[]),x.push(({es:j,output:F})=>je(pf(K),z=>{if(Qn(z)){const V=new lr(B,f,z.left);return h?(j.push([W,V]),ht):Le(new cn(e,f,V,F))}else return Object.prototype.hasOwnProperty.call(r,$)||(F[$]=z.right),ht}))}}}}const C=({es:E,output:k})=>{if(dd(E))return Le(new cn(e,f,ki(E),k));if((u==null?void 0:u.propertyOrder)==="original"){const A=b||Reflect.ownKeys(f);for(const R of s)A.indexOf(R)===-1&&A.push(R);const I={};for(const R of A)Object.prototype.hasOwnProperty.call(k,R)&&(I[R]=k[R]);return ze(I)}return ze(k)};if(x&&x.length>0){const E=x;return vn(()=>{const k={es:Um(m),output:Object.assign({},y)};return je(wa(E,A=>A(k),{concurrency:l,batching:c,discard:!0}),()=>C(k))})}return C({es:m,output:y})}}case"Union":{const n=Fbe(e.types,t),r=Reflect.ownKeys(n.keys),s=r.length,i=e.types.length,a=new Map;for(let c=0;c<i;c++)a.set(e.types[c],Xn(e.types[c],t));const o=I_(e)??1,l=P_(e);return(c,f)=>{const u=[];let h=0,m=[];if(s>0)if(XN(c))for(let S=0;S<s;S++){const y=r[S],b=n.keys[y].buckets;if(Object.prototype.hasOwnProperty.call(c,y)){const x=String(c[y]);if(Object.prototype.hasOwnProperty.call(b,x))m=m.concat(b[x]);else{const{candidates:_,literals:C}=n.keys[y],E=ws.make(C),k=_.length===i?new Ll([new fr(y,E,!1,!0)],[]):ws.make(_);u.push([h++,new cn(k,c,new lr(y,c,new hn(E,c[y])))])}}else{const{candidates:x,literals:_}=n.keys[y],C=new fr(y,ws.make(_),!1,!0),E=x.length===i?new Ll([C],[]):ws.make(x);u.push([h++,new cn(E,c,new lr(y,c,new km(C)))])}}else{const S=n.candidates.length===i?e:ws.make(n.candidates);u.push([h++,new hn(S,c)])}n.otherwise.length>0&&(m=m.concat(n.otherwise));let p;for(let S=0;S<m.length;S++){const y=m[S],b=a.get(y)(c,f);if(Er(b)&&(!p||p.length===0)){if(da(b))return b;u.push([h++,b.left])}else{const x=h++;p||(p=[]),p.push(_=>vn(()=>"finalResult"in _?ht:je(pf(b),C=>(da(C)?_.finalResult=C:_.es.push([x,C.left]),ht))))}}const v=S=>dd(S)?S.length===1&&S[0][1]._tag==="Type"?Le(S[0][1]):Le(new cn(e,c,ki(S))):Le(new hn(e,c));if(p&&p.length>0){const S=p;return vn(()=>{const y={es:Um(u)};return je(wa(S,b=>b(y),{concurrency:o,batching:l,discard:!0}),()=>"finalResult"in y?y.finalResult:v(y.es))})}return v(u)}}case"Suspend":{const n=O9(()=>Xn(e.f(),t));return(r,s)=>n()(r,s)}}},ys=(e,t)=>n=>t(n)?ze(n):Le(new hn(e,n)),Gm=(e,t)=>{switch(e._tag){case"Declaration":{const n=Q9(e);if(Bt(n))return Gm(n.value,t);break}case"TypeLiteral":{const n=[];for(let r=0;r<e.propertySignatures.length;r++){const s=e.propertySignatures[r],i=t?h0(s.type):Rn(s.type);wp(i)&&!s.isOptional&&n.push([s.name,i])}return n}case"TupleType":{const n=[];for(let r=0;r<e.elements.length;r++){const s=e.elements[r],i=t?h0(s.type):Rn(s.type);wp(i)&&!s.isOptional&&n.push([r,i])}return n}case"Refinement":return Gm(e.from,t);case"Suspend":return Gm(e.f(),t);case"Transformation":return Gm(t?e.from:e.to,t)}return[]},Fbe=(e,t)=>{const n={},r=[],s=[];for(let i=0;i<e.length;i++){const a=e[i],o=Gm(a,t);if(o.length>0){s.push(a);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 h=n[c].buckets;if(Object.prototype.hasOwnProperty.call(h,u)){if(l<o.length-1)continue;h[u].push(a),n[c].literals.push(f),n[c].candidates.push(a)}else{h[u]=[a],n[c].literals.push(f),n[c].candidates.push(a);break}}}else r.push(a)}return{keys:n,otherwise:r,candidates:s}},y7=e=>wd(e)?y7(e.from):e,Ym=(e,t,n,r)=>{if((r==null?void 0:r.isEffectAllowed)===!0||Er(e))return e;const s=new uA,i=zA(e,{scheduler:s});s.flush();const a=i.unsafePoll();if(a){if(YB(a))return ze(a.value);const o=a.cause;return Kde(o)?Le(o.error):Le(new UC(t,n,the(o)))}return Le(new UC(t,n,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},Ube=([e],[t])=>e>t?1:e<t?-1:0;function ki(e){return e.sort(Ube).map(t=>t[1])}const Bbe=(e,t)=>{switch(e._tag){case"FinalTransformation":return t?e.decode:e.encode;case"ComposeTransformation":return ze;case"TypeLiteralTransformation":return n=>{let r=ze(n);for(const s of e.propertySignatureTransformations){const[i,a]=t?[s.from,s.to]:[s.to,s.from],o=t?s.decode:s.encode;r=dr(r,c=>{const f=o(Object.prototype.hasOwnProperty.call(c,i)?ie(c[i]):re());return delete c[i],Bt(f)&&(c[a]=f.value),c})}return r}}},$r=(e,t=[])=>({value:e,forest:t}),kp={formatIssue:e=>dr(Af(e),Hbe),formatIssueSync:e=>{const t=kp.formatIssue(e);return Er(t)?uU(t):ui(t)},formatError:e=>kp.formatIssue(e.issue),formatErrorSync:e=>kp.formatIssueSync(e.issue)},Hbe=e=>e.value+v7(`
87
+ `,e.forest),v7=(e,t)=>{let n="";const r=t.length;let s;for(let i=0;i<r;i++){s=t[i];const a=i===r-1;n+=e+(a?"└":"├")+"─ "+s.value,n+=v7(e+(r>1&&!a?"│ ":" "),s.forest)}return n},qbe=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},Vbe=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},b7=e=>"ast"in e?ie(e.ast):re(),BC=ze(void 0),Kbe=e=>b7(e).pipe(Ho($ve),Ft({onNone:()=>BC,onSome:t=>{const n=t(e);return $s(n)?ze({message:n,override:!1}):hc(n)?Et(n,r=>({message:r,override:!1})):$s(n.message)?ze({message:n.message,override:n.override}):Et(n.message,r=>({message:r,override:n.override}))}})),a2=e=>t=>t._tag===e,x7=a2("Composite"),$I=a2("Refinement"),zI=a2("Transformation"),Fl=e=>Pi(Kbe(e),t=>t!==void 0?!t.override&&(x7(e)||$I(e)&&e.kind==="From"||zI(e)&&e.kind!=="Transformation")?zI(e)||$I(e)?Fl(e.issue):BC:ze(t.message):BC),S7=e=>b7(e).pipe(Ho(Uve),pU(t=>t(e)),Zs);function Gbe(e){return X9(e).pipe($i(()=>W9(e)),$i(()=>J9(e)),$i(()=>pw(e)),Kt(()=>`{ ${e.from} | filter }`))}function Ybe(e){return e.message!==void 0?e.message:`Expected ${wd(e.ast)?Gbe(e.ast):String(e.ast)}, actual ${Bo(e.actual)}`}const w7=e=>dr(Fl(e),t=>t??S7(e)??Ybe(e)),Av=e=>S7(e)??String(e.ast),_7=e=>e.message??"is forbidden",k7=e=>e.message??"is unexpected",E7=e=>{const t=zve(e.ast);if(Bt(t)){const n=t.value();return $s(n)?ze(n):n}return ze(e.message??"is missing")},Af=e=>{switch(e._tag){case"Type":return dr(w7(e),$r);case"Forbidden":return ze($r(Av(e),[$r(_7(e))]));case"Unexpected":return ze($r(k7(e)));case"Missing":return dr(E7(e),$r);case"Transformation":return Pi(Fl(e),t=>t!==void 0?ze($r(t)):dr(Af(e.issue),n=>$r(Av(e),[$r(qbe(e.kind),[n])])));case"Refinement":return Pi(Fl(e),t=>t!==void 0?ze($r(t)):dr(Af(e.issue),n=>$r(Av(e),[$r(Vbe(e.kind),[n])])));case"Pointer":return dr(Af(e.issue),t=>$r(M9(e.path),[t]));case"Composite":return Pi(Fl(e),t=>{if(t!==void 0)return ze($r(t));const n=Av(e);return QA(e.issues)?dr(wa(e.issues,Af),r=>$r(n,r)):dr(Af(e.issues),r=>$r(n,[r]))})}},Tc=(e,t,n)=>({_tag:e,path:t,message:n}),Eb={formatIssue:e=>Of(e,void 0,[]),formatIssueSync:e=>{const t=Eb.formatIssue(e);return Er(t)?uU(t):ui(t)},formatError:e=>Eb.formatIssue(e.issue),formatErrorSync:e=>Eb.formatIssueSync(e.issue)},Of=(e,t,n)=>{const r=e._tag;switch(r){case"Type":return dr(w7(e),s=>[Tc(t??r,n,s)]);case"Forbidden":return ze([Tc(r,n,_7(e))]);case"Unexpected":return ze([Tc(r,n,k7(e))]);case"Missing":return dr(E7(e),s=>[Tc(r,n,s)]);case"Pointer":return Of(e.issue,void 0,n.concat(e.path));case"Composite":return Pi(Fl(e),s=>s!==void 0?ze([Tc(r,n,s)]):QA(e.issues)?dr(wa(e.issues,i=>Of(i,void 0,n)),SU):Of(e.issues,void 0,n));case"Refinement":return Pi(Fl(e),s=>s!==void 0?ze([Tc(r,n,s)]):Of(e.issue,e.kind==="Predicate"?r:void 0,n));case"Transformation":return Pi(Fl(e),s=>s!==void 0?ze([Tc(r,n,s)]):Of(e.issue,e.kind==="Transformation"?r:void 0,n))}},LI=kve,Wbe=T(e=>Ui(e[0]),(e,...t)=>{const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}),C7=T(e=>Ui(e[0]),(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n}),rh=Symbol.for("effect/Schema");function Lt(e){var t,n,r;return n=rh,t=rh,r=class{constructor(){w(this,n,HC)}static annotations(i){return Lt(Qi(this.ast,i))}static pipe(){return xe(this,arguments)}static toString(){return String(e)}},w(r,"ast",e),w(r,"Type"),w(r,"Encoded"),w(r,"Context"),w(r,t,HC),r}const HC={_A:e=>e,_I:e=>e,_R:e=>e},FI={typeConstructor:jve,schemaId:Dve,message:P9,missingMessage:ZA,identifier:Ey,title:Ji,description:Ku,examples:$9,default:z9,documentation:Ive,jsonSchema:L9,arbitrary:F9,pretty:U9,equivalence:B9,concurrency:H9,batching:q9,parseIssueTitle:V9,parseOptions:K9,decodingFallback:G9},Yu=e=>{if(!e)return{};const t={...e};for(const n in FI)if(n in e){const r=FI[n];t[r]=e[n],delete t[n]}return t},Qi=(e,t)=>Kh(e,Yu(t));const Jbe=e=>String(e.ast),Xbe=e=>Lt(h0(e.ast)),Ri=e=>Lt(Rn(e.ast)),Em=(e,t)=>{const n=Sw(e,t);return(r,s)=>_p(n(r,s),s2)},Qbe=(e,t)=>{const n=i2(e,t);return(r,s)=>_p(n(r,s),s2)},Zbe=Qbe,Vi=e=>De(e,rh)&&Ui(e[rh]);function exe(e){return n2(e)?ws.make(ybe(e,t=>new d0(t))):new d0(e[0])}function R7(e,t=exe(e)){var n;return n=class extends Lt(t){static annotations(s){return R7(this.literals,Qi(this.ast,s))}},w(n,"literals",[...e]),n}function Us(...e){return gn(e)?R7(e):xg}const txe=(e,t,n)=>o2(e,new gw(e.map(r=>r.ast),(...r)=>t.decode(...r.map(Lt)),(...r)=>t.encode(...r.map(Lt)),Yu(n))),nxe=(e,t)=>{const n=()=>(s,i,a)=>e(s)?Tr(s):yo(new hn(a,s)),r=n;return o2([],new gw([],n,r,Yu(t)))};function o2(e,t){var n;return n=class extends Lt(t){static annotations(s){return o2(this.typeParameters,Qi(this.ast,s))}},w(n,"typeParameters",[...e]),n}const Gh=function(){if(Array.isArray(arguments[0])){const n=arguments[0],r=arguments[1],s=arguments[2];return txe(n,r,s)}const e=arguments[0],t=arguments[1];return nxe(e,t)};class N7 extends Lt(IC){}class rxe extends Lt(Zve){}class T7 extends Lt(Wve){}class xg extends Lt(e2){}class _w extends Lt(e7){}class sxe extends Lt(ube){}class M extends Lt(PC){}class ve extends Lt(zC){}class sn extends Lt(LC){}const ixe=e=>ws.make(e.map(t=>t.ast));function A7(e,t=ixe(e)){var n;return n=class extends Lt(t){static annotations(s){return A7(this.members,Qi(this.ast,s))}},w(n,"members",[...e]),n}function Wu(...e){return n2(e)?A7(e):gn(e)?e[0]:xg}const tn=e=>Wu(e,T7),Wm=e=>Wu(e,N7),$_=e=>Wu(e,T7,N7),axe=(e,t)=>new t2(e.map(n=>Vi(n)?new Gu(n.ast,!1):n.ast),t.map(n=>Vi(n)?new yw(n.ast):n.ast),!0);function p0(e,t,n=axe(e,t)){var r;return r=class extends Lt(n){static annotations(i){return p0(this.elements,this.rest,Qi(this.ast,i))}},w(r,"elements",[...e]),w(r,"rest",[...t]),r}function oxe(...e){return Array.isArray(e[0])?p0(e[0],e.slice(1)):p0(e,[])}function O7(e,t){var n;return n=class extends p0([],[e],t){static annotations(s){return O7(this.value,Qi(this.ast,s))}},w(n,"value",e),n}const Ie=e=>O7(e),qC=e=>e?'"?:"':'":"';class sh extends Gu{constructor(n,r,s,i,a){super(n,r,i);w(this,"isReadonly");w(this,"defaultValue");w(this,"_tag","PropertySignatureDeclaration");this.isReadonly=s,this.defaultValue=a}toString(){const n=qC(this.isOptional),r=String(this.type);return`PropertySignature<${n}, ${r}, never, ${n}, ${r}>`}}class M7 extends Gu{constructor(n,r,s,i,a){super(n,r,i);w(this,"isReadonly");w(this,"fromKey");this.isReadonly=s,this.fromKey=a}}class kw extends Gu{constructor(n,r,s,i,a){super(n,r,i);w(this,"isReadonly");w(this,"defaultValue");this.isReadonly=s,this.defaultValue=a}}const lxe=e=>e===void 0?"never":$s(e)?JSON.stringify(e):String(e);class Ew{constructor(t,n,r,s){w(this,"from");w(this,"to");w(this,"decode");w(this,"encode");w(this,"_tag","PropertySignatureTransformation");this.from=t,this.to=n,this.decode=r,this.encode=s}toString(){return`PropertySignature<${qC(this.to.isOptional)}, ${this.to.type}, ${lxe(this.from.fromKey)}, ${qC(this.from.isOptional)}, ${this.from.type}>`}}const j7=(e,t)=>{switch(e._tag){case"PropertySignatureDeclaration":return new sh(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case"PropertySignatureTransformation":return new Ew(e.from,new kw(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},D7=Symbol.for("effect/PropertySignature"),l2=e=>De(e,D7);var HL,qL;qL=rh,HL=D7;const IO=class IO{constructor(t){w(this,"ast");w(this,qL);w(this,HL,null);w(this,"_TypeToken");w(this,"_Key");w(this,"_EncodedToken");w(this,"_HasDefault");this.ast=t}pipe(){return xe(this,arguments)}annotations(t){return new IO(j7(this.ast,Yu(t)))}toString(){return String(this.ast)}};let g0=IO;const y0=e=>new g0(e);class Cy extends g0{constructor(n,r){super(n);w(this,"from");this.from=r}annotations(n){return new Cy(j7(this.ast,Yu(n)),this.from)}}const Ep=e=>new Cy(new sh(e.ast,!1,!0,{},void 0),e),td=T(2,(e,t)=>{const n=e.ast;switch(n._tag){case"PropertySignatureDeclaration":return y0(new sh(n.type,n.isOptional,n.isReadonly,n.annotations,t));case"PropertySignatureTransformation":return y0(new Ew(n.from,new kw(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),Qo=(e,t,n)=>y0(new Ew(new M7(e.ast,!0,!0,{},void 0),new kw(t.ast,!1,!0,{},void 0),r=>ie(n.decode(r)),Ho(n.encode))),UI=(e,t,n)=>y0(new Ew(new M7(e.ast,!0,!0,{},void 0),new kw(t.ast,!0,!0,{},void 0),n.decode,n.encode)),cxe=(e,t)=>{const n=t==null?void 0:t.exact,r=t==null?void 0:t.default,s=t==null?void 0:t.nullable,i=(t==null?void 0:t.as)=="Option",a=t!=null&&t.onNoneEncoding?$i(t.onNoneEncoding):Oe;if(n){if(r)return s?td(Qo(tn(e),Ri(e),{decode:Ft({onNone:r,onSome:o=>o===null?r():o}),encode:ie}),r).ast:td(Qo(e,Ri(e),{decode:Ft({onNone:r,onSome:Oe}),encode:ie}),r).ast;if(i){const o=YI(Ri(e));return s?Qo(tn(e),o,{decode:Rf(r_),encode:a}).ast:Qo(e,o,{decode:Oe,encode:Oe}).ast}else return s?UI(tn(e),Ri(e),{decode:Rf(r_),encode:Oe}).ast:new sh(e.ast,!0,!0,{},void 0)}else{if(r)return s?td(Qo($_(e),Ri(e),{decode:Ft({onNone:r,onSome:o=>o??r()}),encode:ie}),r).ast:td(Qo(Wm(e),Ri(e),{decode:Ft({onNone:r,onSome:o=>o===void 0?r():o}),encode:ie}),r).ast;if(i){const o=YI(Ri(e));return s?Qo($_(e),o,{decode:Rf(l=>l!=null),encode:a}).ast:Qo(Wm(e),o,{decode:Rf(ite),encode:a}).ast}else return s?UI($_(e),Wm(Ri(e)),{decode:Rf(r_),encode:Oe}).ast:new sh(Wm(e).ast,!0,!0,{},void 0)}},pe=e=>{const t=e.ast===IC||e.ast===e2?IC:Wm(e).ast;return new Cy(new sh(t,!0,!0,{},void 0),e)},oa=T(e=>Vi(e[0]),(e,t)=>new Cy(cxe(e,t),e)),uxe=l7([ZA]),fxe=(e,t)=>{const n=Reflect.ownKeys(e),r=[];if(n.length>0){const i=[],a=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],f=e[c];if(l2(f)){const u=f.ast;switch(u._tag){case"PropertySignatureDeclaration":{const h=u.type,m=u.isOptional,p=u.annotations;i.push(new fr(c,h,m,!0,uxe(u))),a.push(new fr(c,Rn(h),m,!0,p)),r.push(new fr(c,h,m,!0,p));break}case"PropertySignatureTransformation":{const h=u.from.fromKey??c;i.push(new fr(h,u.from.type,u.from.isOptional,!0,u.from.annotations)),a.push(new fr(c,u.to.type,u.to.isOptional,!0,u.to.annotations)),o.push(new Sbe(h,c,u.decode,u.encode));break}}}else i.push(new fr(c,f.ast,!1,!0)),a.push(new fr(c,Rn(f.ast),!1,!0)),r.push(new fr(c,f.ast,!1,!0))}if(gn(o)){const l=[],c=[];for(const f of t){const{indexSignatures:u,propertySignatures:h}=DI(f.key.ast,f.value.ast);h.forEach(m=>{i.push(m),a.push(new fr(m.name,Rn(m.type),m.isOptional,m.isReadonly,m.annotations))}),u.forEach(m=>{l.push(m),c.push(new vw(m.parameter,Rn(m.type),m.isReadonly))})}return new Gc(new Ll(i,l,{[Sd]:"Struct (Encoded side)"}),new Ll(a,c,{[Sd]:"Struct (Type side)"}),new FC(o))}}const s=[];for(const i of t){const{indexSignatures:a,propertySignatures:o}=DI(i.key.ast,i.value.ast);o.forEach(l=>r.push(l)),a.forEach(l=>s.push(l))}return new Ll(r,s)},I7=(e,t)=>{const n=Reflect.ownKeys(e);for(const r of n){const s=e[r];if(t[r]===void 0&&l2(s)){const i=s.ast,a=i._tag==="PropertySignatureDeclaration"?i.defaultValue:i.to.defaultValue;a!==void 0&&(t[r]=a())}}return t};function c2(e,t,n=fxe(e,t)){var r;return r=class extends Lt(n){static annotations(i){return c2(this.fields,this.records,Qi(this.ast,i))}static pick(...i){return de(Wbe(e,...i))}static omit(...i){return de(C7(e,...i))}},w(r,"fields",{...e}),w(r,"records",[...t]),w(r,"make",(i,a)=>{const o=I7(e,{...i});return Rw(a)?o:ww(r)(o)}),r}function de(e,...t){return c2(e,t)}const dxe=e=>Us(e).pipe(Ep,td(()=>e)),hxe=(e,t)=>de({_tag:dxe(e),...t});function P7(e,t,n){var r;return r=class extends c2({},[{key:e,value:t}],n){static annotations(i){return P7(e,t,Qi(this.ast,i))}},w(r,"key",e),w(r,"value",t),r}const mxe=e=>P7(e.key,e.value);function $7(e,t){var n;return n=class extends Lt(t){static annotations(s){return $7(this.from,Qi(this.ast,s))}},w(n,"make",(s,i)=>Rw(i)?s:ww(n)(s)),w(n,"from",e),n}const Yh=(e,t)=>n=>{const r=Ft(Y9(n.ast),{onNone:()=>[e],onSome:i=>[...i,e]}),s=Kh(n.ast,Yu({[I9]:r,...t}));return $7(n,s)},Cm=(e,t,n)=>{if(MI(e)&&MI(t)){const r=[...e.propertySignatures];for(const s of t.propertySignatures){const i=s.name,a=r.findIndex(o=>o.name===i);if(a===-1)r.push(s);else{const{isOptional:o,type:l}=r[a];r[a]=new fr(i,v0(l,s.type,n.concat(i)),o,!0)}}return new Ll(r,e.indexSignatures.concat(t.indexSignatures))}throw new Error(j9(e,t,n))},pxe=Cbe([Ey]),Rm=(e,t)=>t.map(n=>new r2(n,e.filter,pxe(e))),v0=(e,t,n)=>ws.make(Qa([e],[t],n)),Ac=e=>bw(e)?e.types:[e],Qa=(e,t,n)=>Ex(e,r=>Ex(t,s=>{switch(s._tag){case"Literal":{if($s(s.literal)&&$C(r)||jo(s.literal)&&TI(r)||Ld(s.literal)&&AI(r))return[s];break}case"StringKeyword":{if(s===PC){if($C(r)||wp(r)&&$s(r.literal))return[r];if(wd(r))return Rm(r,Qa(Ac(r.from),[s],n))}else if(r===PC)return[s];break}case"NumberKeyword":{if(s===zC){if(TI(r)||wp(r)&&jo(r.literal))return[r];if(wd(r))return Rm(r,Qa(Ac(r.from),[s],n))}else if(r===zC)return[s];break}case"BooleanKeyword":{if(s===LC){if(AI(r)||wp(r)&&Ld(r.literal))return[r];if(wd(r))return Rm(r,Qa(Ac(r.from),[s],n))}else if(r===LC)return[s];break}case"Union":return Qa(Ac(r),s.types,n);case"Suspend":return[new bg(()=>v0(r,s.f(),n))];case"Refinement":return Rm(s,Qa(Ac(r),Ac(s.from),n));case"TypeLiteral":{switch(r._tag){case"Union":return Qa(r.types,[s],n);case"Suspend":return[new bg(()=>v0(r.f(),s,n))];case"Refinement":return Rm(r,Qa(Ac(r.from),[s],n));case"TypeLiteral":return[Cm(r,s,n)];case"Transformation":{const i=r.transformation,a=Cm(r.from,s,n),o=Cm(r.to,Rn(s),n);switch(i._tag){case"TypeLiteralTransformation":return[new Gc(a,o,new FC(i.propertySignatureTransformations))];case"ComposeTransformation":return[new Gc(a,o,i7)];case"FinalTransformation":return[new Gc(a,o,new s7((l,c,f,u)=>dr(i.decode(l,c,f,u),h=>({...l,...h})),(l,c,f,u)=>dr(i.encode(l,c,f,u),h=>({...l,...h}))))]}}}break}case"Transformation":{if(vbe(r)){if(jI(s.transformation)&&jI(r.transformation))return[new Gc(Cm(r.from,s.from,n),Cm(r.to,s.to,n),new FC(s.transformation.propertySignatureTransformations.concat(r.transformation.propertySignatureTransformations)))]}else return Qa([s],[r],n);break}}throw new Error(j9(r,s,n))})),z7=T(2,(e,t)=>Lt(v0(e.ast,t.ast,[]))),Yc=T(e=>Vi(e[1]),(e,t)=>u2(e,t,Nbe(e.ast,t.ast))),gxe=e=>Lt(new bg(()=>e().ast)),L7=Symbol.for("effect/SchemaId/Refine");function F7(e,t,n){var r,s,i;return i=class extends(s=Lt(n),r=L7,s){static annotations(o){return F7(this.from,this.filter,Qi(this.ast,o))}},w(i,r,e),w(i,"from",e),w(i,"filter",t),w(i,"make",(o,l)=>Rw(l)?o:ww(i)(o)),i}const BI=(e,t,n)=>{if(Ld(e))return e?re():ie(new hn(t,n));if($s(e))return ie(new hn(t,n,e));if(e!==void 0){if("_tag"in e)return ie(e);const r=new hn(t,n,e.message);return ie(gn(e.path)?new lr(e.path,n,r):r)}return re()},yxe=(e,t,n)=>{if(Eve(e))return BI(e,t,n);if(gn(e)){const r=ire(e,s=>BI(s,t,n));if(gn(r))return ie(r.length===1?r[0]:new cn(t,n,r))}return re()};function Cw(e,t){return n=>{function r(i,a,o){return yxe(e(i,a,o),o,i)}const s=new r2(n.ast,r,Yu(t));return F7(n,r,s)}}function u2(e,t,n){var r;return r=class extends Lt(n){static annotations(i){return u2(this.from,this.to,Qi(this.ast,i))}},w(r,"from",e),w(r,"to",t),r}const nc=T(e=>Vi(e[0])&&Vi(e[1]),(e,t,n)=>u2(e,t,new Gc(e.ast,t.ast,new s7(n.decode,n.encode)))),pc=T(e=>Vi(e[0])&&Vi(e[1]),(e,t,n)=>nc(e,t,{strict:!0,decode:(r,s,i,a)=>Tr(n.decode(r,a)),encode:(r,s,i,a)=>Tr(n.encode(r,a))})),HI=Symbol.for("effect/SchemaId/Pattern"),qI=(e,t)=>n=>{const r=e.source;return n.pipe(Cw(s=>(e.lastIndex=0,e.test(s)),{schemaId:HI,[HI]:{regex:e},description:`a string matching the pattern ${r}`,jsonSchema:{pattern:r},...t}))},VI=e=>e instanceof Error?e.message:String(e),vxe=e=>nc(M.annotations({description:"a string to be decoded into JSON"}),_w,{strict:!0,decode:(t,n,r)=>m0({try:()=>JSON.parse(t,e==null?void 0:e.reviver),catch:s=>new hn(r,t,VI(s))}),encode:(t,n,r)=>m0({try:()=>JSON.stringify(t,e==null?void 0:e.replacer,e==null?void 0:e.space),catch:s=>new hn(r,t,VI(s))})}).annotations({title:"parseJson",schemaId:Yve}),f2=(e,t)=>Vi(e)?Yc(f2(t),e):vxe(e),bxe=Ove,U7=(e,t)=>n=>n.pipe(Cw(r=>r>=e,{schemaId:bxe,title:`greaterThanOrEqualTo(${e})`,description:"a non-negative number",jsonSchema:{minimum:e},...t})),xxe=Mve,d2=(e,t,n)=>r=>r.pipe(Cw(s=>s>=e&&s<=t,{schemaId:xxe,title:`between(${e}, ${t})`,description:`a number between ${e} and ${t}`,jsonSchema:{minimum:e,maximum:t},...n}));function Sxe(e){return nc(e,ve,{strict:!1,decode:(t,n,r)=>Obe(Moe(t),()=>new hn(r,t,`Unable to decode ${JSON.stringify(t)} into a number`)),encode:t=>Tr(String(t))})}class ou extends Sxe(M.annotations({description:"a string to be decoded into a number"})).annotations({identifier:"NumberFromString"}){}const wxe=(e,t)=>{const n=Symbol.keyFor(e);return n===void 0?yo(new hn(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):Tr(n)},_xe=e=>Tr(Symbol.for(e)),B7=(e,t,n,r)=>Mbe(e,{onFailure:s=>new cn(n,r,s),onSuccess:t});class kxe extends Gh(lte,{typeConstructor:{_tag:"Uint8Array"},identifier:"Uint8ArrayFromSelf",pretty:()=>t=>`new Uint8Array(${JSON.stringify(Array.from(t))})`,arbitrary:()=>t=>t.uint8Array(),equivalence:()=>_S(Re)}){}const KI=Ave;class Eo extends Gh(P5,{typeConstructor:{_tag:"Date"},identifier:"DateFromSelf",schemaId:KI,[KI]:{noInvalidDate:!1},description:"a potentially invalid Date instance",pretty:()=>t=>`new Date(${JSON.stringify(t)})`,arbitrary:()=>t=>t.date({noInvalidDate:!1}),equivalence:()=>une}){}class Cb extends pc(M.annotations({description:"a string to be decoded into a Date"}),Eo,{strict:!0,decode:t=>new Date(t),encode:t=>B5(t)}).annotations({identifier:"DateFromString"}){}const Exe=e=>e._tag==="None"?re():ie(e.value),Cxe=(e,t)=>n=>n.oneof(t,n.record({_tag:n.constant("None")}),n.record({_tag:n.constant("Some"),value:e(n)})).map(Exe),Rxe=e=>Ft({onNone:()=>"none()",onSome:t=>`some(${e(t)})`}),GI=e=>(t,n,r)=>Cne(t)?Qt(t)?Tr(re()):B7(e(t.value,n),ie,r,t):yo(new hn(r,t)),YI=e=>Gh([e],{decode:t=>GI(i2(t)),encode:t=>GI(Sw(t))},{typeConstructor:{_tag:"effect/Option"},pretty:Rxe,arbitrary:Cxe,equivalence:jne}),Nxe=(e,t)=>n=>{const r=n.array(e(n));return(t.depthIdentifier!==void 0?n.oneof(t,n.constant([]),r):r).map(Do)},Txe=e=>t=>`Chunk(${Vr(t).map(e).join(", ")})`,WI=e=>(t,n,r)=>kS(t)?ES(t)?Tr(Vn()):B7(e(Vr(t),n),Do,r,t):yo(new hn(r,t)),Axe=e=>Gh([e],{decode:t=>WI(i2(Ie(t))),encode:t=>WI(Sw(Ie(t)))},{typeConstructor:{_tag:"effect/Chunk"},description:`Chunk<${Jbe(e)}>`,pretty:Txe,arbitrary:Nxe,equivalence:EU});function H7(e){return pc(Ie(e),Axe(Ri(e)),{strict:!0,decode:t=>t.length===0?Vn():Do(t),encode:t=>Vr(t)})}const Oxe=e=>Vi(e)||l2(e),q7=e=>Reflect.ownKeys(e).every(t=>Oxe(e[t])),h2=e=>"fields"in e?e.fields:h2(e[L7]),m2=e=>q7(e)?de(e):Vi(e)?e:de(h2(e)),p2=e=>q7(e)?e:h2(e),Ju=e=>(t,n)=>Cp({kind:"Class",identifier:e,schema:m2(t),fields:p2(t),Base:NA,annotations:n}),Mxe=e=>td(Ep(Us(e)),()=>e),V7=e=>(t,n,r)=>{class s extends TA{}s.prototype.name=t;const i=p2(n),a=m2(n),o={_tag:Mxe(t)},l=Rb(o,i),c="message"in l;class f extends Cp({kind:"TaggedError",identifier:t,schema:z7(a,de(o)),fields:l,Base:s,annotations:r,disableToString:!0}){}return w(f,"_tag",t),c||Object.defineProperty(f.prototype,"message",{get(){return`{ ${Reflect.ownKeys(i).map(u=>`${yS(u)}: ${Bo(this[u])}`).join(", ")} }`},enumerable:!1,configurable:!0}),f},Rb=(e,t)=>{const n={...e};for(const r of Reflect.ownKeys(t)){if(r in e)throw new Error(D9(r));n[r]=t[r]}return n};function Rw(e){return Ld(e)?e:(e==null?void 0:e.disableValidation)??!1}const JI=Fe("effect/Schema/astCache",()=>new WeakMap),jxe=e=>e===void 0?[]:Array.isArray(e)?e:[e],Cp=({Base:e,annotations:t,disableToString:n,fields:r,identifier:s,kind:i,schema:a})=>{var x,_;const o=Symbol.for(`effect/Schema/${i}/${s}`),[l,c,f]=jxe(t),u=Ri(a),h=u.annotations({identifier:s,...l}),m=u.annotations({[Sd]:`${s} (Type side)`,...l}),p=a.annotations({[Sd]:`${s} (Constructor)`,...l}),v=a.annotations({[Sd]:`${s} (Encoded side)`,...f}),S=a.annotations({...f,...l,...c}),y=C=>De(C,o)&&Pbe(m)(C),b=(_=class extends e{constructor(C={},E=!1){C={...C},i!=="Class"&&delete C._tag,C=I7(r,C),Rw(E)||(C=ww(p)(C)),super(C,!0)}static get ast(){let C=JI.get(this);if(C)return C;const E=Gh([a],{decode:()=>(k,A,I)=>k instanceof this||y(k)?Tr(k):yo(new hn(I,k)),encode:()=>(k,A)=>k instanceof this?Tr(k):dr(Sw(m)(k,A),I=>new this(I,!0))},{identifier:s,pretty:k=>A=>`${s}(${k(A)})`,arbitrary:k=>A=>k(A).map(I=>new this(I)),equivalence:Oe,[f0]:h.ast,...l});return C=pc(v,E,{strict:!0,decode:k=>new this(k,!0),encode:Oe}).annotations({[f0]:S.ast,...c}).ast,JI.set(this,C),C}static pipe(){return xe(this,arguments)}static annotations(C){return Lt(this.ast).annotations(C)}static toString(){return`(${String(v)} <-> ${s})`}static make(...C){return new this(...C)}static extend(C){return(E,k)=>{const A=p2(E),I=m2(E),R=Rb(r,A);return Cp({kind:i,identifier:C,schema:z7(a,I),fields:R,Base:this,annotations:k})}}static transformOrFail(C){return(E,k,A)=>{const I=Rb(r,E);return Cp({kind:i,identifier:C,schema:nc(a,Ri(de(I)),k),fields:I,Base:this,annotations:A})}}static transformOrFailFrom(C){return(E,k,A)=>{const I=Rb(r,E);return Cp({kind:i,identifier:C,schema:nc(Xbe(a),de(I),k),fields:I,Base:this,annotations:A})}}get[(x=rh,o)](){return o}},w(_,x,HC),w(_,"fields",{...r}),w(_,"identifier",s),_);return n!==!0&&Object.defineProperty(b.prototype,"toString",{value(){return`${s}({ ${Reflect.ownKeys(r).map(C=>`${yS(C)}: ${Bo(this[C])}`).join(", ")} })`},configurable:!0,writable:!0}),b},XI=hxe("symbol",{key:M}).annotations({description:"an object to be decoded into a globally shared symbol"}),Dxe=nc(XI,sxe,{strict:!0,decode:e=>_xe(e.key),encode:(e,t,n)=>dr(wxe(e,n),r=>XI.make({key:r}))});class Ixe extends Wu(M,ve,Dxe).annotations({identifier:"PropertyKey"}){}class Pxe extends de({_tag:Ep(Us("Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden")).annotations({description:"The tag identifying the type of parse issue"}),path:Ep(Ie(Ixe)).annotations({description:"The path to the property where the issue occurred"}),message:Ep(M).annotations({description:"A descriptive message explaining the issue"})}).annotations({identifier:"ArrayFormatterIssue",description:"Represents an issue returned by the ArrayFormatter formatter"}){}const K7=(e,t)=>{class n extends TA{constructor(){super(...arguments);w(this,"_tag",t)}}return n.prototype[e]=e,n.prototype.name=t,n},$xe=Li,zxe=qh,Lxe=c9,Fxe=qA,QI=VA,Uxe=Eye,G7=Symbol.for("effect/Subscribable"),Y7=e=>De(e,G7),Bxe="effect/SubscriptionRef",Hxe=Symbol.for(Bxe),qxe=T(2,(e,t)=>D(Bce(e.ref,t),LA(kge(e.pubsub,t)),e.semaphore.withPermits(1))),VC=Hxe,ZI=qxe,Vxe="~effect-atom/atom/Result",Nw={[Vxe]:{E:Oe,A:Oe},pipe(){return xe(this,arguments)},[Ke](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return Re(this.value,e.value);case"Failure":return Re(this.cause,e.cause)}},[Ve](){const e=Wt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?Ot(this,e):Ot(this,Ge(e)(this._tag==="Success"?be(this.value):be(this.cause)))}},W7=(e,t)=>e._tag==="Success"?Nu(e.value):Ry(e.cause,{previous:t}),g2=e=>e._tag==="None"?Ul(!0):Tw(e.value),KC=e=>e._tag==="Initial",Kxe=e=>e._tag!=="Initial",Ul=(e=!1)=>{const t=Object.create(Nw);return t._tag="Initial",t.waiting=e,t},fs=e=>e._tag==="Success",Nu=(e,t)=>{const n=Object.create(Nw);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},Jm=e=>e._tag==="Failure",Gxe=(e,t)=>{const n=Object.create(Nw);return n._tag="Failure",n.cause=e,n.previousSuccess=(t==null?void 0:t.previousSuccess)??re(),n.waiting=(t==null?void 0:t.waiting)??!1,n},Ry=(e,t)=>Gxe(e,{previousSuccess:Ho(t.previous,n=>fs(n)?ie(n):Jm(n)?n.previousSuccess:re()),waiting:t.waiting}),Yxe=(e,t)=>Ry(E8(e),t),Tw=(e,t)=>{if(e.waiting)return t!=null&&t.touch?Wxe(e):e;const n=Object.assign(Object.create(Nw),e);return n.waiting=!0,n},Wxe=e=>fs(e)?Nu(e.value,{waiting:e.waiting}):e,Xm=(e,t)=>e._tag==="Failure"?Ry(e.cause,{previous:t,waiting:e.waiting}):e,J7=e=>e._tag==="Success"?ie(e.value):e._tag==="Failure"?os(e.previousSuccess,t=>t.value):re(),GC=e=>mU(J7(e),()=>new Bh("Result.getOrThrow: no value found")),b0=e=>{switch(e._tag){case"Success":return Es(e.value);case"Failure":return Nr(e.cause);default:return Vx(new Bh)}},Co=e=>new Jxe(e);class Jxe{constructor(t){w(this,"result");w(this,"output",re());this.result=t}when(t,n){if(Qt(this.output)&&t(this.result)){const r=n(this.result);Bt(r)&&(this.output=r)}return this}pipe(){return xe(this,arguments)}onWaiting(t){return this.when(n=>n.waiting,n=>ie(t(n)))}onInitialOrWaiting(t){return this.when(n=>KC(n)||n.waiting,n=>ie(t(n)))}onInitial(t){return this.when(KC,n=>ie(t(n)))}onSuccess(t){return this.when(fs,n=>ie(t(n.value,n)))}onFailure(t){return this.when(Jm,n=>ie(t(n.cause,n)))}onError(t){return this.onErrorIf(NE,t)}onErrorIf(t,n){return this.when(Jm,r=>Jde(r.cause).pipe(Rf(t),os(s=>n(s,r))))}onErrorTag(t,n){return this.onErrorIf(r=>De(r,"_tag")&&(Array.isArray(t)?t.includes(r._tag):r._tag===t),n)}onDefect(t){return this.when(Jm,n=>Qde(n.cause).pipe(os(r=>t(r,n))))}orElse(t){return Kt(this.output,t)}orNull(){return Tne(this.output)}render(){if(Bt(this.output))return this.output.value;if(Jm(this.result))throw kA(this.result.cause);return null}}const Xxe={immediate:!0},Qxe=e=>{e()},z_="~effect-atom/atom/Registry",Zxe=e=>new e0e(e==null?void 0:e.initialValues,e==null?void 0:e.scheduleTask,e==null?void 0:e.timeoutResolution,e==null?void 0:e.defaultIdleTTL),YC="~effect-atom/atom/Atom/Serializable",Nm=e=>YC in e?e[YC].key:e;var VL,Wc;VL=z_;class e0e{constructor(t,n=i=>queueMicrotask(i),r,s){w(this,"scheduleTask");w(this,"defaultIdleTTL");w(this,VL);w(this,"timeoutResolution");w(this,"nodes",new Map);w(this,"preloadedSerializable",new Map);w(this,"timeoutBuckets",new Map);w(this,"nodeTimeoutBucket",new Map);w(this,"disposed",!1);w(this,"refresh",t=>{t.refresh!==void 0?t.refresh(this.refresh):this.invalidateAtom(t)});w(this,"invalidateAtom",t=>{this.ensureNode(t).invalidate()});h1(this,Wc,null);if(this.scheduleTask=n,this.defaultIdleTTL=s,this[z_]=z_,r===void 0&&s!==void 0?this.timeoutResolution=Math.round(s/2):this.timeoutResolution=r??1e3,t!==void 0)for(const[i,a]of t)this.ensureNode(i).setValue(a)}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),s=n(r.value());return t.write(r.writeContext,s[1]),s[0]}update(t,n){const r=this.ensureNode(t);t.write(r.writeContext,n(r.value()))}subscribe(t,n,r){const s=this.ensureNode(t);r!=null&&r.immediate&&n(s.value());const i=s.subscribe(function(){n(s._value)});return()=>{i(),s.canBeRemoved&&this.scheduleNodeRemoval(s)}}mount(t){return this.subscribe(t,zd,Xxe)}atomHasTtl(t){return!t.keepAlive&&t.idleTTL!==0&&(t.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(t){const n=Nm(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 s=this.preloadedSerializable.get(n);this.preloadedSerializable.delete(n);const i=t[YC].decode(s);r.setValue(i)}return r}createNode(t){if(this.disposed)throw new Error(`Cannot access Atom ${t}: registry is disposed`);return t.keepAlive||this.scheduleAtomRemoval(t),new t0e(this,t)}scheduleAtomRemoval(t){this.scheduleTask(()=>{const n=this.nodes.get(Nm(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(Nm(t.atom)),t.remove())}setNodeTimeout(t){if(this.nodeTimeoutBucket.has(t))return;let n=t.atom.idleTTL??this.defaultIdleTTL;if(Zy(this,Wc)!==null&&(n-=Zy(this,Wc),n<=0)){this.nodes.delete(Nm(t.atom)),t.remove();return}const r=Math.ceil(n/this.timeoutResolution)*this.timeoutResolution,s=Date.now()+r,i=s-s%this.timeoutResolution+this.timeoutResolution;let a=this.timeoutBuckets.get(i);a===void 0&&(a=[new Set,setTimeout(()=>this.sweepBucket(i),i-Date.now())],this.timeoutBuckets.set(i,a)),a[0].add(t),this.nodeTimeoutBucket.set(t,i)}removeNodeTimeout(t){const n=this.nodeTimeoutBucket.get(t);if(n===void 0)return;this.nodeTimeoutBucket.delete(t),this.scheduleNodeRemoval(t);const[r,s]=this.timeoutBuckets.get(n);r.delete(t),r.size===0&&(clearTimeout(s),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(Nm(r.atom)),ev(this,Wc,r.atom.idleTTL??this.defaultIdleTTL),r.remove(),ev(this,Wc,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()}}Wc=new WeakMap;var nd;(function(e){e[e.alive=1]="alive",e[e.initialized=2]="initialized",e[e.waitingForValue=4]="waitingForValue"})(nd||(nd={}));var Oi;(function(e){e[e.uninitialized=5]="uninitialized",e[e.stale=7]="stale",e[e.valid=3]="valid",e[e.removed=0]="removed"})(Oi||(Oi={}));let t0e=class{constructor(t,n){w(this,"registry");w(this,"atom");w(this,"state",Oi.uninitialized);w(this,"lifetime");w(this,"writeContext");w(this,"parents",[]);w(this,"previousParents");w(this,"children",[]);w(this,"listeners",new Set);w(this,"skipInvalidation",!1);w(this,"_value");this.registry=t,this.atom=n,this.writeContext=new i0e(t,this)}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}value(){if(this.state&nd.waitingForValue){this.lifetime=s0e(this);const t=this.atom.read(this.lifetime);if(this.state&nd.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&nd.initialized?ie(this._value):re()}setValue(t){if(!(this.state&nd.initialized)){this.state=Oi.valid,this._value=t,Cn.phase===pa.collect?Cn.notify.add(this):this.notify();return}this.state=Oi.valid,!Re(this._value,t)&&(this._value=t,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(Cn.phase===pa.collect?Cn.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===Oi.valid&&(this.state=Oi.stale,this.disposeLifetime()),Cn.phase===pa.collect?Cn.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!n0e(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(Qxe),Cn.phase===pa.commit&&Cn.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=Oi.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 n0e(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let s=0,i=t.length;s<i;s++){const a=t[s];if(!a.atom.lazy||a.listeners.size>0)return!0;a.children.length>0&&(n===void 0?n=[a.children]:n.push(a.children))}t=n==null?void 0:n[r++]}return!1}const cr=e=>new Error(`Cannot use context of disposed Atom: ${e}`),r0e={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)throw cr(this.node.atom);this.finalizers??(this.finalizers=[]),this.finalizers.push(e)},get(e){if(this.disposed)throw cr(this.node.atom);const t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed)throw cr(this.node.atom);if(this.isFn)return this.resultOnce(e,t);const n=this.get(e);if(t!=null&&t.suspendOnWaiting&&n.waiting)return v_;switch(n._tag){case"Initial":return v_;case"Failure":return Nr(n.cause);case"Success":return Jt(n.value)}},resultOnce(e,t){if(this.disposed)throw cr(this.node.atom);return n0(n=>{const r=this.once(e);if(r._tag!=="Initial"&&!(t!=null&&t.suspendOnWaiting&&r.waiting))return n(b0(r));const s=this.node.registry.subscribe(e,i=>{i._tag==="Initial"||t!=null&&t.suspendOnWaiting&&i.waiting||(s(),n(b0(i)))},{immediate:!1});return Pt(s)})},setResult(e,t){if(this.disposed)throw cr(this.node.atom);return this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0})},some(e){if(this.disposed)throw cr(this.node.atom);if(this.isFn)return this.someOnce(e);const t=this.get(e);return t._tag==="None"?v_:Jt(t.value)},someOnce(e){if(this.disposed)throw cr(this.node.atom);return n0(t=>{const n=this.once(e);if(Bt(n))return t(Jt(n.value));const r=this.node.registry.subscribe(e,s=>{Qt(s)||(r(),t(Jt(s.value)))},{immediate:!1});return Pt(r)})},once(e){if(this.disposed)throw cr(this.node.atom);return this.node.registry.get(e)},self(){if(this.disposed)throw cr(this.node.atom);return this.node.valueOption()},refresh(e){if(this.disposed)throw cr(this.node.atom);this.node.registry.refresh(e)},refreshSelf(){if(this.disposed)throw cr(this.node.atom);this.node.invalidate()},mount(e){if(this.disposed)throw cr(this.node.atom);this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){if(this.disposed)throw cr(this.node.atom);this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){if(this.disposed)throw cr(this.node.atom);this.node.setValue(e)},set(e,t){if(this.disposed)throw cr(this.node.atom);this.node.registry.set(e,t)},stream(e,t){if(this.disposed)throw cr(this.node.atom);return D(i0(wH((t==null?void 0:t.bufferSize)??16),c0),uH(n=>i0(Pt(()=>this.node.registry.subscribe(e,r=>{Nge(n,r)},{immediate:(t==null?void 0:t.withoutInitialValue)!==!0})),r=>Pt(r))),Et(n=>hve(n)),E9)},streamResult(e,t){return D(this.stream(e,t),fve(Kxe),dve(n=>n._tag==="Success"?gve(n.value):uve(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]()}},s0e=e=>{function t(n){if(t.disposed)throw cr(n);if(t.isFn)return e.registry.get(n);const r=e.registry.ensureNode(n),s=r.value();return e.addParent(r),s}return Object.setPrototypeOf(t,r0e),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t};class i0e{constructor(t,n){w(this,"registry");w(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 pa;(function(e){e[e.disabled=0]="disabled",e[e.collect=1]="collect",e[e.commit=2]="commit"})(pa||(pa={}));const Cn=Fe("@effect-atom/atom/Registry/batchState",()=>({phase:pa.disabled,depth:0,stale:[],notify:new Set}));function a0e(e){Cn.phase=pa.collect,Cn.depth++;try{if(e(),Cn.depth===1){for(let t=0;t<Cn.stale.length;t++)X7(Cn.stale[t]);Cn.phase=pa.commit;for(const t of Cn.notify)t.notify();Cn.notify.clear()}}finally{Cn.depth--,Cn.depth===0&&(Cn.phase=pa.disabled,Cn.stale=[])}}function X7(e){if(e.state!==Oi.valid){for(let t=0;t<e.parents.length;t++){const n=e.parents[t];n.state!==Oi.valid&&X7(n)}e.state!==Oi.valid&&e.value()}}const o0e=e=>{const t=e;switch(t._tag){case"Failure":case"Success":return t;case"Left":return Vx(t.left);case"Right":return Es(t.right);case"Some":return Es(t.value);case"None":return Vx(new Bh)}},y2=e=>{const t=fw(e);return(n,r,s=!1)=>{const i=o0e(n);if(i){r(i);return}const a=new uA,o=t(n,{scheduler:a});a.flush();const l=o.unsafePoll();if(l){r(l);return}o.addObserver(r);function c(){o.removeObserver(r),s||o.unsafeInterruptAsFork(Os)}return c}},l0e="~effect-atom/atom/Registry",c0e=e=>De(e,l0e),u0e=Zxe;class Q7 extends uT("@effect/atom/Registry/CurrentRegistry")(){}const f0e=T(e=>c0e(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.suspendOnWaiting)??!1;return n0(s=>{const i=e.get(t);if(i._tag!=="Initial"&&!(r&&i.waiting))return s(b0(i));const a=e.subscribe(t,o=>{o._tag!=="Initial"&&!(r&&o.waiting)&&(s(b0(o)),a())});return Pt(a)})}),WC="~effect-atom/atom/Atom",JC="~effect-atom/atom/Atom/Writable",Z7=T(2,(e,t)=>{const n=mi(t),r=XU(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Ax(n):void 0})}),Sg=Z7(0),v2={[WC]:WC,pipe(){return xe(this,arguments)},toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}},toString(){return zt(this)},[pt](){return this.toJSON()}},d0e={...v2,atom(e,t){const n=eq(e,t);return ga(r=>{const s=r.self(),i=r(this);return i._tag!=="Success"?Xm(i,s):n(r,i.value)})},fn(e,t){return arguments.length===0?(n,r)=>eP(this,n,r):eP(this,e,t)},pull(e,t){const n=Sg(x0(0)),r=ga(s=>{const i=s.self(),a=s(this);return a._tag!=="Success"?Xm(a,i):Rp(s,_0e(s,n,e,t),Ul(!0),a.value)});return k0e(n,r)},subscriptionRef(e){return v0e(Sg(ga(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Xm(r,n);const s=typeof e=="function"?e(t):e;return VC in s?s:Rp(t,s,Ul(!0),r.value)})),(t,n)=>{const r=GC(t(this));return rP(t,n,r)})},subscribable(e){return b0e(ga(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Xm(r,n);const s=typeof e=="function"?e(t):e;return Y7(s)?s:Rp(t,s,Ul(!0),r.value)}),(t,n)=>{const r=GC(t(this));return rP(t,n,r)})}},eP=(e,t,n)=>{const[r,s,i]=S0e(n!=null&&n.reactivityKeys?(a,o)=>{const l=t(a,o);return hc(l)?C9(l,n.reactivityKeys):_9(l,xve(n.reactivityKeys))}:t,n);return Ny(a=>{a.get(i);const o=a.self(),l=a.get(e);return l._tag!=="Success"?Xm(l,o):r(a,l.value)},s)},h0e={...v2,[JC]:JC},m0e=e=>JC in e,ga=(e,t)=>{const n=Object.create(v2);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},Ny=(e,t,n)=>{const r=Object.create(h0e);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function p0e(e,t){e.setSelf(t)}const Aw=(e,t)=>{const n=eq(e,t);return WC in n?n:ga(n)},tP=e=>Ene in e||gne in e,eq=(e,t)=>{if(typeof e=="function"&&!hc(e)&&!(T_ in e)){const n=e;return function(r,s){const i=n(r);if(Ui(i)){if(tP(i))return i;if(kC in i)return XC(r,i,t,s);if(T_ in i)return nP(r,i,t,s)}return i}}else if(Ui(e)){if(tP(e))return x0(e);if(kC in e)return function(n,r){return XC(n,e,t,r)};if(T_ in e)return function(n,r){return nP(n,e,t,r)}}return x0(e)},x0=e=>Ny(function(t){return e},p0e),XC=(e,t,n,r)=>{const s=(n==null?void 0:n.initialValue)!==void 0?Nu(n.initialValue):Ul();return Rp(e,t,s,r,n==null?void 0:n.uninterruptible)};function Rp(e,t,n,r=dw,s=!1){const i=e.self(),a=ui(j8());e.addFinalizer(()=>{zA(t0(a,hA))});const o=new Map(r.context.unsafeMap);o.set(Ahe.key,a),o.set(Q7.key,e.registry);const l=FA({context:sne(o),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags});let c,f=!1;const u=y2(l)(t,function(h){c=W7(h,i),f&&e.setSelf(c)},s);return f=!0,u!==void 0&&e.addFinalizer(u),c!==void 0?c:i._tag==="Some"?g2(i):Tw(n)}const g0e=e=>{let t=A_;function n(s){const i=Object.create(d0e);i.keepAlive=!1,i.lazy=!0,i.refresh=void 0,i.factory=n;const a=Ty(ga(typeof s=="function"?o=>S_(s(o),t):()=>S_(s,t)));return i.layer=a,i.read=function(l){const c=l(a),f=je(je(cw,u=>uI(c,e.memoMap,u)),u=>a0(xy(),u));return XC(l,f,{uninterruptible:!0})},i}n.memoMap=e.memoMap,n.addGlobalLayer=s=>{t=S_(t,pH(s,A_))};const r=Sg(Aw(wpe(s=>uI(A_,e.memoMap,s)).pipe(Et(_o(ky)))));return n.withReactivity=s=>i=>E0e(i,a=>{const o=GC(a(r));return a.addFinalizer(o.unsafeRegister(s,()=>{a.refresh(i)})),a.subscribe(i,l=>a.setSelf(l)),a.once(i)}),n},y0e=Fe("@effect-atom/atom/Atom/defaultMemoMap",()=>ui(Gpe)),b2=Fe("@effect-atom/atom/Atom/defaultContext",()=>g0e({memoMap:y0e}));b2.withReactivity;const nP=(e,t,n,r)=>{const s=(n==null?void 0:n.initialValue)!==void 0?Nu(n.initialValue):Ul();return x2(e,t,s,r)};function x2(e,t,n,r=dw){const s=e.self(),i=zxe({onInput(l){return Fxe(()=>{const c=mre(l);return c._tag==="Some"&&e.setSelf(Nu(c.value,{waiting:!0})),i})},onFailure(l){return QI(()=>{e.setSelf(Ry(l,{previous:e.self()}))})},onDone(l){return QI(()=>{D(e.self(),Ho(J7),Ft({onNone:()=>e.setSelf(Yxe(new Bh,{previous:e.self()})),onSome:c=>e.setSelf(Nu(c))}))})}}),a=FA({context:ii(r.context,Q7,e.registry),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags}),o=y2(a)(Lxe($xe(k9(t),i)),zd,!1);return o!==void 0&&e.addFinalizer(o),s._tag==="Some"?g2(s):Tw(n)}const rP=(e,t,n=dw)=>G7 in t?(e.addFinalizer(t.changes.pipe(pve(r=>(e.setSelf(r),ht)),$pe(n))),Ppe(n)(t.get)):t._tag!=="Success"?t:x2(e,t.value.changes,Ul(!0),n),v0e=(e,t)=>{function n(r,s){const i=r.get(e);VC in i?ui(ZI(i,s)):fs(i)&&ui(ZI(i.value,s))}return Ny(r=>{const s=r(e);return VC in s||fs(s)?t(r,s):s},n)},b0e=(e,t)=>ga(n=>{const r=n(e);return Y7(r)||fs(r)?t(n,r):r}),x0e=Symbol.for("@effect-atom/atom/Atom/Reset"),L_=Symbol.for("@effect-atom/atom/Atom/Interrupt");function S0e(e,t){const n=Sg(x0([0,void 0])),r=(t==null?void 0:t.initialValue)!==void 0?Nu(t.initialValue):Ul(),s=t!=null&&t.concurrent?Sg(ga(o=>{const l=new Set;return o.addFinalizer(()=>l.forEach(c=>c.unsafeInterruptAsFork(Os))),l})):void 0;function i(o,l){const c=s?o(s):void 0;o.isFn=!0;const[f,u]=o.get(n);if(f===0)return r;if(u===L_)return Ry(C8(Os),{previous:o.self()});let h=e(u,o);if(kC in h){if(c){const m=h;h=je(xy(),p=>{const v=fw(p,m);c.add(v);const S=Array.from(c);return v.addObserver(()=>c.delete(v)),w0e(S)})}return Rp(o,h,r,l,!1)}return x2(o,h,r,l)}function a(o,l){C0e(()=>{l===x0e?o.set(n,[0,void 0]):l===L_?o.set(n,[o.get(n)[0]+1,L_]):o.set(n,[o.get(n)[0]+1,l]),o.refreshSelf()})}return[i,a,n]}const w0e=e=>n0(t=>{let n=0,r,s;function i(o,l=!1){o._tag==="Failure"?r=r?Vde(o.cause,r):o.cause:r||(s=o),n++,l||a()}function a(){for(;n<e.length;){const o=e[n],l=o.unsafePoll();if(!l)return o.addObserver(i);i(l,!0)}t(r?Nr(r):s||Nr(qde))}return a(),Pt(()=>{n<e.length&&e[n].removeObserver(i)})}),_0e=(e,t,n,r)=>je(Uxe(k9(typeof n=="function"?n(e):n)),s=>{const i=Tpe(1),a=One(Jhe()),o=a.currentContext;let l=Vn();const c=je(Rpe(vn(()=>s),gH,o),as({onLeft:()=>{const m=Vr(l);return dd(m)?Jt({done:!0,items:m}):Pa(new Bh("Atom.pull: no items"))},onRight(m){let p;r!=null&&r.disableAccumulation?p=m:(p=On(l,m),l=p);const v=Vr(p);return dd(v)?Jt({done:!1,items:v}):c}})),f=i.withPermits(1)(c),u=y2(FA({context:o,fiberRefs:a.getFiberRefs(),runtimeFlags:dw.runtimeFlags})),h=new Set;return e.addFinalizer(()=>{for(const m of h)m()}),e.once(t),e.subscribe(t,()=>{e.setSelf(g2(e.self()));let m;m=u(f,p=>{m&&h.delete(m);const v=W7(p,e.self()),S=h.size>0;e.setSelf(S?Tw(v):v)}),m&&h.add(m)}),c}),k0e=(e,t)=>Ny(t.read,function(n,r){n.set(e,n.get(e)+1)}),sP=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const t=uC();return function(n){const r=so(t,n);if(r._tag==="Some")return r.value;const s=e(n);return Fc(t,n,s),s}}:e=>{const t=uC(),n=new FinalizationRegistry(r=>{yfe(t,r)});return function(r){const s=so(t,r).pipe(pU(a=>a.deref()));if(s._tag==="Some")return s.value;const i=e(r);return Fc(t,r,new WeakRef(i)),n.register(i,r),i}},Ty=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),E0e=T(2,(e,t)=>m0e(e)?Ny(t,function(n,r){n.set(e,r)},e.refresh??function(n){n(e)}):ga(t,e.refresh??function(n){n(e)})),C0e=a0e,iP="~effect-atom/atom/Atom/ServerValue",R0e=T(2,(e,t)=>iP in e?e[iP](n=>t.get(n)):t.get(e)),Nb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipart"),Tb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipartStream"),Np=Symbol.for("@effect/platform/HttpApiSchema/AnnotationStatus"),Ab=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEmptyDecodeable"),Ob=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEncoding"),Mb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationParam"),tq=e=>{const t={};return Np in e&&(t[Np]=e[Np]),Ab in e&&(t[Ab]=e[Ab]),Ob in e&&(t[Ob]=e[Ob]),Mb in e&&(t[Mb]=e[Mb]),Nb in e&&(t[Nb]=e[Nb]),Tb in e&&(t[Tb]=e[Tb]),t},N0e=e=>e._tag==="Transformation"?{...e.to.annotations,...e.annotations}:e.annotations,Ay=(e,t)=>N0e(e)[t],nq=(e,t)=>Ay(e,Np)??t,T0e=e=>Ay(e,Ab)??!1,A0e=e=>Ay(e,Nb),O0e=e=>Ay(e,Tb),M0e={kind:"Json",contentType:"application/json"},Ow=(e,t=M0e)=>Ay(e,Ob)??t,j0e=e=>{var n;return(n=(e._tag==="PropertySignatureTransformation"?e.to.annotations:e.annotations)[Mb])==null?void 0:n.name},ih=e=>{const t=C7(e,"status");return e.status!==void 0&&(t[Np]=e.status),t},QC=e=>{switch(e._tag){case"VoidKeyword":return!0;case"Transformation":return QC(e.from);case"Suspend":return QC(e.f());default:return!1}},D0e=e=>nq(e,QC(e)?204:200),F_=e=>nq(e,500),ZC=e=>{function t(r){if(bw(r))for(const s of r.types)t(s);else n.push(r)}const n=[];return t(e),n},rq=(e,t)=>ws.make(Array.from(new Set([...ZC(e),...ZC(t)]))),Bl=(e,t)=>Lt(rq(e.ast,t.ast)),I0e=e=>rxe.annotations(ih({status:e})),eR=I0e(204);class P0e extends Pxe.annotations({identifier:"Issue",description:"Represents an error encountered while parsing a value to match the schema"}){}class S0 extends V7()("HttpApiDecodeError",{issues:Ie(P0e),message:M},ih({status:400,description:"The request did not match the expected schema"})){static fromParseError(t){return Eb.formatError(t).pipe(o0(kp.formatError(t)),Et(([n,r])=>new S0({issues:n,message:r})))}static refailParseError(t){return je(S0.fromParseError(t),Pa)}}const aP=Symbol.for("@effect/platform/HttpApi"),$0e={[aP]:aP,pipe(){return xe(this,arguments)},add(e){return nl({identifier:this.identifier,groups:Une(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(Ea());r.annotations=us(e.annotations,r.annotations),r.middlewares=new Set([...e.middlewares,...r.middlewares]),t[n]=r}return nl({identifier:this.identifier,groups:t,errorSchema:Bl(this.errorSchema,e.errorSchema),annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return nl({identifier:this.identifier,groups:this.groups,errorSchema:Bl(this.errorSchema,t!=null&&t.status?e.annotations(ih({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return nl({identifier:this.identifier,groups:Jf(this.groups,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return nl({identifier:this.identifier,groups:this.groups,errorSchema:Bl(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return nl({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:ii(this.annotations,e,t),middlewares:this.middlewares})},annotateContext(e){return nl({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:us(this.annotations,e),middlewares:this.middlewares})}},nl=e=>{function t(){}return Object.setPrototypeOf(t,$0e),t.groups=e.groups,t.errorSchema=e.errorSchema,t.annotations=e.annotations,t.middlewares=e.middlewares,t},z0e=e=>nl({groups:new Map,errorSchema:S0,annotations:Ea(),middlewares:new Set}),L0e=(e,t)=>{const n=Ov(e.errorSchema.ast,new Map,F_),r=Object.values(e.groups);for(const s of r){const i=Ov(s.errorSchema.ast,n,F_),a=us(e.annotations,s.annotations);t.onGroup({group:s,mergedAnnotations:a});const o=Object.values(s.endpoints);for(const l of o){if(t.predicate&&!t.predicate({endpoint:l,group:s}))continue;const c=Ov(l.errorSchema.ast,i,F_);t.onEndpoint({group:s,endpoint:l,middleware:new Set([...s.middlewares,...l.middlewares]),mergedAnnotations:us(a,l.annotations),payloads:l.payloadSchema._tag==="Some"?U0e(l.payloadSchema.value.ast):F0e,successes:Ov(l.successSchema.ast,new Map,D0e),errors:c})}}},F0e=new Map,Ov=(e,t,n)=>{const r=new Map(t);function s(i){if(nbe(i))return;const a=tq(e.annotations);Fne(a)||(i=Kh(i,{...a,...i.annotations}));const o=n(i),l=T0e(i),c=r.get(o);r.set(o,{description:(c?c.description:re()).pipe($i(()=>B0e(i))),ast:(c?c.ast:re()).pipe(os(f=>rq(f,i)),$i(()=>!l&&ebe(h0(i))?re():ie(i)))})}return ZC(e).forEach(s),r},U0e=e=>{const t=new Map;function n(r){if(r._tag==="NeverKeyword")return;r=Kh(r,{...tq(e.annotations),...r.annotations});const s=Ow(r),i=A0e(r)||O0e(r)?"multipart/form-data":s.contentType,a=t.get(i);a===void 0?t.set(i,{encoding:s,ast:r}):a.ast=ws.make([a.ast,r])}if(e._tag==="Union")for(const r of e.types)n(r);else n(e);return t},B0e=e=>{const t="to"in e?{...e.to.annotations,...e.annotations}:e.annotations;return Ah(t[Ku]??t[Ey])},Xu=e=>{const t=sq(e),n=[];for(let r=0;r<t.length;r++)if(Array.isArray(t[r][0])){const[s,i]=t[r];n.push([`${s[0]}[${s.slice(1).join("][")}]`,i])}else n.push(t[r]);return n},sq=e=>{const t=Symbol.iterator in e?kt(e):Object.entries(e),n=[];for(const[r,s]of t)if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]!==void 0&&n.push([r,String(s[i])]);else if(typeof s=="object"){const i=sq(s);for(const[a,o]of i)n.push([[r,...typeof a=="string"?[a]:a],o])}else s!==void 0&&n.push([r,String(s)]);return n},iq=Ie(oxe(M,M)).annotations({identifier:"UrlParams"}),H0e=[],q0e=T(2,(e,t)=>{const n=Xu(t),r=new Set;for(let s=0;s<n.length;s++)r.add(n[s][0]);for(let s=0;s<e.length;s++)r.has(e[s][0])||n.push(e[s]);return n}),V0e=T(2,(e,t)=>mT(e,Xu(t))),K0e=(e,t,n)=>{try{const r=new URL(e,G0e());for(let s=0;s<t.length;s++){const[i,a]=t[s];a!==void 0&&r.searchParams.append(i,a)}return n._tag==="Some"&&(r.hash=n.value),ze(r)}catch(r){return Le(r)}},aq=e=>new URLSearchParams(e).toString(),G0e=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Y0e=e=>{const t=Object.create(null);for(const[n,r]of e){const s=t[n];s===void 0?t[n]=r:typeof s=="string"?t[n]=[s,r]:s.push(r)}return{...t}},W0e=pc(M,iq,{decode(e){return Xu(new URLSearchParams(e))},encode(e){return aq(e)}}),J0e=e=>pc(iq,e,{decode(t){return Y0e(t)},encode(t){return Xu(t)}}),X0e=e=>Yc(W0e,J0e(e)),jb=Symbol.for("@effect/platform/HttpBody");var KL;class S2{constructor(){w(this,KL);this[jb]=jb}[(KL=jb,pt)](){return this.toJSON()}toString(){return zt(this)}}class Q0e extends S2{constructor(){super(...arguments);w(this,"_tag","Empty")}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Empty"}}}const Z0e=new Q0e;class eSe extends S2{constructor(n,r){super();w(this,"body");w(this,"contentType");w(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 oq=(e,t)=>new eSe(e,t??"application/octet-stream"),tSe=new TextEncoder,lq=(e,t)=>oq(tSe.encode(e),t??"text/plain"),nSe=(e,t)=>lq(aq(e),t??"application/x-www-form-urlencoded");class rSe extends S2{constructor(n){super();w(this,"formData");w(this,"_tag","FormData");this.formData=n}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"FormData",formData:this.formData}}}const sSe=e=>new rSe(e),iSe=jb,aSe=e=>De(e,iSe),oSe=oq,oP=lq,lSe=nSe,lP=Symbol.for("@effect/platform/Cookies"),cP=Symbol.for("@effect/platform/Cookies/Cookie"),cSe={[lP]:lP,...vS,toJSON(){return{_id:"@effect/platform/Cookies",cookies:Jf(this.cookies,e=>e.toJSON())}},pipe(){return xe(this,arguments)}},uSe=e=>{const t=Object.create(cSe);return t.cookies=e,t},fSe=e=>{const t={};for(const n of e)t[n.name]=n;return uSe(t)},dSe=e=>{const t=typeof e=="string"?[e]:e,n=[];for(const r of t){const s=hSe(r.trim());Bt(s)&&n.push(s.value)}return fSe(n)};function hSe(e){const t=e.split(";").map(o=>o.trim()).filter(o=>o!=="");if(t.length===0)return re();const n=t[0].indexOf("=");if(n===-1)return re();const r=t[0].slice(0,n);if(!mSe.test(r))return re();const s=t[0].slice(n+1),i=pSe(s);if(t.length===1)return ie(Object.assign(Object.create(uP),{name:r,value:i,valueEncoded:s}));const a={};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 h=u.trim().replace(/^\./,"");h&&(a.domain=h);break}case"expires":{if(u===void 0)break;const h=new Date(u);isNaN(h.getTime())||(a.expires=h);break}case"max-age":{if(u===void 0)break;const h=parseInt(u,10);isNaN(h)||(a.maxAge=QU(h));break}case"path":{if(u===void 0)break;u[0]==="/"&&(a.path=u);break}case"priority":{if(u===void 0)break;switch(u.toLowerCase()){case"low":a.priority="low";break;case"medium":a.priority="medium";break;case"high":a.priority="high";break}break}case"httponly":{a.httpOnly=!0;break}case"secure":{a.secure=!0;break}case"partitioned":{a.partitioned=!0;break}case"samesite":{if(u===void 0)break;switch(u.toLowerCase()){case"lax":a.sameSite="lax";break;case"strict":a.sameSite="strict";break;case"none":a.sameSite="none";break}break}}}return ie(Object.assign(Object.create(uP),{name:r,value:i,valueEncoded:s,options:Object.keys(a).length>0?a:void 0}))}const mSe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,uP={[cP]:cP,...vS,toJSON(){return{_id:"@effect/platform/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}},pSe=e=>{try{return decodeURIComponent(e)}catch{return e}},fP=Symbol.for("@effect/platform/Headers"),wg=Object.assign(Object.create(null),{[fP]:fP,[bS](e){return nR(this,yB(e,uq))}}),Mw=e=>Object.assign(Object.create(wg),e),cq=Object.create(wg),w2=e=>{if(e===void 0)return cq;if(Symbol.iterator in e){const n=Object.create(wg);for(const[r,s]of e)n[r.toLowerCase()]=s;return n}const t=Object.create(wg);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},gSe=e=>Object.setPrototypeOf(e,wg),tR=T(3,(e,t,n)=>{const r=Mw(e);return r[t.toLowerCase()]=n,r}),ySe=T(2,(e,t)=>Mw({...e,...w2(t)})),vSe=T(2,(e,t)=>{const n=Mw(e);return Object.assign(n,t),n}),bSe=T(2,(e,t)=>{const n=Mw(e),r=s=>{if(typeof s=="string"){const i=s.toLowerCase();i in e&&delete n[i]}else for(const i in e)s.test(i)&&delete n[i]};if(Array.isArray(t))for(let s=0;s<t.length;s++)r(t[s]);else r(t);return n}),nR=T(2,(e,t)=>{const n={...e},r=s=>{if(typeof s=="string"){const i=s.toLowerCase();i in e&&(n[i]=LI(e[i]))}else for(const i in e)s.test(i)&&(n[i]=LI(e[i]))};if(Array.isArray(t))for(let s=0;s<t.length;s++)r(t[s]);else r(t);return n}),uq=Fe("@effect/platform/Headers/currentRedactedNames",()=>UA(["authorization","cookie","set-cookie","x-api-key"])),xSe=Symbol.for("@effect/platform/HttpClientError"),fq=xSe;class dq extends K7(fq,"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 eo extends K7(fq,"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 Tp=Symbol.for("@effect/platform/HttpIncomingMessage"),SSe=(e,t)=>{const n=e.headers["content-type"]??"";let r;if(n.includes("application/json"))try{r=ui(e.json)}catch{}else if(n.includes("text/")||n.includes("urlencoded"))try{r=ui(e.text)}catch{}const s={...t,headers:nT(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(s.body=r),s},wSe=e=>gSe({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"}`}),dP=Symbol.for("@effect/platform/HttpClientRequest"),_Se={[dP]:dP,...vS,toJSON(){return{_id:"@effect/platform/HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:nT(this.headers),body:this.body.toJSON()}},pipe(){return xe(this,arguments)}};function Ki(e,t,n,r,s,i){const a=Object.create(_Se);return a.method=e,a.url=t,a.urlParams=n,a.hash=r,a.headers=s,a.body=i,a}const kSe=Ki("GET","",H0e,re(),cq,Z0e),gc=e=>(t,n)=>MSe(kSe,{method:e,url:t,...n??void 0}),ESe=gc("GET"),CSe=gc("POST"),RSe=gc("PUT"),NSe=gc("PATCH"),TSe=gc("DELETE"),ASe=gc("HEAD"),OSe=gc("OPTIONS"),MSe=T(2,(e,t)=>{let n=e;return t.method&&(n=ISe(n,t.method)),t.url&&(n=mq(n,t.url)),t.headers&&(n=_2(n,t.headers)),t.urlParams&&(n=pq(n,t.urlParams)),t.hash&&(n=zSe(n,t.hash)),t.body&&(n=k2(n,t.body)),t.accept&&(n=hq(n,t.accept)),t.acceptJson&&(n=DSe(n)),n}),jSe=T(3,(e,t,n)=>Ki(e.method,e.url,e.urlParams,e.hash,tR(e.headers,t,n),e.body)),_2=T(2,(e,t)=>Ki(e.method,e.url,e.urlParams,e.hash,ySe(e.headers,t),e.body)),hq=T(2,(e,t)=>jSe(e,"Accept",t)),DSe=hq("application/json"),ISe=T(2,(e,t)=>Ki(t,e.url,e.urlParams,e.hash,e.headers,e.body)),mq=T(2,(e,t)=>{if(typeof t=="string")return Ki(e.method,t,e.urlParams,e.hash,e.headers,e.body);const n=new URL(t.toString()),r=Xu(n.searchParams),s=n.hash?ie(n.hash.slice(1)):re();return n.search="",n.hash="",Ki(e.method,n.toString(),r,s,e.headers,e.body)}),PSe=T(2,(e,t)=>Ki(e.method,t.endsWith("/")&&e.url.startsWith("/")?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),$Se=T(2,(e,t)=>Ki(e.method,e.url,V0e(e.urlParams,t),e.hash,e.headers,e.body)),pq=T(2,(e,t)=>Ki(e.method,e.url,q0e(e.urlParams,t),e.hash,e.headers,e.body)),zSe=T(2,(e,t)=>Ki(e.method,e.url,e.urlParams,ie(t),e.headers,e.body)),k2=T(2,(e,t)=>{let n=e.headers;if(t._tag==="Empty"||t._tag==="FormData")n=bSe(n,["Content-type","Content-length"]);else{const r=t.contentType;r&&(n=tR(n,"content-type",r));const s=t.contentLength;s&&(n=tR(n,"content-length",s.toString()))}return Ki(e.method,e.url,e.urlParams,e.hash,n,t)}),LSe=T(2,(e,t)=>k2(e,sSe(t))),Ap=Symbol.for("@effect/platform/HttpClientResponse"),FSe=(e,t)=>new USe(e,t);var GL,YL,WL;class USe extends(WL=Ete,YL=Tp,GL=Ap,WL){constructor(n,r){super();w(this,"request");w(this,"source");w(this,YL);w(this,GL);w(this,"cachedCookies");w(this,"textBody");w(this,"formDataBody");w(this,"arrayBufferBody");this.request=n,this.source=r,this[Tp]=Tp,this[Ap]=Ap}toJSON(){return SSe(this,{_id:"@effect/platform/HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return w2(this.source.headers)}get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=dSe(this.source.headers.getSetCookie())}get remoteAddress(){return re()}get stream(){return this.source.body?mve(()=>this.source.body,n=>new eo({request:this.request,response:this,reason:"Decode",cause:n})):cve(new eo({request:this.request,response:this,reason:"EmptyBody",description:"can not create stream from empty body"}))}get json(){return vpe(this.text,{try:n=>n===""?null:JSON.parse(n),catch:n=>new eo({request:this.request,response:this,reason:"Decode",cause:n})})}get text(){return this.textBody??(this.textBody=Sp({try:()=>this.source.text(),catch:n=>new eo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(y_,ui))}get urlParamsBody(){return je(this.text,n=>ype({try:()=>Xu(new URLSearchParams(n)),catch:r=>new eo({request:this.request,response:this,reason:"Decode",cause:r})}))}get formData(){return this.formDataBody??(this.formDataBody=Sp({try:()=>this.source.formData(),catch:n=>new eo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(y_,ui))}get arrayBuffer(){return this.arrayBufferBody??(this.arrayBufferBody=Sp({try:()=>this.source.arrayBuffer(),catch:n=>new eo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(y_,ui))}}const BSe=T(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)}),HSe=e=>`http.request.header.${e}`,qSe="http.request.method",VSe=e=>`http.response.header.${e}`,KSe="http.response.status_code",GSe="server.address",YSe="server.port",WSe="url.full",JSe="url.path",XSe="url.scheme",QSe="url.query",hP=Symbol.for("@effect/platform/HttpClient"),E2=fc("@effect/platform/HttpClient"),ZSe=Fe(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"),()=>UA(Ml)),ewe=Fe(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"),()=>UA(!0)),twe=Th()("@effect/platform/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>`http.client ${e.method}`}),nwe={[hP]:hP,pipe(){return xe(this,arguments)},...vS,toJSON(){return{_id:"@effect/platform/HttpClient"}},get(e,t){return this.execute(ESe(e,t))},head(e,t){return this.execute(ASe(e,t))},post(e,t){return this.execute(CSe(e,t))},put(e,t){return this.execute(RSe(e,t))},patch(e,t){return this.execute(NSe(e,t))},del(e,t){return this.execute(TSe(e,t))},options(e,t){return this.execute(OSe(e,t))}},C2=(e,t)=>{const n=Object.create(nwe);return n.preprocess=t,n.postprocess=e,n.execute=function(r){return e(t(r))},n},w0=Fe("@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))}}}),rwe=Fe("@effect/platform/HttpClient/scopedRequests",()=>new WeakMap),swe=e=>C2(t=>je(t,n=>r0(r=>{const s=rwe.get(n),i=s??new AbortController,a=K0e(n.url,n.urlParams,n.hash);if(a._tag==="Left")return Pa(new dq({request:n,reason:"InvalidUrl",cause:a.left}));const o=a.right;if(!r.getFiberRef(Ype)||r.getFiberRef(ZSe)(n)){const f=e(n,o,i.signal,r);return s?f:s0(u=>Di(u(f),{onSuccess(h){return w0.register(h,i),Jt(new mP(h,i))},onFailure(h){return Xx(h)&&i.abort(),zi(h)}}))}const c=_o(r.currentContext,twe);return Dpe(c(n),{kind:"client",captureStackTrace:!1},f=>{f.attribute(qSe,n.method),f.attribute(GSe,o.origin),o.port!==""&&f.attribute(YSe,+o.port),f.attribute(WSe,o.toString()),f.attribute(JSe,o.pathname),f.attribute(XSe,o.protocol.slice(0,-1));const u=o.search.slice(1);u!==""&&f.attribute(QSe,u);const h=r.getFiberRef(uq),m=nR(n.headers,h);for(const p in m)f.attribute(HSe(p),String(m[p]));return n=r.getFiberRef(ewe)?_2(n,wSe(f)):n,s0(p=>p(e(n,o,i.signal,r)).pipe(Ipe(f),Di({onSuccess:v=>{f.attribute(KSe,v.status);const S=nR(v.headers,h);for(const y in S)f.attribute(VSe(y),String(S[y]));return s?Jt(v):(w0.register(v,i),Jt(new mP(v,i)))},onFailure(v){return!s&&Xx(v)&&i.abort(),zi(v)}})))})})),Jt);var JL,XL;class mP{constructor(t,n){w(this,"original");w(this,"controller");w(this,XL,Ap);w(this,JL,Tp);this.original=t,this.controller=n}applyInterrupt(t){return vn(()=>(w0.unregister(this.original),bpe(t,()=>Pt(()=>{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 yve(()=>(w0.unregister(this.original),_9(this.original.stream,Pt(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[(XL=Ap,JL=Tp,pt)](){return this.original[pt]()}}const{del:rFe,execute:sFe,get:iFe,head:aFe,options:oFe,patch:lFe,post:cFe,put:uFe}=Epe(E2),iwe=T(2,(e,t)=>{const n=e;return C2(r=>t(n.postprocess(r)),n.preprocess)}),awe=T(2,(e,t)=>{const n=e;return C2(n.postprocess,r=>Et(n.preprocess(r),t))}),owe=e=>Kpe(E2,je(aH(),t=>Et(e,n=>iwe(n,oH(r=>us(t,r)))))),lwe=E2,cwe=awe,uwe=gc,fwe=_2,dwe=mq,hwe=PSe,mwe=pq,pwe=$Se,gwe=k2,ywe=LSe,vwe=BSe,pP=e=>e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS",bwe=(e,t)=>vd(function*(){const n=yield*aH(),r=t.httpClient.pipe((t==null?void 0:t.baseUrl)===void 0?Oe:cwe(hwe(t.baseUrl.toString())));L0e(e,{predicate:t==null?void 0:t.predicate,onGroup(s){var i;(i=t.onGroup)==null||i.call(t,s)},onEndpoint(s){const{endpoint:i,errors:a,successes:o}=s,l=_we(i.path),c={orElse:Rwe},f=vwe(c);a.forEach(({ast:S},y)=>{if(S._tag==="None"){c[y]=Nwe;return}const b=gP(S.value);c[y]=x=>je(b(x),Pa)}),o.forEach(({ast:S},y)=>{c[y]=S._tag==="None"?Twe:gP(S.value)});const u=i.pathSchema.pipe(os(Em)),h=i.payloadSchema.pipe(os(S=>pP(i.method)?Em(Owe(S)):Em(S))),m=i.headersSchema.pipe(os(Em)),p=i.urlParamsSchema.pipe(os(Em)),v=dH(function*(S){let y=uwe(i.method)(i.path);if(S&&S.path){const _=u._tag==="Some"?yield*u.value(S.path):S.path;y=dwe(y,l(_))}if(S&&S.payload instanceof FormData)y=ywe(y,S.payload);else if(h._tag==="Some")if(pP(i.method)){const _=yield*h.value(S.payload);y=gwe(y,_)}else{const _=yield*h.value(S.payload);y=mwe(y,_)}m._tag==="Some"&&(y=fwe(y,yield*m.value(S.headers))),p._tag==="Some"&&(y=pwe(y,yield*p.value(S.urlParams)));const b=yield*r.execute(y),x=yield*t.transformResponse===void 0?f(b):t.transformResponse(f(b));return(S==null?void 0:S.withResponse)===!0?[x,b]:x},oH(S=>us(n,S)));t.onEndpoint({...s,endpointFn:v})}})}),xwe=(e,t)=>je(lwe,n=>Swe(e,{...t,httpClient:t!=null&&t.transformClient?t.transformClient(n):n})),Swe=(e,t)=>{const n={};return bwe(e,{...t,onGroup({group:r}){r.topLevel||(n[r.identifier]={})},onEndpoint({endpoint:r,endpointFn:s,group:i}){(i.topLevel?n:n[i.identifier])[r.name]=s}}).pipe(Et(()=>n))},wwe=/:(\w+)\??/g,_we=e=>{const t=e.split(wwe),n=t.length;return n===1?r=>e:r=>{let s=t[0];for(let i=1;i<n;i++)i%2===0?s+=t[i]:s+=r[t[i]];return s}},gP=e=>{const t=Ow(e),n=Zbe(gq(e,t));return r=>je(r.arrayBuffer,n)},kwe=pc(_w,kxe,{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)}}),rR=pc(_w,M,{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)}}),Ewe=nc(M,_w,{strict:!0,decode:(e,t,n)=>e===""?Tr(void 0):m0({try:()=>JSON.parse(e),catch:()=>new hn(n,e,"Could not parse JSON")}),encode:(e,t,n)=>e===void 0?Tr(""):m0({try:()=>JSON.stringify(e),catch:()=>new hn(n,e,"Could not encode as JSON")})}),Cwe=Yc(rR,Ewe),gq=(e,t)=>{if(e._tag==="Union")return Wu(...e.types.map(r=>gq(r,Ow(r,t))));const n=Lt(e);switch(t.kind){case"Json":return Yc(Cwe,n);case"UrlParams":return Yc(rR,X0e(n));case"Uint8Array":return Yc(kwe,n);case"Text":return Yc(rR,n)}},Rwe=e=>Pa(new eo({reason:"Decode",request:e.request,response:e})),Nwe=e=>Pa(new eo({reason:"StatusCode",request:e.request,response:e})),Twe=e=>ht,Awe=Gh(aSe),Owe=e=>{const t=e.ast._tag==="Union"?e.ast.types:[e.ast];return Wu(...t.map(Mwe))},U_=Fe("@effect/platform/HttpApiClient/bodyFromPayloadCache",()=>new WeakMap),Mwe=e=>{if(U_.has(e))return U_.get(e);const t=Lt(e),n=Ow(e),r=nc(Awe,t,{decode(s,i,a){return yo(new UC(a,s,"encode only schema"))},encode(s,i,a){switch(n.kind){case"Json":try{return Tr(oP(JSON.stringify(s),n.contentType))}catch{return yo(new hn(a,s,"Could not encode as JSON"))}case"Text":return typeof s!="string"?yo(new hn(a,s,"Expected a string")):Tr(oP(s,n.contentType));case"UrlParams":return Tr(lSe(Xu(s)));case"Uint8Array":return s instanceof Uint8Array?Tr(oSe(s,n.contentType)):yo(new hn(a,s,"Expected a Uint8Array"))}}});return U_.set(e,r),r},jwe=e=>{if(Array.isArray(e))return tI(e);const t=Object.create(Eme.prototype);for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=tI(r))}return t},Dwe=()=>(e,t)=>{const n=uT(e)();n.layer=mH(n,xwe(t.api,t)).pipe(pH(t.httpClient));const r=t.runtime??b2;n.runtime=r(n.layer);const s=sP(({endpoint:a,group:o,withResponse:l})=>n.runtime.fn()(dH(function*(c){const u=(yield*n)[o][a]({...c,withResponse:l});return yield*c.reactivityKeys?C9(u,c.reactivityKeys):u})));n.mutation=(a,o,l)=>s(new Iwe({group:a,endpoint:o,withResponse:(l==null?void 0:l.withResponse)??!1}));const i=sP(a=>{let o=n.runtime.atom(je(n,l=>l[a.group][a.endpoint](a)));return a.timeToLive&&(o=XU(a.timeToLive)?Z7(o,a.timeToLive):Ty(o)),a.reactivityKeys?n.runtime.factory.withReactivity(a.reactivityKeys)(o):o});return n.query=(a,o,l)=>i(new Pwe({group:a,endpoint:o,path:l.path&&Bm(l.path),urlParams:l.urlParams&&Bm(l.urlParams),payload:l.payload&&Bm(l.payload),headers:l.headers&&Bm(l.headers),withResponse:l.withResponse??!1,reactivityKeys:l.reactivityKeys?jwe(l.reactivityKeys):void 0,timeToLive:l.timeToLive?mi(l.timeToLive):void 0})),n};class Iwe extends NA{[Ke](t){return this.group===t.group&&this.endpoint===t.endpoint&&this.withResponse===t.withResponse}[Ve](){return D(Wt(`${this.group}/${this.endpoint}/${this.withResponse}`),Ot(this))}}class Pwe extends NA{[Ke](t){return this.group===t.group&&this.endpoint===t.endpoint&&Re(this.path,t.path)&&Re(this.urlParams,t.urlParams)&&Re(this.payload,t.payload)&&Re(this.headers,t.headers)&&Re(this.withResponse,t.withResponse)&&Re(this.reactivityKeys,t.reactivityKeys)&&Re(this.timeToLive,t.timeToLive)}[Ve](){return D(Wt(`${this.group}/${this.endpoint}`),Ge(be(this.path)),Ge(be(this.urlParams)),Ge(be(this.payload)),Ge(be(this.headers)),Ge(be(this.withResponse)),Ge(be(this.reactivityKeys)),Ge(be(this.timeToLive)),Ot(this))}}const $we=Symbol.for("@effect/matcher/Matcher"),zwe={[$we]:{_input:Oe,_filters:Oe,_remaining:Oe,_result:Oe,_provided:Oe,_return:Oe},_tag:"ValueMatcher",add(e){return this.value._tag==="Right"?this:e._tag==="When"&&e.guard(this.provided)===!0?sR(this.provided,ze(e.evaluate(this.provided))):e._tag==="Not"&&e.guard(this.provided)===!1?sR(this.provided,ze(e.evaluate(this.provided))):this},pipe(){return xe(this,arguments)}};function sR(e,t){const n=Object.create(zwe);return n.provided=e,n.value=t,n}const Lwe=(e,t)=>({_tag:"When",guard:e,evaluate:t}),iR=e=>{if(typeof e=="function")return e;if(Array.isArray(e)){const t=e.map(iR),n=t.length;return r=>{if(!Array.isArray(r))return!1;for(let s=0;s<n;s++)if(t[s](r[s])===!1)return!1;return!0}}else if(e!==null&&typeof e=="object"){const t=Object.entries(e).map(([r,s])=>[r,iR(s)]),n=t.length;return r=>{if(typeof r!="object"||r===null)return!1;for(let s=0;s<n;s++){const[i,a]=t[s];if(!(i in r)||a(r[i])===!1)return!1}return!0}}return t=>t===e},Fwe=e=>sR(e,Le(e)),Uwe=(e,t)=>n=>n.add(Lwe(iR(e),t)),Bwe=e=>t=>{const n=Hwe(t);return lU(n)?n._tag==="Right"?n.right:e(n.left):r=>{const s=n(r);return s._tag==="Right"?s.right:e(s.left)}},Hwe=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?ze(n.evaluate(r)):Le(r)}return n=>{for(let r=0;r<t;r++){const s=e.cases[r];if(s._tag==="When"&&s.guard(n)===!0)return ze(s.evaluate(n));if(s._tag==="Not"&&s.guard(n)===!1)return ze(s.evaluate(n))}return Le(n)}},yq=Fwe,Op=Uwe,vq=Bwe;function qwe(e){Rk.unstable_scheduleCallback(Rk.unstable_LowPriority,e)}const R2=g.createContext(u0e({scheduleTask:qwe,defaultIdleTTL:400})),yP=Fe("@effect-atom/atom-react/storeRegistry",()=>new WeakMap);function Vwe(e,t){let n=yP.get(e);n===void 0&&(n=new WeakMap,yP.set(e,n));const r=n.get(t);if(r!==void 0)return r;const s={subscribe(i){return e.subscribe(t,i)},snapshot(){return e.get(t)},getServerSnapshot(){return R0e(t,e)}};return n.set(t,s),s}function bq(e,t){const n=Vwe(e,t);return g.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}const an=(e,t)=>{const n=g.useContext(R2);return bq(n,e)};function Kwe(e,t){g.useEffect(()=>e.mount(t),[t,e])}function xq(e,t,n){return(n==null?void 0:n.mode)==="promise"||(n==null?void 0:n.mode)==="promiseExit"?g.useCallback(r=>{e.set(t,r);const s=jpe(f0e(e,t,{suspendOnWaiting:!0}));return n.mode==="promise"?s.then(Gwe):s},[e,t,n.mode]):g.useCallback(r=>{e.set(t,typeof r=="function"?r(e.get(t)):r)},[e,t])}const Gwe=e=>{if(YB(e))return e.value;throw kA(e.cause)},ft=(e,t)=>{const n=g.useContext(R2);return Kwe(n,e),xq(n,e,t)},aR=(e,t)=>{const n=g.useContext(R2);return[bq(n,e),xq(n,e,t)]};function Ywe(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 Wwe=e=>{switch(e){case"success":return Qwe;case"info":return e1e;case"warning":return Zwe;case"error":return t1e;default:return null}},Jwe=Array(12).fill(0),Xwe=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},Jwe.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Qwe=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"})),Zwe=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"})),e1e=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"})),t1e=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"})),n1e=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"})),r1e=()=>{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 oR=1;class s1e{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,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:oR++,a=this.toasts.find(l=>l.id===i),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:o,title:r}):l):this.addToast({title:r,...s,dismissible:o,id:i}),i},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 s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,a;const o=s.then(async c=>{if(a=["resolve",c],ee.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(a1e(c)&&!c.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,h=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:h,...p})}else if(c instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(c):n.error,h=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:h,...p})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(c):n.success,h=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:h,...p})}}).catch(async c=>{if(a=["reject",c],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,m=typeof f=="object"&&!ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:u,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,f)=>o.then(()=>a[0]==="reject"?f(a[1]):c(a[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)||oR++;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 rs=new s1e,i1e=(e,t)=>{const n=(t==null?void 0:t.id)||oR++;return rs.addToast({title:e,...t,id:n}),n},a1e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",o1e=i1e,l1e=()=>rs.toasts,c1e=()=>rs.getActiveToasts(),Sq=Object.assign(o1e,{success:rs.success,info:rs.info,warning:rs.warning,error:rs.error,custom:rs.custom,message:rs.message,promise:rs.promise,dismiss:rs.dismiss,loading:rs.loading},{getHistory:l1e,getToasts:c1e});Ywe("[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 Mv(e){return e.label!==void 0}const u1e=3,f1e="24px",d1e="16px",vP=4e3,h1e=356,m1e=14,p1e=45,g1e=200;function na(...e){return e.filter(Boolean).join(" ")}function y1e(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const v1e=e=>{var t,n,r,s,i,a,o,l,c;const{invert:f,toast:u,unstyled:h,interacting:m,setHeights:p,visibleToasts:v,heights:S,index:y,toasts:b,expanded:x,removeToast:_,defaultRichColors:C,closeButton:E,style:k,cancelButtonStyle:A,actionButtonStyle:I,className:R="",descriptionClassName:$="",duration:U,position:K,gap:W,expandByDefault:B,classNames:j,icons:F,closeButtonAriaLabel:z="Close toast"}=e,[V,O]=ee.useState(null),[me,q]=ee.useState(null),[N,J]=ee.useState(!1),[Y,le]=ee.useState(!1),[Q,ae]=ee.useState(!1),[te,fe]=ee.useState(!1),[Ce,ye]=ee.useState(!1),[xt,rn]=ee.useState(0),[Bs,Pn]=ee.useState(0),Sr=ee.useRef(u.duration||U||vP),Wo=ee.useRef(null),wn=ee.useRef(null),sf=y===0,im=y+1<=v,ir=u.type,ea=u.dismissible!==!1,bi=u.className||"",Ua=u.descriptionClassName||"",G=ee.useMemo(()=>S.findIndex(Ye=>Ye.toastId===u.id)||0,[S,u.id]),ce=ee.useMemo(()=>{var Ye;return(Ye=u.closeButton)!=null?Ye:E},[u.closeButton,E]),Ne=ee.useMemo(()=>u.duration||U||vP,[u.duration,U]),Be=ee.useRef(0),ot=ee.useRef(0),wr=ee.useRef(0),Yn=ee.useRef(null),[gs,ar]=K.split("-"),xi=ee.useMemo(()=>S.reduce((Ye,_n,zn)=>zn>=G?Ye:Ye+_n.height,0),[S,G]),$n=r1e(),Si=u.invert||f,Ir=ir==="loading";ot.current=ee.useMemo(()=>G*W+xi,[G,xi]),ee.useEffect(()=>{Sr.current=Ne},[Ne]),ee.useEffect(()=>{J(!0)},[]),ee.useEffect(()=>{const Ye=wn.current;if(Ye){const _n=Ye.getBoundingClientRect().height;return Pn(_n),p(zn=>[{toastId:u.id,height:_n,position:u.position},...zn]),()=>p(zn=>zn.filter(Wn=>Wn.toastId!==u.id))}},[p,u.id]),ee.useLayoutEffect(()=>{if(!N)return;const Ye=wn.current,_n=Ye.style.height;Ye.style.height="auto";const zn=Ye.getBoundingClientRect().height;Ye.style.height=_n,Pn(zn),p(Wn=>Wn.find(kn=>kn.toastId===u.id)?Wn.map(kn=>kn.toastId===u.id?{...kn,height:zn}:kn):[{toastId:u.id,height:zn,position:u.position},...Wn])},[N,u.title,u.description,p,u.id,u.jsx,u.action,u.cancel]);const wi=ee.useCallback(()=>{le(!0),rn(ot.current),p(Ye=>Ye.filter(_n=>_n.toastId!==u.id)),setTimeout(()=>{_(u)},g1e)},[u,_,p,ot]);ee.useEffect(()=>{if(u.promise&&ir==="loading"||u.duration===1/0||u.type==="loading")return;let Ye;return x||m||$n?(()=>{if(wr.current<Be.current){const Wn=new Date().getTime()-Be.current;Sr.current=Sr.current-Wn}wr.current=new Date().getTime()})():(()=>{Sr.current!==1/0&&(Be.current=new Date().getTime(),Ye=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),wi()},Sr.current))})(),()=>clearTimeout(Ye)},[x,m,u,ir,$n,wi]),ee.useEffect(()=>{u.delete&&(wi(),u.onDismiss==null||u.onDismiss.call(u,u))},[wi,u.delete]);function af(){var Ye;if(F!=null&&F.loading){var _n;return ee.createElement("div",{className:na(j==null?void 0:j.loader,u==null||(_n=u.classNames)==null?void 0:_n.loader,"sonner-loader"),"data-visible":ir==="loading"},F.loading)}return ee.createElement(Xwe,{className:na(j==null?void 0:j.loader,u==null||(Ye=u.classNames)==null?void 0:Ye.loader),visible:ir==="loading"})}const Yy=u.icon||(F==null?void 0:F[ir])||Wwe(ir);var of,Wy;return ee.createElement("li",{tabIndex:0,ref:wn,className:na(R,bi,j==null?void 0:j.toast,u==null||(t=u.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[ir],u==null||(n=u.classNames)==null?void 0:n[ir]),"data-sonner-toast":"","data-rich-colors":(of=u.richColors)!=null?of:C,"data-styled":!(u.jsx||u.unstyled||h),"data-mounted":N,"data-promise":!!u.promise,"data-swiped":Ce,"data-removed":Y,"data-visible":im,"data-y-position":gs,"data-x-position":ar,"data-index":y,"data-front":sf,"data-swiping":Q,"data-dismissible":ea,"data-type":ir,"data-invert":Si,"data-swipe-out":te,"data-swipe-direction":me,"data-expanded":!!(x||B&&N),"data-testid":u.testId,style:{"--index":y,"--toasts-before":y,"--z-index":b.length-y,"--offset":`${Y?xt:ot.current}px`,"--initial-height":B?"auto":`${Bs}px`,...k,...u.style},onDragEnd:()=>{ae(!1),O(null),Yn.current=null},onPointerDown:Ye=>{Ye.button!==2&&(Ir||!ea||(Wo.current=new Date,rn(ot.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ae(!0),Yn.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,_n,zn;if(te||!ea)return;Yn.current=null;const Wn=Number(((Ye=wn.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ba=Number(((_n=wn.current)==null?void 0:_n.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kn=new Date().getTime()-((zn=Wo.current)==null?void 0:zn.getTime()),Xr=V==="x"?Wn:Ba,lf=Math.abs(Xr)/kn;if(Math.abs(Xr)>=p1e||lf>.11){rn(ot.current),u.onDismiss==null||u.onDismiss.call(u,u),q(V==="x"?Wn>0?"right":"left":Ba>0?"down":"up"),wi(),fe(!0);return}else{var P,L;(P=wn.current)==null||P.style.setProperty("--swipe-amount-x","0px"),(L=wn.current)==null||L.style.setProperty("--swipe-amount-y","0px")}ye(!1),ae(!1),O(null)},onPointerMove:Ye=>{var _n,zn,Wn;if(!Yn.current||!ea||((_n=window.getSelection())==null?void 0:_n.toString().length)>0)return;const kn=Ye.clientY-Yn.current.y,Xr=Ye.clientX-Yn.current.x;var lf;const P=(lf=e.swipeDirections)!=null?lf:y1e(K);!V&&(Math.abs(Xr)>1||Math.abs(kn)>1)&&O(Math.abs(Xr)>Math.abs(kn)?"x":"y");let L={x:0,y:0};const H=Z=>1/(1.5+Math.abs(Z)/20);if(V==="y"){if(P.includes("top")||P.includes("bottom"))if(P.includes("top")&&kn<0||P.includes("bottom")&&kn>0)L.y=kn;else{const Z=kn*H(kn);L.y=Math.abs(Z)<Math.abs(kn)?Z:kn}}else if(V==="x"&&(P.includes("left")||P.includes("right")))if(P.includes("left")&&Xr<0||P.includes("right")&&Xr>0)L.x=Xr;else{const Z=Xr*H(Xr);L.x=Math.abs(Z)<Math.abs(Xr)?Z:Xr}(Math.abs(L.x)>0||Math.abs(L.y)>0)&&ye(!0),(zn=wn.current)==null||zn.style.setProperty("--swipe-amount-x",`${L.x}px`),(Wn=wn.current)==null||Wn.style.setProperty("--swipe-amount-y",`${L.y}px`)}},ce&&!u.jsx&&ir!=="loading"?ee.createElement("button",{"aria-label":z,"data-disabled":Ir,"data-close-button":!0,onClick:Ir||!ea?()=>{}:()=>{wi(),u.onDismiss==null||u.onDismiss.call(u,u)},className:na(j==null?void 0:j.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Wy=F==null?void 0:F.close)!=null?Wy:n1e):null,(ir||u.icon||u.promise)&&u.icon!==null&&((F==null?void 0:F[ir])!==null||u.icon)?ee.createElement("div",{"data-icon":"",className:na(j==null?void 0:j.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||af():null,u.type!=="loading"?Yy:null):null,ee.createElement("div",{"data-content":"",className:na(j==null?void 0:j.content,u==null||(i=u.classNames)==null?void 0:i.content)},ee.createElement("div",{"data-title":"",className:na(j==null?void 0:j.title,u==null||(a=u.classNames)==null?void 0:a.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?ee.createElement("div",{"data-description":"",className:na($,Ua,j==null?void 0:j.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&&Mv(u.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Ye=>{Mv(u.cancel)&&ea&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ye),wi())},className:na(j==null?void 0:j.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ee.isValidElement(u.action)?u.action:u.action&&Mv(u.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||I,onClick:Ye=>{Mv(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ye),!Ye.defaultPrevented&&wi())},className:na(j==null?void 0:j.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function bP(){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 b1e(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?d1e:f1e;function l(c){["top","right","bottom","left"].forEach(f=>{n[`${a}-${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[`${a}-${c}`]=o:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(o)}),n}const x1e=ee.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:c,offset:f,mobileOffset:u,theme:h="light",richColors:m,duration:p,style:v,visibleToasts:S=u1e,toastOptions:y,dir:b=bP(),gap:x=m1e,icons:_,containerAriaLabel:C="Notifications"}=t,[E,k]=ee.useState([]),A=ee.useMemo(()=>r?E.filter(N=>N.toasterId===r):E.filter(N=>!N.toasterId),[E,r]),I=ee.useMemo(()=>Array.from(new Set([i].concat(A.filter(N=>N.position).map(N=>N.position)))),[A,i]),[R,$]=ee.useState([]),[U,K]=ee.useState(!1),[W,B]=ee.useState(!1),[j,F]=ee.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ee.useRef(null),V=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=ee.useRef(null),me=ee.useRef(!1),q=ee.useCallback(N=>{k(J=>{var Y;return(Y=J.find(le=>le.id===N.id))!=null&&Y.delete||rs.dismiss(N.id),J.filter(({id:le})=>le!==N.id)})},[]);return ee.useEffect(()=>rs.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{k(J=>J.map(Y=>Y.id===N.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{h3.flushSync(()=>{k(J=>{const Y=J.findIndex(le=>le.id===N.id);return Y!==-1?[...J.slice(0,Y),{...J[Y],...N},...J.slice(Y+1)]:[N,...J]})})})}),[E]),ee.useEffect(()=>{if(h!=="system"){F(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const N=window.matchMedia("(prefers-color-scheme: dark)");try{N.addEventListener("change",({matches:J})=>{F(J?"dark":"light")})}catch{N.addListener(({matches:Y})=>{try{F(Y?"dark":"light")}catch(le){console.error(le)}})}},[h]),ee.useEffect(()=>{E.length<=1&&K(!1)},[E]),ee.useEffect(()=>{const N=J=>{var Y;if(a.every(ae=>J[ae]||J.code===ae)){var Q;K(!0),(Q=z.current)==null||Q.focus()}J.code==="Escape"&&(document.activeElement===z.current||(Y=z.current)!=null&&Y.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[a]),ee.useEffect(()=>{if(z.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,me.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},I.map((N,J)=>{var Y;const[le,Q]=N.split("-");return A.length?ee.createElement("ol",{key:N,dir:b==="auto"?bP():b,tabIndex:-1,ref:z,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":le,"data-x-position":Q,style:{"--front-toast-height":`${((Y=R[0])==null?void 0:Y.height)||0}px`,"--width":`${h1e}px`,"--gap":`${x}px`,...v,...b1e(f,u)},onBlur:ae=>{me.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(me.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||me.current||(me.current=!0,O.current=ae.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{W||K(!1)},onDragEnd:()=>K(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},A.filter(ae=>!ae.position&&J===0||ae.position===N).map((ae,te)=>{var fe,Ce;return ee.createElement(v1e,{key:ae.id,icons:_,index:te,toast:ae,defaultRichColors:m,duration:(fe=y==null?void 0:y.duration)!=null?fe:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:s,visibleToasts:S,closeButton:(Ce=y==null?void 0:y.closeButton)!=null?Ce:l,interacting:W,position:N,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:q,toasts:A.filter(ye=>ye.position==ae.position),heights:R.filter(ye=>ye.position==ae.position),setHeights:$,expandByDefault:o,gap:x,expanded:U,swipeDirections:t.swipeDirections})})):null}))}),S1e="@effect/platform/FetchHttpClient/Fetch",w1e="@effect/platform/FetchHttpClient/FetchOptions",_1e=swe((e,t,n,r)=>{const s=r.getFiberRef(gH),i=s.unsafeMap.get(S1e)??globalThis.fetch,a=s.unsafeMap.get(w1e)??{},o=a.headers?vSe(w2(a.headers),e.headers):e.headers,l=c=>Et(Sp({try:()=>i(t,{...a,method:e.method,headers:o,body:c,duplex:e.body._tag==="Stream"?"half":void 0,signal:n}),catch:f=>new dq({request:e,reason:"Transport",cause:f})}),f=>FSe(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 je(vve(e.body.stream),l)}return l(void 0)}),k1e=owe(Jt(_1e)),E1e=k1e,C1e=e=>e.endsWith("/")?e.slice(0,-1):e,R1e=T(2,(e,t)=>(t=C1e(t),e==="/"?t:t+e)),N1e=R1e,xP=Symbol.for("@effect/platform/HttpApiEndpoint"),T1e={[xP]:xP,pipe(){return xe(this,arguments)},addSuccess(e,t){return e=t!=null&&t.status?e.annotations(ih({status:t.status})):e,Ks({...this,successSchema:this.successSchema===eR?e:Bl(this.successSchema,e)})},addError(e,t){return Ks({...this,errorSchema:Bl(this.errorSchema,t!=null&&t.status?e.annotations(ih({status:t.status})):e)})},setPayload(e){return Ks({...this,payloadSchema:ie(e)})},setPath(e){return Ks({...this,pathSchema:ie(e)})},setUrlParams(e){return Ks({...this,urlParamsSchema:ie(e)})},setHeaders(e){return Ks({...this,headersSchema:ie(e)})},prefix(e){return Ks({...this,path:N1e(this.path,e)})},middleware(e){return Ks({...this,errorSchema:Bl(this.errorSchema,e.failure),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Ks({...this,annotations:ii(this.annotations,e,t)})},annotateContext(e){return Ks({...this,annotations:us(this.annotations,e)})}},Ks=e=>Object.assign(Object.create(T1e),e),jw=e=>(t,...n)=>n.length===1?Ks({name:t,path:n[0],method:e,pathSchema:re(),urlParamsSchema:re(),payloadSchema:re(),headersSchema:re(),successSchema:eR,errorSchema:xg,annotations:Ea(),middlewares:new Set}):(r,...s)=>{let i=r[0].replace(":","::"),a=re();if(s.length>0){const o={};for(let l=0;l<s.length;l++){const c=s[l],f=j0e(c.ast)??String(l),u=c.ast._tag==="PropertySignatureTransformation"&&c.ast.from.isOptional||c.ast._tag==="PropertySignatureDeclaration"&&c.ast.isOptional;o[f]=c,i+=`:${f}${u?"?":""}${r[l+1].replace(":","::")}`}a=ie(de(o))}return Ks({name:t,path:i,method:e,pathSchema:a,urlParamsSchema:re(),payloadSchema:re(),headersSchema:re(),successSchema:eR,errorSchema:xg,annotations:Ea(),middlewares:new Set})},Hn=jw("GET"),mn=jw("POST"),A1e=jw("PUT"),N2=jw("DELETE"),SP=Symbol.for("@effect/platform/HttpApiGroup"),O1e={[SP]:SP,add(e){return sa({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 sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Bl(this.errorSchema,t!=null&&t.status?e.annotations(ih({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Jf(this.endpoints,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:Bl(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},middlewareEndpoints(e){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Jf(this.endpoints,t=>t.middleware(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateContext(e){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:us(this.annotations,e),middlewares:this.middlewares})},annotate(e,t){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:ii(this.annotations,e,t),middlewares:this.middlewares})},annotateEndpointsContext(e){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Jf(this.endpoints,t=>t.annotateContext(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateEndpoints(e,t){return sa({identifier:this.identifier,topLevel:this.topLevel,endpoints:Jf(this.endpoints,n=>n.annotate(e,t)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},pipe(){return xe(this,arguments)}},sa=e=>{function t(){}return Object.setPrototypeOf(t,O1e),Object.assign(t,e)},$a=(e,t)=>sa({identifier:e,topLevel:!1,endpoints:Lne(),errorSchema:xg,annotations:Ea(),middlewares:new Set}),Ro=M.pipe(Yh("PullRequestId")),wq=M.pipe(Yh("RepositoryName")),Wh=M.pipe(Yh("AwsProfileName")),_q=M.pipe(Yh("AwsRegion")),wP=M.pipe(Yh("CommentId")),Hl=M.pipe(Yh("SandboxId")),kq=Us("OPEN","CLOSED","MERGED"),M1e=Us("error","info","warning","success"),j1e=Us("idle","loading","error"),Eq=Us("creating","cloning","starting","running","stopping","stopped","error");class rd extends Ju("Account")({profile:Wh,region:_q,awsAccountId:pe(M),repoAccountId:pe(M)}){}class D1e extends Ju("ApprovalRule")({ruleName:M,requiredApprovals:ve,poolMembers:Ie(M),poolMemberArns:oa(Ie(M),{default:()=>[]}),satisfied:sn,fromTemplate:pe(M)}){}class I1e extends Ju("PullRequest")({id:Ro,title:M,description:pe(M),author:M,repositoryName:wq,creationDate:Eo,lastModifiedDate:Eo,link:M,account:rd,status:kq,sourceBranch:M,destinationBranch:M,isMergeable:sn,isApproved:sn,commentCount:pe(ve),healthScore:pe(ve),fetchedAt:pe(Eo),approvedBy:Ie(M),approvedByArns:oa(Ie(M),{default:()=>[]}),commentedBy:Ie(M),filesChanged:pe(ve),approvalRules:oa(Ie(D1e),{default:()=>[]})}){get consoleUrl(){return P1e(this.account.region,this.repositoryName,this.id)}}const Cq=(e,t)=>!t||e.approvedBy.includes(t)?!1:e.approvalRules.some(n=>!n.satisfied&&n.poolMembers.includes(t)),P1e=(e,t,n)=>`https://${e}.console.aws.amazon.com/codesuite/codecommit/repositories/${t}/pull-requests/${n}?region=${e}`;class fFe extends Ju("Sandbox")({id:Hl,pullRequestId:Ro,awsAccountId:M,repositoryName:wq,sourceBranch:M,containerId:pe(M),port:pe(ve),workspacePath:M,status:Eq,error:pe(M),createdAt:Eo,lastActivityAt:Eo}){}class dFe extends Ju("PRComment")({id:wP,content:M,author:M,creationDate:Eo,inReplyTo:pe(wP),deleted:sn,filePath:pe(M),lineNumber:pe(ve)}){}const $1e=de({id:M,content:M,author:M,creationDate:M,inReplyTo:pe(M),deleted:sn,filePath:pe(M),lineNumber:pe(ve)}),Rq=de({root:$1e,replies:Ie(gxe(()=>Rq))}),z1e=de({filePath:pe(M),beforeCommitId:pe(M),afterCommitId:pe(M),comments:Ie(Rq)}),L1e=Us("new_comment","comment_edited","comment_deleted","approval_changed","approval_requested","review_reminder","merge_changed","title_changed","description_changed","pr_merged","pr_closed","pr_reopened");class hFe extends Ju("PersistentNotification")({id:ve,pullRequestId:Ro,awsAccountId:M,type:L1e,message:M,createdAt:Eo,read:sn}){}Cme();class mFe extends Ju("NotificationItem")({type:M1e,title:M,message:M,timestamp:Eo,profile:oa(M,{exact:!0})}){}const F1e=de({author:M,prCount:ve}),U1e=de({author:M,commentCount:ve}),B1e=de({author:M,approvalCount:ve}),H1e=de({id:M,title:M,author:M,repositoryName:M,commentCount:ve,awsAccountId:M}),q1e=de({small:ve,medium:ve,large:ve,extraLarge:ve}),V1e=de({filesAdded:ve,filesModified:ve,filesDeleted:ve}),K1e=de({author:M,avgFilesChanged:ve,prCount:ve}),G1e=de({id:M,title:M,author:M,repositoryName:M,daysSinceActivity:ve,awsAccountId:M}),Y1e=de({topContributorShare:ve,uniqueContributors:ve}),B_=de({prId:M,prTitle:M,author:M,repositoryName:M,awsAccountId:M,durationMs:ve,fromLabel:M,toLabel:M}),W1e=de({week:M,weekStart:M,weekEnd:M,dataAvailableSince:tn(M),prsCreated:ve,prsMerged:ve,prsClosed:ve,totalComments:ve,topContributors:Ie(F1e),topReviewers:Ie(U1e),topApprovers:Ie(B1e),medianTimeToMerge:tn(ve),medianTimeToFirstReview:tn(ve),medianTimeToAddressFeedback:tn(ve),mergeTimeDetails:Ie(B_),firstReviewDetails:Ie(B_),feedbackDetails:Ie(B_),mostActivePRs:Ie(H1e),prSizeDistribution:q1e,avgDiffSize:tn(V1e),diffSizeByContributor:Ie(K1e),stalePRs:Ie(G1e),reviewCoverage:tn(ve),approvalRate:tn(ve),busFactor:tn(Y1e),availableRepos:Ie(M),availableAuthors:Ie(M),availableAccounts:Ie(M)});class St extends V7()("ApiError",{message:M}){}const J1e=de({id:M,awsAccountId:M,accountProfile:M,accountRegion:M,title:M,description:tn(M),author:M,repositoryName:M,creationDate:M,lastModifiedDate:M,status:M,sourceBranch:M,destinationBranch:M,isMergeable:ve,isApproved:ve,commentCount:tn(ve),link:M,fetchedAt:M}),X1e=de({id:ve,pullRequestId:M,awsAccountId:M,type:M,title:M,profile:M,message:M,createdAt:M,read:ve});class Q1e extends $a("prs").add(Hn("list","/").addSuccess(H7(I1e))).add(mn("refresh","/refresh").addSuccess(M)).add(Hn("search","/search").setUrlParams(de({q:M,limit:pe(ou.pipe(d2(1,50))),offset:pe(ou.pipe(U7(0)))})).addSuccess(de({items:Ie(J1e),total:ve,hasMore:sn})).addError(St)).add(mn("refreshSingle","/:awsAccountId/:prId/refresh").setPath(de({awsAccountId:M,prId:Ro})).addSuccess(M).addError(St)).add(mn("create","/").setPayload(de({repositoryName:M,title:M,description:pe(M),sourceBranch:M,destinationBranch:M,account:rd})).addSuccess(M).addError(St)).add(mn("open","/open").setPayload(de({profile:M,link:M.pipe(Cw(t=>/^https:\/\/[\w-]+\.console\.aws\.amazon\.com\//.test(t)))})).addSuccess(M).addError(St)).add(Hn("comments","/comments").setUrlParams(de({pullRequestId:M,repositoryName:M,profile:Wh,region:_q})).addSuccess(Ie(z1e)).addError(St)).add(mn("createApprovalRule","/approval-rules").setPayload(de({pullRequestId:M,approvalRuleName:M,requiredApprovals:ve,poolMembers:Ie(M),account:rd})).addSuccess(M).addError(St)).add(A1e("updateApprovalRule","/approval-rules").setPayload(de({pullRequestId:M,approvalRuleName:M,requiredApprovals:ve,poolMembers:Ie(M),account:rd})).addSuccess(M).addError(St)).add(N2("deleteApprovalRule","/approval-rules").setPayload(de({pullRequestId:M,approvalRuleName:M,account:rd})).addSuccess(M).addError(St)).prefix("/api/prs"){}class Z1e extends $a("events").add(Hn("stream","/").addSuccess(M)).prefix("/api/events"){}const e_e=de({hostPath:M,containerPath:M,readonly:sn}),Nq=de({image:M,extensions:Ie(M),setupCommands:Ie(M),env:mxe({key:M,value:M}),enableClaudeCode:sn,volumeMounts:Ie(e_e),cloneDepth:ve}),Tq=de({accounts:Ie(de({profile:M,regions:Ie(M),enabled:sn})),autoDetect:sn,autoRefresh:sn,refreshIntervalSeconds:ve,currentUser:pe(M),sandbox:pe(Nq)}),t_e=de({path:M,exists:sn,modifiedAt:pe(M)}),n_e=de({path:M,sizeBytes:ve,exists:sn,modifiedAt:pe(M)}),r_e=de({status:Us("valid","missing","corrupted"),path:M,errors:Ie(M)}),s_e=de({accounts:Ie(de({profile:M,regions:Ie(M),enabled:sn})),autoDetect:sn,autoRefresh:sn,refreshIntervalSeconds:ve,sandbox:pe(Nq)}),i_e=de({backupPath:pe(M),config:Tq});class a_e extends $a("config").add(Hn("list","/").addSuccess(Tq)).add(Hn("path","/path").addSuccess(t_e).addError(St)).add(Hn("database","/database").addSuccess(n_e).addError(St)).add(Hn("validate","/validate").addSuccess(r_e).addError(St)).add(mn("save","/save").setPayload(s_e).addSuccess(M).addError(St)).add(mn("reset","/reset").addSuccess(i_e).addError(St)).prefix("/api/config"){}class o_e extends $a("accounts").add(Hn("list","/").addSuccess(H7(rd))).prefix("/api/accounts"){}const _P=de({awsAccountId:M,pullRequestId:Ro}),l_e=de({awsAccountId:M,pullRequestId:M});class c_e extends $a("subscriptions").add(mn("subscribe","/subscribe").setPayload(_P).addSuccess(M).addError(St)).add(mn("unsubscribe","/unsubscribe").setPayload(_P).addSuccess(M).addError(St)).add(Hn("list","/").addSuccess(Ie(l_e))).prefix("/api/subscriptions"){}const u_e=de({items:Ie(X1e),nextCursor:pe(ve)});class f_e extends $a("notifications").add(Hn("list","/").setUrlParams(de({limit:pe(ou.pipe(d2(1,100))),cursor:pe(ou),filter:pe(Us("system","prs")),unreadOnly:pe(ou)})).addSuccess(u_e)).add(Hn("count","/count").addSuccess(de({unread:ve}))).add(mn("markRead","/read").setPayload(de({id:ve})).addSuccess(M)).add(mn("markUnread","/unread").setPayload(de({id:ve})).addSuccess(M)).add(mn("markAllRead","/read-all").addSuccess(M)).add(mn("ssoLogin","/sso-login").setPayload(de({profile:Wh})).addSuccess(M).addError(St)).add(mn("ssoLogout","/sso-logout").addSuccess(M).addError(St)).prefix("/api/notifications"){}const H_=de({id:M,pullRequestId:M,awsAccountId:M,repositoryName:M,sourceBranch:M,containerId:tn(M),port:tn(ve),status:Eq,statusDetail:tn(M),logs:tn(M),error:tn(M),createdAt:M,lastActivityAt:M}),d_e=de({pullRequestId:Ro,awsAccountId:M,repositoryName:M,sourceBranch:M,profile:Wh,region:M}),jv=de({sandboxId:Hl});class h_e extends $a("sandbox").add(mn("create","/").setPayload(d_e).addSuccess(H_).addError(St)).add(Hn("list","/").addSuccess(Ie(H_)).addError(St)).add(Hn("get","/:sandboxId").setPath(jv).addSuccess(H_).addError(St)).add(mn("stop","/:sandboxId/stop").setPath(jv).addSuccess(M).addError(St)).add(mn("restart","/:sandboxId/restart").setPath(jv).addSuccess(M).addError(St)).add(N2("delete","/:sandboxId").setPath(jv).addSuccess(M).addError(St)).prefix("/api/sandbox"){}class m_e extends $a("stats").add(Hn("get","/").setUrlParams(de({week:M.pipe(qI(/^\d{4}-W\d{2}$/)),repo:pe(M),author:pe(M),account:pe(M)})).addSuccess(W1e).addError(St)).add(mn("sync","/sync").setPayload(de({week:M.pipe(qI(/^\d{4}-W\d{2}$/))})).addSuccess(M).addError(St)).prefix("/api/stats"){}const Aq=Us("always_allow","allow","deny"),p_e=de({operation:M,state:Aq,category:Us("read","write"),description:M}),kP=de({id:ve,timestamp:M,operation:M,accountProfile:M,region:M,permissionState:M,context:M,durationMs:tn(ve)});class g_e extends $a("permissions").add(mn("respond","/respond").setPayload(de({id:M,response:Us("allow_once","always_allow","deny")})).addSuccess(M).addError(St)).add(Hn("list","/").addSuccess(Ie(p_e))).add(mn("update","/update").setPayload(de({operation:M,state:Aq})).addSuccess(M).addError(St)).add(mn("reset","/reset").addSuccess(M)).add(Hn("auditSettings","/audit").addSuccess(de({enabled:sn,retentionDays:ve}))).add(mn("updateAuditSettings","/audit").setPayload(de({enabled:pe(sn),retentionDays:pe(ve)})).addSuccess(M).addError(St)).prefix("/api/permissions"){}class y_e extends $a("audit").add(Hn("list","/").setUrlParams(de({limit:pe(ou.pipe(d2(1,200))),offset:pe(ou.pipe(U7(0))),operation:pe(M),accountProfile:pe(M),permissionState:pe(M),from:pe(M),to:pe(M),search:pe(M)})).addSuccess(de({items:Ie(kP),total:ve,nextCursor:pe(ve)})).addError(St)).add(Hn("export","/export").setUrlParams(de({from:pe(M),to:pe(M)})).addSuccess(Ie(kP)).addError(St)).add(N2("clear","/").addSuccess(de({deleted:ve})).addError(St)).prefix("/api/audit"){}class v_e extends z0e().add(Q1e).add(Z1e).add(a_e).add(o_e).add(f_e).add(c_e).add(h_e).add(m_e).add(g_e).add(y_e){}class We extends Dwe()("ApiClient",{api:v_e,baseUrl:"/",httpClient:E1e}){}b2(We.layer);const b_e={pullRequests:[],accounts:[],status:"idle"};We.query("prs","list",{reactivityKeys:["prs"],timeToLive:"30 seconds"});const T2=We.query("config","list",{reactivityKeys:["config"],timeToLive:"30 seconds"});We.query("accounts","list",{reactivityKeys:["accounts"],timeToLive:"60 seconds"});const Oq=We.mutation("prs","refresh"),x_e=We.mutation("prs","open"),S_e=We.query("config","path",{reactivityKeys:["config"],timeToLive:"60 seconds"}),w_e=We.query("config","database",{reactivityKeys:["config"],timeToLive:"60 seconds"}),__e=We.query("config","validate",{reactivityKeys:["config"],timeToLive:"60 seconds"}),A2=We.mutation("config","save"),k_e=We.mutation("config","reset"),O2=We.mutation("notifications","ssoLogin"),M2=We.mutation("notifications","ssoLogout"),E_e=We.query("subscriptions","list",{reactivityKeys:["subscriptions"],timeToLive:"5 seconds"}),C_e=We.mutation("subscriptions","subscribe"),R_e=We.mutation("subscriptions","unsubscribe");We.query("notifications","list",{urlParams:{},reactivityKeys:["notifications"],timeToLive:"10 seconds"});We.query("notifications","count",{reactivityKeys:["notifications"],timeToLive:"10 seconds"});const N_e=We.mutation("notifications","list"),T_e=We.mutation("notifications","markRead"),A_e=We.mutation("notifications","markUnread"),O_e=We.mutation("notifications","markAllRead");We.query("sandbox","list",{reactivityKeys:["sandbox"],timeToLive:"5 seconds"});const M_e=We.mutation("sandbox","create"),Mq=We.mutation("sandbox","stop"),jq=We.mutation("sandbox","restart"),Dq=We.mutation("sandbox","delete"),j_e=We.mutation("stats","sync");We.mutation("prs","search");const D_e=We.mutation("prs","refreshSingle"),I_e=We.mutation("prs","createApprovalRule"),P_e=We.mutation("prs","updateApprovalRule");We.mutation("prs","deleteApprovalRule");const $_e=We.query("permissions","list",{reactivityKeys:["permissions"],timeToLive:"30 seconds"}),z_e=We.mutation("permissions","respond"),L_e=We.mutation("permissions","update"),F_e=We.mutation("permissions","reset"),U_e=We.query("permissions","auditSettings",{reactivityKeys:["permissions"],timeToLive:"30 seconds"}),B_e=We.mutation("permissions","updateAuditSettings"),H_e=We.mutation("audit","list"),q_e=We.mutation("audit","export"),V_e=We.mutation("audit","clear"),gi=Aw(b_e).pipe(Ty);function K_e(e){const t=g.useRef(e);t.current=e;const n=g.useRef([]),r=g.useRef(new Set);return{notify:g.useCallback(i=>{if(i.id!=null){if(r.current.has(i.id))return;if(r.current.add(i.id),r.current.size>500){const o=[...r.current];r.current=new Set(o.slice(o.length-250))}}if(typeof Notification>"u"||Notification.permission!=="granted")return;try{if(localStorage.getItem(ss.desktopNotifications)!=="true")return}catch{return}const a=new Notification(i.title||"CodeCommit",{body:i.message,icon:"/favicon.ico"});a.addEventListener("click",()=>{var l;window.focus(),a.close();const o=i.awsAccountId&&i.pullRequestId?`/accounts/${i.awsAccountId}/prs/${i.pullRequestId}`:"/notifications";(l=t.current)==null||l.call(t,o)}),n.current.push(a),setTimeout(()=>{n.current=n.current.filter(o=>o!==a)},3e4)},[])}}const G_e=60*60*1e3;function EP(e,t){try{const n=localStorage.getItem(e);return n===null?t:n==="true"}catch{return t}}function Y_e(e,t){try{const n=localStorage.getItem(e);return n===null?t:Number(n)||t}catch{return t}}function W_e(e){const t=g.useRef(e);t.current=e,g.useEffect(()=>{let n=null;const r=()=>{const i=Y_e(ss.reminderInterval,G_e);n=setTimeout(s,i)},s=()=>{EP(ss.reminders,!0)&&t.current>0&&(Sq(`You have ${t.current} PR${t.current>1?"s":""} awaiting your review`,{duration:1e4}),typeof Notification<"u"&&Notification.permission==="granted"&&EP(ss.desktopNotifications,!1)&&new Notification("Review Reminder",{body:`${t.current} PR${t.current>1?"s":""} awaiting your review`,icon:"/favicon.ico",tag:"review-reminder"})),r()};return r(),()=>{n&&clearTimeout(n)}},[])}const J_e=de({id:M,title:M,description:pe(M),author:M,repositoryName:M,creationDate:Cb,lastModifiedDate:Cb,link:M,account:de({profile:M,region:M,awsAccountId:pe(M),repoAccountId:pe(M)}),status:kq,sourceBranch:M,destinationBranch:M,isMergeable:sn,isApproved:sn,commentCount:pe(ve),healthScore:pe(ve),fetchedAt:pe(Cb),approvedBy:oa(Ie(M),{default:()=>[]}),approvedByArns:oa(Ie(M),{default:()=>[]}),commentedBy:oa(Ie(M),{default:()=>[]}),filesChanged:pe(ve),approvalRules:oa(Ie(de({ruleName:M,requiredApprovals:ve,poolMembers:Ie(M),poolMemberArns:oa(Ie(M),{default:()=>[]}),satisfied:sn,fromTemplate:pe(M)})),{default:()=>[]})}),X_e=de({id:ve,pullRequestId:M,awsAccountId:M,type:M,title:M,profile:M,message:M,createdAt:M,read:ve}),Q_e=de({id:M,pullRequestId:M,awsAccountId:M,repositoryName:M,sourceBranch:M,containerId:tn(M),port:tn(ve),status:M,statusDetail:tn(M),logs:tn(M),error:tn(M),createdAt:M,lastActivityAt:M}),Z_e=de({pullRequests:Ie(J_e),accounts:Ie(de({profile:M,region:M,enabled:sn})),status:j1e,statusDetail:pe(M),error:pe(M),lastUpdated:pe(Cb),currentUser:pe(M),pendingReviewCount:oa(ve,{default:()=>0}),unreadNotificationCount:pe(ve),notifications:pe(de({items:Ie(X_e),nextCursor:pe(ve)})),sandboxes:pe(Ie(Q_e)),permissionPrompt:pe(de({id:M,operation:M,category:M,context:M}))}),eke=p7(f2(Z_e));function tke(e,t,n){const r=g.useRef(e);r.current=e;const s=g.useRef(t);s.current=t;const i=g.useRef(n);i.current=n;const[a,o]=g.useState("disconnected"),l=g.useRef(0);return g.useEffect(()=>{let c=null,f=0,u=null;const h=()=>{c=new EventSource("/api/events/"),c.onopen=()=>{f=0,o("connected")},c.onmessage=m=>{var p,v;try{const S=eke(m.data),y=((p=S.notifications)==null?void 0:p.items)??[],b=new Set(["title_changed","description_changed"]);if(l.current>0)for(const x of y)x.id>l.current&&!b.has(x.type)&&(Sq(x.title||"New notification",{id:`notif-${x.id}`,description:x.message,duration:8e3,action:x.awsAccountId&&x.pullRequestId?{label:"View",onClick:()=>{var _;return(_=s.current)==null?void 0:_.call(s,`/accounts/${x.awsAccountId}/prs/${x.pullRequestId}`)}}:{label:"View",onClick:()=>{var _;return(_=s.current)==null?void 0:_.call(s,"/notifications")}}}),(v=i.current)==null||v.call(i,{id:x.id,type:x.type,title:x.title||"CodeCommit",message:x.message,awsAccountId:x.awsAccountId,pullRequestId:x.pullRequestId}));if(y.length>0){const x=Math.max(...y.map(_=>_.id));x>l.current&&(l.current=x)}r.current(S)}catch{}},c.onerror=()=>{if(c==null||c.close(),f>=50){o("disconnected");return}o("reconnecting");const m=Math.min(1e3*2**f,3e4);u=setTimeout(()=>{f++,h()},m)}};return h(),()=>{c==null||c.close(),u&&clearTimeout(u)}},[]),a}/**
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 Iq=(...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 nke=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 rke=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 CP=e=>{const t=rke(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 ske={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 ike=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 ake=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>g.createElement("svg",{ref:l,...ske,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Iq("lucide",s),...!i&&!ike(o)&&{"aria-hidden":"true"},...o},[...a.map(([c,f])=>g.createElement(c,f)),...Array.isArray(i)?i:[i]]));/**
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 Ue=(e,t)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(ake,{ref:i,iconNode:t,className:Iq(`lucide-${nke(CP(e))}`,`lucide-${e}`,r),...s}));return n.displayName=CP(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 oke=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Oy=Ue("arrow-left",oke);/**
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 lke=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Pq=Ue("arrow-right",lke);/**
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 cke=[["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"}]],uke=Ue("bell-off",cke);/**
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 fke=[["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"}]],My=Ue("bell",fke);/**
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 dke=[["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"}]],_g=Ue("box",dke);/**
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 hke=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],mke=Ue("calendar",hke);/**
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 pke=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],gke=Ue("chart-column",pke);/**
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 yke=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jh=Ue("check",yke);/**
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 vke=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jy=Ue("chevron-down",vke);/**
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 bke=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],xke=Ue("chevron-left",bke);/**
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 Ske=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wke=Ue("chevron-right",Ske);/**
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 _ke=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kke=Ue("chevron-up",_ke);/**
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 Eke=[["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"}]],Cke=Ue("circle-alert",Eke);/**
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 Rke=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$q=Ue("circle-check-big",Rke);/**
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 Nke=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Tke=Ue("clock",Nke);/**
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 Ake=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],zq=Ue("code",Ake);/**
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 Oke=[["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"}]],Lq=Ue("copy",Oke);/**
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 Mke=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],jke=Ue("download",Mke);/**
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 Dke=[["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"}]],Ike=Ue("external-link",Dke);/**
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 Pke=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j2=Ue("eye",Pke);/**
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 $ke=[["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"}]],zke=Ue("file",$ke);/**
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 Lke=[["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"}]],Fq=Ue("flame",Lke);/**
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 Fke=[["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"}]],RP=Ue("funnel",Fke);/**
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 Uke=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],NP=Ue("git-pull-request",Uke);/**
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 Bke=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],D2=Ue("info",Bke);/**
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 Hke=[["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"}]],Ra=Ue("loader",Hke);/**
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 qke=[["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"}]],Uq=Ue("log-in",qke);/**
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 Vke=[["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"}]],Bq=Ue("log-out",Vke);/**
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 Kke=[["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"}]],Gke=Ue("mail-open",Kke);/**
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 Yke=[["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"}]],Wke=Ue("mail",Yke);/**
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 Jke=[["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"}]],Hq=Ue("message-square",Jke);/**
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 Xke=[["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"}]],Qke=Ue("monitor",Xke);/**
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 Zke=[["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"}]],qq=Ue("moon",Zke);/**
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 eEe=[["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"}]],tEe=Ue("palette",eEe);/**
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 nEe=[["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"}]],Vq=Ue("play",nEe);/**
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 rEe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vo=Ue("plus",rEe);/**
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 sEe=[["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"}]],Qu=Ue("refresh-cw",sEe);/**
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 iEe=[["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"}]],aEe=Ue("rotate-ccw",iEe);/**
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 oEe=[["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"}]],Dw=Ue("scroll-text",oEe);/**
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 lEe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Iw=Ue("search",lEe);/**
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 cEe=[["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"}]],uEe=Ue("server",cEe);/**
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 fEe=[["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"}]],Mf=Ue("settings",fEe);/**
338
+ * @license lucide-react v0.563.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const dEe=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Kq=Ue("shield-check",dEe);/**
343
+ * @license lucide-react v0.563.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const hEe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Gq=Ue("square",hEe);/**
348
+ * @license lucide-react v0.563.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const mEe=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],pEe=Ue("star",mEe);/**
353
+ * @license lucide-react v0.563.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const gEe=[["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"}]],Yq=Ue("sun",gEe);/**
358
+ * @license lucide-react v0.563.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const yEe=[["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"}]],Wq=Ue("trash-2",yEe);/**
363
+ * @license lucide-react v0.563.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const vEe=[["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"}]],Db=Ue("trash",vEe);/**
368
+ * @license lucide-react v0.563.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const bEe=[["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"}]],xEe=Ue("triangle-alert",bEe);/**
373
+ * @license lucide-react v0.563.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const SEe=[["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"}]],Pw=Ue("user",SEe);/**
378
+ * @license lucide-react v0.563.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const wEe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mp=Ue("x",wEe),Jq=["account","author","approver","commenter","scope","repo","status","size"],TP=Aw(!1).pipe(Ty),Xq=["accounts","refresh","sandbox","notifications","permissions","audit","theme","config","about"];Aw("accounts").pipe(Ty);var AP=1,_Ee=.9,kEe=.8,EEe=.17,q_=.1,V_=.999,CEe=.9999,REe=.99,NEe=/[\\\/_+.#"@\[\(\{&]/,TEe=/[\\\/_+.#"@\[\(\{&]/g,AEe=/[\s-]/,Qq=/[\s-]/g;function lR(e,t,n,r,s,i,a){if(i===t.length)return s===e.length?AP:REe;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var l=r.charAt(i),c=n.indexOf(l,s),f=0,u,h,m,p;c>=0;)u=lR(e,t,n,r,c+1,i+1,a),u>f&&(c===s?u*=AP:NEe.test(e.charAt(c-1))?(u*=kEe,m=e.slice(s,c-1).match(TEe),m&&s>0&&(u*=Math.pow(V_,m.length))):AEe.test(e.charAt(c-1))?(u*=_Ee,p=e.slice(s,c-1).match(Qq),p&&s>0&&(u*=Math.pow(V_,p.length))):(u*=EEe,s>0&&(u*=Math.pow(V_,c-s))),e.charAt(c)!==t.charAt(i)&&(u*=CEe)),(u<q_&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(h=lR(e,t,n,r,c+1,i+2,a),h*q_>u&&(u=h*q_)),u>f&&(f=u),c=n.indexOf(l,c+1);return a[o]=f,f}function OP(e){return e.toLowerCase().replace(Qq," ")}function OEe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,lR(e,t,OP(e),OP(t),0,0,{})}function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function MP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Na(...e){return t=>{let n=!1;const r=e.map(s=>{const i=MP(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():MP(e[s],null)}}}}function Mt(...e){return g.useCallback(Na(...e),e)}function MEe(e,t){const n=g.createContext(t),r=i=>{const{children:a,...o}=i,l=g.useMemo(()=>o,Object.values(o));return d.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function s(i){const a=g.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function Go(e,t=[]){let n=[];function r(i,a){const o=g.createContext(a),l=n.length;n=[...n,a];const c=u=>{var y;const{scope:h,children:m,...p}=u,v=((y=h==null?void 0:h[e])==null?void 0:y[l])||o,S=g.useMemo(()=>p,Object.values(p));return d.jsx(v.Provider,{value:S,children:m})};c.displayName=i+"Provider";function f(u,h){var v;const m=((v=h==null?void 0:h[e])==null?void 0:v[l])||o,p=g.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,f]}const s=()=>{const i=n.map(a=>g.createContext(a));return function(o){const l=(o==null?void 0:o[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return s.scopeName=e,[r,jEe(s,...t)]}function jEe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...o,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var jr=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},DEe=q0[" useId ".trim().toString()]||(()=>{}),IEe=0;function Or(e){const[t,n]=g.useState(DEe());return jr(()=>{n(r=>r??String(IEe++))},[e]),e||(t?`radix-${t}`:"")}var PEe=q0[" useInsertionEffect ".trim().toString()]||jr;function $o({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,a]=$Ee({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:s;{const f=g.useRef(e!==void 0);g.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=g.useCallback(f=>{var u;if(o){const h=zEe(f)?f(e):f;h!==e&&((u=a.current)==null||u.call(a,h))}else i(f)},[o,e,i,a]);return[l,c]}function $Ee({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),s=g.useRef(n),i=g.useRef(t);return PEe(()=>{i.current=t},[t]),g.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function zEe(e){return typeof e=="function"}function rc(e){const t=LEe(e),n=g.forwardRef((r,s)=>{const{children:i,...a}=r,o=g.Children.toArray(i),l=o.find(UEe);if(l){const c=l.props.children,f=o.map(u=>u===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return d.jsx(t,{...a,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,f):null})}return d.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var Zq=rc("Slot");function LEe(e){const t=g.forwardRef((n,r)=>{const{children:s,...i}=n;if(g.isValidElement(s)){const a=HEe(s),o=BEe(i,s.props);return s.type!==g.Fragment&&(o.ref=r?Na(r,a):a),g.cloneElement(s,o)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FEe=Symbol("radix.slottable");function UEe(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FEe}function BEe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{const l=i(...o);return s(...o),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function HEe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rt=qEe.reduce((e,t)=>{const n=rc(`Primitive.${t}`),r=g.forwardRef((s,i)=>{const{asChild:a,...o}=s,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function eV(e,t){e&&gh.flushSync(()=>e.dispatchEvent(t))}function Ta(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function VEe(e,t=globalThis==null?void 0:globalThis.document){const n=Ta(e);g.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var KEe="DismissableLayer",cR="dismissableLayer.update",GEe="dismissableLayer.pointerDownOutside",YEe="dismissableLayer.focusOutside",jP,tV=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dy=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...l}=e,c=g.useContext(tV),[f,u]=g.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),p=Mt(t,k=>u(k)),v=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(S),b=f?v.indexOf(f):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,_=b>=y,C=XEe(k=>{const A=k.target,I=[...c.branches].some(R=>R.contains(A));!_||I||(s==null||s(k),a==null||a(k),k.defaultPrevented||o==null||o())},h),E=QEe(k=>{const A=k.target;[...c.branches].some(R=>R.contains(A))||(i==null||i(k),a==null||a(k),k.defaultPrevented||o==null||o())},h);return VEe(k=>{b===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&o&&(k.preventDefault(),o()))},h),g.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(jP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),DP(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jP)}},[f,h,n,c]),g.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),DP())},[f,c]),g.useEffect(()=>{const k=()=>m({});return document.addEventListener(cR,k),()=>document.removeEventListener(cR,k)},[]),d.jsx(rt.div,{...l,ref:p,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,C.onPointerDownCapture)})});Dy.displayName=KEe;var WEe="DismissableLayerBranch",JEe=g.forwardRef((e,t)=>{const n=g.useContext(tV),r=g.useRef(null),s=Mt(t,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(rt.div,{...e,ref:s})});JEe.displayName=WEe;function XEe(e,t=globalThis==null?void 0:globalThis.document){const n=Ta(e),r=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let l=function(){nV(GEe,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function QEe(e,t=globalThis==null?void 0:globalThis.document){const n=Ta(e),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&nV(YEe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function DP(){const e=new CustomEvent(cR);document.dispatchEvent(e)}function nV(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?eV(s,i):s.dispatchEvent(i)}var K_="focusScope.autoFocusOnMount",G_="focusScope.autoFocusOnUnmount",IP={bubbles:!1,cancelable:!0},ZEe="FocusScope",Iy=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[o,l]=g.useState(null),c=Ta(s),f=Ta(i),u=g.useRef(null),h=Mt(t,v=>l(v)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let v=function(x){if(m.paused||!o)return;const _=x.target;o.contains(_)?u.current=_:rl(u.current,{select:!0})},S=function(x){if(m.paused||!o)return;const _=x.relatedTarget;_!==null&&(o.contains(_)||rl(u.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&rl(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const b=new MutationObserver(y);return o&&b.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),b.disconnect()}}},[r,o,m.paused]),g.useEffect(()=>{if(o){$P.add(m);const v=document.activeElement;if(!o.contains(v)){const y=new CustomEvent(K_,IP);o.addEventListener(K_,c),o.dispatchEvent(y),y.defaultPrevented||(eCe(iCe(rV(o)),{select:!0}),document.activeElement===v&&rl(o))}return()=>{o.removeEventListener(K_,c),setTimeout(()=>{const y=new CustomEvent(G_,IP);o.addEventListener(G_,f),o.dispatchEvent(y),y.defaultPrevented||rl(v??document.body,{select:!0}),o.removeEventListener(G_,f),$P.remove(m)},0)}}},[o,c,f,m]);const p=g.useCallback(v=>{if(!n&&!r||m.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(S&&y){const b=v.currentTarget,[x,_]=tCe(b);x&&_?!v.shiftKey&&y===_?(v.preventDefault(),n&&rl(x,{select:!0})):v.shiftKey&&y===x&&(v.preventDefault(),n&&rl(_,{select:!0})):y===b&&v.preventDefault()}},[n,r,m.paused]);return d.jsx(rt.div,{tabIndex:-1,...a,ref:h,onKeyDown:p})});Iy.displayName=ZEe;function eCe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rl(r,{select:t}),document.activeElement!==n)return}function tCe(e){const t=rV(e),n=PP(t,e),r=PP(t.reverse(),e);return[n,r]}function rV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function PP(e,t){for(const n of e)if(!nCe(n,{upTo:t}))return n}function nCe(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 rCe(e){return e instanceof HTMLInputElement&&"select"in e}function rl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rCe(e)&&t&&e.select()}}var $P=sCe();function sCe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zP(e,t),e.unshift(t)},remove(t){var n;e=zP(e,t),(n=e[0])==null||n.resume()}}}function zP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iCe(e){return e.filter(t=>t.tagName!=="A")}var aCe="Portal",Py=g.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[s,i]=g.useState(!1);jr(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?h3.createPortal(d.jsx(rt.div,{...r,ref:t}),a):null});Py.displayName=aCe;function oCe(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var za=e=>{const{present:t,children:n}=e,r=lCe(t),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=Mt(r.ref,cCe(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};za.displayName="Presence";function lCe(e){const[t,n]=g.useState(),r=g.useRef(null),s=g.useRef(e),i=g.useRef("none"),a=e?"mounted":"unmounted",[o,l]=oCe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Dv(r.current);i.current=o==="mounted"?c:"none"},[o]),jr(()=>{const c=r.current,f=s.current;if(f!==e){const h=i.current,m=Dv(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),jr(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=m=>{const v=Dv(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(l("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},h=m=>{m.target===t&&(i.current=Dv(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Dv(e){return(e==null?void 0:e.animationName)||"none"}function cCe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Y_=0;function $w(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??LP()),document.body.insertAdjacentElement("beforeend",e[1]??LP()),Y_++,()=>{Y_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Y_--}},[])}function LP(){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 la=function(){return la=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},la.apply(this,arguments)};function sV(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function uCe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ib="right-scroll-bar-position",Pb="width-before-scroll-bar",fCe="with-scroll-bars-hidden",dCe="--removed-body-scroll-bar-size";function W_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hCe(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var mCe=typeof window<"u"?g.useLayoutEffect:g.useEffect,FP=new WeakMap;function pCe(e,t){var n=hCe(null,function(r){return e.forEach(function(s){return W_(s,r)})});return mCe(function(){var r=FP.get(n);if(r){var s=new Set(r),i=new Set(e),a=n.current;s.forEach(function(o){i.has(o)||W_(o,null)}),i.forEach(function(o){s.has(o)||W_(o,a)})}FP.set(n,e)},[e]),n}function gCe(e){return e}function yCe(e,t){t===void 0&&(t=gCe);var n=[],r=!1,s={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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(i),a=n}var l=function(){var f=a;a=[],f.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){a.push(f),c()},filter:function(f){return a=a.filter(f),n}}}};return s}function vCe(e){e===void 0&&(e={});var t=yCe(null);return t.options=la({async:!0,ssr:!1},e),t}var iV=function(e){var t=e.sideCar,n=sV(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 g.createElement(r,la({},n))};iV.isSideCarExport=!0;function bCe(e,t){return e.useMedium(t),iV}var aV=vCe(),J_=function(){},zw=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:J_,onWheelCapture:J_,onTouchMoveCapture:J_}),s=r[0],i=r[1],a=e.forwardProps,o=e.children,l=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,h=e.sideCar,m=e.noRelative,p=e.noIsolation,v=e.inert,S=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,x=e.gapMode,_=sV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=pCe([n,t]),k=la(la({},_),s);return g.createElement(g.Fragment,null,f&&g.createElement(C,{sideCar:aV,removeScrollBar:c,shards:u,noRelative:m,noIsolation:p,inert:v,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:x}),a?g.cloneElement(g.Children.only(o),la(la({},k),{ref:E})):g.createElement(b,la({},k,{className:l,ref:E}),o))});zw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zw.classNames={fullWidth:Pb,zeroRight:Ib};var xCe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function SCe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xCe();return t&&e.setAttribute("nonce",t),e}function wCe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _Ce(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kCe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=SCe())&&(wCe(t,n),_Ce(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ECe=function(){var e=kCe();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oV=function(){var e=ECe(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},CCe={left:0,top:0,right:0,gap:0},X_=function(e){return parseInt(e||"",10)||0},RCe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[X_(n),X_(r),X_(s)]},NCe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return CCe;var t=RCe(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])}},TCe=oV(),_d="data-scroll-locked",ACe=function(e,t,n,r){var s=e.left,i=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
383
+ .`.concat(fCe,` {
384
+ overflow: hidden `).concat(r,`;
385
+ padding-right: `).concat(o,"px ").concat(r,`;
386
+ }
387
+ body[`).concat(_d,`] {
388
+ overflow: hidden `).concat(r,`;
389
+ overscroll-behavior: contain;
390
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
391
+ padding-left: `.concat(s,`px;
392
+ padding-top: `).concat(i,`px;
393
+ padding-right: `).concat(a,`px;
394
+ margin-left:0;
395
+ margin-top:0;
396
+ margin-right: `).concat(o,"px ").concat(r,`;
397
+ `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
398
+ }
399
+
400
+ .`).concat(Ib,` {
401
+ right: `).concat(o,"px ").concat(r,`;
402
+ }
403
+
404
+ .`).concat(Pb,` {
405
+ margin-right: `).concat(o,"px ").concat(r,`;
406
+ }
407
+
408
+ .`).concat(Ib," .").concat(Ib,` {
409
+ right: 0 `).concat(r,`;
410
+ }
411
+
412
+ .`).concat(Pb," .").concat(Pb,` {
413
+ margin-right: 0 `).concat(r,`;
414
+ }
415
+
416
+ body[`).concat(_d,`] {
417
+ `).concat(dCe,": ").concat(o,`px;
418
+ }
419
+ `)},UP=function(){var e=parseInt(document.body.getAttribute(_d)||"0",10);return isFinite(e)?e:0},OCe=function(){g.useEffect(function(){return document.body.setAttribute(_d,(UP()+1).toString()),function(){var e=UP()-1;e<=0?document.body.removeAttribute(_d):document.body.setAttribute(_d,e.toString())}},[])},MCe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;OCe();var i=g.useMemo(function(){return NCe(s)},[s]);return g.createElement(TCe,{styles:ACe(i,!t,s,n?"":"!important")})},uR=!1;if(typeof window<"u")try{var Iv=Object.defineProperty({},"passive",{get:function(){return uR=!0,!0}});window.addEventListener("test",Iv,Iv),window.removeEventListener("test",Iv,Iv)}catch{uR=!1}var vf=uR?{passive:!1}:!1,jCe=function(e){return e.tagName==="TEXTAREA"},lV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jCe(e)&&n[t]==="visible")},DCe=function(e){return lV(e,"overflowY")},ICe=function(e){return lV(e,"overflowX")},BP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=cV(e,r);if(s){var i=uV(e,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PCe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$Ce=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cV=function(e,t){return e==="v"?DCe(t):ICe(t)},uV=function(e,t){return e==="v"?PCe(t):$Ce(t)},zCe=function(e,t){return e==="h"&&t==="rtl"?-1:1},LCe=function(e,t,n,r,s){var i=zCe(e,window.getComputedStyle(t).direction),a=i*r,o=n.target,l=t.contains(o),c=!1,f=a>0,u=0,h=0;do{if(!o)break;var m=uV(e,o),p=m[0],v=m[1],S=m[2],y=v-S-i*p;(p||y)&&cV(e,o)&&(u+=y,h+=p);var b=o.parentNode;o=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(f&&Math.abs(u)<1||!f&&Math.abs(h)<1)&&(c=!0),c},Pv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HP=function(e){return[e.deltaX,e.deltaY]},qP=function(e){return e&&"current"in e?e.current:e},FCe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UCe=function(e){return`
420
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
421
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
422
+ `)},BCe=0,bf=[];function HCe(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(BCe++)[0],i=g.useState(oV)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=uCe([e.lockRef.current],(e.shards||[]).map(qP),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var o=g.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var y=Pv(v),b=n.current,x="deltaX"in v?v.deltaX:b[0]-y[0],_="deltaY"in v?v.deltaY:b[1]-y[1],C,E=v.target,k=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in v&&k==="h"&&E.type==="range")return!1;var A=window.getSelection(),I=A&&A.anchorNode,R=I?I===E||I.contains(E):!1;if(R)return!1;var $=BP(k,E);if(!$)return!0;if($?C=k:(C=k==="v"?"h":"v",$=BP(k,E)),!$)return!1;if(!r.current&&"changedTouches"in v&&(x||_)&&(r.current=C),!C)return!0;var U=r.current||C;return LCe(U,S,v,U==="h"?x:_)},[]),l=g.useCallback(function(v){var S=v;if(!(!bf.length||bf[bf.length-1]!==i)){var y="deltaY"in S?HP(S):Pv(S),b=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&FCe(C.delta,y)})[0];if(b&&b.should){S.cancelable&&S.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(qP).filter(Boolean).filter(function(C){return C.contains(S.target)}),_=x.length>0?o(S,x[0]):!a.current.noIsolation;_&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(v,S,y,b){var x={name:v,delta:S,target:y,should:b,shadowParent:qCe(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),f=g.useCallback(function(v){n.current=Pv(v),r.current=void 0},[]),u=g.useCallback(function(v){c(v.type,HP(v),v.target,o(v,e.lockRef.current))},[]),h=g.useCallback(function(v){c(v.type,Pv(v),v.target,o(v,e.lockRef.current))},[]);g.useEffect(function(){return bf.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",l,vf),document.addEventListener("touchmove",l,vf),document.addEventListener("touchstart",f,vf),function(){bf=bf.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,vf),document.removeEventListener("touchmove",l,vf),document.removeEventListener("touchstart",f,vf)}},[]);var m=e.removeScrollBar,p=e.inert;return g.createElement(g.Fragment,null,p?g.createElement(i,{styles:UCe(s)}):null,m?g.createElement(MCe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qCe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const VCe=bCe(aV,HCe);var $y=g.forwardRef(function(e,t){return g.createElement(zw,la({},e,{ref:t,sideCar:VCe}))});$y.classNames=zw.classNames;var KCe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xf=new WeakMap,$v=new WeakMap,zv={},Q_=0,fV=function(e){return e&&(e.host||fV(e.parentNode))},GCe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fV(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})},YCe=function(e,t,n,r){var s=GCe(t,Array.isArray(e)?e:[e]);zv[n]||(zv[n]=new WeakMap);var i=zv[n],a=[],o=new Set,l=new Set(s),c=function(u){!u||o.has(u)||(o.add(u),c(u.parentNode))};s.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(h){if(o.has(h))f(h);else try{var m=h.getAttribute(r),p=m!==null&&m!=="false",v=(xf.get(h)||0)+1,S=(i.get(h)||0)+1;xf.set(h,v),i.set(h,S),a.push(h),v===1&&p&&$v.set(h,!0),S===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return f(t),o.clear(),Q_++,function(){a.forEach(function(u){var h=xf.get(u)-1,m=i.get(u)-1;xf.set(u,h),i.set(u,m),h||($v.has(u)||u.removeAttribute(r),$v.delete(u)),m||u.removeAttribute(n)}),Q_--,Q_||(xf=new WeakMap,xf=new WeakMap,$v=new WeakMap,zv={})}},Lw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=KCe(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),YCe(r,s,n,"aria-hidden")):function(){return null}},Fw="Dialog",[dV]=Go(Fw),[WCe,Zi]=dV(Fw),hV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,o=g.useRef(null),l=g.useRef(null),[c,f]=$o({prop:r,defaultProp:s??!1,onChange:i,caller:Fw});return d.jsx(WCe,{scope:t,triggerRef:o,contentRef:l,contentId:Or(),titleId:Or(),descriptionId:Or(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(u=>!u),[f]),modal:a,children:n})};hV.displayName=Fw;var mV="DialogTrigger",JCe=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zi(mV,n),i=Mt(t,s.triggerRef);return d.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$2(s.open),...r,ref:i,onClick:Ee(e.onClick,s.onOpenToggle)})});JCe.displayName=mV;var I2="DialogPortal",[XCe,pV]=dV(I2,{forceMount:void 0}),gV=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Zi(I2,t);return d.jsx(XCe,{scope:t,forceMount:n,children:g.Children.map(r,a=>d.jsx(za,{present:n||i.open,children:d.jsx(Py,{asChild:!0,container:s,children:a})}))})};gV.displayName=I2;var _0="DialogOverlay",yV=g.forwardRef((e,t)=>{const n=pV(_0,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Zi(_0,e.__scopeDialog);return i.modal?d.jsx(za,{present:r||i.open,children:d.jsx(ZCe,{...s,ref:t})}):null});yV.displayName=_0;var QCe=rc("DialogOverlay.RemoveScroll"),ZCe=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zi(_0,n);return d.jsx($y,{as:QCe,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(rt.div,{"data-state":$2(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Tu="DialogContent",vV=g.forwardRef((e,t)=>{const n=pV(Tu,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Zi(Tu,e.__scopeDialog);return d.jsx(za,{present:r||i.open,children:i.modal?d.jsx(eRe,{...s,ref:t}):d.jsx(tRe,{...s,ref:t})})});vV.displayName=Tu;var eRe=g.forwardRef((e,t)=>{const n=Zi(Tu,e.__scopeDialog),r=g.useRef(null),s=Mt(t,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return Lw(i)},[]),d.jsx(bV,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())})}),tRe=g.forwardRef((e,t)=>{const n=Zi(Tu,e.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return d.jsx(bV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),bV=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,o=Zi(Tu,n),l=g.useRef(null),c=Mt(t,l);return $w(),d.jsxs(d.Fragment,{children:[d.jsx(Iy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:d.jsx(Dy,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":$2(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(nRe,{titleId:o.titleId}),d.jsx(sRe,{contentRef:l,descriptionId:o.descriptionId})]})]})}),P2="DialogTitle",xV=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zi(P2,n);return d.jsx(rt.h2,{id:s.titleId,...r,ref:t})});xV.displayName=P2;var SV="DialogDescription",wV=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zi(SV,n);return d.jsx(rt.p,{id:s.descriptionId,...r,ref:t})});wV.displayName=SV;var _V="DialogClose",kV=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zi(_V,n);return d.jsx(rt.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>s.onOpenChange(!1))})});kV.displayName=_V;function $2(e){return e?"open":"closed"}var EV="DialogTitleWarning",[pFe,CV]=MEe(EV,{contentName:Tu,titleName:P2,docsSlug:"dialog"}),nRe=({titleId:e})=>{const t=CV(EV),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
423
+
424
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
425
+
426
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rRe="DialogDescriptionWarning",sRe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${CV(rRe).contentName}}.`;return g.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},RV=hV,NV=gV,TV=yV,AV=vV,iRe=xV,aRe=wV,oRe=kV,lRe=Symbol.for("react.lazy"),k0=q0[" use ".trim().toString()];function cRe(e){return typeof e=="object"&&e!==null&&"then"in e}function OV(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lRe&&"_payload"in e&&cRe(e._payload)}function uRe(e){const t=fRe(e),n=g.forwardRef((r,s)=>{let{children:i,...a}=r;OV(i)&&typeof k0=="function"&&(i=k0(i._payload));const o=g.Children.toArray(i),l=o.find(hRe);if(l){const c=l.props.children,f=o.map(u=>u===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return d.jsx(t,{...a,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,f):null})}return d.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function fRe(e){const t=g.forwardRef((n,r)=>{let{children:s,...i}=n;if(OV(s)&&typeof k0=="function"&&(s=k0(s._payload)),g.isValidElement(s)){const a=pRe(s),o=mRe(i,s.props);return s.type!==g.Fragment&&(o.ref=r?Na(r,a):a),g.cloneElement(s,o)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dRe=Symbol("radix.slottable");function hRe(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dRe}function mRe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{const l=i(...o);return s(...o),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function pRe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gRe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yc=gRe.reduce((e,t)=>{const n=uRe(`Primitive.${t}`),r=g.forwardRef((s,i)=>{const{asChild:a,...o}=s,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Tm='[cmdk-group=""]',Z_='[cmdk-group-items=""]',yRe='[cmdk-group-heading=""]',MV='[cmdk-item=""]',VP=`${MV}:not([aria-disabled="true"])`,fR="cmdk-item-select",jf="data-value",vRe=(e,t,n)=>OEe(e,t,n),jV=g.createContext(void 0),zy=()=>g.useContext(jV),DV=g.createContext(void 0),z2=()=>g.useContext(DV),IV=g.createContext(void 0),PV=g.forwardRef((e,t)=>{let n=Df(()=>{var q,N;return{search:"",value:(N=(q=e.value)!=null?q:e.defaultValue)!=null?N:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Df(()=>new Set),s=Df(()=>new Map),i=Df(()=>new Map),a=Df(()=>new Set),o=$V(e),{label:l,children:c,value:f,onValueChange:u,filter:h,shouldFilter:m,loop:p,disablePointerSelection:v=!1,vimBindings:S=!0,...y}=e,b=Or(),x=Or(),_=Or(),C=g.useRef(null),E=TRe();Au(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,k.emit()}},[f]),Au(()=>{E(6,K)},[]);let k=g.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>n.current,setState:(q,N,J)=>{var Y,le,Q,ae;if(!Object.is(n.current[q],N)){if(n.current[q]=N,q==="search")U(),R(),E(1,$);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(_);te?te.focus():(Y=document.getElementById(b))==null||Y.focus()}if(E(7,()=>{var te;n.current.selectedItemId=(te=W())==null?void 0:te.id,k.emit()}),J||E(5,K),((le=o.current)==null?void 0:le.value)!==void 0){let te=N??"";(ae=(Q=o.current).onValueChange)==null||ae.call(Q,te);return}}k.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),A=g.useMemo(()=>({value:(q,N,J)=>{var Y;N!==((Y=i.current.get(q))==null?void 0:Y.value)&&(i.current.set(q,{value:N,keywords:J}),n.current.filtered.items.set(q,I(N,J)),E(2,()=>{R(),k.emit()}))},item:(q,N)=>(r.current.add(q),N&&(s.current.has(N)?s.current.get(N).add(q):s.current.set(N,new Set([q]))),E(3,()=>{U(),R(),n.current.value||$(),k.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let J=W();E(4,()=>{U(),(J==null?void 0:J.getAttribute("id"))===q&&$(),k.emit()})}),group:q=>(s.current.has(q)||s.current.set(q,new Set),()=>{i.current.delete(q),s.current.delete(q)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:b,inputId:_,labelId:x,listInnerRef:C}),[]);function I(q,N){var J,Y;let le=(Y=(J=o.current)==null?void 0:J.filter)!=null?Y:vRe;return q?le(q,n.current.search,N):0}function R(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,N=[];n.current.filtered.groups.forEach(Y=>{let le=s.current.get(Y),Q=0;le.forEach(ae=>{let te=q.get(ae);Q=Math.max(te,Q)}),N.push([Y,Q])});let J=C.current;B().sort((Y,le)=>{var Q,ae;let te=Y.getAttribute("id"),fe=le.getAttribute("id");return((Q=q.get(fe))!=null?Q:0)-((ae=q.get(te))!=null?ae:0)}).forEach(Y=>{let le=Y.closest(Z_);le?le.appendChild(Y.parentElement===le?Y:Y.closest(`${Z_} > *`)):J.appendChild(Y.parentElement===J?Y:Y.closest(`${Z_} > *`))}),N.sort((Y,le)=>le[1]-Y[1]).forEach(Y=>{var le;let Q=(le=C.current)==null?void 0:le.querySelector(`${Tm}[${jf}="${encodeURIComponent(Y[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function $(){let q=B().find(J=>J.getAttribute("aria-disabled")!=="true"),N=q==null?void 0:q.getAttribute(jf);k.setState("value",N||void 0)}function U(){var q,N,J,Y;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let Q of r.current){let ae=(N=(q=i.current.get(Q))==null?void 0:q.value)!=null?N:"",te=(Y=(J=i.current.get(Q))==null?void 0:J.keywords)!=null?Y:[],fe=I(ae,te);n.current.filtered.items.set(Q,fe),fe>0&&le++}for(let[Q,ae]of s.current)for(let te of ae)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=le}function K(){var q,N,J;let Y=W();Y&&(((q=Y.parentElement)==null?void 0:q.firstChild)===Y&&((J=(N=Y.closest(Tm))==null?void 0:N.querySelector(yRe))==null||J.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function W(){var q;return(q=C.current)==null?void 0:q.querySelector(`${MV}[aria-selected="true"]`)}function B(){var q;return Array.from(((q=C.current)==null?void 0:q.querySelectorAll(VP))||[])}function j(q){let N=B()[q];N&&k.setState("value",N.getAttribute(jf))}function F(q){var N;let J=W(),Y=B(),le=Y.findIndex(ae=>ae===J),Q=Y[le+q];(N=o.current)!=null&&N.loop&&(Q=le+q<0?Y[Y.length-1]:le+q===Y.length?Y[0]:Y[le+q]),Q&&k.setState("value",Q.getAttribute(jf))}function z(q){let N=W(),J=N==null?void 0:N.closest(Tm),Y;for(;J&&!Y;)J=q>0?RRe(J,Tm):NRe(J,Tm),Y=J==null?void 0:J.querySelector(VP);Y?k.setState("value",Y.getAttribute(jf)):F(q)}let V=()=>j(B().length-1),O=q=>{q.preventDefault(),q.metaKey?V():q.altKey?z(1):F(1)},me=q=>{q.preventDefault(),q.metaKey?j(0):q.altKey?z(-1):F(-1)};return g.createElement(yc.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:q=>{var N;(N=y.onKeyDown)==null||N.call(y,q);let J=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||J))switch(q.key){case"n":case"j":{S&&q.ctrlKey&&O(q);break}case"ArrowDown":{O(q);break}case"p":case"k":{S&&q.ctrlKey&&me(q);break}case"ArrowUp":{me(q);break}case"Home":{q.preventDefault(),j(0);break}case"End":{q.preventDefault(),V();break}case"Enter":{q.preventDefault();let Y=W();if(Y){let le=new Event(fR);Y.dispatchEvent(le)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:ORe},l),Uw(e,q=>g.createElement(DV.Provider,{value:k},g.createElement(jV.Provider,{value:A},q))))}),bRe=g.forwardRef((e,t)=>{var n,r;let s=Or(),i=g.useRef(null),a=g.useContext(IV),o=zy(),l=$V(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Au(()=>{if(!c)return o.item(s,a==null?void 0:a.id)},[c]);let f=zV(s,i,[e.value,e.children,i],e.keywords),u=z2(),h=sc(E=>E.value&&E.value===f.current),m=sc(E=>c||o.filter()===!1?!0:E.search?E.filtered.items.get(s)>0:!0);g.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener(fR,p),()=>E.removeEventListener(fR,p)},[m,e.onSelect,e.disabled]);function p(){var E,k;v(),(k=(E=l.current).onSelect)==null||k.call(E,f.current)}function v(){u.setState("value",f.current,!0)}if(!m)return null;let{disabled:S,value:y,onSelect:b,forceMount:x,keywords:_,...C}=e;return g.createElement(yc.div,{ref:Na(i,t),...C,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!h,"data-disabled":!!S,"data-selected":!!h,onPointerMove:S||o.getDisablePointerSelection()?void 0:v,onClick:S?void 0:p},e.children)}),xRe=g.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,a=Or(),o=g.useRef(null),l=g.useRef(null),c=Or(),f=zy(),u=sc(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Au(()=>f.group(a),[]),zV(a,o,[e.value,e.heading,l]);let h=g.useMemo(()=>({id:a,forceMount:s}),[s]);return g.createElement(yc.div,{ref:Na(o,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&g.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Uw(e,m=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},g.createElement(IV.Provider,{value:h},m))))}),SRe=g.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=g.useRef(null),i=sc(a=>!a.search);return!n&&!i?null:g.createElement(yc.div,{ref:Na(s,t),...r,"cmdk-separator":"",role:"separator"})}),wRe=g.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=z2(),a=sc(c=>c.search),o=sc(c=>c.selectedItemId),l=zy();return g.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),g.createElement(yc.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:s?e.value:a,onChange:c=>{s||i.setState("search",c.target.value),n==null||n(c.target.value)}})}),_Re=g.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=g.useRef(null),a=g.useRef(null),o=sc(c=>c.selectedItemId),l=zy();return g.useEffect(()=>{if(a.current&&i.current){let c=a.current,f=i.current,u,h=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=c.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(c),()=>{cancelAnimationFrame(u),h.unobserve(c)}}},[]),g.createElement(yc.div,{ref:Na(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},Uw(e,c=>g.createElement("div",{ref:Na(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),kRe=g.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=e;return g.createElement(RV,{open:n,onOpenChange:r},g.createElement(NV,{container:a},g.createElement(TV,{"cmdk-overlay":"",className:s}),g.createElement(AV,{"aria-label":e.label,"cmdk-dialog":"",className:i},g.createElement(PV,{ref:t,...o}))))}),ERe=g.forwardRef((e,t)=>sc(n=>n.filtered.count===0)?g.createElement(yc.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CRe=g.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return g.createElement(yc.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Uw(e,a=>g.createElement("div",{"aria-hidden":!0},a)))}),Zu=Object.assign(PV,{List:_Re,Item:bRe,Input:wRe,Group:xRe,Separator:SRe,Dialog:kRe,Empty:ERe,Loading:CRe});function RRe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function NRe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $V(e){let t=g.useRef(e);return Au(()=>{t.current=e}),t}var Au=typeof window>"u"?g.useEffect:g.useLayoutEffect;function Df(e){let t=g.useRef();return t.current===void 0&&(t.current=e()),t}function sc(e){let t=z2(),n=()=>e(t.snapshot());return g.useSyncExternalStore(t.subscribe,n,n)}function zV(e,t,n,r=[]){let s=g.useRef(),i=zy();return Au(()=>{var a;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():s.current}})(),l=r.map(c=>c.trim());i.value(e,o,l),(a=t.current)==null||a.setAttribute(jf,o),s.current=o}),s}var TRe=()=>{let[e,t]=g.useState(),n=Df(()=>new Map);return Au(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function ARe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Uw({asChild:e,children:t},n){return e&&g.isValidElement(t)?g.cloneElement(ARe(t),{ref:t.ref},n(t.props.children)):n(t)}var ORe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},LV=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"}),MRe="VisuallyHidden",jRe=g.forwardRef((e,t)=>d.jsx(rt.span,{...e,ref:t,style:{...LV,...e.style}}));jRe.displayName=MRe;function L2(e){const t=e+"CollectionProvider",[n,r]=Go(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:S,children:y}=v,b=ee.useRef(null),x=ee.useRef(new Map).current;return d.jsx(s,{scope:S,itemMap:x,collectionRef:b,children:y})};a.displayName=t;const o=e+"CollectionSlot",l=rc(o),c=ee.forwardRef((v,S)=>{const{scope:y,children:b}=v,x=i(o,y),_=Mt(S,x.collectionRef);return d.jsx(l,{ref:_,children:b})});c.displayName=o;const f=e+"CollectionItemSlot",u="data-radix-collection-item",h=rc(f),m=ee.forwardRef((v,S)=>{const{scope:y,children:b,...x}=v,_=ee.useRef(null),C=Mt(S,_),E=i(f,y);return ee.useEffect(()=>(E.itemMap.set(_,{ref:_,...x}),()=>void E.itemMap.delete(_))),d.jsx(h,{[u]:"",ref:C,children:b})});m.displayName=f;function p(v){const S=i(e+"CollectionConsumer",v);return ee.useCallback(()=>{const b=S.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(S.itemMap.values()).sort((E,k)=>x.indexOf(E.ref.current)-x.indexOf(k.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:a,Slot:c,ItemSlot:m},p,r]}var DRe=g.createContext(void 0);function Bw(e){const t=g.useContext(DRe);return e||t||"ltr"}function IRe(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function PRe(e){const[t,n]=g.useState(void 0);return jr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,o;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const $Re=["top","right","bottom","left"],ic=Math.min,_s=Math.max,E0=Math.round,Lv=Math.floor,_a=e=>({x:e,y:e}),zRe={left:"right",right:"left",bottom:"top",top:"bottom"},LRe={start:"end",end:"start"};function dR(e,t,n){return _s(e,ic(t,n))}function zo(e,t){return typeof e=="function"?e(t):e}function Lo(e){return e.split("-")[0]}function Xh(e){return e.split("-")[1]}function F2(e){return e==="x"?"y":"x"}function U2(e){return e==="y"?"height":"width"}const FRe=new Set(["top","bottom"]);function ya(e){return FRe.has(Lo(e))?"y":"x"}function B2(e){return F2(ya(e))}function URe(e,t,n){n===void 0&&(n=!1);const r=Xh(e),s=B2(e),i=U2(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=C0(a)),[a,C0(a)]}function BRe(e){const t=C0(e);return[hR(e),t,hR(t)]}function hR(e){return e.replace(/start|end/g,t=>LRe[t])}const KP=["left","right"],GP=["right","left"],HRe=["top","bottom"],qRe=["bottom","top"];function VRe(e,t,n){switch(e){case"top":case"bottom":return n?t?GP:KP:t?KP:GP;case"left":case"right":return t?HRe:qRe;default:return[]}}function KRe(e,t,n,r){const s=Xh(e);let i=VRe(Lo(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(hR)))),i}function C0(e){return e.replace(/left|right|bottom|top/g,t=>zRe[t])}function GRe(e){return{top:0,right:0,bottom:0,left:0,...e}}function FV(e){return typeof e!="number"?GRe(e):{top:e,right:e,bottom:e,left:e}}function R0(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function YP(e,t,n){let{reference:r,floating:s}=e;const i=ya(t),a=B2(t),o=U2(a),l=Lo(t),c=i==="y",f=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,h=r[o]/2-s[o]/2;let m;switch(l){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-s.width,y:u};break;default:m={x:r.x,y:r.y}}switch(Xh(t)){case"start":m[a]-=h*(n&&c?-1:1);break;case"end":m[a]+=h*(n&&c?-1:1);break}return m}async function YRe(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=zo(t,e),p=FV(m),S=o[h?u==="floating"?"reference":"floating":u],y=R0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:f,strategy:l})),b=u==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=R0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-C.top+p.top)/_.y,bottom:(C.bottom-y.bottom+p.bottom)/_.y,left:(y.left-C.left+p.left)/_.x,right:(C.right-y.right+p.right)/_.x}}const WRe=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=YP(c,r,l),h=r,m={},p=0;for(let S=0;S<o.length;S++){var v;const{name:y,fn:b}=o[S],{x,y:_,data:C,reset:E}=await b({x:f,y:u,initialPlacement:r,placement:h,strategy:s,middlewareData:m,rects:c,platform:{...a,detectOverflow:(v=a.detectOverflow)!=null?v:YRe},elements:{reference:e,floating:t}});f=x??f,u=_??u,m={...m,[y]:{...m[y],...C}},E&&p<=50&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:f,y:u}=YP(c,h,l)),S=-1)}return{x:f,y:u,placement:h,strategy:s,middlewareData:m}},JRe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:l}=t,{element:c,padding:f=0}=zo(e,t)||{};if(c==null)return{};const u=FV(f),h={x:n,y:r},m=B2(s),p=U2(m),v=await a.getDimensions(c),S=m==="y",y=S?"top":"left",b=S?"bottom":"right",x=S?"clientHeight":"clientWidth",_=i.reference[p]+i.reference[m]-h[m]-i.floating[p],C=h[m]-i.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=E?E[x]:0;(!k||!await(a.isElement==null?void 0:a.isElement(E)))&&(k=o.floating[x]||i.floating[p]);const A=_/2-C/2,I=k/2-v[p]/2-1,R=ic(u[y],I),$=ic(u[b],I),U=R,K=k-v[p]-$,W=k/2-v[p]/2+A,B=dR(U,W,K),j=!l.arrow&&Xh(s)!=null&&W!==B&&i.reference[p]/2-(W<U?R:$)-v[p]/2<0,F=j?W<U?W-U:W-K:0;return{[m]:h[m]+F,data:{[m]:B,centerOffset:W-B-F,...j&&{alignmentOffset:F}},reset:j}}}),XRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...S}=zo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Lo(s),b=ya(o),x=Lo(o)===o,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(x||!v?[C0(o)]:BRe(o)),E=p!=="none";!h&&E&&C.push(...KRe(o,v,p,_));const k=[o,...C],A=await l.detectOverflow(t,S),I=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&I.push(A[y]),u){const W=URe(s,a,_);I.push(A[W[0]],A[W[1]])}if(R=[...R,{placement:s,overflows:I}],!I.every(W=>W<=0)){var $,U;const W=((($=i.flip)==null?void 0:$.index)||0)+1,B=k[W];if(B&&(!(u==="alignment"?b!==ya(B):!1)||R.every(z=>ya(z.placement)===b?z.overflows[0]>0:!0)))return{data:{index:W,overflows:R},reset:{placement:B}};let j=(U=R.filter(F=>F.overflows[0]<=0).sort((F,z)=>F.overflows[1]-z.overflows[1])[0])==null?void 0:U.placement;if(!j)switch(m){case"bestFit":{var K;const F=(K=R.filter(z=>{if(E){const V=ya(z.placement);return V===b||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,O)=>V+O,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:K[0];F&&(j=F);break}case"initialPlacement":j=o;break}if(s!==j)return{reset:{placement:j}}}return{}}}};function WP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JP(e){return $Re.some(t=>e[t]>=0)}const QRe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=zo(e,t);switch(s){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=WP(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:JP(o)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),o=WP(a,n.floating);return{data:{escapedOffsets:o,escaped:JP(o)}}}default:return{}}}}},UV=new Set(["left","top"]);async function ZRe(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Lo(n),o=Xh(n),l=ya(n)==="y",c=UV.has(a)?-1:1,f=i&&l?-1:1,u=zo(t,e);let{mainAxis:h,crossAxis:m,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"&&(m=o==="end"?p*-1:p),l?{x:m*f,y:h*c}:{x:h*c,y:m*f}}const eNe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=t,l=await ZRe(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:a}}}}},tNe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...c}=zo(e,t),f={x:n,y:r},u=await i.detectOverflow(t,c),h=ya(Lo(s)),m=F2(h);let p=f[m],v=f[h];if(a){const y=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=p+u[y],_=p-u[b];p=dR(x,p,_)}if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=v+u[y],_=v-u[b];v=dR(x,v,_)}const S=l.fn({...t,[m]:p,[h]:v});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[m]:a,[h]:o}}}}}},nNe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=zo(e,t),f={x:n,y:r},u=ya(s),h=F2(u);let m=f[h],p=f[u];const v=zo(o,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=h==="y"?"height":"width",_=i.reference[h]-i.floating[x]+S.mainAxis,C=i.reference[h]+i.reference[x]-S.mainAxis;m<_?m=_:m>C&&(m=C)}if(c){var y,b;const x=h==="y"?"width":"height",_=UV.has(Lo(s)),C=i.reference[u]-i.floating[x]+(_&&((y=a.offset)==null?void 0:y[u])||0)+(_?0:S.crossAxis),E=i.reference[u]+i.reference[x]+(_?0:((b=a.offset)==null?void 0:b[u])||0)-(_?S.crossAxis:0);p<C?p=C:p>E&&(p=E)}return{[h]:m,[u]:p}}}},rNe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:o}=t,{apply:l=()=>{},...c}=zo(e,t),f=await a.detectOverflow(t,c),u=Lo(s),h=Xh(s),m=ya(s)==="y",{width:p,height:v}=i.floating;let S,y;u==="top"||u==="bottom"?(S=u,y=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=u,S=h==="end"?"top":"bottom");const b=v-f.top-f.bottom,x=p-f.left-f.right,_=ic(v-f[S],b),C=ic(p-f[y],x),E=!t.middlewareData.shift;let k=_,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),E&&!h){const R=_s(f.left,0),$=_s(f.right,0),U=_s(f.top,0),K=_s(f.bottom,0);m?A=p-2*(R!==0||$!==0?R+$:_s(f.left,f.right)):k=v-2*(U!==0||K!==0?U+K:_s(f.top,f.bottom))}await l({...t,availableWidth:A,availableHeight:k});const I=await a.getDimensions(o.floating);return p!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function Hw(){return typeof window<"u"}function Qh(e){return BV(e)?(e.nodeName||"").toLowerCase():"#document"}function js(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function La(e){var t;return(t=(BV(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BV(e){return Hw()?e instanceof Node||e instanceof js(e).Node:!1}function Gi(e){return Hw()?e instanceof Element||e instanceof js(e).Element:!1}function Aa(e){return Hw()?e instanceof HTMLElement||e instanceof js(e).HTMLElement:!1}function XP(e){return!Hw()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof js(e).ShadowRoot}const sNe=new Set(["inline","contents"]);function Ly(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Yi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!sNe.has(s)}const iNe=new Set(["table","td","th"]);function aNe(e){return iNe.has(Qh(e))}const oNe=[":popover-open",":modal"];function qw(e){return oNe.some(t=>{try{return e.matches(t)}catch{return!1}})}const lNe=["transform","translate","scale","rotate","perspective"],cNe=["transform","translate","scale","rotate","perspective","filter"],uNe=["paint","layout","strict","content"];function H2(e){const t=q2(),n=Gi(e)?Yi(e):e;return lNe.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)||cNe.some(r=>(n.willChange||"").includes(r))||uNe.some(r=>(n.contain||"").includes(r))}function fNe(e){let t=ac(e);for(;Aa(t)&&!ah(t);){if(H2(t))return t;if(qw(t))return null;t=ac(t)}return null}function q2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dNe=new Set(["html","body","#document"]);function ah(e){return dNe.has(Qh(e))}function Yi(e){return js(e).getComputedStyle(e)}function Vw(e){return Gi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ac(e){if(Qh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||XP(e)&&e.host||La(e);return XP(t)?t.host:t}function HV(e){const t=ac(e);return ah(t)?e.ownerDocument?e.ownerDocument.body:e.body:Aa(t)&&Ly(t)?t:HV(t)}function kg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=HV(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=js(s);if(i){const o=mR(a);return t.concat(a,a.visualViewport||[],Ly(s)?s:[],o&&n?kg(o):[])}return t.concat(s,kg(s,[],n))}function mR(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qV(e){const t=Yi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Aa(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,o=E0(n)!==i||E0(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function V2(e){return Gi(e)?e:e.contextElement}function kd(e){const t=V2(e);if(!Aa(t))return _a(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=qV(t);let a=(i?E0(n.width):n.width)/r,o=(i?E0(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const hNe=_a(0);function VV(e){const t=js(e);return!q2()||!t.visualViewport?hNe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mNe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==js(e)?!1:t}function Ou(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=V2(e);let a=_a(1);t&&(r?Gi(r)&&(a=kd(r)):a=kd(e));const o=mNe(i,n,r)?VV(i):_a(0);let l=(s.left+o.x)/a.x,c=(s.top+o.y)/a.y,f=s.width/a.x,u=s.height/a.y;if(i){const h=js(i),m=r&&Gi(r)?js(r):r;let p=h,v=mR(p);for(;v&&r&&m!==p;){const S=kd(v),y=v.getBoundingClientRect(),b=Yi(v),x=y.left+(v.clientLeft+parseFloat(b.paddingLeft))*S.x,_=y.top+(v.clientTop+parseFloat(b.paddingTop))*S.y;l*=S.x,c*=S.y,f*=S.x,u*=S.y,l+=x,c+=_,p=js(v),v=mR(p)}}return R0({width:f,height:u,x:l,y:c})}function Kw(e,t){const n=Vw(e).scrollLeft;return t?t.left+n:Ou(La(e)).left+n}function KV(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kw(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function pNe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=La(r),o=t?qw(t.floating):!1;if(r===a||o&&i)return n;let l={scrollLeft:0,scrollTop:0},c=_a(1);const f=_a(0),u=Aa(r);if((u||!u&&!i)&&((Qh(r)!=="body"||Ly(a))&&(l=Vw(r)),Aa(r))){const m=Ou(r);c=kd(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=a&&!u&&!i?KV(a,l):_a(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-l.scrollTop*c.y+f.y+h.y}}function gNe(e){return Array.from(e.getClientRects())}function yNe(e){const t=La(e),n=Vw(e),r=e.ownerDocument.body,s=_s(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_s(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kw(e);const o=-n.scrollTop;return Yi(r).direction==="rtl"&&(a+=_s(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}const QP=25;function vNe(e,t){const n=js(e),r=La(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,l=0;if(s){i=s.width,a=s.height;const f=q2();(!f||f&&t==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}const c=Kw(r);if(c<=0){const f=r.ownerDocument,u=f.body,h=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(r.clientWidth-u.clientWidth-m);p<=QP&&(i-=p)}else c<=QP&&(i+=c);return{width:i,height:a,x:o,y:l}}const bNe=new Set(["absolute","fixed"]);function xNe(e,t){const n=Ou(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Aa(e)?kd(e):_a(1),a=e.clientWidth*i.x,o=e.clientHeight*i.y,l=s*i.x,c=r*i.y;return{width:a,height:o,x:l,y:c}}function ZP(e,t,n){let r;if(t==="viewport")r=vNe(e,n);else if(t==="document")r=yNe(La(e));else if(Gi(t))r=xNe(t,n);else{const s=VV(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return R0(r)}function GV(e,t){const n=ac(e);return n===t||!Gi(n)||ah(n)?!1:Yi(n).position==="fixed"||GV(n,t)}function SNe(e,t){const n=t.get(e);if(n)return n;let r=kg(e,[],!1).filter(o=>Gi(o)&&Qh(o)!=="body"),s=null;const i=Yi(e).position==="fixed";let a=i?ac(e):e;for(;Gi(a)&&!ah(a);){const o=Yi(a),l=H2(a);!l&&o.position==="fixed"&&(s=null),(i?!l&&!s:!l&&o.position==="static"&&!!s&&bNe.has(s.position)||Ly(a)&&!l&&GV(e,a))?r=r.filter(f=>f!==a):s=o,a=ac(a)}return t.set(e,r),r}function wNe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?qw(t)?[]:SNe(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,f)=>{const u=ZP(t,f,s);return c.top=_s(u.top,c.top),c.right=ic(u.right,c.right),c.bottom=ic(u.bottom,c.bottom),c.left=_s(u.left,c.left),c},ZP(t,o,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function _Ne(e){const{width:t,height:n}=qV(e);return{width:t,height:n}}function kNe(e,t,n){const r=Aa(t),s=La(t),i=n==="fixed",a=Ou(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const l=_a(0);function c(){l.x=Kw(s)}if(r||!r&&!i)if((Qh(t)!=="body"||Ly(s))&&(o=Vw(t)),r){const m=Ou(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else s&&c();i&&!r&&s&&c();const f=s&&!r&&!i?KV(s,o):_a(0),u=a.left+o.scrollLeft-l.x-f.x,h=a.top+o.scrollTop-l.y-f.y;return{x:u,y:h,width:a.width,height:a.height}}function ek(e){return Yi(e).position==="static"}function e$(e,t){if(!Aa(e)||Yi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return La(e)===n&&(n=n.ownerDocument.body),n}function YV(e,t){const n=js(e);if(qw(e))return n;if(!Aa(e)){let s=ac(e);for(;s&&!ah(s);){if(Gi(s)&&!ek(s))return s;s=ac(s)}return n}let r=e$(e,t);for(;r&&aNe(r)&&ek(r);)r=e$(r,t);return r&&ah(r)&&ek(r)&&!H2(r)?n:r||fNe(e)||n}const ENe=async function(e){const t=this.getOffsetParent||YV,n=this.getDimensions,r=await n(e.floating);return{reference:kNe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CNe(e){return Yi(e).direction==="rtl"}const RNe={convertOffsetParentRelativeRectToViewportRelativeRect:pNe,getDocumentElement:La,getClippingRect:wNe,getOffsetParent:YV,getElementRects:ENe,getClientRects:gNe,getDimensions:_Ne,getScale:kd,isElement:Gi,isRTL:CNe};function WV(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function NNe(e,t){let n=null,r;const s=La(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:f,top:u,width:h,height:m}=c;if(o||t(),!h||!m)return;const p=Lv(u),v=Lv(s.clientWidth-(f+h)),S=Lv(s.clientHeight-(u+m)),y=Lv(f),x={rootMargin:-p+"px "+-v+"px "+-S+"px "+-y+"px",threshold:_s(0,ic(1,l))||1};let _=!0;function C(E){const k=E[0].intersectionRatio;if(k!==l){if(!_)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!WV(c,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function TNe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=V2(e),f=s||i?[...c?kg(c):[],...kg(t)]:[];f.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const u=c&&o?NNe(c,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let p,v=l?Ou(e):null;l&&S();function S(){const y=Ou(e);v&&!WV(v,y)&&n(),v=y,p=requestAnimationFrame(S)}return n(),()=>{var y;f.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const ANe=eNe,ONe=tNe,MNe=XRe,jNe=rNe,DNe=QRe,t$=JRe,INe=nNe,PNe=(e,t,n)=>{const r=new Map,s={platform:RNe,...n},i={...s.platform,_c:r};return WRe(e,t,{...s,platform:i})};var $Ne=typeof document<"u",zNe=function(){},$b=$Ne?g.useLayoutEffect:zNe;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,s;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(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!N0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function JV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n$(e,t){const n=JV(e);return Math.round(t*n)/n}function tk(e){const t=g.useRef(e);return $b(()=>{t.current=e}),t}function LNe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=e,[f,u]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=g.useState(r);N0(h,r)||m(r);const[p,v]=g.useState(null),[S,y]=g.useState(null),b=g.useCallback(z=>{z!==E.current&&(E.current=z,v(z))},[]),x=g.useCallback(z=>{z!==k.current&&(k.current=z,y(z))},[]),_=i||p,C=a||S,E=g.useRef(null),k=g.useRef(null),A=g.useRef(f),I=l!=null,R=tk(l),$=tk(s),U=tk(c),K=g.useCallback(()=>{if(!E.current||!k.current)return;const z={placement:t,strategy:n,middleware:h};$.current&&(z.platform=$.current),PNe(E.current,k.current,z).then(V=>{const O={...V,isPositioned:U.current!==!1};W.current&&!N0(A.current,O)&&(A.current=O,gh.flushSync(()=>{u(O)}))})},[h,t,n,$,U]);$b(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(z=>({...z,isPositioned:!1})))},[c]);const W=g.useRef(!1);$b(()=>(W.current=!0,()=>{W.current=!1}),[]),$b(()=>{if(_&&(E.current=_),C&&(k.current=C),_&&C){if(R.current)return R.current(_,C,K);K()}},[_,C,K,R,I]);const B=g.useMemo(()=>({reference:E,floating:k,setReference:b,setFloating:x}),[b,x]),j=g.useMemo(()=>({reference:_,floating:C}),[_,C]),F=g.useMemo(()=>{const z={position:n,left:0,top:0};if(!j.floating)return z;const V=n$(j.floating,f.x),O=n$(j.floating,f.y);return o?{...z,transform:"translate("+V+"px, "+O+"px)",...JV(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:O}},[n,o,j.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:K,refs:B,elements:j,floatingStyles:F}),[f,K,B,j,F])}const FNe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?t$({element:r.current,padding:s}).fn(n):{}:r?t$({element:r,padding:s}).fn(n):{}}}},UNe=(e,t)=>({...ANe(e),options:[e,t]}),BNe=(e,t)=>({...ONe(e),options:[e,t]}),HNe=(e,t)=>({...INe(e),options:[e,t]}),qNe=(e,t)=>({...MNe(e),options:[e,t]}),VNe=(e,t)=>({...jNe(e),options:[e,t]}),KNe=(e,t)=>({...DNe(e),options:[e,t]}),GNe=(e,t)=>({...FNe(e),options:[e,t]});var YNe="Arrow",XV=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return d.jsx(rt.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});XV.displayName=YNe;var WNe=XV,K2="Popper",[QV,Zh]=Go(K2),[JNe,ZV]=QV(K2),eK=e=>{const{__scopePopper:t,children:n}=e,[r,s]=g.useState(null);return d.jsx(JNe,{scope:t,anchor:r,onAnchorChange:s,children:n})};eK.displayName=K2;var tK="PopperAnchor",nK=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=ZV(tK,n),a=g.useRef(null),o=Mt(t,a),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||a.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:d.jsx(rt.div,{...s,ref:o})});nK.displayName=tK;var G2="PopperContent",[XNe,QNe]=QV(G2),rK=g.forwardRef((e,t)=>{var Q,ae,te,fe,Ce,ye;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...v}=e,S=ZV(G2,n),[y,b]=g.useState(null),x=Mt(t,xt=>b(xt)),[_,C]=g.useState(null),E=PRe(_),k=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,I=r+(i!=="center"?"-"+i:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(c)?c:[c],U=$.length>0,K={padding:R,boundary:$.filter(eTe),altBoundary:U},{refs:W,floatingStyles:B,placement:j,isPositioned:F,middlewareData:z}=LNe({strategy:"fixed",placement:I,whileElementsMounted:(...xt)=>TNe(...xt,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[UNe({mainAxis:s+A,alignmentAxis:a}),l&&BNe({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?HNe():void 0,...K}),l&&qNe({...K}),VNe({...K,apply:({elements:xt,rects:rn,availableWidth:Bs,availableHeight:Pn})=>{const{width:Sr,height:Wo}=rn.reference,wn=xt.floating.style;wn.setProperty("--radix-popper-available-width",`${Bs}px`),wn.setProperty("--radix-popper-available-height",`${Pn}px`),wn.setProperty("--radix-popper-anchor-width",`${Sr}px`),wn.setProperty("--radix-popper-anchor-height",`${Wo}px`)}}),_&&GNe({element:_,padding:o}),tTe({arrowWidth:k,arrowHeight:A}),h&&KNe({strategy:"referenceHidden",...K})]}),[V,O]=aK(j),me=Ta(p);jr(()=>{F&&(me==null||me())},[F,me]);const q=(Q=z.arrow)==null?void 0:Q.x,N=(ae=z.arrow)==null?void 0:ae.y,J=((te=z.arrow)==null?void 0:te.centerOffset)!==0,[Y,le]=g.useState();return jr(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),d.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:F?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(fe=z.transformOrigin)==null?void 0:fe.x,(Ce=z.transformOrigin)==null?void 0:Ce.y].join(" "),...((ye=z.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(XNe,{scope:n,placedSide:V,onArrowChange:C,arrowX:q,arrowY:N,shouldHideArrow:J,children:d.jsx(rt.div,{"data-side":V,"data-align":O,...v,ref:x,style:{...v.style,animation:F?void 0:"none"}})})})});rK.displayName=G2;var sK="PopperArrow",ZNe={top:"bottom",right:"left",bottom:"top",left:"right"},iK=g.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=QNe(sK,r),a=ZNe[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(WNe,{...s,ref:n,style:{...s.style,display:"block"}})})});iK.displayName=sK;function eTe(e){return e!==null}var tTe=e=>({name:"transformOrigin",options:e,fn(t){var S,y,b;const{placement:n,rects:r,middlewareData:s}=t,a=((S=s.arrow)==null?void 0:S.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,f]=aK(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(((y=s.arrow)==null?void 0:y.x)??0)+o/2,m=(((b=s.arrow)==null?void 0:b.y)??0)+l/2;let p="",v="";return c==="bottom"?(p=a?u:`${h}px`,v=`${-l}px`):c==="top"?(p=a?u:`${h}px`,v=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,v=a?u:`${m}px`):c==="left"&&(p=`${r.floating.width+l}px`,v=a?u:`${m}px`),{data:{x:p,y:v}}}});function aK(e){const[t,n="center"]=e.split("-");return[t,n]}var Y2=eK,Gw=nK,W2=rK,J2=iK,nk="rovingFocusGroup.onEntryFocus",nTe={bubbles:!1,cancelable:!0},Fy="RovingFocusGroup",[pR,oK,rTe]=L2(Fy),[sTe,Yw]=Go(Fy,[rTe]),[iTe,aTe]=sTe(Fy),lK=g.forwardRef((e,t)=>d.jsx(pR.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(pR.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(oTe,{...e,ref:t})})}));lK.displayName=Fy;var oTe=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,h=g.useRef(null),m=Mt(t,h),p=Bw(i),[v,S]=$o({prop:a,defaultProp:o??null,onChange:l,caller:Fy}),[y,b]=g.useState(!1),x=Ta(c),_=oK(n),C=g.useRef(!1),[E,k]=g.useState(0);return g.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(nk,x),()=>A.removeEventListener(nk,x)},[x]),d.jsx(iTe,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:v,onItemFocus:g.useCallback(A=>S(A),[S]),onItemShiftTab:g.useCallback(()=>b(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:g.useCallback(()=>k(A=>A-1),[]),children:d.jsx(rt.div,{tabIndex:y||E===0?-1:0,"data-orientation":r,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{C.current=!0}),onFocus:Ee(e.onFocus,A=>{const I=!C.current;if(A.target===A.currentTarget&&I&&!y){const R=new CustomEvent(nk,nTe);if(A.currentTarget.dispatchEvent(R),!R.defaultPrevented){const $=_().filter(j=>j.focusable),U=$.find(j=>j.active),K=$.find(j=>j.id===v),B=[U,K,...$].filter(Boolean).map(j=>j.ref.current);fK(B,f)}}C.current=!1}),onBlur:Ee(e.onBlur,()=>b(!1))})})}),cK="RovingFocusGroupItem",uK=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...o}=e,l=Or(),c=i||l,f=aTe(cK,n),u=f.currentTabStopId===c,h=oK(n),{onFocusableItemAdd:m,onFocusableItemRemove:p,currentTabStopId:v}=f;return g.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),d.jsx(pR.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:d.jsx(rt.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:Ee(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:Ee(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=uTe(S,f.orientation,f.dir);if(y!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=h().filter(_=>_.focusable).map(_=>_.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const _=x.indexOf(S.currentTarget);x=f.loop?fTe(x,_+1):x.slice(_+1)}setTimeout(()=>fK(x))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:v!=null}):a})})});uK.displayName=cK;var lTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uTe(e,t,n){const r=cTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lTe[r]}function fK(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dK=lK,hK=uK,gR=["Enter"," "],dTe=["ArrowDown","PageUp","Home"],mK=["ArrowUp","PageDown","End"],hTe=[...dTe,...mK],mTe={ltr:[...gR,"ArrowRight"],rtl:[...gR,"ArrowLeft"]},pTe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Uy="Menu",[Eg,gTe,yTe]=L2(Uy),[ef,pK]=Go(Uy,[yTe,Zh,Yw]),Ww=Zh(),gK=Yw(),[vTe,tf]=ef(Uy),[bTe,By]=ef(Uy),yK=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=e,o=Ww(t),[l,c]=g.useState(null),f=g.useRef(!1),u=Ta(i),h=Bw(s);return g.useEffect(()=>{const m=()=>{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",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),d.jsx(Y2,{...o,children:d.jsx(vTe,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:d.jsx(bTe,{scope:t,onClose:g.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:a,children:r})})})};yK.displayName=Uy;var xTe="MenuAnchor",X2=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ww(n);return d.jsx(Gw,{...s,...r,ref:t})});X2.displayName=xTe;var Q2="MenuPortal",[STe,vK]=ef(Q2,{forceMount:void 0}),bK=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=tf(Q2,t);return d.jsx(STe,{scope:t,forceMount:n,children:d.jsx(za,{present:n||i.open,children:d.jsx(Py,{asChild:!0,container:s,children:r})})})};bK.displayName=Q2;var fi="MenuContent",[wTe,Z2]=ef(fi),xK=g.forwardRef((e,t)=>{const n=vK(fi,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=tf(fi,e.__scopeMenu),a=By(fi,e.__scopeMenu);return d.jsx(Eg.Provider,{scope:e.__scopeMenu,children:d.jsx(za,{present:r||i.open,children:d.jsx(Eg.Slot,{scope:e.__scopeMenu,children:a.modal?d.jsx(_Te,{...s,ref:t}):d.jsx(kTe,{...s,ref:t})})})})}),_Te=g.forwardRef((e,t)=>{const n=tf(fi,e.__scopeMenu),r=g.useRef(null),s=Mt(t,r);return g.useEffect(()=>{const i=r.current;if(i)return Lw(i)},[]),d.jsx(eO,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kTe=g.forwardRef((e,t)=>{const n=tf(fi,e.__scopeMenu);return d.jsx(eO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ETe=rc("MenuContent.ScrollLock"),eO=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,disableOutsideScroll:p,...v}=e,S=tf(fi,n),y=By(fi,n),b=Ww(n),x=gK(n),_=gTe(n),[C,E]=g.useState(null),k=g.useRef(null),A=Mt(t,k,S.onContentChange),I=g.useRef(0),R=g.useRef(""),$=g.useRef(0),U=g.useRef(null),K=g.useRef("right"),W=g.useRef(0),B=p?$y:g.Fragment,j=p?{as:ETe,allowPinchZoom:!0}:void 0,F=V=>{var Q,ae;const O=R.current+V,me=_().filter(te=>!te.disabled),q=document.activeElement,N=(Q=me.find(te=>te.ref.current===q))==null?void 0:Q.textValue,J=me.map(te=>te.textValue),Y=$Te(J,O,N),le=(ae=me.find(te=>te.textValue===Y))==null?void 0:ae.ref.current;(function te(fe){R.current=fe,window.clearTimeout(I.current),fe!==""&&(I.current=window.setTimeout(()=>te(""),1e3))})(O),le&&setTimeout(()=>le.focus())};g.useEffect(()=>()=>window.clearTimeout(I.current),[]),$w();const z=g.useCallback(V=>{var me,q;return K.current===((me=U.current)==null?void 0:me.side)&&LTe(V,(q=U.current)==null?void 0:q.area)},[]);return d.jsx(wTe,{scope:n,searchRef:R,onItemEnter:g.useCallback(V=>{z(V)&&V.preventDefault()},[z]),onItemLeave:g.useCallback(V=>{var O;z(V)||((O=k.current)==null||O.focus(),E(null))},[z]),onTriggerLeave:g.useCallback(V=>{z(V)&&V.preventDefault()},[z]),pointerGraceTimerRef:$,onPointerGraceIntentChange:g.useCallback(V=>{U.current=V},[]),children:d.jsx(B,{...j,children:d.jsx(Iy,{asChild:!0,trapped:s,onMountAutoFocus:Ee(i,V=>{var O;V.preventDefault(),(O=k.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:d.jsx(Dy,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,children:d.jsx(dK,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Ee(l,V=>{y.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(W2,{role:"menu","aria-orientation":"vertical","data-state":PK(S.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Ee(v.onKeyDown,V=>{const me=V.target.closest("[data-radix-menu-content]")===V.currentTarget,q=V.ctrlKey||V.altKey||V.metaKey,N=V.key.length===1;me&&(V.key==="Tab"&&V.preventDefault(),!q&&N&&F(V.key));const J=k.current;if(V.target!==J||!hTe.includes(V.key))return;V.preventDefault();const le=_().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);mK.includes(V.key)&&le.reverse(),ITe(le)}),onBlur:Ee(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(I.current),R.current="")}),onPointerMove:Ee(e.onPointerMove,Cg(V=>{const O=V.target,me=W.current!==V.clientX;if(V.currentTarget.contains(O)&&me){const q=V.clientX>W.current?"right":"left";K.current=q,W.current=V.clientX}}))})})})})})})});xK.displayName=fi;var CTe="MenuGroup",tO=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(rt.div,{role:"group",...r,ref:t})});tO.displayName=CTe;var RTe="MenuLabel",SK=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(rt.div,{...r,ref:t})});SK.displayName=RTe;var T0="MenuItem",r$="menu.itemSelect",Jw=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=g.useRef(null),a=By(T0,e.__scopeMenu),o=Z2(T0,e.__scopeMenu),l=Mt(t,i),c=g.useRef(!1),f=()=>{const u=i.current;if(!n&&u){const h=new CustomEvent(r$,{bubbles:!0,cancelable:!0});u.addEventListener(r$,m=>r==null?void 0:r(m),{once:!0}),eV(u,h),h.defaultPrevented?c.current=!1:a.onClose()}};return d.jsx(wK,{...s,ref:l,disabled:n,onClick:Ee(e.onClick,f),onPointerDown:u=>{var h;(h=e.onPointerDown)==null||h.call(e,u),c.current=!0},onPointerUp:Ee(e.onPointerUp,u=>{var h;c.current||(h=u.currentTarget)==null||h.click()}),onKeyDown:Ee(e.onKeyDown,u=>{const h=o.searchRef.current!=="";n||h&&u.key===" "||gR.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Jw.displayName=T0;var wK=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,a=Z2(T0,n),o=gK(n),l=g.useRef(null),c=Mt(t,l),[f,u]=g.useState(!1),[h,m]=g.useState("");return g.useEffect(()=>{const p=l.current;p&&m((p.textContent??"").trim())},[i.children]),d.jsx(Eg.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:d.jsx(hK,{asChild:!0,...o,focusable:!r,children:d.jsx(rt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Ee(e.onPointerMove,Cg(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,Cg(p=>a.onItemLeave(p))),onFocus:Ee(e.onFocus,()=>u(!0)),onBlur:Ee(e.onBlur,()=>u(!1))})})})}),NTe="MenuCheckboxItem",_K=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return d.jsx(NK,{scope:e.__scopeMenu,checked:n,children:d.jsx(Jw,{role:"menuitemcheckbox","aria-checked":A0(n)?"mixed":n,...s,ref:t,"data-state":rO(n),onSelect:Ee(s.onSelect,()=>r==null?void 0:r(A0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_K.displayName=NTe;var kK="MenuRadioGroup",[TTe,ATe]=ef(kK,{value:void 0,onValueChange:()=>{}}),EK=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Ta(r);return d.jsx(TTe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:d.jsx(tO,{...s,ref:t})})});EK.displayName=kK;var CK="MenuRadioItem",RK=g.forwardRef((e,t)=>{const{value:n,...r}=e,s=ATe(CK,e.__scopeMenu),i=n===s.value;return d.jsx(NK,{scope:e.__scopeMenu,checked:i,children:d.jsx(Jw,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":rO(i),onSelect:Ee(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});RK.displayName=CK;var nO="MenuItemIndicator",[NK,OTe]=ef(nO,{checked:!1}),TK=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=OTe(nO,n);return d.jsx(za,{present:r||A0(i.checked)||i.checked===!0,children:d.jsx(rt.span,{...s,ref:t,"data-state":rO(i.checked)})})});TK.displayName=nO;var MTe="MenuSeparator",AK=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(rt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AK.displayName=MTe;var jTe="MenuArrow",OK=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ww(n);return d.jsx(J2,{...s,...r,ref:t})});OK.displayName=jTe;var DTe="MenuSub",[gFe,MK]=ef(DTe),Qm="MenuSubTrigger",jK=g.forwardRef((e,t)=>{const n=tf(Qm,e.__scopeMenu),r=By(Qm,e.__scopeMenu),s=MK(Qm,e.__scopeMenu),i=Z2(Qm,e.__scopeMenu),a=g.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},f=g.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return g.useEffect(()=>f,[f]),g.useEffect(()=>{const u=o.current;return()=>{window.clearTimeout(u),l(null)}},[o,l]),d.jsx(X2,{asChild:!0,...c,children:d.jsx(wK,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":PK(n.open),...e,ref:Na(t,s.onTriggerChange),onClick:u=>{var h;(h=e.onClick)==null||h.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,Cg(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Ee(e.onPointerLeave,Cg(u=>{var m,p;f();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const v=(p=n.content)==null?void 0:p.dataset.side,S=v==="right",y=S?-5:5,b=h[S?"left":"right"],x=h[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+y,y:u.clientY},{x:b,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:b,y:h.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,u=>{var m;const h=i.searchRef.current!=="";e.disabled||h&&u.key===" "||mTe[r.dir].includes(u.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),u.preventDefault())})})})});jK.displayName=Qm;var DK="MenuSubContent",IK=g.forwardRef((e,t)=>{const n=vK(fi,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=tf(fi,e.__scopeMenu),a=By(fi,e.__scopeMenu),o=MK(DK,e.__scopeMenu),l=g.useRef(null),c=Mt(t,l);return d.jsx(Eg.Provider,{scope:e.__scopeMenu,children:d.jsx(za,{present:r||i.open,children:d.jsx(Eg.Slot,{scope:e.__scopeMenu,children:d.jsx(eO,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{var m;const u=f.currentTarget.contains(f.target),h=pTe[a.dir].includes(f.key);u&&h&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});IK.displayName=DK;function PK(e){return e?"open":"closed"}function A0(e){return e==="indeterminate"}function rO(e){return A0(e)?"indeterminate":e?"checked":"unchecked"}function ITe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function PTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $Te(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=PTe(e,Math.max(i,0));s.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function zTe(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const o=t[i],l=t[a],c=o.x,f=o.y,u=l.x,h=l.y;f>r!=h>r&&n<(u-c)*(r-f)/(h-f)+c&&(s=!s)}return s}function LTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zTe(n,t)}function Cg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var FTe=yK,UTe=X2,BTe=bK,HTe=xK,qTe=tO,VTe=SK,KTe=Jw,GTe=_K,YTe=EK,WTe=RK,JTe=TK,XTe=AK,QTe=OK,ZTe=jK,eAe=IK,Xw="DropdownMenu",[tAe]=Go(Xw,[pK]),Jr=pK(),[nAe,$K]=tAe(Xw),zK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=Jr(t),c=g.useRef(null),[f,u]=$o({prop:s,defaultProp:i??!1,onChange:a,caller:Xw});return d.jsx(nAe,{scope:t,triggerId:Or(),triggerRef:c,contentId:Or(),open:f,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(h=>!h),[u]),modal:o,children:d.jsx(FTe,{...l,open:f,onOpenChange:u,dir:r,modal:o,children:n})})};zK.displayName=Xw;var LK="DropdownMenuTrigger",FK=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=$K(LK,n),a=Jr(n);return d.jsx(UTe,{asChild:!0,...a,children:d.jsx(rt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Na(t,i.triggerRef),onPointerDown:Ee(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:Ee(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});FK.displayName=LK;var rAe="DropdownMenuPortal",UK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Jr(t);return d.jsx(BTe,{...r,...n})};UK.displayName=rAe;var BK="DropdownMenuContent",HK=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=$K(BK,n),i=Jr(n),a=g.useRef(!1);return d.jsx(HTe,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,o=>{var l;a.current||(l=s.triggerRef.current)==null||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,f=l.button===2||c;(!s.modal||f)&&(a.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)"}})});HK.displayName=BK;var sAe="DropdownMenuGroup",iAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(qTe,{...s,...r,ref:t})});iAe.displayName=sAe;var aAe="DropdownMenuLabel",oAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(VTe,{...s,...r,ref:t})});oAe.displayName=aAe;var lAe="DropdownMenuItem",qK=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(KTe,{...s,...r,ref:t})});qK.displayName=lAe;var cAe="DropdownMenuCheckboxItem",uAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(GTe,{...s,...r,ref:t})});uAe.displayName=cAe;var fAe="DropdownMenuRadioGroup",dAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(YTe,{...s,...r,ref:t})});dAe.displayName=fAe;var hAe="DropdownMenuRadioItem",mAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(WTe,{...s,...r,ref:t})});mAe.displayName=hAe;var pAe="DropdownMenuItemIndicator",gAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(JTe,{...s,...r,ref:t})});gAe.displayName=pAe;var yAe="DropdownMenuSeparator",vAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(XTe,{...s,...r,ref:t})});vAe.displayName=yAe;var bAe="DropdownMenuArrow",xAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(QTe,{...s,...r,ref:t})});xAe.displayName=bAe;var SAe="DropdownMenuSubTrigger",wAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(ZTe,{...s,...r,ref:t})});wAe.displayName=SAe;var _Ae="DropdownMenuSubContent",kAe=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return d.jsx(eAe,{...s,...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)"}})});kAe.displayName=_Ae;var EAe=zK,CAe=FK,RAe=UK,NAe=HK,TAe=qK;function s$(e,[t,n]){return Math.min(n,Math.max(t,e))}var Qw="Popover",[VK]=Go(Qw,[Zh]),Hy=Zh(),[AAe,vc]=VK(Qw),KK=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=e,o=Hy(t),l=g.useRef(null),[c,f]=g.useState(!1),[u,h]=$o({prop:r,defaultProp:s??!1,onChange:i,caller:Qw});return d.jsx(Y2,{...o,children:d.jsx(AAe,{scope:t,contentId:Or(),triggerRef:l,open:u,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:a,children:n})})};KK.displayName=Qw;var GK="PopoverAnchor",OAe=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vc(GK,n),i=Hy(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return g.useEffect(()=>(a(),()=>o()),[a,o]),d.jsx(Gw,{...i,...r,ref:t})});OAe.displayName=GK;var YK="PopoverTrigger",WK=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vc(YK,n),i=Hy(n),a=Mt(t,s.triggerRef),o=d.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":eG(s.open),...r,ref:a,onClick:Ee(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:d.jsx(Gw,{asChild:!0,...i,children:o})});WK.displayName=YK;var sO="PopoverPortal",[MAe,jAe]=VK(sO,{forceMount:void 0}),JK=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=vc(sO,t);return d.jsx(MAe,{scope:t,forceMount:n,children:d.jsx(za,{present:n||i.open,children:d.jsx(Py,{asChild:!0,container:s,children:r})})})};JK.displayName=sO;var oh="PopoverContent",XK=g.forwardRef((e,t)=>{const n=jAe(oh,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=vc(oh,e.__scopePopover);return d.jsx(za,{present:r||i.open,children:i.modal?d.jsx(IAe,{...s,ref:t}):d.jsx(PAe,{...s,ref:t})})});XK.displayName=oh;var DAe=rc("PopoverContent.RemoveScroll"),IAe=g.forwardRef((e,t)=>{const n=vc(oh,e.__scopePopover),r=g.useRef(null),s=Mt(t,r),i=g.useRef(!1);return g.useEffect(()=>{const a=r.current;if(a)return Lw(a)},[]),d.jsx($y,{as:DAe,allowPinchZoom:!0,children:d.jsx(QK,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,c=o.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ee(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),PAe=g.forwardRef((e,t)=>{const n=vc(oh,e.__scopePopover),r=g.useRef(!1),s=g.useRef(!1);return d.jsx(QK,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),QK=g.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,...u}=e,h=vc(oh,n),m=Hy(n);return $w(),d.jsx(Iy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:d.jsx(Dy,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(W2,{"data-state":eG(h.open),role:"dialog",id:h.contentId,...m,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ZK="PopoverClose",$Ae=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vc(ZK,n);return d.jsx(rt.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>s.onOpenChange(!1))})});$Ae.displayName=ZK;var zAe="PopoverArrow",LAe=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Hy(n);return d.jsx(J2,{...s,...r,ref:t})});LAe.displayName=zAe;function eG(e){return e?"open":"closed"}var FAe=KK,UAe=WK,BAe=JK,HAe=XK,qAe=[" ","Enter","ArrowUp","ArrowDown"],VAe=[" ","Enter"],Mu="Select",[Zw,e1,KAe]=L2(Mu),[em]=Go(Mu,[KAe,Zh]),t1=Zh(),[GAe,bc]=em(Mu),[YAe,WAe]=em(Mu),tG=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:h,required:m,form:p}=e,v=t1(t),[S,y]=g.useState(null),[b,x]=g.useState(null),[_,C]=g.useState(!1),E=Bw(c),[k,A]=$o({prop:r,defaultProp:s??!1,onChange:i,caller:Mu}),[I,R]=$o({prop:a,defaultProp:o,onChange:l,caller:Mu}),$=g.useRef(null),U=S?p||!!S.closest("form"):!0,[K,W]=g.useState(new Set),B=Array.from(K).map(j=>j.props.value).join(";");return d.jsx(Y2,{...v,children:d.jsxs(GAe,{required:m,scope:t,trigger:S,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Or(),value:I,onValueChange:R,open:k,onOpenChange:A,dir:E,triggerPointerDownPosRef:$,disabled:h,children:[d.jsx(Zw.Provider,{scope:t,children:d.jsx(YAe,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(j=>{W(F=>new Set(F).add(j))},[]),onNativeOptionRemove:g.useCallback(j=>{W(F=>{const z=new Set(F);return z.delete(j),z})},[]),children:n})}),U?d.jsxs(_G,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:u,value:I,onChange:j=>R(j.target.value),disabled:h,form:p,children:[I===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},B):null]})})};tG.displayName=Mu;var nG="SelectTrigger",rG=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=t1(n),a=bc(nG,n),o=a.disabled||r,l=Mt(t,a.onTriggerChange),c=e1(n),f=g.useRef("touch"),[u,h,m]=EG(v=>{const S=c().filter(x=>!x.disabled),y=S.find(x=>x.value===a.value),b=CG(S,v,y);b!==void 0&&a.onValueChange(b.value)}),p=v=>{o||(a.onOpenChange(!0),m()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(Gw,{asChild:!0,...i,children:d.jsx(rt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":kG(a.value)?"":void 0,...s,ref:l,onClick:Ee(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&p(v)}),onPointerDown:Ee(s.onPointerDown,v=>{f.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(p(v),v.preventDefault())}),onKeyDown:Ee(s.onKeyDown,v=>{const S=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(S&&v.key===" ")&&qAe.includes(v.key)&&(p(),v.preventDefault())})})})});rG.displayName=nG;var sG="SelectValue",iG=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=e,l=bc(sG,n),{onValueNodeHasChildrenChange:c}=l,f=i!==void 0,u=Mt(t,l.onValueNodeChange);return jr(()=>{c(f)},[c,f]),d.jsx(rt.span,{...o,ref:u,style:{pointerEvents:"none"},children:kG(l.value)?d.jsx(d.Fragment,{children:a}):i})});iG.displayName=sG;var JAe="SelectIcon",aG=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return d.jsx(rt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});aG.displayName=JAe;var XAe="SelectPortal",oG=e=>d.jsx(Py,{asChild:!0,...e});oG.displayName=XAe;var ju="SelectContent",lG=g.forwardRef((e,t)=>{const n=bc(ju,e.__scopeSelect),[r,s]=g.useState();if(jr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?gh.createPortal(d.jsx(cG,{scope:e.__scopeSelect,children:d.jsx(Zw.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(uG,{...e,ref:t})});lG.displayName=ju;var Ci=10,[cG,xc]=em(ju),QAe="SelectContentImpl",ZAe=rc("SelectContent.RemoveScroll"),uG=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:h,collisionPadding:m,sticky:p,hideWhenDetached:v,avoidCollisions:S,...y}=e,b=bc(ju,n),[x,_]=g.useState(null),[C,E]=g.useState(null),k=Mt(t,Q=>_(Q)),[A,I]=g.useState(null),[R,$]=g.useState(null),U=e1(n),[K,W]=g.useState(!1),B=g.useRef(!1);g.useEffect(()=>{if(x)return Lw(x)},[x]),$w();const j=g.useCallback(Q=>{const[ae,...te]=U().map(ye=>ye.ref.current),[fe]=te.slice(-1),Ce=document.activeElement;for(const ye of Q)if(ye===Ce||(ye==null||ye.scrollIntoView({block:"nearest"}),ye===ae&&C&&(C.scrollTop=0),ye===fe&&C&&(C.scrollTop=C.scrollHeight),ye==null||ye.focus(),document.activeElement!==Ce))return},[U,C]),F=g.useCallback(()=>j([A,x]),[j,A,x]);g.useEffect(()=>{K&&F()},[K,F]);const{onOpenChange:z,triggerPointerDownPosRef:V}=b;g.useEffect(()=>{if(x){let Q={x:0,y:0};const ae=fe=>{var Ce,ye;Q={x:Math.abs(Math.round(fe.pageX)-(((Ce=V.current)==null?void 0:Ce.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((ye=V.current)==null?void 0:ye.y)??0))}},te=fe=>{Q.x<=10&&Q.y<=10?fe.preventDefault():x.contains(fe.target)||z(!1),document.removeEventListener("pointermove",ae),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,z,V]),g.useEffect(()=>{const Q=()=>z(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[z]);const[O,me]=EG(Q=>{const ae=U().filter(Ce=>!Ce.disabled),te=ae.find(Ce=>Ce.ref.current===document.activeElement),fe=CG(ae,Q,te);fe&&setTimeout(()=>fe.ref.current.focus())}),q=g.useCallback((Q,ae,te)=>{const fe=!B.current&&!te;(b.value!==void 0&&b.value===ae||fe)&&(I(Q),fe&&(B.current=!0))},[b.value]),N=g.useCallback(()=>x==null?void 0:x.focus(),[x]),J=g.useCallback((Q,ae,te)=>{const fe=!B.current&&!te;(b.value!==void 0&&b.value===ae||fe)&&$(Q)},[b.value]),Y=r==="popper"?yR:fG,le=Y===yR?{side:o,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:h,collisionPadding:m,sticky:p,hideWhenDetached:v,avoidCollisions:S}:{};return d.jsx(cG,{scope:n,content:x,viewport:C,onViewportChange:E,itemRefCallback:q,selectedItem:A,onItemLeave:N,itemTextRefCallback:J,focusSelectedItem:F,selectedItemText:R,position:r,isPositioned:K,searchRef:O,children:d.jsx($y,{as:ZAe,allowPinchZoom:!0,children:d.jsx(Iy,{asChild:!0,trapped:b.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ee(s,Q=>{var ae;(ae=b.trigger)==null||ae.focus({preventScroll:!0}),Q.preventDefault()}),children:d.jsx(Dy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:d.jsx(Y,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Q=>Q.preventDefault(),...y,...le,onPlaced:()=>W(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ee(y.onKeyDown,Q=>{const ae=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ae&&Q.key.length===1&&me(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let fe=U().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Ce=Q.target,ye=fe.indexOf(Ce);fe=fe.slice(ye+1)}setTimeout(()=>j(fe)),Q.preventDefault()}})})})})})})});uG.displayName=QAe;var e2e="SelectItemAlignedPosition",fG=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=bc(ju,n),a=xc(ju,n),[o,l]=g.useState(null),[c,f]=g.useState(null),u=Mt(t,k=>f(k)),h=e1(n),m=g.useRef(!1),p=g.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:y,focusSelectedItem:b}=a,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&v&&S&&y){const k=i.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const Ce=R.left-A.left,ye=I.left-Ce,xt=k.left-ye,rn=k.width+xt,Bs=Math.max(rn,A.width),Pn=window.innerWidth-Ci,Sr=s$(ye,[Ci,Math.max(Ci,Pn-Bs)]);o.style.minWidth=rn+"px",o.style.left=Sr+"px"}else{const Ce=A.right-R.right,ye=window.innerWidth-I.right-Ce,xt=window.innerWidth-k.right-ye,rn=k.width+xt,Bs=Math.max(rn,A.width),Pn=window.innerWidth-Ci,Sr=s$(ye,[Ci,Math.max(Ci,Pn-Bs)]);o.style.minWidth=rn+"px",o.style.right=Sr+"px"}const $=h(),U=window.innerHeight-Ci*2,K=v.scrollHeight,W=window.getComputedStyle(c),B=parseInt(W.borderTopWidth,10),j=parseInt(W.paddingTop,10),F=parseInt(W.borderBottomWidth,10),z=parseInt(W.paddingBottom,10),V=B+j+K+z+F,O=Math.min(S.offsetHeight*5,V),me=window.getComputedStyle(v),q=parseInt(me.paddingTop,10),N=parseInt(me.paddingBottom,10),J=k.top+k.height/2-Ci,Y=U-J,le=S.offsetHeight/2,Q=S.offsetTop+le,ae=B+j+Q,te=V-ae;if(ae<=J){const Ce=$.length>0&&S===$[$.length-1].ref.current;o.style.bottom="0px";const ye=c.clientHeight-v.offsetTop-v.offsetHeight,xt=Math.max(Y,le+(Ce?N:0)+ye+F),rn=ae+xt;o.style.height=rn+"px"}else{const Ce=$.length>0&&S===$[0].ref.current;o.style.top="0px";const xt=Math.max(J,B+v.offsetTop+(Ce?q:0)+le)+te;o.style.height=xt+"px",v.scrollTop=ae-J+v.offsetTop}o.style.margin=`${Ci}px 0`,o.style.minHeight=O+"px",o.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,o,c,v,S,y,i.dir,r]);jr(()=>x(),[x]);const[_,C]=g.useState();jr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=g.useCallback(k=>{k&&p.current===!0&&(x(),b==null||b(),p.current=!1)},[x,b]);return d.jsx(n2e,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:d.jsx(rt.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});fG.displayName=e2e;var t2e="SelectPopperPosition",yR=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ci,...i}=e,a=t1(n);return d.jsx(W2,{...a,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});yR.displayName=t2e;var[n2e,iO]=em(ju,{}),vR="SelectViewport",dG=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=xc(vR,n),a=iO(vR,n),o=Mt(t,i.onViewportChange),l=g.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Zw.Slot,{scope:n,children:d.jsx(rt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ee(s.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&u){const m=Math.abs(l.current-f.scrollTop);if(m>0){const p=window.innerHeight-Ci*2,v=parseFloat(u.style.minHeight),S=parseFloat(u.style.height),y=Math.max(v,S);if(y<p){const b=y+m,x=Math.min(p,b),_=b-x;u.style.height=x+"px",u.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});dG.displayName=vR;var hG="SelectGroup",[r2e,s2e]=em(hG),i2e=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Or();return d.jsx(r2e,{scope:n,id:s,children:d.jsx(rt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});i2e.displayName=hG;var mG="SelectLabel",a2e=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=s2e(mG,n);return d.jsx(rt.div,{id:s.id,...r,ref:t})});a2e.displayName=mG;var O0="SelectItem",[o2e,pG]=em(O0),gG=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=e,o=bc(O0,n),l=xc(O0,n),c=o.value===r,[f,u]=g.useState(i??""),[h,m]=g.useState(!1),p=Mt(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,s)}),v=Or(),S=g.useRef("touch"),y=()=>{s||(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 d.jsx(o2e,{scope:n,value:r,disabled:s,textId:v,isSelected:c,onItemTextChange:g.useCallback(b=>{u(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:d.jsx(Zw.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:d.jsx(rt.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:Ee(a.onFocus,()=>m(!0)),onBlur:Ee(a.onBlur,()=>m(!1)),onClick:Ee(a.onClick,()=>{S.current!=="mouse"&&y()}),onPointerUp:Ee(a.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:Ee(a.onPointerDown,b=>{S.current=b.pointerType}),onPointerMove:Ee(a.onPointerMove,b=>{var x;S.current=b.pointerType,s?(x=l.onItemLeave)==null||x.call(l):S.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:Ee(a.onKeyDown,b=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&b.key===" "||(VAe.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});gG.displayName=O0;var Zm="SelectItemText",yG=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,a=bc(Zm,n),o=xc(Zm,n),l=pG(Zm,n),c=WAe(Zm,n),[f,u]=g.useState(null),h=Mt(t,y=>u(y),l.onItemTextChange,y=>{var b;return(b=o.itemTextRefCallback)==null?void 0:b.call(o,y,l.value,l.disabled)}),m=f==null?void 0:f.textContent,p=g.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=c;return jr(()=>(v(p),()=>S(p)),[v,S,p]),d.jsxs(d.Fragment,{children:[d.jsx(rt.span,{id:l.textId,...i,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gh.createPortal(i.children,a.valueNode):null]})});yG.displayName=Zm;var vG="SelectItemIndicator",bG=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pG(vG,n).isSelected?d.jsx(rt.span,{"aria-hidden":!0,...r,ref:t}):null});bG.displayName=vG;var bR="SelectScrollUpButton",xG=g.forwardRef((e,t)=>{const n=xc(bR,e.__scopeSelect),r=iO(bR,e.__scopeSelect),[s,i]=g.useState(!1),a=Mt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?d.jsx(wG,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});xG.displayName=bR;var xR="SelectScrollDownButton",SG=g.forwardRef((e,t)=>{const n=xc(xR,e.__scopeSelect),r=iO(xR,e.__scopeSelect),[s,i]=g.useState(!1),a=Mt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;i(f)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?d.jsx(wG,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});SG.displayName=xR;var wG=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=xc("SelectScrollButton",n),a=g.useRef(null),o=e1(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),jr(()=>{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]),d.jsx(rt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ee(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ee(s.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ee(s.onPointerLeave,()=>{l()})})}),l2e="SelectSeparator",c2e=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(rt.div,{"aria-hidden":!0,...r,ref:t})});c2e.displayName=l2e;var SR="SelectArrow",u2e=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=t1(n),i=bc(SR,n),a=xc(SR,n);return i.open&&a.position==="popper"?d.jsx(J2,{...s,...r,ref:t}):null});u2e.displayName=SR;var f2e="SelectBubbleInput",_G=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=g.useRef(null),i=Mt(r,s),a=IRe(t);return g.useEffect(()=>{const o=s.current;if(!o)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const u=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(u)}},[a,t]),d.jsx(rt.select,{...n,style:{...LV,...n.style},ref:i,defaultValue:t})});_G.displayName=f2e;function kG(e){return e===""||e===void 0}function EG(e){const t=Ta(e),n=g.useRef(""),r=g.useRef(0),s=g.useCallback(a=>{const o=n.current+a;t(o),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function CG(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=d2e(e,Math.max(i,0));s.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function d2e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var h2e=tG,m2e=rG,p2e=iG,g2e=aG,y2e=oG,v2e=lG,b2e=dG,x2e=gG,S2e=yG,w2e=bG,_2e=xG,k2e=SG,E2e="Separator",i$="horizontal",C2e=["horizontal","vertical"],RG=g.forwardRef((e,t)=>{const{decorative:n,orientation:r=i$,...s}=e,i=R2e(r)?r:i$,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return d.jsx(rt.div,{"data-orientation":i,...o,...s,ref:t})});RG.displayName=E2e;function R2e(e){return C2e.includes(e)}var N2e=RG,NG="Toggle",TG=g.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...i}=e,[a,o]=$o({prop:n,onChange:s,defaultProp:r??!1,caller:NG});return d.jsx(rt.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ee(e.onClick,()=>{e.disabled||o(!a)})})});TG.displayName=NG;var Sc="ToggleGroup",[AG]=Go(Sc,[Yw]),OG=Yw(),aO=ee.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return d.jsx(T2e,{...s,ref:t})}if(n==="multiple"){const s=r;return d.jsx(A2e,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Sc}\``)});aO.displayName=Sc;var[MG,jG]=AG(Sc),T2e=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[a,o]=$o({prop:n,defaultProp:r??"",onChange:s,caller:Sc});return d.jsx(MG,{scope:e.__scopeToggleGroup,type:"single",value:ee.useMemo(()=>a?[a]:[],[a]),onItemActivate:o,onItemDeactivate:ee.useCallback(()=>o(""),[o]),children:d.jsx(DG,{...i,ref:t})})}),A2e=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[a,o]=$o({prop:n,defaultProp:r??[],onChange:s,caller:Sc}),l=ee.useCallback(f=>o((u=[])=>[...u,f]),[o]),c=ee.useCallback(f=>o((u=[])=>u.filter(h=>h!==f)),[o]);return d.jsx(MG,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:d.jsx(DG,{...i,ref:t})})});aO.displayName=Sc;var[O2e,M2e]=AG(Sc),DG=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...l}=e,c=OG(n),f=Bw(a),u={role:"group",dir:f,...l};return d.jsx(O2e,{scope:n,rovingFocus:s,disabled:r,children:s?d.jsx(dK,{asChild:!0,...c,orientation:i,dir:f,loop:o,children:d.jsx(rt.div,{...u,ref:t})}):d.jsx(rt.div,{...u,ref:t})})}),M0="ToggleGroupItem",IG=ee.forwardRef((e,t)=>{const n=jG(M0,e.__scopeToggleGroup),r=M2e(M0,e.__scopeToggleGroup),s=OG(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,o={...e,pressed:i,disabled:a},l=ee.useRef(null);return r.rovingFocus?d.jsx(hK,{asChild:!0,...s,focusable:!a,active:i,ref:l,children:d.jsx(a$,{...o,ref:t})}):d.jsx(a$,{...o,ref:t})});IG.displayName=M0;var a$=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,i=jG(M0,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return d.jsx(TG,{...o,...s,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),j2e=aO,D2e=IG;function PG(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=PG(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $G(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=PG(e))&&(r&&(r+=" "),r+=t);return r}const I2e=(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},P2e=(e,t)=>({classGroupId:e,validator:t}),zG=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),j0="-",o$=[],$2e="arbitrary..",z2e=e=>{const t=F2e(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return L2e(a);const o=a.split(j0),l=o[0]===""&&o.length>1?1:0;return LG(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],c=n[a];return l?c?I2e(c,l):l:c||o$}return n[a]||o$}}},LG=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const c=LG(e,t+1,i);if(c)return c}const a=n.validators;if(a===null)return;const o=t===0?e.join(j0):e.slice(t).join(j0),l=a.length;for(let c=0;c<l;c++){const f=a[c];if(f.validator(o))return f.classGroupId}},L2e=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?$2e+r:void 0})(),F2e=e=>{const{theme:t,classGroups:n}=e;return U2e(n,t)},U2e=(e,t)=>{const n=zG();for(const r in e){const s=e[r];oO(s,n,r,t)}return n},oO=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const a=e[i];B2e(a,t,n,r)}},B2e=(e,t,n,r)=>{if(typeof e=="string"){H2e(e,t,n);return}if(typeof e=="function"){q2e(e,t,n,r);return}V2e(e,t,n,r)},H2e=(e,t,n)=>{const r=e===""?t:FG(t,e);r.classGroupId=n},q2e=(e,t,n,r)=>{if(K2e(e)){oO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(P2e(n,e))},V2e=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a<i;a++){const[o,l]=s[a];oO(l,FG(t,o),n,r)}},FG=(e,t)=>{let n=e;const r=t.split(j0),s=r.length;for(let i=0;i<s;i++){const a=r[i];let o=n.nextPart.get(a);o||(o=zG(),n.nextPart.set(a,o)),n=o}return n},K2e=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,G2e=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},wR="!",l$=":",Y2e=[],c$=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),W2e=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let a=0,o=0,l=0,c;const f=s.length;for(let v=0;v<f;v++){const S=s[v];if(a===0&&o===0){if(S===l$){i.push(s.slice(l,v)),l=v+1;continue}if(S==="/"){c=v;continue}}S==="["?a++:S==="]"?a--:S==="("?o++:S===")"&&o--}const u=i.length===0?s:s.slice(l);let h=u,m=!1;u.endsWith(wR)?(h=u.slice(0,-1),m=!0):u.startsWith(wR)&&(h=u.slice(1),m=!0);const p=c&&c>l?c-l:void 0;return c$(i,m,h,p)};if(t){const s=t+l$,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):c$(Y2e,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},J2e=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],o=a[0]==="[",l=t.has(a);o||l?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},X2e=e=>({cache:G2e(e.cacheSize),parseClassName:W2e(e),sortModifiers:J2e(e),...z2e(e)}),Q2e=/\s+/,Z2e=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,a=[],o=e.trim().split(Q2e);let l="";for(let c=o.length-1;c>=0;c-=1){const f=o[c],{isExternal:u,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:v}=n(f);if(u){l=f+(l.length>0?" "+l:l);continue}let S=!!v,y=r(S?p.substring(0,v):p);if(!y){if(!S){l=f+(l.length>0?" "+l:l);continue}if(y=r(p),!y){l=f+(l.length>0?" "+l:l);continue}S=!1}const b=h.length===0?"":h.length===1?h[0]:i(h).join(":"),x=m?b+wR:b,_=x+y;if(a.indexOf(_)>-1)continue;a.push(_);const C=s(y,S);for(let E=0;E<C.length;++E){const k=C[E];a.push(x+k)}l=f+(l.length>0?" "+l:l)}return l},eOe=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=UG(n))&&(s&&(s+=" "),s+=r);return s},UG=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=UG(e[r]))&&(n&&(n+=" "),n+=t);return n},tOe=(e,...t)=>{let n,r,s,i;const a=l=>{const c=t.reduce((f,u)=>u(f),e());return n=X2e(c),r=n.cache.get,s=n.cache.set,i=o,o(l)},o=l=>{const c=r(l);if(c)return c;const f=Z2e(l,n);return s(l,f),f};return i=a,(...l)=>i(eOe(...l))},nOe=[],Ln=e=>{const t=n=>n[e]||nOe;return t.isThemeGetter=!0,t},BG=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HG=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rOe=/^\d+\/\d+$/,sOe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iOe=/\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$/,aOe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oOe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lOe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sf=e=>rOe.test(e),st=e=>!!e&&!Number.isNaN(Number(e)),Zo=e=>!!e&&Number.isInteger(Number(e)),rk=e=>e.endsWith("%")&&st(e.slice(0,-1)),Wa=e=>sOe.test(e),cOe=()=>!0,uOe=e=>iOe.test(e)&&!aOe.test(e),qG=()=>!1,fOe=e=>oOe.test(e),dOe=e=>lOe.test(e),hOe=e=>!we(e)&&!_e(e),mOe=e=>tm(e,GG,qG),we=e=>BG.test(e),Oc=e=>tm(e,YG,uOe),sk=e=>tm(e,bOe,st),u$=e=>tm(e,VG,qG),pOe=e=>tm(e,KG,dOe),Fv=e=>tm(e,WG,fOe),_e=e=>HG.test(e),Am=e=>nm(e,YG),gOe=e=>nm(e,xOe),f$=e=>nm(e,VG),yOe=e=>nm(e,GG),vOe=e=>nm(e,KG),Uv=e=>nm(e,WG,!0),tm=(e,t,n)=>{const r=BG.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nm=(e,t,n=!1)=>{const r=HG.exec(e);return r?r[1]?t(r[1]):n:!1},VG=e=>e==="position"||e==="percentage",KG=e=>e==="image"||e==="url",GG=e=>e==="length"||e==="size"||e==="bg-size",YG=e=>e==="length",bOe=e=>e==="number",xOe=e=>e==="family-name",WG=e=>e==="shadow",SOe=()=>{const e=Ln("color"),t=Ln("font"),n=Ln("text"),r=Ln("font-weight"),s=Ln("tracking"),i=Ln("leading"),a=Ln("breakpoint"),o=Ln("container"),l=Ln("spacing"),c=Ln("radius"),f=Ln("shadow"),u=Ln("inset-shadow"),h=Ln("text-shadow"),m=Ln("drop-shadow"),p=Ln("blur"),v=Ln("perspective"),S=Ln("aspect"),y=Ln("ease"),b=Ln("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),_e,we],E=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],A=()=>[_e,we,l],I=()=>[Sf,"full","auto",...A()],R=()=>[Zo,"none","subgrid",_e,we],$=()=>["auto",{span:["full",Zo,_e,we]},Zo,_e,we],U=()=>[Zo,"auto",_e,we],K=()=>["auto","min","max","fr",_e,we],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...A()],F=()=>[Sf,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],z=()=>[e,_e,we],V=()=>[..._(),f$,u$,{position:[_e,we]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],me=()=>["auto","cover","contain",yOe,mOe,{size:[_e,we]}],q=()=>[rk,Am,Oc],N=()=>["","none","full",c,_e,we],J=()=>["",st,Am,Oc],Y=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[st,rk,f$,u$],ae=()=>["","none",p,_e,we],te=()=>["none",st,_e,we],fe=()=>["none",st,_e,we],Ce=()=>[st,_e,we],ye=()=>[Sf,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[cOe],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[hOe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wa],shadow:[Wa],spacing:["px",st],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sf,we,_e,S]}],container:["container"],columns:[{columns:[st,we,_e,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Zo,"auto",_e,we]}],basis:[{basis:[Sf,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,Sf,"auto","initial","none",we]}],grow:[{grow:["",st,_e,we]}],shrink:[{shrink:["",st,_e,we]}],order:[{order:[Zo,"first","last","none",_e,we]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],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:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"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:[a]},...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,Am,Oc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,_e,sk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rk,we]}],"font-family":[{font:[gOe,we,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:[s,_e,we]}],"line-clamp":[{"line-clamp":[st,"none",_e,sk]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",_e,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,we]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",_e,Oc]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[st,"auto",_e,we]}],"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",_e,we]}],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",_e,we]}],"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:O()}],"bg-size":[{bg:me()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,_e,we],radial:["",_e,we],conic:[Zo,_e,we]},vOe,pOe]}],"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:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"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:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,_e,we]}],"outline-w":[{outline:["",st,Am,Oc]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,Uv,Fv]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",u,Uv,Fv]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[st,Oc]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",h,Uv,Fv]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[st,_e,we]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[st]}],"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":[_e,we]}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"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:O()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,we]}],filter:[{filter:["","none",_e,we]}],blur:[{blur:ae()}],brightness:[{brightness:[st,_e,we]}],contrast:[{contrast:[st,_e,we]}],"drop-shadow":[{"drop-shadow":["","none",m,Uv,Fv]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",st,_e,we]}],"hue-rotate":[{"hue-rotate":[st,_e,we]}],invert:[{invert:["",st,_e,we]}],saturate:[{saturate:[st,_e,we]}],sepia:[{sepia:["",st,_e,we]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,we]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[st,_e,we]}],"backdrop-contrast":[{"backdrop-contrast":[st,_e,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,_e,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,_e,we]}],"backdrop-invert":[{"backdrop-invert":["",st,_e,we]}],"backdrop-opacity":[{"backdrop-opacity":[st,_e,we]}],"backdrop-saturate":[{"backdrop-saturate":[st,_e,we]}],"backdrop-sepia":[{"backdrop-sepia":["",st,_e,we]}],"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",_e,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",_e,we]}],ease:[{ease:["linear","initial",y,_e,we]}],delay:[{delay:[st,_e,we]}],animate:[{animate:["none",b,_e,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,_e,we]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[_e,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"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",_e,we]}],"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",_e,we]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[st,Am,Oc,sk]}],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"]}},wOe=tOe(SOe);function at(...e){return wOe($G(e))}function D0({...e}){return d.jsx(RV,{"data-slot":"dialog",...e})}function _Oe({...e}){return d.jsx(NV,{"data-slot":"dialog-portal",...e})}function kOe({className:e,...t}){return d.jsx(TV,{"data-slot":"dialog-overlay",className:at("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 I0({children:e,className:t,showCloseButton:n=!0,...r}){return d.jsxs(_Oe,{"data-slot":"dialog-portal",children:[d.jsx(kOe,{}),d.jsxs(AV,{"data-slot":"dialog-content",className:at("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&&d.jsxs(oRe,{"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:[d.jsx(Mp,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function P0({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:at("flex flex-col gap-2 text-center sm:text-left",e),...t})}function _R({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:at("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function $0({className:e,...t}){return d.jsx(iRe,{"data-slot":"dialog-title",className:at("text-lg leading-none font-semibold",e),...t})}function z0({className:e,...t}){return d.jsx(aRe,{"data-slot":"dialog-description",className:at("text-muted-foreground text-sm",e),...t})}function JG({className:e,...t}){return d.jsx(Zu,{"data-slot":"command",className:at("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function EOe({children:e,className:t,description:n="Search for a command to run...",showCloseButton:r=!0,title:s="Command Palette",...i}){return d.jsxs(D0,{...i,children:[d.jsxs(P0,{className:"sr-only",children:[d.jsx($0,{children:s}),d.jsx(z0,{children:n})]}),d.jsx(I0,{className:at("overflow-hidden p-0",t),showCloseButton:r,children:d.jsx(JG,{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 XG({className:e,...t}){return d.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[d.jsx(Iw,{className:"size-4 shrink-0 opacity-50"}),d.jsx(Zu.Input,{"data-slot":"command-input",className:at("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 QG({className:e,...t}){return d.jsx(Zu.List,{"data-slot":"command-list",className:at("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ZG({...e}){return d.jsx(Zu.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function zb({className:e,...t}){return d.jsx(Zu.Group,{"data-slot":"command-group",className:at("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 d$({className:e,...t}){return d.jsx(Zu.Separator,{"data-slot":"command-separator",className:at("bg-border -mx-1 h-px",e),...t})}function Ei({className:e,...t}){return d.jsx(Zu.Item,{"data-slot":"command-item",className:at("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 COe={account:"Account",author:"Author",approver:"Approver",commenter:"Commenter",scope:"Scope",repo:"Repo",status:"Status",size:"Size"};function ROe(){const e=an(TP),t=ft(TP),n=hs(),r=ft(Oq),s=i=>{n(i?`/settings/${i}`:"/settings"),t(!1)};return g.useEffect(()=>{const i=a=>{a.key==="p"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),t(o=>!o))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),d.jsxs(EOe,{open:e,onOpenChange:t,showCloseButton:!1,children:[d.jsx(XG,{placeholder:"Type a command..."}),d.jsxs(QG,{children:[d.jsx(ZG,{children:"No results found."}),d.jsxs(zb,{heading:"Actions",children:[d.jsxs(Ei,{onSelect:()=>{r({}),t(!1)},children:[d.jsx(Qu,{}),"Refresh PRs"]}),d.jsxs(Ei,{onSelect:()=>{n("/"),t(!1)},children:[d.jsx(RP,{}),"View: PR List"]}),d.jsxs(Ei,{onSelect:()=>{n("/notifications"),t(!1)},children:[d.jsx(My,{}),"View: Notifications"]})]}),d.jsx(d$,{}),d.jsxs(zb,{heading:"Settings",children:[d.jsxs(Ei,{onSelect:()=>s(),children:[d.jsx(Mf,{}),"Open Settings"]}),d.jsxs(Ei,{onSelect:()=>s("accounts"),children:[d.jsx(Mf,{}),"Settings: Accounts"]}),d.jsxs(Ei,{onSelect:()=>s("theme"),children:[d.jsx(Mf,{}),"Settings: Theme"]}),d.jsxs(Ei,{onSelect:()=>s("config"),children:[d.jsx(Mf,{}),"Settings: Config"]}),d.jsxs(Ei,{onSelect:()=>s("about"),children:[d.jsx(Mf,{}),"Settings: About"]})]}),d.jsx(d$,{}),d.jsxs(zb,{heading:"Filters",children:[d.jsxs(Ei,{onSelect:()=>{n("/?hot=1"),t(!1)},children:[d.jsx(Fq,{}),"Hot"]}),Jq.map(i=>d.jsxs(Ei,{onSelect:()=>{n(`/?f=${i}:`),t(!1)},children:[d.jsx(RP,{}),"Filter: ",COe[i]]},i))]})]})]})}const NOe=e=>Jq.includes(e),eY=[{key:"status",value:"open"}],h$=eY.map(e=>`${e.key}:${e.value}`);function TOe(e){const t=e.getAll("f");if(t.length===0)return eY;const n=[];for(const r of t){const s=r.indexOf(":");if(s<1)continue;const i=r.slice(0,s),a=r.slice(s+1);!NOe(i)||!a||n.some(o=>o.key===i&&o.value===a)||n.push({key:i,value:a})}return n}function tY(){const[e,t]=hS(),n=g.useMemo(()=>{const u=e.get("mineScope"),h=e.get("from"),m=e.get("to");return{filters:TOe(e),hot:e.has("hot"),mine:e.has("mine"),review:e.has("review"),...u!=null?{mineScope:u}:{},q:e.get("q")??"",...h!=null?{from:h}:{},...m!=null?{to:m}:{}}},[e]),r=g.useCallback((u,h)=>{t(m=>{let p=m.getAll("f");const v=`${u}:${h}`;if(p.length===0){for(const y of h$)m.append("f",y);p=m.getAll("f")}const S=p.includes(v);m.delete("f");for(const y of p)y===v||y===""||m.append("f",y);return S||m.append("f",v),m.getAll("f").length===0&&S&&m.append("f",""),m},{replace:!0})},[t]),s=g.useCallback(u=>{t(h=>{let m=h.getAll("f");if(m.length===0){for(const p of h$)h.append("f",p);m=h.getAll("f")}h.delete("f");for(const p of m)p===""||p.slice(0,p.indexOf(":"))===u||h.append("f",p);return h.getAll("f").length===0&&h.append("f",""),h},{replace:!0})},[t]),i=g.useCallback(()=>{t(u=>(u.has("hot")?u.delete("hot"):u.set("hot","1"),u),{replace:!0})},[t]),a=g.useCallback(()=>{t(u=>(u.has("review")?u.delete("review"):u.set("review","1"),u),{replace:!0})},[t]),o=g.useCallback(()=>{t(u=>(u.has("mine")?(u.delete("mine"),u.delete("mineScope")):u.set("mine","1"),u),{replace:!0})},[t]),l=g.useCallback(u=>{t(h=>(u?h.set("mineScope",u):h.delete("mineScope"),h),{replace:!0})},[t]),c=g.useCallback(u=>{t(h=>(u?h.set("q",u):h.delete("q"),h),{replace:!0})},[t]),f=g.useCallback(()=>{t(u=>(u.delete("f"),u.delete("hot"),u.delete("mine"),u.delete("review"),u.delete("mineScope"),u.delete("q"),u.delete("from"),u.delete("to"),u),{replace:!0})},[t]);return{state:n,toggleFilter:r,removeFilterKey:s,toggleHot:i,toggleReview:a,toggleMine:o,setMineScope:l,setFilterText:c,clearAll:f}}const Ed=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},m$=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,p$=$G,lO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return p$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(c=>{const f=n==null?void 0:n[c],u=i==null?void 0:i[c];if(f===null)return null;const h=m$(f)||m$(u);return s[c][h]}),o=n&&Object.entries(n).reduce((c,f)=>{let[u,h]=f;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:h,...m}=f;return Object.entries(m).every(p=>{let[v,S]=p;return Array.isArray(S)?S.includes({...i,...o}[v]):{...i,...o}[v]===S})?[...c,u,h]:c},[]);return p$(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},AOe=lO("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 qe({asChild:e=!1,className:t,variant:n="default",...r}){const s=e?Zq:"span";return d.jsx(s,{"data-slot":"badge","data-variant":n,className:at(AOe({variant:n}),t),...r})}const OOe=lO("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 he({asChild:e=!1,className:t,size:n="default",variant:r="default",...s}){const i=e?Zq:"button";return d.jsx(i,{"data-slot":"button","data-variant":r,"data-size":n,className:at(OOe({variant:r,size:n,className:t})),...s})}function n1({className:e,...t}){return d.jsx("div",{"data-slot":"button-group",className:at("inline-flex items-stretch rounded-md border overflow-hidden [&>*]:rounded-none [&>*]:border-0 [&>*]:shadow-none [&>*:not(:last-child)]:border-r",e),...t})}function MOe({...e}){return d.jsx(FAe,{"data-slot":"popover",...e})}function jOe({...e}){return d.jsx(UAe,{"data-slot":"popover-trigger",...e})}function DOe({align:e="start",className:t,sideOffset:n=4,...r}){return d.jsx(BAe,{children:d.jsx(HAe,{"data-slot":"popover-content",align:e,sideOffset:n,className:at("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 w-[200px] origin-(--radix-popover-content-transform-origin) overflow-hidden rounded-md border p-0 shadow-md outline-hidden",t),...r})})}const g$={account:"Account",author:"Author",approver:"Approver",commenter:"Commenter",scope:"Scope",repo:"Repo",status:"Status",size:"Size"},y$=["author","repo","status","scope","account","approver","commenter","size"];function IOe({filterKey:e,groups:t,label:n,onToggle:r,options:s,selected:i}){const[a,o]=g.useState(!1),l=i.length,c=g.useMemo(()=>t?new Set(Object.values(t).flat()):new Set,[t]),f=g.useMemo(()=>{if(!t)return new Map;const u=new Map;for(const[h,m]of Object.entries(t))for(const p of m)u.set(p,h);return u},[t]);return d.jsxs(MOe,{open:a,onOpenChange:o,children:[d.jsx(jOe,{asChild:!0,children:d.jsxs(he,{variant:l>0?"secondary":"outline",size:"sm",className:"h-8 gap-1 text-xs",children:[n,l>0&&d.jsx(qe,{variant:"default",className:"ml-0.5 h-4 min-w-[16px] px-1 text-[10px] rounded-full",children:l}),d.jsx(jy,{className:"size-3 opacity-50"})]})}),d.jsx(DOe,{className:"w-[200px] p-0",children:d.jsxs(JG,{children:[d.jsx(XG,{placeholder:`Search ${n.toLowerCase()}...`}),d.jsxs(QG,{children:[d.jsx(ZG,{children:"No results."}),d.jsx(zb,{children:s.map((u,h)=>{const m=t!=null&&u in t,p=c.has(u),v=f.get(u),S=m?t[u].every(x=>i.includes(x))||i.includes(u):i.includes(u)||v!=null&&i.includes(v),y=h>0?s[h-1]:void 0,b=!p&&!m&&y!=null&&c.has(y);return d.jsxs("div",{children:[b&&d.jsx("div",{className:"my-1 h-px bg-border"}),d.jsxs(Ei,{onSelect:()=>r(e,u),className:p?"pl-8":"",children:[d.jsx("div",{className:`mr-2 flex size-4 shrink-0 items-center justify-center rounded-sm border ${S?"bg-primary border-primary text-primary-foreground":"opacity-50"}`,children:S&&d.jsx(Jh,{className:"size-3"})}),d.jsx("span",{className:`truncate ${m?"font-medium":""}`,children:u})]})]},u)})})]})]})})]})}function POe(e,t){var c;const n=new Set,r=new Set,s=new Set,i=new Set,a=new Set,o=new Set,l=new Set;for(const f of e){n.add(f.author),r.add(((c=f.account)==null?void 0:c.profile)??"unknown"),a.add(f.repositoryName);const u=Ed(f.title);if(u&&(s.add(u),t&&f.author===t&&i.add(u)),f.commentedBy)for(const h of f.commentedBy)h&&o.add(h);if(f.approvedBy)for(const h of f.approvedBy)h&&l.add(h)}return{account:Array.from(r).sort(),author:Array.from(n).sort(),approver:Array.from(l).sort(),commenter:Array.from(o).sort(),scope:Array.from(s).sort(),repo:Array.from(a).sort(),status:["open","approved","pending","mergeable","conflicts","merged","closed"],size:["small","medium","large","xlarge"],myScopes:Array.from(i).sort()}}function $Oe(e,t){var n,r,s;switch(t.key){case"account":return(((n=e.account)==null?void 0:n.profile)??"unknown")===t.value;case"author":return e.author===t.value;case"scope":return Ed(e.title)===t.value;case"repo":return e.repositoryName===t.value;case"approver":return((r=e.approvedBy)==null?void 0:r.some(i=>i===t.value))??!1;case"commenter":return((s=e.commentedBy)==null?void 0:s.some(i=>i===t.value))??!1;case"size":{const i=e.filesChanged;if(i==null)return!1;switch(t.value){case"small":return i<5;case"medium":return i>=5&&i<=15;case"large":return i>=16&&i<=30;case"xlarge":return i>30;default:return!0}}case"status":switch(t.value){case"approved":return e.status==="OPEN"&&e.isApproved;case"pending":return e.status==="OPEN"&&!e.isApproved;case"mergeable":return e.status==="OPEN"&&e.isMergeable;case"conflicts":return e.status==="OPEN"&&!e.isMergeable;case"merged":return e.status==="MERGED";case"closed":return e.status==="CLOSED";case"open":return e.status==="OPEN";default:return!0}default:return!0}}const Bv=["approved","pending","mergeable","conflicts"];function zOe(){var b;const e=an(gi),{clearAll:t,setFilterText:n,state:r,toggleFilter:s,toggleHot:i,toggleReview:a}=tY(),[,o]=hS(),l=g.useCallback((x,_)=>{o(C=>(x?C.set("from",x):C.delete("from"),_?C.set("to",_):C.delete("to"),C),{replace:!0})},[o]),c=e.pullRequests,f=e.currentUser,u=g.useMemo(()=>{const x=new Map;for(const _ of r.filters){const C=x.get(_.key);C?C.push(_.value):x.set(_.key,[_.value])}return x},[r.filters]),h=g.useCallback((x,_)=>{var C;x==="status"&&_==="open"?o(E=>{let k=E.getAll("f");if(k.length===0&&(E.append("f","status:open"),k=E.getAll("f")),k.includes("status:open")){E.delete("f");for(const $ of k)$==="status:open"||$===""||E.append("f",$);return E.getAll("f").length===0&&E.append("f",""),E}const A=Bv.map($=>`status:${$}`),I=new Set(["status:merged","status:closed"]),R=A.every($=>k.includes($));E.delete("f");for(const $ of k)A.includes($)||I.has($)||E.append("f",$);if(!R)for(const $ of A)E.append("f",$);return E.getAll("f").length===0&&E.append("f",""),E},{replace:!0}):x==="status"&&Bv.includes(_)&&((C=u.get("status"))!=null&&C.includes("open"))?o(E=>{let k=E.getAll("f");k.length===0&&(E.append("f","status:open"),k=E.getAll("f")),E.delete("f");for(const A of k)A==="status:open"||A===""||E.append("f",A);for(const A of Bv)A!==_&&E.append("f",`status:${A}`);return E},{replace:!0}):s(x,_)},[s,o,u]),m={open:"lifecycle",merged:"lifecycle",closed:"lifecycle",approved:"approval",pending:"approval",mergeable:"merge",conflicts:"merge"},p=g.useMemo(()=>{const x=new Map;for(const C of r.filters){const E=C.key==="status"?`status:${m[C.value]??C.value}`:C.key,k=x.get(E);k?k.push(C):x.set(E,[C])}const _={};for(const C of y$){const E=[...x.entries()].filter(([I])=>I!==C&&!I.startsWith(`${C}:`));let k=c;E.length>0&&(k=c.filter(I=>E.every(([,R])=>R.some($=>$Oe(I,$)))));const A=POe(k,f);_[C]=A[C]??[]}return _},[c,f,r.filters]),v=!!r.from||!!r.to,S=r.filters.length>0||r.hot||r.review||r.q||v,y=r.filters.length>0;return d.jsxs("div",{className:"border-b bg-background",children:[d.jsxs("div",{className:"mx-auto flex max-w-5xl items-center gap-1.5 px-4 pt-2 pb-1 flex-wrap",children:[d.jsxs(he,{variant:r.hot?"default":"outline",size:"sm",className:"gap-1 h-7",onClick:i,children:[d.jsx(Fq,{className:"size-3.5"}),"Hot"]}),f&&d.jsxs(he,{variant:(b=u.get("author"))!=null&&b.includes(f)?"default":"outline",size:"sm",className:"gap-1 h-7",onClick:()=>h("author",f),children:[d.jsx(Pw,{className:"size-3.5"}),"Mine"]}),f&&d.jsxs(he,{variant:r.review?"default":"outline",size:"sm",className:"gap-1 h-7",onClick:a,children:[d.jsx(j2,{className:"size-3.5"}),"Review"]}),d.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),y$.map(x=>d.jsx(IOe,{filterKey:x,label:g$[x],options:p[x],selected:u.get(x)??[],onToggle:h,...x==="status"?{groups:{open:Bv}}:{}},x))]}),d.jsx("div",{className:"mx-auto max-w-5xl px-4 pb-2",children:d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border bg-background px-3 min-h-[44px] focus-within:ring-1 focus-within:ring-ring flex-wrap py-1.5",children:[d.jsx(Iw,{className:"size-4 shrink-0 text-muted-foreground"}),[...u.entries()].map(([x,_])=>_.map(C=>d.jsxs(qe,{variant:"secondary",className:"cursor-pointer gap-1 pl-2 pr-0.5 h-5 text-[10px] shrink-0",onClick:()=>s(x,C),children:[g$[x],": ",C,d.jsx(Mp,{className:"size-2.5"})]},`${x}:${C}`))),v&&d.jsxs(qe,{variant:"outline",className:"cursor-pointer gap-1 pl-2 pr-0.5 h-5 text-[10px] shrink-0",onClick:()=>l(void 0,void 0),children:[r.from," → ",r.to,d.jsx(Mp,{className:"size-2.5"})]}),d.jsx("input",{placeholder:y||v?"Refine...":"Search PRs...",className:"flex-1 min-w-[80px] bg-transparent text-sm outline-none placeholder:text-muted-foreground",value:r.q,onChange:x=>n(x.target.value)}),S&&d.jsx("button",{type:"button",className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",onClick:t,children:d.jsx(Mp,{className:"size-3.5"})})]})})]})}const r1=e=>{const t=e.getDate().toString().padStart(2,"0"),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return`${t}.${n}.${r}`},s1=(e,t,n="Updated")=>{const r=Math.max(0,Math.floor((t.getTime()-e.getTime())/1e3));return yq(r).pipe(Op(s=>s<60,s=>`${n} ${s}s ago`),Op(s=>s<3600,s=>`${n} ${Math.floor(s/60)}m ago`),Op(s=>s<86400,s=>`${n} ${Math.floor(s/3600)}h ago`),vq(()=>`${n} on ${r1(e)}`))},LOe=e=>{const t=/^(\d{4})-W(\d{2})$/.exec(e);if(!t)return re();const n=parseInt(t[1],10),r=parseInt(t[2],10);if(r<1||r>53)return re();const s=new Date(Date.UTC(n,0,4)),i=s.getUTCDay()||7,a=new Date(s.getTime()+((r-1)*7-(i-1))*864e5),o=new Date(a.getTime()+7*864e5);return ie({week:e,start:a,end:o})},v$=e=>{const t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())),n=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-n);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1)),s=Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7);return`${t.getUTCFullYear()}-W${s.toString().padStart(2,"0")}`},FOe=e=>{const t=e.week.split("-W"),n=e.start.toLocaleString("en-US",{month:"short",timeZone:"UTC"}),r=e.end.toLocaleString("en-US",{month:"short",timeZone:"UTC"}),s=e.start.getUTCDate(),i=e.end.getUTCDate(),a=n===r?`${n} ${s} – ${i}`:`${n} ${s} – ${r} ${i}`;return`W${t[1]} ${t[0]} · ${a}`},Lb=e=>{const t=bu(e),n=Ese(t);return n<1?`${Math.round(n*60)}m`:n<24?`${Math.floor(n)}h`:`${Math.round(n/24*10)/10}d`};function UOe({...e}){return d.jsx(EAe,{"data-slot":"dropdown-menu",...e})}function BOe({...e}){return d.jsx(CAe,{"data-slot":"dropdown-menu-trigger",...e})}function HOe({align:e="end",className:t,sideOffset:n=4,...r}){return d.jsx(RAe,{children:d.jsx(NAe,{"data-slot":"dropdown-menu-content",align:e,sideOffset:n,className:at("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 qOe({className:e,...t}){return d.jsx(TAe,{"data-slot":"dropdown-menu-item",className:at("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 VOe({className:e,...t}){return d.jsx("kbd",{"data-slot":"kbd",className:at("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 tr({className:e,decorative:t=!0,orientation:n="horizontal",...r}){return d.jsx(N2e,{"data-slot":"separator",decorative:t,orientation:n,className:at("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 KOe(){const e=an(gi),t=ft(Oq),n=ft(M2),r=hs(),{setTheme:s,theme:i}=D5(),a=e.status==="loading",o=e.status==="error",l=e.unreadNotificationCount??0,c=e.pendingReviewCount??0,f=(e.sandboxes??[]).filter(u=>u.status==="running"||u.status==="creating"||u.status==="cloning"||u.status==="starting");return d.jsx("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:d.jsxs("div",{className:"mx-auto flex h-14 max-w-5xl items-center gap-4 px-4",children:[d.jsx("button",{className:"text-sm font-semibold tracking-tight hover:text-foreground/80",onClick:()=>r("/"),children:"codecommit"}),d.jsx(tr,{orientation:"vertical",className:"h-4"}),o&&d.jsx("span",{className:"text-sm text-destructive",children:e.error??"Error loading PRs"}),a&&d.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx(Ra,{className:"size-3 animate-spin"}),e.statusDetail&&d.jsx("span",{className:"font-mono opacity-60",children:e.statusDetail})]}),e.lastUpdated&&!o&&!a&&d.jsx("span",{className:"text-xs text-muted-foreground",children:s1(e.lastUpdated,new Date)}),d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.currentUser&&d.jsxs(UOe,{children:[d.jsx(BOe,{asChild:!0,children:d.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:[d.jsx(Pw,{className:"size-3"}),e.currentUser]})}),d.jsx(HOe,{children:d.jsxs(qOe,{onClick:()=>n({}),children:[d.jsx(Bq,{className:"size-3"}),"Logout"]})})]}),d.jsxs(he,{variant:"ghost",size:"icon-sm",onClick:()=>r("/stats"),children:[d.jsx(gke,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Statistics"})]}),d.jsxs(he,{variant:"ghost",size:"icon-sm",onClick:()=>r("/audit"),children:[d.jsx(Dw,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Audit Log"})]}),d.jsxs(he,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/sandboxes"),children:[d.jsx(_g,{className:"size-4"}),f.length>0&&d.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:f.length}),d.jsx("span",{className:"sr-only",children:"Sandboxes"})]}),c>0&&d.jsxs(he,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/?review=1"),children:[d.jsx(j2,{className:"size-4"}),d.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex size-4 items-center justify-center rounded-full bg-yellow-500 text-[10px] font-medium text-white",children:c>9?"9+":c}),d.jsx("span",{className:"sr-only",children:"Needs my review"})]}),d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:()=>t({}),disabled:a,children:d.jsx(Qu,{className:at("size-4",a&&"animate-spin")})}),d.jsxs(he,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/notifications"),children:[d.jsx(My,{className:"size-4"}),l>0&&d.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}),d.jsx("span",{className:"sr-only",children:"Notifications"})]}),d.jsxs(he,{variant:"ghost",size:"icon-sm",onClick:()=>r("/settings"),children:[d.jsx(Mf,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Settings"})]}),d.jsx(VOe,{children:"⌘P"}),d.jsxs(he,{variant:"ghost",size:"icon-sm",onClick:()=>s(i==="dark"?"light":i==="light"?"system":"dark"),children:[d.jsx(Yq,{className:"size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),d.jsx(qq,{className:"absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),d.jsx("span",{className:"sr-only",children:"Toggle theme"})]})]})]})})}function GOe({prompt:e}){const t=ft(z_e),n=r=>t({payload:{id:e.id,response:r}});return d.jsx(D0,{open:!0,children:d.jsxs(I0,{showCloseButton:!1,children:[d.jsxs(P0,{children:[d.jsxs($0,{className:"flex items-center gap-2",children:[d.jsx(Kq,{className:"size-5"}),"API Permission Required"]}),d.jsx(z0,{children:e.context})]}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2",children:[d.jsx(qe,{variant:e.category==="write"?"destructive":"secondary",children:e.category}),d.jsx("code",{className:"text-xs font-mono",children:e.operation})]}),d.jsxs(_R,{children:[d.jsx(he,{variant:"outline",onClick:()=>n("deny"),children:"Deny"}),d.jsx(he,{variant:"secondary",onClick:()=>n("allow_once"),children:"Allow Once"}),d.jsx(he,{onClick:()=>n("always_allow"),children:"Always Allow"})]})]})})}function YOe(){const e=ft(gi),t=an(gi),n=hs(),r=g.useCallback(l=>n(l??"/notifications"),[n]),{notify:s}=K_e(l=>n(l));tke(l=>e(l),r,s),W_e(t.pendingReviewCount??0);const{pathname:i}=ja(),a=i==="/",o=j3e();return d.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[d.jsx(KOe,{}),a&&d.jsx(zOe,{}),d.jsx("main",{className:o?"flex-1":"mx-auto w-full max-w-5xl flex-1 px-4 py-6",children:d.jsx(gee,{})}),d.jsx(ROe,{}),d.jsx(x1e,{}),t.permissionPrompt&&d.jsx(GOe,{prompt:t.permissionPrompt})]})}function to({className:e,type:t,...n}){return d.jsx("input",{type:t,"data-slot":"input",className:at("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 lh({...e}){return d.jsx(h2e,{"data-slot":"select",...e})}function ch({...e}){return d.jsx(p2e,{"data-slot":"select-value",...e})}function uh({children:e,className:t,size:n="default",...r}){return d.jsxs(m2e,{"data-slot":"select-trigger","data-size":n,className:at("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,d.jsx(g2e,{asChild:!0,children:d.jsx(jy,{className:"size-4 opacity-50"})})]})}function fh({align:e="center",children:t,className:n,position:r="item-aligned",...s}){return d.jsx(y2e,{children:d.jsxs(v2e,{"data-slot":"select-content",className:at("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,...s,children:[d.jsx(WOe,{}),d.jsx(b2e,{className:at("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(JOe,{})]})})}function Dt({children:e,className:t,...n}){return d.jsxs(x2e,{"data-slot":"select-item",className:at("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:[d.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(w2e,{children:d.jsx(Jh,{className:"size-4"})})}),d.jsx(S2e,{children:e})]})}function WOe({className:e,...t}){return d.jsx(_2e,{"data-slot":"select-scroll-up-button",className:at("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(kke,{className:"size-4"})})}function JOe({className:e,...t}){return d.jsx(k2e,{"data-slot":"select-scroll-down-button",className:at("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(jy,{className:"size-4"})})}const Om=50,XOe=e=>{switch(e){case"always_allowed":return"secondary";case"allowed":return"default";case"denied":return"destructive";case"timed_out":return"outline";default:return"outline"}};function QOe(){const e=hs(),[,t]=aR(H_e,{mode:"promise"}),[,n]=aR(q_e,{mode:"promise"}),[r,s]=g.useState([]),[i,a]=g.useState(0),[o,l]=g.useState(!0),[c,f]=g.useState(0),[u,h]=g.useState(""),[m,p]=g.useState(""),[v,S]=g.useState(""),y=g.useMemo(()=>{const _={limit:Om,offset:c};return u&&(_.search=u),m&&(_.operation=m),v&&(_.permissionState=v),_},[c,u,m,v]);g.useEffect(()=>{let _=!1;return l(!0),t({urlParams:y}).then(C=>{_||(s(C.items),a(C.total),l(!1))}).catch(()=>l(!1)),()=>{_=!0}},[t,y]);const b=c+Om<i,x=g.useCallback(()=>{n({urlParams:{}}).then(_=>{const C=new Blob([JSON.stringify(_,null,2)],{type:"application/json"}),E=URL.createObjectURL(C),k=document.createElement("a");k.href=E,k.download=`audit-log-${new Date().toISOString().slice(0,10)}.json`,k.click(),URL.revokeObjectURL(E)}).catch(()=>{})},[n]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(he,{variant:"ghost",size:"sm",className:"gap-2",onClick:()=>e("/"),children:[d.jsx(Oy,{className:"size-4"}),"Back"]}),d.jsx("h1",{className:"text-lg font-semibold",children:"Audit Log"}),d.jsxs("span",{className:"text-sm text-muted-foreground",children:[i," entries"]}),d.jsx("div",{className:"ml-auto",children:d.jsxs(he,{variant:"outline",size:"sm",className:"gap-2",onClick:x,children:[d.jsx(jke,{className:"size-3"}),"Export JSON"]})})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(Iw,{className:"absolute left-2.5 top-2.5 size-4 text-muted-foreground"}),d.jsx(to,{placeholder:"Search operations and context...",value:u,onChange:_=>{h(_.target.value),f(0)},className:"pl-9"})]}),d.jsxs(lh,{value:m||"all",onValueChange:_=>{p(_==="all"?"":_),f(0)},children:[d.jsx(uh,{className:"w-48",children:d.jsx(ch,{placeholder:"Operation"})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"all",children:"All operations"}),d.jsx(Dt,{value:"getPullRequests",children:"getPullRequests"}),d.jsx(Dt,{value:"getCallerIdentity",children:"getCallerIdentity"}),d.jsx(Dt,{value:"createPullRequest",children:"createPullRequest"}),d.jsx(Dt,{value:"listRepositories",children:"listRepositories"}),d.jsx(Dt,{value:"listBranches",children:"listBranches"}),d.jsx(Dt,{value:"getPullRequest",children:"getPullRequest"}),d.jsx(Dt,{value:"getDifferences",children:"getDifferences"}),d.jsx(Dt,{value:"getCommentsForPullRequest",children:"getCommentsForPullRequest"})]})]}),d.jsxs(lh,{value:v||"all",onValueChange:_=>{S(_==="all"?"":_),f(0)},children:[d.jsx(uh,{className:"w-40",children:d.jsx(ch,{placeholder:"State"})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"all",children:"All states"}),d.jsx(Dt,{value:"always_allowed",children:"Always allowed"}),d.jsx(Dt,{value:"allowed",children:"Allowed"}),d.jsx(Dt,{value:"denied",children:"Denied"}),d.jsx(Dt,{value:"timed_out",children:"Timed out"})]})]})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b bg-muted/50",children:[d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Timestamp"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Operation"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Account"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"State"}),d.jsx("th",{className:"px-3 py-2 text-right font-medium",children:"Duration"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Context"})]})}),d.jsxs("tbody",{children:[o&&r.length===0&&d.jsx("tr",{children:d.jsx("td",{colSpan:6,className:"px-3 py-8 text-center text-muted-foreground",children:"Loading..."})}),!o&&r.length===0&&d.jsx("tr",{children:d.jsx("td",{colSpan:6,className:"px-3 py-8 text-center text-muted-foreground",children:"No entries"})}),r.map(_=>d.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/30",children:[d.jsx("td",{className:"px-3 py-2 font-mono text-xs text-muted-foreground whitespace-nowrap",children:new Date(_.timestamp).toLocaleString()}),d.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:_.operation}),d.jsx("td",{className:"px-3 py-2 text-xs",children:_.accountProfile||"-"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(qe,{variant:XOe(_.permissionState),className:"text-xs",children:_.permissionState})}),d.jsx("td",{className:"px-3 py-2 text-right font-mono text-xs text-muted-foreground",children:_.durationMs!=null?`${_.durationMs}ms`:"-"}),d.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground truncate max-w-[200px]",children:_.context})]},_.id))]})]})}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs text-muted-foreground",children:i>0?`${c+1}–${Math.min(c+Om,i)} of ${i}`:"0 entries"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(he,{variant:"outline",size:"sm",disabled:c===0,onClick:()=>f(Math.max(0,c-Om)),children:"Previous"}),d.jsx(he,{variant:"outline",size:"sm",disabled:!b,onClick:()=>f(c+Om),children:"Next"})]})]})]})}function ZOe(e={}){var k;const{filter:t,unreadOnly:n}=e,r=t!==void 0||n===!0,i=an(gi).notifications,[a,o]=g.useState([]),[l,c]=g.useState(null),[f,u]=aR(N_e,{mode:"promise"}),h=g.useRef(`${t}:${n}`),m=`${t}:${n}`;h.current!==m&&(h.current=m,o([]),c(null));const p=(k=i==null?void 0:i.items[0])==null?void 0:k.id,v=g.useRef(p);!r&&v.current!==p&&(v.current=p,a.length>0&&o([]));const S=g.useMemo(()=>({limit:20,...t?{filter:t}:{},...n?{unreadOnly:1}:{}}),[t,n]);g.useEffect(()=>{if(!r)return;let A=!1;return u({urlParams:S}).then(I=>{A||c({items:I.items,...I.nextCursor!==void 0?{nextCursor:I.nextCursor}:{}})}).catch(()=>{}),()=>{A=!0}},[r,S,u]);const y=r?l:i,b=a.length>0?a[a.length-1].nextCursor:y==null?void 0:y.nextCursor,x=b!==void 0,_=f.waiting,C=g.useCallback(async()=>{if(!(!x||_||b===void 0))try{const A=await u({urlParams:{...S,cursor:b}}),I={items:A.items,...A.nextCursor!==void 0?{nextCursor:A.nextCursor}:{}};o(R=>[...R,I])}catch{}},[x,_,b,u,S]);return{items:g.useMemo(()=>{const A=(y==null?void 0:y.items)??[];return a.length===0?A:[...A,...a.flatMap(I=>I.items)]},[y==null?void 0:y.items,a]),hasMore:x,isLoading:_,loadMore:C}}function eMe(e,t){const n=g.useRef(null),r=g.useRef(e);return r.current=e,g.useCallback(i=>{var a;(a=n.current)==null||a.disconnect(),n.current=null,i&&(n.current=new IntersectionObserver(o=>{var l;(l=o[0])!=null&&l.isIntersecting&&r.current()},t),n.current.observe(i))},[JSON.stringify(t)])}function tMe(e){const[t,n]=g.useState(null),r=g.useRef(e);return r.current!==e&&(r.current=e,t!==null&&n(null)),[t??e,n]}function b$(e){const[t,n]=g.useState(new Set),r=g.useRef(e);r.current!==e&&(r.current=e,t.size>0&&n(new Set));const s=g.useCallback(o=>{n(l=>new Set(l).add(o))},[]),i=g.useCallback(o=>{n(new Set(o))},[]),a=g.useCallback(o=>{n(l=>{const c=new Set(l);return c.delete(o),c})},[]);return[t,s,i,a]}const nMe=lO("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"}}),nY=g.createContext({size:"default",variant:"default",spacing:0});function rMe({children:e,className:t,size:n,spacing:r=0,variant:s,...i}){return d.jsx(j2e,{"data-slot":"toggle-group","data-variant":s,"data-size":n,"data-spacing":r,className:at("group/toggle-group flex w-fit items-center rounded-md",t),...i,children:d.jsx(nY,{value:{variant:s,size:n,spacing:r},children:e})})}function ik({children:e,className:t,size:n,variant:r,...s}){const i=g.useContext(nY);return d.jsx(D2e,{"data-slot":"toggle-group-item","data-variant":i.variant||r,"data-size":i.size||n,"data-spacing":i.spacing,className:at(nMe({variant:i.variant||r,size:i.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),...s,children:e})}const sMe=e=>/ExpiredToken|Unauthorized|AuthFailure|SSO|token|credentials|expired/i.test(e),iMe=e=>{switch(e){case"error":return d.jsx(Cke,{className:"size-4 text-destructive shrink-0"});case"warning":return d.jsx(xEe,{className:"size-4 text-yellow-500 shrink-0"});case"success":return d.jsx($q,{className:"size-4 text-green-500 shrink-0"});default:return d.jsx(D2,{className:"size-4 text-blue-500 shrink-0"})}},rY=de({operation:pe(M),profile:pe(M),region:pe(M),cause:pe(M),error:pe(M),message:pe(M)}),aMe=f2(rY),oMe=pc(M,rY,{decode:e=>({cause:e}),encode:e=>e.cause??""}),lMe=Ibe(Wu(aMe,oMe)),sY=e=>lMe(e),cMe=e=>{const t=sY(e);if(Qt(t))return e;const{cause:n,error:r,message:s,operation:i}=t.value,a=n??r??s,o=[];return i&&o.push(i),a&&o.push(a),o.length>0?o.join(" — "):e},uMe=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 fMe(){var K,W;const[e,t]=g.useState(void 0),[n,r]=g.useState(!0),[s,i]=g.useState(new Set),a=B=>i(j=>{const F=new Set(j);return F.has(B)?F.delete(B):F.add(B),F}),o=an(gi),l=hs(),{items:c,hasMore:f,isLoading:u,loadMore:h}=ZOe({filter:e,unreadOnly:n}),m=ft(T_e),p=ft(A_e),v=ft(O_e),S=ft(O2),y=ft(M2),[b,x,_]=b$((K=c[0])==null?void 0:K.id),[C,E,,k]=b$((W=c[0])==null?void 0:W.id),A=eMe(()=>{f&&!u&&h()}),I=c.map(B=>C.has(B.id)?{...B,read:0}:b.has(B.id)?{...B,read:1}:B),R=o.unreadNotificationCount??0,$=B=>B.pullRequestId==="",U=B=>{B.read===0&&(x(B.id),k(B.id),m({payload:{id:B.id}})),$(B)?a(B.id):l(`/accounts/${encodeURIComponent(B.awsAccountId)}/prs/${B.pullRequestId}`)};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-lg font-semibold",children:"Notifications"}),d.jsx(he,{variant:"ghost",size:"sm",onClick:()=>l("/"),children:"Back"})]}),d.jsx(tr,{}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(rMe,{type:"single",value:e??"all",onValueChange:B=>t(B==="all"||B===""?void 0:B),variant:"outline",size:"sm",children:[d.jsx(ik,{value:"all",children:"All"}),d.jsx(ik,{value:"system",children:"System"}),d.jsx(ik,{value:"prs",children:"PRs"})]}),d.jsx(he,{variant:n?"secondary":"ghost",size:"sm",onClick:()=>r(B=>!B),children:"Unread only"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-2",children:R>0&&d.jsxs(qe,{variant:"destructive",children:[R," unread"]})}),R>0&&d.jsxs(he,{variant:"ghost",size:"sm",onClick:()=>{_(I.map(B=>B.id)),v({})},children:[d.jsx(Jh,{className:"size-3.5 mr-1"}),"Mark all read"]})]}),I.length===0?d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No notifications"}):d.jsx("div",{className:"divide-y rounded-md border",children:I.map(B=>{const j=cMe(B.message),F=s.has(B.id);return d.jsxs("div",{className:`flex ${B.read===0?"border-l-2 border-l-blue-500":""}`,children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.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:()=>U(B),onKeyDown:z=>{z.key==="Enter"&&U(B)},children:[iMe(B.type),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:`text-sm truncate ${B.read===0?"font-medium":"text-muted-foreground"}`,children:B.title||($(B)?B.type:`PR #${B.pullRequestId}`)}),d.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:uMe(B.createdAt)})]}),!F&&d.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-1",children:j})]})]}),F&&d.jsxs("div",{className:"px-3 pb-2.5 ml-7 space-y-2 min-w-0 overflow-hidden",children:[Ft(sY(B.message),{onNone:()=>d.jsx("p",{className:"text-xs text-muted-foreground break-words",children:B.message}),onSome:z=>d.jsxs("div",{className:"text-xs text-muted-foreground space-y-0.5",children:[z.operation&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"operation:"})," ",z.operation]}),z.profile&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"profile:"})," ",z.profile]}),z.region&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"region:"})," ",z.region]}),z.cause&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"cause:"})," ",z.cause]}),z.error&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"error:"})," ",z.error]}),z.message&&d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:"message:"})," ",z.message]})]})}),d.jsxs(n1,{children:[d.jsx(he,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{B.read===0?(x(B.id),k(B.id),m({payload:{id:B.id}})):(E(B.id),p({payload:{id:B.id}}))},children:B.read===0?d.jsxs(d.Fragment,{children:[d.jsx(Gke,{className:"size-3"})," Mark as read"]}):d.jsxs(d.Fragment,{children:[d.jsx(Wke,{className:"size-3"})," Mark as unread"]})}),$(B)&&sMe(B.message)&&d.jsxs(d.Fragment,{children:[d.jsx(he,{variant:"default",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{try{const z=g7(Wh)(B.profile||B.title);S({payload:{profile:z}})}catch{}},children:"Login"}),d.jsx(he,{variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{y({})},children:"Logout"})]})]})]})]}),d.jsx("button",{className:"shrink-0 px-3 flex items-center hover:bg-accent/50 transition-colors border-l border-border",onClick:()=>a(B.id),title:F?"Collapse":"Expand",children:d.jsx(wke,{className:`size-4 text-muted-foreground transition-transform ${F?"rotate-90":""}`})})]},B.id)})}),d.jsx("div",{ref:A,className:"h-1"}),u&&d.jsx("div",{className:"flex justify-center py-2",children:d.jsx(Ra,{className:"size-4 animate-spin text-muted-foreground"})})]})]})}const dMe=864e5,Mc=e=>Math.round(e*10)/10,hMe=(e,t,n)=>Math.min(t,Math.max(e,n)),x$=(e,t)=>Math.max(0,(t.getTime()-e.getTime())/dMe),mMe=e=>/^\w+(\([^)]+\))?:/.test(e)||/^[A-Z]+-\d+:/.test(e),iY=(e,t)=>{const n=x$(e.lastModifiedDate,t),r=x$(e.creationDate,t),s=e.commentCount??0,i=mMe(e.title),a=!!e.description&&e.description.trim().length>0,o=-(n*1),l=-(r*.5),c=s*1,f=e.isApproved?2:0,u=e.isMergeable?0:-3,h=i?.5:0,m=a?.5:0,p=10+o+l+c+f+u+h+m,v=Mc(hMe(0,10,p)),S=[{label:"Base",value:10},{label:"Time decay",value:Mc(o)},{label:"Age",value:Mc(l)},{label:"Comments",value:Mc(c)},{label:"Approval",value:f},{label:"Conflicts",value:u},{label:"Scope",value:h},{label:"Description",value:m}],y=[{label:"Activity",description:`-1 per day since last update (${Math.round(n)}d ago)`,value:Mc(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:Mc(l),...r<3?{status:"positive",statusLabel:"FRESH"}:r<=14?{status:"neutral",statusLabel:"AGING"}:{status:"negative",statusLabel:"OLD"}},{label:"Engagement",description:`+1 per comment (${s} comments)`,value:Mc(c),...s>=3?{status:"positive",statusLabel:"ACTIVE"}:s>=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:i?"+0.5 bonus — conventional commit or ticket prefix detected":"No scope prefix found (e.g. feat(auth): or JIRA-123:)",value:h,...i?{status:"positive",statusLabel:"DETECTED"}:{status:"negative",statusLabel:"MISSING"}},{label:"Description",description:a?"+0.5 bonus — PR description provided":"No PR description provided",value:m,...a?{status:"positive",statusLabel:"PROVIDED"}:{status:"negative",statusLabel:"MISSING"}}];return ie({total:v,breakdown:S,categories:y})},cO=e=>yq(e).pipe(Op(t=>t>=7,()=>"green"),Op(t=>t>=4,()=>"yellow"),vq(()=>"red"));function pMe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const gMe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yMe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vMe={};function S$(e,t){return(vMe.jsx?yMe:gMe).test(e)}const bMe=/[ \t\n\f\r]/g;function xMe(e){return typeof e=="object"?e.type==="text"?w$(e.value):!1:w$(e)}function w$(e){return e.replace(bMe,"")===""}class qy{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qy.prototype.normal={};qy.prototype.property={};qy.prototype.space=void 0;function aY(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new qy(n,r,t)}function kR(e){return e.toLowerCase()}class ps{constructor(t,n){this.attribute=n,this.property=t}}ps.prototype.attribute="";ps.prototype.booleanish=!1;ps.prototype.boolean=!1;ps.prototype.commaOrSpaceSeparated=!1;ps.prototype.commaSeparated=!1;ps.prototype.defined=!1;ps.prototype.mustUseProperty=!1;ps.prototype.number=!1;ps.prototype.overloadedBoolean=!1;ps.prototype.property="";ps.prototype.spaceSeparated=!1;ps.prototype.space=void 0;let SMe=0;const tt=nf(),En=nf(),ER=nf(),se=nf(),qt=nf(),Cd=nf(),vs=nf();function nf(){return 2**++SMe}const CR=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:En,commaOrSpaceSeparated:vs,commaSeparated:Cd,number:se,overloadedBoolean:ER,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),ak=Object.keys(CR);class uO extends ps{constructor(t,n,r,s){let i=-1;if(super(t,n),_$(this,"space",s),typeof r=="number")for(;++i<ak.length;){const a=ak[i];_$(this,ak[i],(r&CR[a])===CR[a])}}}uO.prototype.defined=!0;function _$(e,t,n){n&&(e[t]=n)}function rm(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new uO(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[kR(r)]=r,n[kR(i.attribute)]=r}return new qy(t,n,e.space)}const oY=rm({properties:{ariaActiveDescendant:null,ariaAtomic:En,ariaAutoComplete:null,ariaBusy:En,ariaChecked:En,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:En,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:En,ariaFlowTo:qt,ariaGrabbed:En,ariaHasPopup:null,ariaHidden:En,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:se,ariaLive:null,ariaModal:En,ariaMultiLine:En,ariaMultiSelectable:En,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:En,ariaReadOnly:En,ariaRelevant:null,ariaRequired:En,ariaRoleDescription:qt,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:En,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lY(e,t){return t in e?e[t]:t}function cY(e,t){return lY(e,t.toLowerCase())}const wMe=rm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cd,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:qt,autoFocus:tt,autoPlay:tt,blocking:qt,capture:null,charSet:null,checked:tt,cite:null,className:qt,cols:se,colSpan:null,content:null,contentEditable:En,controls:tt,controlsList:qt,coords:se|Cd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:ER,draggable:En,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:qt,height:se,hidden:ER,high:se,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:qt,itemRef:qt,itemScope:tt,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,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:tt,optimum:se,pattern:null,ping:qt,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:qt,required:tt,reversed:tt,rows:se,rowSpan:se,sandbox:qt,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:En,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:En,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:En,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:cY}),_Me=rm({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:vs,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:qt,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Cd,g2:Cd,glyphName:Cd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:vs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vs,rev:vs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vs,requiredFeatures:vs,requiredFonts:vs,requiredFormats:vs,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:vs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vs,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lY}),uY=rm({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()}}),fY=rm({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:cY}),dY=rm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kMe={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"},EMe=/[A-Z]/g,k$=/-[a-z]/g,CMe=/^data[-\w.:]+$/i;function RMe(e,t){const n=kR(t);let r=t,s=ps;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CMe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(k$,TMe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!k$.test(i)){let a=i.replace(EMe,NMe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=uO}return new s(r,t)}function NMe(e){return"-"+e.toLowerCase()}function TMe(e){return e.charAt(1).toUpperCase()}const AMe=aY([oY,wMe,uY,fY,dY],"html"),fO=aY([oY,_Me,uY,fY,dY],"svg");function OMe(e){return e.join(" ").trim()}var dO={},E$=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,MMe=/\n/g,jMe=/^\s*/,DMe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,IMe=/^:\s*/,PMe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$Me=/^[;\s]*/,zMe=/^\s+|\s+$/g,LMe=`
427
+ `,C$="/",R$="*",Hc="",FMe="comment",UMe="declaration";function BMe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(p){var v=p.match(MMe);v&&(n+=v.length);var S=p.lastIndexOf(LMe);r=~S?p.length-S:r+p.length}function i(){var p={line:n,column:r};return function(v){return v.position=new a(p),c(),v}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var v=new Error(t.source+":"+n+":"+r+": "+p);if(v.reason=p,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(p){var v=p.exec(e);if(v){var S=v[0];return s(S),e=e.slice(S.length),v}}function c(){l(jMe)}function f(p){var v;for(p=p||[];v=u();)v!==!1&&p.push(v);return p}function u(){var p=i();if(!(C$!=e.charAt(0)||R$!=e.charAt(1))){for(var v=2;Hc!=e.charAt(v)&&(R$!=e.charAt(v)||C$!=e.charAt(v+1));)++v;if(v+=2,Hc===e.charAt(v-1))return o("End of comment missing");var S=e.slice(2,v-2);return r+=2,s(S),e=e.slice(v),r+=2,p({type:FMe,comment:S})}}function h(){var p=i(),v=l(DMe);if(v){if(u(),!l(IMe))return o("property missing ':'");var S=l(PMe),y=p({type:UMe,property:N$(v[0].replace(E$,Hc)),value:S?N$(S[0].replace(E$,Hc)):Hc});return l($Me),y}}function m(){var p=[];f(p);for(var v;v=h();)v!==!1&&(p.push(v),f(p));return p}return c(),m()}function N$(e){return e?e.replace(zMe,Hc):Hc}var HMe=BMe,qMe=Bb&&Bb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dO,"__esModule",{value:!0});dO.default=KMe;const VMe=qMe(HMe);function KMe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,VMe.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?t(a,o,i):o&&(n=n||{},n[a]=o)}),n}var i1={};Object.defineProperty(i1,"__esModule",{value:!0});i1.camelCase=void 0;var GMe=/^--[a-zA-Z0-9_-]+$/,YMe=/-([a-z])/g,WMe=/^[^-]+$/,JMe=/^-(webkit|moz|ms|o|khtml)-/,XMe=/^-(ms)-/,QMe=function(e){return!e||WMe.test(e)||GMe.test(e)},ZMe=function(e,t){return t.toUpperCase()},T$=function(e,t){return"".concat(t,"-")},eje=function(e,t){return t===void 0&&(t={}),QMe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(XMe,T$):e=e.replace(JMe,T$),e.replace(YMe,ZMe))};i1.camelCase=eje;var tje=Bb&&Bb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nje=tje(dO),rje=i1;function RR(e,t){var n={};return!e||typeof e!="string"||(0,nje.default)(e,function(r,s){r&&s&&(n[(0,rje.camelCase)(r,t)]=s)}),n}RR.default=RR;var sje=RR;const ije=Dg(sje),hY=mY("end"),hO=mY("start");function mY(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 pY(e){const t=hO(e),n=hY(e);if(t&&n)return{start:t,end:n}}function jp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A$(e.position):"start"in e||"end"in e?A$(e):"line"in e||"column"in e?NR(e):""}function NR(e){return O$(e&&e.line)+":"+O$(e&&e.column)}function A$(e){return NR(e&&e.start)+"-"+NR(e&&e.end)}function O$(e){return e&&typeof e=="number"?e:1}class Dr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=jp(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dr.prototype.file="";Dr.prototype.name="";Dr.prototype.reason="";Dr.prototype.message="";Dr.prototype.stack="";Dr.prototype.column=void 0;Dr.prototype.line=void 0;Dr.prototype.ancestors=void 0;Dr.prototype.cause=void 0;Dr.prototype.fatal=void 0;Dr.prototype.place=void 0;Dr.prototype.ruleId=void 0;Dr.prototype.source=void 0;const mO={}.hasOwnProperty,aje=new Map,oje=/[A-Z]/g,lje=new Set(["table","tbody","thead","tfoot","tr"]),cje=new Set(["td","th"]),gY="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uje(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=vje(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=yje(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fO:AMe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=yY(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function yY(e,t,n){if(t.type==="element")return fje(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dje(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mje(e,t,n);if(t.type==="mdxjsEsm")return hje(e,t);if(t.type==="root")return pje(e,t,n);if(t.type==="text")return gje(e,t)}function fje(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=fO,e.schema=s),e.ancestors.push(t);const i=bY(e,t.tagName,!1),a=bje(e,t);let o=gO(e,t);return lje.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!xMe(l):!0})),vY(e,a,i,t),pO(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function dje(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)}Rg(e,t.position)}function hje(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rg(e,t.position)}function mje(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=fO,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:bY(e,t.name,!0),a=xje(e,t),o=gO(e,t);return vY(e,a,i,t),pO(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function pje(e,t,n){const r={};return pO(r,gO(e,t)),e.create(t,e.Fragment,r,n)}function gje(e,t){return t.value}function vY(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function pO(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yje(e,t,n){return r;function r(s,i,a,o){const c=Array.isArray(a.children)?n:t;return o?c(i,a,o):c(i,a)}}function vje(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=hO(r);return t(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function bje(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&mO.call(t.properties,s)){const i=Sje(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&cje.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xje(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Rg(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Rg(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function gO(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:aje;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;a=l+"-"+c,s.set(l,c+1)}}const o=yY(e,i,a);o!==void 0&&n.push(o)}return n}function Sje(e,t,n){const r=RMe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pMe(n):OMe(n)),r.property==="style"){let s=typeof n=="object"?n:wje(e,String(n));return e.stylePropertyNameCase==="css"&&(s=_je(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?kMe[r.property]||r.property:r.attribute,n]}}function wje(e,t){try{return ije(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=gY+"#cannot-parse-style-attribute",s}}function bY(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,a;for(;++i<s.length;){const o=S$(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=a}else r=S$(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return mO.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rg(e)}function Rg(e,t){const n=new Dr("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=gY+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _je(e){const t={};let n;for(n in e)mO.call(e,n)&&(t[kje(n)]=e[n]);return t}function kje(e){let t=e.replace(oje,Eje);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Eje(e){return"-"+e.toLowerCase()}const ok={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"]},Cje={};function yO(e,t){const n=Cje,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return xY(e,r,s)}function xY(e,t,n){if(Rje(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 M$(e.children,t,n)}return Array.isArray(e)?M$(e,t,n):""}function M$(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=xY(e[s],t,n);return r.join("")}function Rje(e){return!!(e&&typeof e=="object")}const j$=document.createElement("i");function vO(e){const t="&"+e+";";j$.innerHTML=t;const n=j$.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ds(e,t,n,r){const s=e.length;let i=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function ti(e,t){return e.length>0?(Ds(e,e.length,0,t),e):t}const D$={}.hasOwnProperty;function SY(e){const t={};let n=-1;for(;++n<e.length;)Nje(t,e[n]);return t}function Nje(e,t){let n;for(n in t){const s=(D$.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){D$.call(s,a)||(s[a]=[]);const o=i[a];Tje(s[a],Array.isArray(o)?o:o?[o]:[])}}}function Tje(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ds(e,0,0,r)}function wY(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 Fi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Br=wc(/[A-Za-z]/),Ar=wc(/[\dA-Za-z]/),Aje=wc(/[#-'*+\--9=?A-Z^-~]/);function L0(e){return e!==null&&(e<32||e===127)}const TR=wc(/\d/),Oje=wc(/[\dA-Fa-f]/),Mje=wc(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function Ht(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const a1=wc(new RegExp("\\p{P}|\\p{S}","u")),Du=wc(/\s/);function wc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sm(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Ar(e.charCodeAt(n+1))&&Ar(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function yt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return ut(l)?(e.enter(n),o(l)):t(l)}function o(l){return ut(l)&&i++<s?(e.consume(l),o):(e.exit(n),t(l))}}const jje={tokenize:Dje};function Dje(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),yt(e,t,"linePrefix")}function s(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return $e(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),a)}}const Ije={tokenize:Pje},I$={tokenize:$je};function Pje(e){const t=this,n=[];let r=0,s,i,a;return o;function o(x){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&b();const _=t.events.length;let C=_,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}y(r);let k=_;for(;k<t.events.length;)t.events[k][1].end={...E},k++;return Ds(t.events,C+1,0,t.events.slice(_)),t.events.length=k,c(x)}return o(x)}function c(x){if(r===n.length){if(!s)return h(x);if(s.currentConstruct&&s.currentConstruct.concrete)return p(x);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I$,f,u)(x)}function f(x){return s&&b(),y(r),h(x)}function u(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(I$,m,p)(x)}function m(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){s&&b(),y(0),e.consume(x);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),v(x)}function v(x){if(x===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return $e(x)?(e.consume(x),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(x),v)}function S(x,_){const C=t.sliceStream(x);if(_&&C.push(null),x.previous=i,i&&(i.next=x),i=x,s.defineSkip(x.start),s.write(C),t.parser.lazy[x.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<a&&(!s.events[E][1].end||s.events[E][1].end.offset>a))return;const k=t.events.length;let A=k,I,R;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(I){R=t.events[A][1].end;break}I=!0}for(y(r),E=k;E<t.events.length;)t.events[E][1].end={...R},E++;Ds(t.events,A+1,0,t.events.slice(k)),t.events.length=E}}function y(x){let _=n.length;for(;_-- >x;){const C=n[_];t.containerState=C[1],C[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function $je(e,t,n){return yt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dh(e){if(e===null||Ht(e)||Du(e))return 1;if(a1(e))return 2}function o1(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const AR={name:"attention",resolveAll:zje,tokenize:Lje};function zje(e,t){let n=-1,r,s,i,a,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},h={...e[n][1].start};P$(u,-l),P$(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ti(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ti(c,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=ti(c,o1(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ti(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=ti(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ds(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 Lje(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=dh(r);let i;return a;function a(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const c=e.exit("attentionSequence"),f=dh(l),u=!f||f===2&&s||n.includes(l),h=!s||s===2&&f||n.includes(r);return c._open=!!(i===42?u:u&&(s||!h)),c._close=!!(i===42?h:h&&(f||!u)),t(l)}}function P$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Fje={name:"autolink",tokenize:Uje};function Uje(e,t,n){let r=0;return s;function s(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return Br(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||Ar(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||Ar(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||L0(m)?n(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),f):Aje(m)?(e.consume(m),c):n(m)}function f(m){return Ar(m)?u(m):n(m)}function u(m){return m===46?(e.consume(m),r=0,f):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Ar(m))&&r++<63){const p=m===45?h:u;return e.consume(m),p}return n(m)}}const Vy={partial:!0,tokenize:Bje};function Bje(e,t,n){return r;function r(i){return ut(i)?yt(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||$e(i)?t(i):n(i)}}const _Y={continuation:{tokenize:qje},exit:Vje,name:"blockQuote",tokenize:Hje};function Hje(e,t,n){const r=this;return s;function s(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return ut(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function qje(e,t,n){const r=this;return s;function s(a){return ut(a)?yt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(_Y,t,n)(a)}}function Vje(e){e.exit("blockQuote")}const kY={name:"characterEscape",tokenize:Kje};function Kje(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return Mje(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const EY={name:"characterReference",tokenize:Gje};function Gje(e,t,n){const r=this;let s=0,i,a;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"),i=31,a=Ar,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=Oje,f):(e.enter("characterReferenceValue"),i=7,a=TR,f(u))}function f(u){if(u===59&&s){const h=e.exit("characterReferenceValue");return a===Ar&&!vO(r.sliceSerialize(h))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&s++<i?(e.consume(u),f):n(u)}}const $$={partial:!0,tokenize:Wje},z$={concrete:!0,name:"codeFenced",tokenize:Yje};function Yje(e,t,n){const r=this,s={partial:!0,tokenize:C};let i=0,a=0,o;return l;function l(E){return c(E)}function c(E){const k=r.events[r.events.length-1];return i=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,o=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===o?(a++,e.consume(E),f):a<3?n(E):(e.exit("codeFencedFenceSequence"),ut(E)?yt(e,u,"whitespace")(E):u(E))}function u(E){return E===null||$e(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check($$,v,_)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||$e(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(E)):ut(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yt(e,m,"whitespace")(E)):E===96&&E===o?n(E):(e.consume(E),h)}function m(E){return E===null||$e(E)?u(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||$e(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(E)):E===96&&E===o?n(E):(e.consume(E),p)}function v(E){return e.attempt(s,_,S)(E)}function S(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),y}function y(E){return i>0&&ut(E)?yt(e,b,"linePrefix",i+1)(E):b(E)}function b(E){return E===null||$e(E)?e.check($$,v,_)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||$e(E)?(e.exit("codeFlowValue"),b(E)):(e.consume(E),x)}function _(E){return e.exit("codeFenced"),t(E)}function C(E,k,A){let I=0;return R;function R(B){return E.enter("lineEnding"),E.consume(B),E.exit("lineEnding"),$}function $(B){return E.enter("codeFencedFence"),ut(B)?yt(E,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):U(B)}function U(B){return B===o?(E.enter("codeFencedFenceSequence"),K(B)):A(B)}function K(B){return B===o?(I++,E.consume(B),K):I>=a?(E.exit("codeFencedFenceSequence"),ut(B)?yt(E,W,"whitespace")(B):W(B)):A(B)}function W(B){return B===null||$e(B)?(E.exit("codeFencedFence"),k(B)):A(B)}}}function Wje(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const lk={name:"codeIndented",tokenize:Xje},Jje={partial:!0,tokenize:Qje};function Xje(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),yt(e,i,"linePrefix",5)(c)}function i(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):$e(c)?e.attempt(Jje,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||$e(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function Qje(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):$e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):yt(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):$e(a)?s(a):n(a)}}const Zje={name:"codeText",previous:tDe,resolve:eDe,tokenize:nDe};function eDe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function tDe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nDe(e,t,n){let r=0,s,i;return a;function a(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?(i=e.enter("codeTextSequence"),s=0,f(u)):$e(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||$e(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),s++,f):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(i.type="codeTextData",c(u))}}class rDe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Mm(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),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 CY(e){const t={};let n=-1,r,s,i,a,o,l,c;const f=new rDe(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,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,sDe(f,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=f.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(f.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...f.get(s)[1].start},o=f.slice(s,n),o.unshift(r),f.splice(s,n-s+1,o))}}return Ds(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function sDe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],c={};let f,u,h=-1,m=n,p=0,v=0;const S=[v];for(;m;){for(;e.get(++s)[1]!==m;);i.push(s),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),u&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(v=h+1,S.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),h=S.length;h--;){const y=o.slice(S[h],S[h+1]),b=i.pop();l.push([b,b+y.length-1]),e.splice(b,2,y)}for(l.reverse(),h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const iDe={resolve:oDe,tokenize:lDe},aDe={partial:!0,tokenize:cDe};function oDe(e){return CY(e),e}function lDe(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(o)}function s(o){return o===null?i(o):$e(o)?e.check(aDe,a,i)(o):(e.consume(o),s)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function cDe(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),yt(e,i,"linePrefix")}function i(a){if(a===null||$e(a))return n(a);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(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function RY(e,t,n,r,s,i,a,o,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||L0(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),v(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),h(y)):y===null||y===60||$e(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!f&&(y===null||y===41||Ht(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):f<c&&y===40?(e.consume(y),f++,v):y===41?(e.consume(y),f--,v):y===null||y===32||y===40||L0(y)?n(y):(e.consume(y),y===92?S:v)}function S(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function NY(e,t,n,r,s,i){const a=this;let o=0,l;return c;function c(m){return e.enter(r),e.enter(s),e.consume(m),e.exit(s),e.enter(i),f}function f(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):$e(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===null||m===91||m===93||$e(m)||o++>999?(e.exit("chunkString"),f(m)):(e.consume(m),l||(l=!ut(m)),m===92?h:u)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}}function TY(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===a?(e.exit(i),l(a)):h===null?n(h):$e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),yt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===a||h===null||$e(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?u:f)}function u(h){return h===a||h===92?(e.consume(h),f):f(h)}}function Dp(e,t){let n;return r;function r(s){return $e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ut(s)?yt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const uDe={name:"definition",tokenize:dDe},fDe={partial:!0,tokenize:hDe};function dDe(e,t,n){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return NY.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Ht(m)?Dp(e,c)(m):c(m)}function c(m){return RY(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(fDe,u,u)(m)}function u(m){return ut(m)?yt(e,h,"whitespace")(m):h(m)}function h(m){return m===null||$e(m)?(e.exit("definition"),r.parser.defined.push(s),t(m)):n(m)}}function hDe(e,t,n){return r;function r(o){return Ht(o)?Dp(e,s)(o):n(o)}function s(o){return TY(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return ut(o)?yt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||$e(o)?t(o):n(o)}}const mDe={name:"hardBreakEscape",tokenize:pDe};function pDe(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return $e(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const gDe={name:"headingAtx",resolve:yDe,tokenize:vDe};function yDe(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ds(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function vDe(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),i(f)}function i(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Ht(f)?(e.exit("atxHeadingSequence"),o(f)):n(f)}function o(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||$e(f)?(e.exit("atxHeading"),t(f)):ut(f)?yt(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||Ht(f)?(e.exit("atxHeadingText"),o(f)):(e.consume(f),c)}}const bDe=["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"],L$=["pre","script","style","textarea"],xDe={concrete:!0,name:"htmlFlow",resolveTo:_De,tokenize:kDe},SDe={partial:!0,tokenize:CDe},wDe={partial:!0,tokenize:EDe};function _De(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 kDe(e,t,n){const r=this;let s,i,a,o,l;return c;function c(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,v):N===63?(e.consume(N),s=3,r.interrupt?t:O):Br(N)?(e.consume(N),a=String.fromCharCode(N),S):n(N)}function h(N){return N===45?(e.consume(N),s=2,m):N===91?(e.consume(N),s=5,o=0,p):Br(N)?(e.consume(N),s=4,r.interrupt?t:O):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:O):n(N)}function p(N){const J="CDATA[";return N===J.charCodeAt(o++)?(e.consume(N),o===J.length?r.interrupt?t:U:p):n(N)}function v(N){return Br(N)?(e.consume(N),a=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||Ht(N)){const J=N===47,Y=a.toLowerCase();return!J&&!i&&L$.includes(Y)?(s=1,r.interrupt?t(N):U(N)):bDe.includes(a.toLowerCase())?(s=6,J?(e.consume(N),y):r.interrupt?t(N):U(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?b(N):x(N))}return N===45||Ar(N)?(e.consume(N),a+=String.fromCharCode(N),S):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:U):n(N)}function b(N){return ut(N)?(e.consume(N),b):R(N)}function x(N){return N===47?(e.consume(N),R):N===58||N===95||Br(N)?(e.consume(N),_):ut(N)?(e.consume(N),x):R(N)}function _(N){return N===45||N===46||N===58||N===95||Ar(N)?(e.consume(N),_):C(N)}function C(N){return N===61?(e.consume(N),E):ut(N)?(e.consume(N),C):x(N)}function E(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,k):ut(N)?(e.consume(N),E):A(N)}function k(N){return N===l?(e.consume(N),l=null,I):N===null||$e(N)?n(N):(e.consume(N),k)}function A(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Ht(N)?C(N):(e.consume(N),A)}function I(N){return N===47||N===62||ut(N)?x(N):n(N)}function R(N){return N===62?(e.consume(N),$):n(N)}function $(N){return N===null||$e(N)?U(N):ut(N)?(e.consume(N),$):n(N)}function U(N){return N===45&&s===2?(e.consume(N),j):N===60&&s===1?(e.consume(N),F):N===62&&s===4?(e.consume(N),me):N===63&&s===3?(e.consume(N),O):N===93&&s===5?(e.consume(N),V):$e(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(SDe,q,K)(N)):N===null||$e(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),U)}function K(N){return e.check(wDe,W,q)(N)}function W(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),B}function B(N){return N===null||$e(N)?K(N):(e.enter("htmlFlowData"),U(N))}function j(N){return N===45?(e.consume(N),O):U(N)}function F(N){return N===47?(e.consume(N),a="",z):U(N)}function z(N){if(N===62){const J=a.toLowerCase();return L$.includes(J)?(e.consume(N),me):U(N)}return Br(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),z):U(N)}function V(N){return N===93?(e.consume(N),O):U(N)}function O(N){return N===62?(e.consume(N),me):N===45&&s===2?(e.consume(N),O):U(N)}function me(N){return N===null||$e(N)?(e.exit("htmlFlowData"),q(N)):(e.consume(N),me)}function q(N){return e.exit("htmlFlow"),t(N)}}function EDe(e,t,n){const r=this;return s;function s(a){return $e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function CDe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Vy,t,n)}}const RDe={name:"htmlText",tokenize:NDe};function NDe(e,t,n){const r=this;let s,i,a;return o;function o(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),l}function l(O){return O===33?(e.consume(O),c):O===47?(e.consume(O),C):O===63?(e.consume(O),x):Br(O)?(e.consume(O),A):n(O)}function c(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),i=0,p):Br(O)?(e.consume(O),b):n(O)}function f(O){return O===45?(e.consume(O),m):n(O)}function u(O){return O===null?n(O):O===45?(e.consume(O),h):$e(O)?(a=u,F(O)):(e.consume(O),u)}function h(O){return O===45?(e.consume(O),m):u(O)}function m(O){return O===62?j(O):O===45?h(O):u(O)}function p(O){const me="CDATA[";return O===me.charCodeAt(i++)?(e.consume(O),i===me.length?v:p):n(O)}function v(O){return O===null?n(O):O===93?(e.consume(O),S):$e(O)?(a=v,F(O)):(e.consume(O),v)}function S(O){return O===93?(e.consume(O),y):v(O)}function y(O){return O===62?j(O):O===93?(e.consume(O),y):v(O)}function b(O){return O===null||O===62?j(O):$e(O)?(a=b,F(O)):(e.consume(O),b)}function x(O){return O===null?n(O):O===63?(e.consume(O),_):$e(O)?(a=x,F(O)):(e.consume(O),x)}function _(O){return O===62?j(O):x(O)}function C(O){return Br(O)?(e.consume(O),E):n(O)}function E(O){return O===45||Ar(O)?(e.consume(O),E):k(O)}function k(O){return $e(O)?(a=k,F(O)):ut(O)?(e.consume(O),k):j(O)}function A(O){return O===45||Ar(O)?(e.consume(O),A):O===47||O===62||Ht(O)?I(O):n(O)}function I(O){return O===47?(e.consume(O),j):O===58||O===95||Br(O)?(e.consume(O),R):$e(O)?(a=I,F(O)):ut(O)?(e.consume(O),I):j(O)}function R(O){return O===45||O===46||O===58||O===95||Ar(O)?(e.consume(O),R):$(O)}function $(O){return O===61?(e.consume(O),U):$e(O)?(a=$,F(O)):ut(O)?(e.consume(O),$):I(O)}function U(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,K):$e(O)?(a=U,F(O)):ut(O)?(e.consume(O),U):(e.consume(O),W)}function K(O){return O===s?(e.consume(O),s=void 0,B):O===null?n(O):$e(O)?(a=K,F(O)):(e.consume(O),K)}function W(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Ht(O)?I(O):(e.consume(O),W)}function B(O){return O===47||O===62||Ht(O)?I(O):n(O)}function j(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function F(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),z}function z(O){return ut(O)?yt(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):V(O)}function V(O){return e.enter("htmlTextData"),a(O)}}const bO={name:"labelEnd",resolveAll:MDe,resolveTo:jDe,tokenize:DDe},TDe={tokenize:IDe},ADe={tokenize:PDe},ODe={tokenize:$De};function MDe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Ds(e,0,e.length,n),e}function jDe(e,t){let n=e.length,r=0,s,i,a,o;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},f={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=ti(o,e.slice(i+1,i+r+3)),o=ti(o,[["enter",f,t]]),o=ti(o,o1(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=ti(o,[["exit",f,t],e[a-2],e[a-1],["exit",c,t]]),o=ti(o,e.slice(a+1)),o=ti(o,[["exit",l,t]]),Ds(e,i,e.length,o),e}function DDe(e,t,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return o;function o(h){return i?i._inactive?u(h):(a=r.parser.defined.includes(Fi(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(TDe,f,a?f:u)(h):h===91?e.attempt(ADe,f,a?c:u)(h):a?f(h):u(h)}function c(h){return e.attempt(ODe,f,u)(h)}function f(h){return t(h)}function u(h){return i._balanced=!0,n(h)}}function IDe(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),s}function s(u){return Ht(u)?Dp(e,i)(u):i(u)}function i(u){return u===41?f(u):RY(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Ht(u)?Dp(e,l)(u):f(u)}function o(u){return n(u)}function l(u){return u===34||u===39||u===40?TY(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return Ht(u)?Dp(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 PDe(e,t,n){const r=this;return s;function s(o){return NY.call(r,e,i,a,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function $De(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const zDe={name:"labelStartImage",resolveAll:bO.resolveAll,tokenize:LDe};function LDe(e,t,n){const r=this;return s;function s(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const FDe={name:"labelStartLink",resolveAll:bO.resolveAll,tokenize:UDe};function UDe(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ck={name:"lineEnding",tokenize:BDe};function BDe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),yt(e,t,"linePrefix")}}const Fb={name:"thematicBreak",tokenize:HDe};function HDe(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return s=c,o(c)}function o(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||$e(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ut(c)?yt(e,o,"whitespace")(c):o(c))}}const es={continuation:{tokenize:GDe},exit:WDe,name:"list",tokenize:KDe},qDe={partial:!0,tokenize:JDe},VDe={partial:!0,tokenize:YDe};function KDe(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:TR(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Fb,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return TR(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Vy,r.interrupt?n:f,e.attempt(qDe,h,u))}function f(m){return r.containerState.initialBlankLine=!0,i++,h(m)}function u(m){return ut(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function GDe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vy,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!ut(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VDe,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,yt(e,e.attempt(es,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function YDe(e,t,n){const r=this;return yt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function WDe(e){e.exit(this.containerState.type)}function JDe(e,t,n){const r=this;return yt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!ut(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const F$={name:"setextUnderline",resolveTo:XDe,tokenize:QDe};function XDe(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function QDe(e,t,n){const r=this;let s;return i;function i(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"),s=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===s?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),ut(c)?yt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||$e(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const ZDe={tokenize:eIe};function eIe(e){const t=this,n=e.attempt(Vy,r,e.attempt(this.parser.constructs.flowInitial,s,yt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(iDe,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tIe={resolveAll:OY()},nIe=AY("string"),rIe=AY("text");function AY(e){return{resolveAll:OY(e==="text"?sIe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(f){return c(f)?i(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"),i(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const u=s[f];let h=-1;if(u)for(;++h<u.length;){const m=u[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function OY(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function sIe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,a=-1,o=0,l;for(;i--;){const c=s[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,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 iIe={42:es,43:es,45:es,48:es,49:es,50:es,51:es,52:es,53:es,54:es,55:es,56:es,57:es,62:_Y},aIe={91:uDe},oIe={[-2]:lk,[-1]:lk,32:lk},lIe={35:gDe,42:Fb,45:[F$,Fb],60:xDe,61:F$,95:Fb,96:z$,126:z$},cIe={38:EY,92:kY},uIe={[-5]:ck,[-4]:ck,[-3]:ck,33:zDe,38:EY,42:AR,60:[Fje,RDe],91:FDe,92:[mDe,kY],93:bO,95:AR,96:Zje},fIe={null:[AR,tIe]},dIe={null:[42,95]},hIe={null:[]},mIe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dIe,contentInitial:aIe,disable:hIe,document:iIe,flow:lIe,flowInitial:oIe,insideSpan:fIe,string:cIe,text:uIe},Symbol.toStringTag,{value:"Module"}));function pIe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],o=[];const l={attempt:k(C),check:k(E),consume:b,enter:x,exit:_,interrupt:k(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:u};let f=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function u($){return a=ti(a,$),S(),a[a.length-1]!==null?[]:(A(t,0),c.events=o1(i,c.events,c),c.events)}function h($,U){return yIe(m($),U)}function m($){return gIe(a,$)}function p(){const{_bufferIndex:$,_index:U,line:K,column:W,offset:B}=r;return{_bufferIndex:$,_index:U,line:K,column:W,offset:B}}function v($){s[$.line]=$.column,R()}function S(){let $;for(;r._index<a.length;){const U=a[r._index];if(typeof U=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<U.length;)y(U.charCodeAt(r._bufferIndex));else y(U)}}function y($){f=f($)}function b($){$e($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,R()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=$}function x($,U){const K=U||{};return K.type=$,K.start=p(),c.events.push(["enter",K,c]),o.push(K),K}function _($){const U=o.pop();return U.end=p(),c.events.push(["exit",U,c]),U}function C($,U){A($,U.from)}function E($,U){U.restore()}function k($,U){return K;function K(W,B,j){let F,z,V,O;return Array.isArray(W)?q(W):"tokenize"in W?q([W]):me(W);function me(le){return Q;function Q(ae){const te=ae!==null&&le[ae],fe=ae!==null&&le.null,Ce=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return q(Ce)(ae)}}function q(le){return F=le,z=0,le.length===0?j:N(le[z])}function N(le){return Q;function Q(ae){return O=I(),V=le,le.partial||(c.currentConstruct=le),le.name&&c.parser.constructs.disable.null.includes(le.name)?Y():le.tokenize.call(U?Object.assign(Object.create(c),U):c,l,J,Y)(ae)}}function J(le){return $(V,O),B}function Y(le){return O.restore(),++z<F.length?N(F[z]):j}}}function A($,U){$.resolveAll&&!i.includes($)&&i.push($),$.resolve&&Ds(c.events,U,c.events.length-U,$.resolve(c.events.slice(U),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function I(){const $=p(),U=c.previous,K=c.currentConstruct,W=c.events.length,B=Array.from(o);return{from:W,restore:j};function j(){r=$,c.previous=U,c.currentConstruct=K,c.events.length=W,o=B,R()}}function R(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function gIe(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,i)];else{if(a=e.slice(n,s),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function yIe(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
428
+ `;break}case-3:{a=`\r
429
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function vIe(e){const r={constructs:SY([mIe,...(e||{}).extensions||[]]),content:s(jje),defined:[],document:s(Ije),flow:s(ZDe),lazy:{},string:s(nIe),text:s(rIe)};return r;function s(i){return a;function a(o){return pIe(r,i,o)}}}function bIe(e){for(;!CY(e););return e}const U$=/[\0\t\n\r]/g;function xIe(){let e=1,t="",n=!0,r;return s;function s(i,a,o){const l=[];let c,f,u,h,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t="",n&&(i.charCodeAt(0)===65279&&u++,n=void 0);u<i.length;){if(U$.lastIndex=u,c=U$.exec(i),h=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(h),!c){t=i.slice(u);break}if(m===10&&u===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<h&&(l.push(i.slice(u,h)),e+=h-u),m){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=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const SIe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wIe(e){return e.replace(SIe,_Ie)}function _Ie(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return wY(n.slice(i?2:1),i?16:10)}return vO(n)||e}const MY={}.hasOwnProperty;function kIe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),EIe(n)(bIe(vIe(n).document().write(xIe()(e,t,!0))))}function EIe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(wn),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Bs),blockQuote:i(fe),characterEscape:I,characterReference:I,codeFenced:i(Ce),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Ce,a),codeText:i(ye,a),codeTextData:I,data:I,codeFlowValue:I,definition:i(xt),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(rn),hardBreakEscape:i(Pn),hardBreakTrailing:i(Pn),htmlFlow:i(Sr,a),htmlFlowData:I,htmlText:i(Sr,a),htmlTextData:I,image:i(Wo),label:a,link:i(wn),listItem:i(im),listItemValue:h,listOrdered:i(sf,u),listUnordered:i(sf),paragraph:i(ir),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Bs),strong:i(ea),thematicBreak:i(Ua)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:te,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:le,characterReference:Q,codeFenced:l(S),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:R,codeIndented:l(y),codeText:l(B),codeTextData:R,data:R,definition:l(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(K),htmlFlowData:R,htmlText:l(W),htmlTextData:R,image:l(F),label:V,labelText:z,lineEnding:$,link:l(j),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:J,resourceDestinationString:O,resourceTitleString:me,resource:q,setextHeading:l(A),setextHeadingLineSequence:k,setextHeadingText:E,strong:l(),thematicBreak:l()}};jY(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let ce={type:"root",children:[]};const Ne={stack:[ce],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:f,data:n},Be=[];let ot=-1;for(;++ot<G.length;)if(G[ot][1].type==="listOrdered"||G[ot][1].type==="listUnordered")if(G[ot][0]==="enter")Be.push(ot);else{const wr=Be.pop();ot=s(G,wr,ot)}for(ot=-1;++ot<G.length;){const wr=t[G[ot][0]];MY.call(wr,G[ot][1].type)&&wr[G[ot][1].type].call(Object.assign({sliceSerialize:G[ot][2].sliceSerialize},Ne),G[ot][1])}if(Ne.tokenStack.length>0){const wr=Ne.tokenStack[Ne.tokenStack.length-1];(wr[1]||B$).call(Ne,void 0,wr[0])}for(ce.position={start:el(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:el(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)ce=t.transforms[ot](ce)||ce;return ce}function s(G,ce,Ne){let Be=ce-1,ot=-1,wr=!1,Yn,gs,ar,xi;for(;++Be<=Ne;){const $n=G[Be];switch($n[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$n[0]==="enter"?ot++:ot--,xi=void 0;break}case"lineEndingBlank":{$n[0]==="enter"&&(Yn&&!xi&&!ot&&!ar&&(ar=Be),xi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xi=void 0}if(!ot&&$n[0]==="enter"&&$n[1].type==="listItemPrefix"||ot===-1&&$n[0]==="exit"&&($n[1].type==="listUnordered"||$n[1].type==="listOrdered")){if(Yn){let Si=Be;for(gs=void 0;Si--;){const Ir=G[Si];if(Ir[1].type==="lineEnding"||Ir[1].type==="lineEndingBlank"){if(Ir[0]==="exit")continue;gs&&(G[gs][1].type="lineEndingBlank",wr=!0),Ir[1].type="lineEnding",gs=Si}else if(!(Ir[1].type==="linePrefix"||Ir[1].type==="blockQuotePrefix"||Ir[1].type==="blockQuotePrefixWhitespace"||Ir[1].type==="blockQuoteMarker"||Ir[1].type==="listItemIndent"))break}ar&&(!gs||ar<gs)&&(Yn._spread=!0),Yn.end=Object.assign({},gs?G[gs][1].start:$n[1].end),G.splice(gs||Be,0,["exit",Yn,$n[2]]),Be++,Ne++}if($n[1].type==="listItemPrefix"){const Si={type:"listItem",_spread:!1,start:Object.assign({},$n[1].start),end:void 0};Yn=Si,G.splice(Be,0,["enter",Si,$n[2]]),Be++,Ne++,ar=void 0,xi=!0}}}return G[ce][1]._spread=wr,Ne}function i(G,ce){return Ne;function Ne(Be){o.call(this,G(Be),Be),ce&&ce.call(this,Be)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(G,ce,Ne){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([ce,Ne||void 0]),G.position={start:el(ce.start),end:void 0}}function l(G){return ce;function ce(Ne){G&&G.call(this,Ne),c.call(this,Ne)}}function c(G,ce){const Ne=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==G.type&&(ce?ce.call(this,G,Be[0]):(Be[1]||B$).call(this,G,Be[0]));else throw new Error("Cannot close `"+G.type+"` ("+jp({start:G.start,end:G.end})+"): it’s not open");Ne.position.end=el(G.end)}function f(){return yO(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function h(G){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function m(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=G}function p(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=G}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.value=G.replace(/(\r?\n|\r)$/g,"")}function b(G){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ce,Ne.identifier=Fi(this.sliceSerialize(G)).toLowerCase()}function x(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.title=G}function _(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.url=G}function C(G){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ne=this.sliceSerialize(G).length;ce.depth=Ne}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function k(G){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function I(G){const Ne=this.stack[this.stack.length-1].children;let Be=Ne[Ne.length-1];(!Be||Be.type!=="text")&&(Be=bi(),Be.position={start:el(G.start),end:void 0},Ne.push(Be)),this.stack.push(Be)}function R(G){const ce=this.stack.pop();ce.value+=this.sliceSerialize(G),ce.position.end=el(G.end)}function $(G){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=ce.children[ce.children.length-1];Ne.position.end=el(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(I.call(this,G),R.call(this,G))}function U(){this.data.atHardBreak=!0}function K(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.value=G}function W(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.value=G}function B(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.value=G}function j(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ce,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function F(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ce,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function z(G){const ce=this.sliceSerialize(G),Ne=this.stack[this.stack.length-2];Ne.label=wIe(ce),Ne.identifier=Fi(ce).toLowerCase()}function V(){const G=this.stack[this.stack.length-1],ce=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Be=G.children;Ne.children=Be}else Ne.alt=ce}function O(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.url=G}function me(){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.title=G}function q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function J(G){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ce,Ne.identifier=Fi(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function Y(G){this.data.characterReferenceType=G.type}function le(G){const ce=this.sliceSerialize(G),Ne=this.data.characterReferenceType;let Be;Ne?(Be=wY(ce,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=vO(ce);const ot=this.stack[this.stack.length-1];ot.value+=Be}function Q(G){const ce=this.stack.pop();ce.position.end=el(G.end)}function ae(G){R.call(this,G);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(G)}function te(G){R.call(this,G);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(G)}function fe(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function xt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function rn(){return{type:"emphasis",children:[]}}function Bs(){return{type:"heading",depth:0,children:[]}}function Pn(){return{type:"break"}}function Sr(){return{type:"html",value:""}}function Wo(){return{type:"image",title:null,url:"",alt:null}}function wn(){return{type:"link",title:null,url:"",children:[]}}function sf(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function im(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function ir(){return{type:"paragraph",children:[]}}function ea(){return{type:"strong",children:[]}}function bi(){return{type:"text",value:""}}function Ua(){return{type:"thematicBreak"}}}function el(e){return{line:e.line,column:e.column,offset:e.offset}}function jY(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jY(e,r):CIe(e,r)}}function CIe(e,t){let n;for(n in t)if(MY.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 B$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+jp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jp({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+jp({start:t.start,end:t.end})+") is still open")}function RIe(e){const t=this;t.parser=n;function n(r){return kIe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function NIe(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 TIe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
430
+ `}]}function AIe(e,t){const n=t.value?t.value+`
431
+ `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function OIe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MIe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jIe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=sm(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function DIe(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 IIe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DY(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function PIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DY(e,t);const s={src:sm(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function $Ie(e,t){const n={src:sm(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 zIe(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 LIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DY(e,t);const s={href:sm(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function FIe(e,t){const n={href:sm(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 UIe(e,t,n){const r=e.all(t),s=n?BIe(n):IY(t),i={},a=[];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:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const f=r[o];(s||o!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
432
+ `}),f.type==="element"&&f.tagName==="p"&&!s?a.push(...f.children):a.push(f)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
433
+ `});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function BIe(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=IY(n[r])}return t}function IY(e){const t=e.spread;return t??e.children.length>1}function HIe(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function qIe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VIe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function KIe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GIe(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=hO(t.children[1]),l=hY(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function YIe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const u=t.children[l],h={},m=a?a[l]:void 0;m&&(h.align=m);let p={type:"element",tagName:i,properties:h,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 WIe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const H$=9,q$=32;function JIe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(V$(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(V$(t.slice(s),s>0,!1)),i.join("")}function V$(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===H$||i===q$;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===H$||i===q$;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function XIe(e,t){const n={type:"text",value:JIe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function QIe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZIe={blockquote:NIe,break:TIe,code:AIe,delete:OIe,emphasis:MIe,footnoteReference:jIe,heading:DIe,html:IIe,imageReference:PIe,image:$Ie,inlineCode:zIe,linkReference:LIe,link:FIe,listItem:UIe,list:HIe,paragraph:qIe,root:VIe,strong:KIe,table:GIe,tableCell:WIe,tableRow:YIe,text:XIe,thematicBreak:QIe,toml:Hv,yaml:Hv,definition:Hv,footnoteDefinition:Hv};function Hv(){}const PY=-1,l1=0,Ip=1,F0=2,xO=3,SO=4,wO=5,_O=6,$Y=7,zY=8,K$=typeof self=="object"?self:globalThis,ePe=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case l1:case PY:return n(a,s);case Ip:{const o=n([],s);for(const l of a)o.push(r(l));return o}case F0:{const o=n({},s);for(const[l,c]of a)o[r(l)]=r(c);return o}case xO:return n(new Date(a),s);case SO:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case wO:{const o=n(new Map,s);for(const[l,c]of a)o.set(r(l),r(c));return o}case _O:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case $Y:{const{name:o,message:l}=a;return n(new K$[o](l),s)}case zY:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new K$[i](a),s)};return r},G$=e=>ePe(new Map,e)(0),wf="",{toString:tPe}={},{keys:nPe}=Object,jm=e=>{const t=typeof e;if(t!=="object"||!e)return[l1,t];const n=tPe.call(e).slice(8,-1);switch(n){case"Array":return[Ip,wf];case"Object":return[F0,wf];case"Date":return[xO,wf];case"RegExp":return[SO,wf];case"Map":return[wO,wf];case"Set":return[_O,wf];case"DataView":return[Ip,n]}return n.includes("Array")?[Ip,n]:n.includes("Error")?[$Y,n]:[F0,n]},qv=([e,t])=>e===l1&&(t==="function"||t==="symbol"),rPe=(e,t,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=jm(a);switch(o){case l1:{let f=a;switch(l){case"bigint":o=zY,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return s([PY],a)}return s([o,f],a)}case Ip:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),s([l,[...h]],a)}const f=[],u=s([o,f],a);for(const h of a)f.push(i(h));return u}case F0:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const f=[],u=s([o,f],a);for(const h of nPe(a))(e||!qv(jm(a[h])))&&f.push([i(h),i(a[h])]);return u}case xO:return s([o,a.toISOString()],a);case SO:{const{source:f,flags:u}=a;return s([o,{source:f,flags:u}],a)}case wO:{const f=[],u=s([o,f],a);for(const[h,m]of a)(e||!(qv(jm(h))||qv(jm(m))))&&f.push([i(h),i(m)]);return u}case _O:{const f=[],u=s([o,f],a);for(const h of a)(e||!qv(jm(h)))&&f.push(i(h));return u}}const{message:c}=a;return s([o,{name:l,message:c}],a)};return i},Y$=(e,{json:t,lossy:n}={})=>{const r=[];return rPe(!(t||n),!!t,new Map,r)(e),r},Ng=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?G$(Y$(e,t)):structuredClone(e):(e,t)=>G$(Y$(e,t));function sPe(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 iPe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aPe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sPe,r=e.options.footnoteBackLabel||iPe,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=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(),h=sm(u.toLowerCase());let m=0;const p=[],v=e.footnoteCounts.get(u);for(;v!==void 0&&++m<=v;){p.length>0&&p.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,m);typeof b=="string"&&(b={type:"text",value:b}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const b=S.children[S.children.length-1];b&&b.type==="text"?b.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...p)}else f.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(c,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Ng(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
434
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
435
+ `}]}}const c1=function(e){if(e==null)return uPe;if(typeof e=="function")return u1(e);if(typeof e=="object")return Array.isArray(e)?oPe(e):lPe(e);if(typeof e=="string")return cPe(e);throw new Error("Expected function, string, or object as test")};function oPe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=c1(e[n]);return u1(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function lPe(e){const t=e;return u1(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function cPe(e){return u1(t);function t(n){return n&&n.type===e}}function u1(e){return t;function t(n,r,s){return!!(fPe(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function uPe(){return!0}function fPe(e){return e!==null&&typeof e=="object"&&"type"in e}const LY=[],dPe=!0,OR=!1,hPe="skip";function FY(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=c1(s),a=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 m=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=LY,p,v,S;if((!t||i(l,c,f[f.length-1]||void 0))&&(m=mPe(n(l,f)),m[0]===OR))return m;if("children"in l&&l.children){const y=l;if(y.children&&m[0]!==hPe)for(v=(r?y.children.length:-1)+a,S=f.concat(y);v>-1&&v<y.children.length;){const b=y.children[v];if(p=o(b,v,S)(),p[0]===OR)return p;v=typeof p[1]=="number"?p[1]:v+a}}return m}}}function mPe(e){return Array.isArray(e)?e:typeof e=="number"?[dPe,e]:e==null?LY:[e]}function kO(e,t,n,r){let s,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,s=n):(i=t,a=n,s=r),FY(e,i,o,s);function o(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return a(l,u,f)}}const MR={}.hasOwnProperty,pPe={};function gPe(e,t){const n=t||pPe,r=new Map,s=new Map,i=new Map,a={...ZIe,...n.handlers},o={all:c,applyData:vPe,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:yPe,wrap:xPe};return kO(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?r:s,h=String(f.identifier).toUpperCase();u.has(h)||u.set(h,f)}}),o;function l(f,u){const h=f.type,m=o.handlers[h];if(MR.call(o.handlers,h)&&m)return m(o,f,u);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in f){const{children:v,...S}=f,y=Ng(S);return y.children=o.all(f),y}return Ng(f)}return(o.options.unknownHandler||bPe)(o,f,u)}function c(f){const u=[];if("children"in f){const h=f.children;let m=-1;for(;++m<h.length;){const p=o.one(h[m],f);if(p){if(m&&h[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=W$(p.value)),!Array.isArray(p)&&p.type==="element")){const v=p.children[0];v&&v.type==="text"&&(v.value=W$(v.value))}Array.isArray(p)?u.push(...p):u.push(p)}}}return u}}function yPe(e,t){e.position&&(t.position=pY(e))}function vPe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,Ng(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function bPe(e,t){const n=t.data||{},r="value"in t&&!(MR.call(n,"hProperties")||MR.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 xPe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
436
+ `});++r<e.length;)r&&n.push({type:"text",value:`
437
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
438
+ `}),n}function W$(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function J$(e,t){const n=gPe(e,t),r=n.one(e,void 0),s=aPe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
439
+ `},s),i}function SPe(e,t){return e&&"run"in e?async function(n,r){const s=J$(n,{file:r,...t});await e.run(s,r)}:function(n,r){return J$(n,{file:r,...e||t})}}function X$(e){if(e)throw e}var Ub=Object.prototype.hasOwnProperty,UY=Object.prototype.toString,Q$=Object.defineProperty,Z$=Object.getOwnPropertyDescriptor,ez=function(t){return typeof Array.isArray=="function"?Array.isArray(t):UY.call(t)==="[object Array]"},tz=function(t){if(!t||UY.call(t)!=="[object Object]")return!1;var n=Ub.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ub.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Ub.call(t,s)},nz=function(t,n){Q$&&n.name==="__proto__"?Q$(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rz=function(t,n){if(n==="__proto__")if(Ub.call(t,n)){if(Z$)return Z$(t,n).value}else return;return t[n]},wPe=function e(){var t,n,r,s,i,a,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=rz(o,n),s=rz(t,n),o!==s&&(f&&s&&(tz(s)||(i=ez(s)))?(i?(i=!1,a=r&&ez(r)?r:[]):a=r&&tz(r)?r:{},nz(o,{name:n,newValue:e(f,a,s)})):typeof s<"u"&&nz(o,{name:n,newValue:s}));return o};const uk=Dg(wPe);function jR(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 _Pe(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...s);function o(l,...c){const f=e[++i];let u=-1;if(l){a(l);return}for(;++u<s.length;)(c[u]===null||c[u]===void 0)&&(c[u]=s[u]);s=c,f?kPe(f,o)(...c):a(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function kPe(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(c){const f=c;if(o&&n)throw f;return s(f)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const ia={basename:EPe,dirname:CPe,extname:RPe,join:NPe,sep:"/"};function EPe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ky(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function CPe(e){if(Ky(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 RPe(e){Ky(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function NPe(...e){let t=-1,n;for(;++t<e.length;)Ky(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":TPe(n)}function TPe(e){Ky(e);const t=e.codePointAt(0)===47;let n=APe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function APe(e,t){let n="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function Ky(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OPe={cwd:MPe};function MPe(){return"/"}function DR(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jPe(e){if(typeof e=="string")e=new URL(e);else if(!DR(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 DPe(e)}function DPe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const fk=["history","path","basename","stem","extname","dirname"];class BY{constructor(t){let n;t?DR(t)?n={path:t}:typeof t=="string"||IPe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":OPe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<fk.length;){const i=fk[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)fk.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ia.basename(this.path):void 0}set basename(t){hk(t,"basename"),dk(t,"basename"),this.path=ia.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ia.dirname(this.path):void 0}set dirname(t){sz(this.basename,"dirname"),this.path=ia.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ia.extname(this.path):void 0}set extname(t){if(dk(t,"extname"),sz(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=ia.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){DR(t)&&(t=jPe(t)),hk(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ia.basename(this.path,this.extname):void 0}set stem(t){hk(t,"stem"),dk(t,"stem"),this.path=ia.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Dr(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function dk(e,t){if(e&&e.includes(ia.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ia.sep+"`")}function hk(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sz(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function IPe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PPe=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},$Pe={}.hasOwnProperty;class EO extends PPe{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=_Pe()}copy(){const t=new EO;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(uk(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gk("data",this.frozen),this.namespace[t]=n,this):$Pe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gk("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Vv(t),r=this.parser||this.Parser;return mk("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),mk("process",this.parser||this.Parser),pk("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const o=Vv(t),l=r.parse(o);r.run(l,o,function(f,u,h){if(f||!u||!h)return c(f);const m=u,p=r.stringify(m,h);FPe(p)?h.value=p:h.result=p,c(f,h)});function c(f,u){f||!u?a(f):i?i(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),mk("processSync",this.parser||this.Parser),pk("processSync",this.compiler||this.Compiler),this.process(t,s),az("processSync","process",n),r;function s(i,a){n=!0,X$(i),r=a}}run(t,n,r){iz(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,o){const l=Vv(n);s.run(t,l,c);function c(f,u,h){const m=u||t;f?o(f):a?a(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),az("runSync","run",r),s;function i(a,o){X$(a),s=o,r=!0}}stringify(t,n){this.freeze();const r=Vv(n),s=this.compiler||this.Compiler;return pk("stringify",s),iz(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(gk("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(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&&(s.settings=uk(!0,s.settings,c.settings))}function o(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];i(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,h=-1;for(;++u<r.length;)if(r[u][0]===c){h=u;break}if(h===-1)r.push([c,...f]);else if(f.length>0){let[m,...p]=f;const v=r[h][1];jR(v)&&jR(m)&&(m=uk(!0,v,m)),r[h]=[c,m,...p]}}}}const zPe=new EO().freeze();function mk(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pk(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gk(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 iz(e){if(!jR(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function az(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vv(e){return LPe(e)?e:new BY(e)}function LPe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FPe(e){return typeof e=="string"||UPe(e)}function UPe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BPe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",oz=[],lz={allowDangerousHtml:!0},HPe=/^(https?|ircs?|mailto|xmpp)$/i,qPe=[{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 HY(e){const t=VPe(e),n=KPe(e);return GPe(t.runSync(t.parse(n),n),e)}function VPe(e){const t=e.rehypePlugins||oz,n=e.remarkPlugins||oz,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lz}:lz;return zPe().use(RIe).use(n).use(SPe,r).use(t)}function KPe(e){const t=e.children||"",n=new BY;return typeof t=="string"&&(n.value=t),n}function GPe(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||YPe;for(const f of qPe)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+BPe+f.id,void 0);return kO(e,c),uje(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(f,u,h){if(f.type==="raw"&&h&&typeof u=="number")return a?h.children.splice(u,1):h.children[u]={type:"text",value:f.value},u;if(f.type==="element"){let m;for(m in ok)if(Object.hasOwn(ok,m)&&Object.hasOwn(f.properties,m)){const p=f.properties[m],v=ok[m];(v===null||v.includes(f.tagName))&&(f.properties[m]=l(String(p||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):i?i.includes(f.tagName):!1;if(!m&&r&&typeof u=="number"&&(m=!r(f,u,h)),m&&h&&typeof u=="number")return o&&f.children?h.children.splice(u,1,...f.children):h.children.splice(u,1),u}}}function YPe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||HPe.test(e.slice(0,t))?e:""}const jc=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],cz={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...jc,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...jc],h2:[["className","sr-only"]],img:[...jc,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...jc,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...jc],table:[...jc],ul:[...jc,["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"]},ol={}.hasOwnProperty;function WPe(e,t){let n={type:"root",children:[]};const r={schema:t?{...cz,...t}:cz,stack:[]},s=qY(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function qY(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return JPe(e,n);case"doctype":return XPe(e,n);case"element":return QPe(e,n);case"root":return ZPe(e,n);case"text":return e$e(e,n)}}}function JPe(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return Gy(i,t),i}}function XPe(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Gy(n,t),n}}function QPe(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=VY(e,t.children),s=t$e(e,t.properties);e.stack.pop();let i=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&ol.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let l=-1;for(i=!1;++l<o.length;)e.stack.includes(o[l])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:s,children:r};return Gy(a,t),a}function ZPe(e,t){const r={type:"root",children:VY(e,t.children)};return Gy(r,t),r}function e$e(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Gy(r,t),r}function VY(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const i=qY(e,r[s]);i&&(Array.isArray(i)?n.push(...i):n.push(i))}}return n}function t$e(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,i=r&&ol.call(r,n)?r[n]:void 0,a=r&&ol.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},l={};let c;for(c in o)if(ol.call(o,c)){const f=o[c];let u=uz(e,fz(i,c),c,f);u==null&&(u=uz(e,fz(a,c),c,f)),u!=null&&(l[c]=u)}if(s&&ol.call(s,n)){const f=s[n];for(c in f)ol.call(f,c)&&!ol.call(l,c)&&(l[c]=f[c])}return l}function uz(e,t,n,r){return t?Array.isArray(r)?n$e(e,t,n,r):KY(e,t,n,r):void 0}function n$e(e,t,n,r){let s=-1;const i=[];for(;++s<r.length;){const a=KY(e,t,n,r[s]);(typeof a=="number"||typeof a=="string")&&i.push(a)}return i}function KY(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&r$e(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,i=0;for(;++i<t.length;){const a=t[i];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){s=!0;break}}else if(a===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function r$e(e,t,n){const r=e.schema.protocols&&ol.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),i=s.indexOf(":"),a=s.indexOf("?"),o=s.indexOf("#"),l=s.indexOf("/");if(i<0||l>-1&&i>l||a>-1&&i>a||o>-1&&i>o)return!0;let c=-1;for(;++c<r.length;){const f=r[c];if(i===f.length&&s.slice(0,f.length)===f)return!0}return!1}function Gy(e,t){const n=pY(t);t.data&&(e.data=Ng(t.data)),n&&(e.position=n)}function fz(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],i=typeof s=="string"?s:s[0];if(i===t)return s;i==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function GY(e){return function(t){return WPe(t,e)}}function dz(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function s$e(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function i$e(e,t,n){const s=c1((n||{}).ignore||[]),i=a$e(t);let a=-1;for(;++a<i.length;)FY(e,"text",o);function o(c,f){let u=-1,h;for(;++u<f.length;){const m=f[u],p=h?h.children:void 0;if(s(m,p?p.indexOf(m):void 0,h))return;h=m}if(h)return l(c,f)}function l(c,f){const u=f[f.length-1],h=i[a][0],m=i[a][1];let p=0;const S=u.children.indexOf(c);let y=!1,b=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const _=x.index,C={index:x.index,input:x.input,stack:[...f,c]};let E=m(...x,C);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=_+1:(p!==_&&b.push({type:"text",value:c.value.slice(p,_)}),Array.isArray(E)?b.push(...E):E&&b.push(E),p=_+x[0].length,y=!0),!h.global)break;x=h.exec(c.value)}return y?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),u.children.splice(S,1,...b)):b=[c],S+b.length}}function a$e(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 s=n[r];t.push([o$e(s[0]),l$e(s[1])])}return t}function o$e(e){return typeof e=="string"?new RegExp(s$e(e),"g"):e}function l$e(e){return typeof e=="function"?e:function(){return e}}const yk="phrasing",vk=["autolink","link","image","label"];function c$e(){return{transforms:[g$e],enter:{literalAutolink:f$e,literalAutolinkEmail:bk,literalAutolinkHttp:bk,literalAutolinkWww:bk},exit:{literalAutolink:p$e,literalAutolinkEmail:m$e,literalAutolinkHttp:d$e,literalAutolinkWww:h$e}}}function u$e(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yk,notInConstruct:vk},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yk,notInConstruct:vk},{character:":",before:"[ps]",after:"\\/",inConstruct:yk,notInConstruct:vk}]}}function f$e(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function bk(e){this.config.enter.autolinkProtocol.call(this,e)}function d$e(e){this.config.exit.autolinkProtocol.call(this,e)}function h$e(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 m$e(e){this.config.exit.autolinkEmail.call(this,e)}function p$e(e){this.exit(e)}function g$e(e){i$e(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,y$e],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),v$e]],{ignore:["link","linkReference"]})}function y$e(e,t,n,r,s){let i="";if(!YY(s)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!b$e(n)))return!1;const a=x$e(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function v$e(e,t,n,r){return!YY(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function b$e(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 x$e(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 s=dz(e,"(");let i=dz(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function YY(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Du(n)||a1(n))&&(!t||n!==47)}WY.peek=T$e;function S$e(){this.buffer()}function w$e(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _$e(){this.buffer()}function k$e(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function E$e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function C$e(e){this.exit(e)}function R$e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function N$e(e){this.exit(e)}function T$e(){return"["}function WY(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function A$e(){return{enter:{gfmFootnoteCallString:S$e,gfmFootnoteCall:w$e,gfmFootnoteDefinitionLabelString:_$e,gfmFootnoteDefinition:k$e},exit:{gfmFootnoteCallString:E$e,gfmFootnoteCall:C$e,gfmFootnoteDefinitionLabelString:R$e,gfmFootnoteDefinition:N$e}}}function O$e(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:WY},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const c=i.enter("footnoteDefinition"),f=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),f(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
440
+ `:" ")+i.indentLines(i.containerFlow(r,o.current()),t?JY:M$e))),c(),l}}function M$e(e,t,n){return t===0?e:JY(e,t,n)}function JY(e,t,n){return(n?"":" ")+e}const j$e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];XY.peek=z$e;function D$e(){return{canContainEols:["delete"],enter:{strikethrough:P$e},exit:{strikethrough:$$e}}}function I$e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:j$e}],handlers:{delete:XY}}}function P$e(e){this.enter({type:"delete",children:[]},e)}function $$e(e){this.exit(e)}function XY(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function z$e(){return"~"}function L$e(e){return e.length}function F$e(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||L$e,i=[],a=[],o=[],l=[];let c=0,f=-1;for(;++f<e.length;){const v=[],S=[];let y=-1;for(e[f].length>c&&(c=e[f].length);++y<e[f].length;){const b=U$e(e[f][y]);if(n.alignDelimiters!==!1){const x=s(b);S[y]=x,(l[y]===void 0||x>l[y])&&(l[y]=x)}v.push(b)}a[f]=v,o[f]=S}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)i[u]=hz(r[u]);else{const v=hz(r);for(;++u<c;)i[u]=v}u=-1;const h=[],m=[];for(;++u<c;){const v=i[u];let S="",y="";v===99?(S=":",y=":"):v===108?S=":":v===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,l[u]-S.length-y.length);const x=S+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=S.length+b+y.length,b>l[u]&&(l[u]=b),m[u]=b),h[u]=x}a.splice(1,0,h),o.splice(1,0,m),f=-1;const p=[];for(;++f<a.length;){const v=a[f],S=o[f];u=-1;const y=[];for(;++u<c;){const b=v[u]||"";let x="",_="";if(n.alignDelimiters!==!1){const C=l[u]-(S[u]||0),E=i[u];E===114?x=" ".repeat(C):E===99?C%2?(x=" ".repeat(C/2+.5),_=" ".repeat(C/2-.5)):(x=" ".repeat(C/2),_=x):_=" ".repeat(C)}n.delimiterStart!==!1&&!u&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||u)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(b),n.alignDelimiters!==!1&&y.push(_),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
441
+ `)}function U$e(e){return e==null?"":String(e)}function hz(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 B$e(e,t,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),H$e);return s(),a}function H$e(e,t,n){return">"+(n?"":" ")+e}function q$e(e,t){return mz(e,t.inConstruct,!0)&&!mz(e,t.notInConstruct,!1)}function mz(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 pz(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
442
+ `&&q$e(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
443
+ `}function V$e(e,t){const n=String(e);let r=n.indexOf(t),s=r,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>a&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}function K$e(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 G$e(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 Y$e(e,t,n,r){const s=G$e(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(K$e(e,n)){const u=n.enter("codeIndented"),h=n.indentLines(i,W$e);return u(),h}const o=n.createTracker(r),l=s.repeat(Math.max(V$e(i,s)+1,3)),c=n.enter("codeFenced");let f=o.move(l);if(e.lang){const u=n.enter(`codeFencedLang${a}`);f+=o.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...o.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${a}`);f+=o.move(" "),f+=o.move(n.safe(e.meta,{before:f,after:`
444
+ `,encode:["`"],...o.current()})),u()}return f+=o.move(`
445
+ `),i&&(f+=o.move(i+`
446
+ `)),f+=o.move(l),c(),f}function W$e(e,t,n){return(n?"":" ")+e}function CO(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 J$e(e,t,n,r){const s=CO(n),i=s==='"'?"Quote":"Apostrophe",a=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?" ":`
447
+ `,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),o()),a(),c}function X$e(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 Tg(e){return"&#x"+e.toString(16).toUpperCase()+";"}function U0(e,t,n){const r=dh(e),s=dh(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}QY.peek=Q$e;function QY(e,t,n,r){const s=X$e(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const c=l.charCodeAt(0),f=U0(r.before.charCodeAt(r.before.length-1),c,s);f.inside&&(l=Tg(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=U0(r.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Tg(u));const m=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},o+l+m}function Q$e(e,t,n){return n.options.emphasis||"*"}function Z$e(e,t){let n=!1;return kO(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,OR}),!!((!e.depth||e.depth<3)&&yO(e)&&(t.options.setext||n))}function eze(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(Z$e(e,n)){const f=n.enter("headingSetext"),u=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:`
448
+ `,after:`
449
+ `});return u(),f(),h+`
450
+ `+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
451
+ `))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
452
+ `,...i.current()});return/^[\t ]/.test(c)&&(c=Tg(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),o(),c}ZY.peek=tze;function ZY(e){return e.value||""}function tze(){return"<"}eW.peek=nze;function eW(e,t,n,r){const s=CO(n),i=s==='"'?"Quote":"Apostrophe",a=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${i}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),o()),c+=l.move(")"),a(),c}function nze(){return"!"}tW.peek=rze;function tW(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=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+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=f,i(),s==="full"||!c||c!==u?l+=o.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function rze(){return"!"}nW.peek=sze;function nW(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],o=n.compilePattern(a);let l;if(a.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 s+r+s}function sze(){return"`"}function rW(e,t){const n=yO(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))}sW.peek=ize;function sW(e,t,n,r){const s=CO(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(rW(e,n)){const f=n.stack;n.stack=[],o=n.enter("autolink");let u=a.move("<");return u+=a.move(n.containerPhrasing(e,{before:u,after:">",...a.current()})),u+=a.move(">"),o(),n.stack=f,u}o=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+s),c+=a.move(n.safe(e.title,{before:c,after:s,...a.current()})),c+=a.move(s),l()),c+=a.move(")"),o(),c}function ize(e,t,n){return rW(e,n)?"<":"["}iW.peek=aze;function iW(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=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+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=f,i(),s==="full"||!c||c!==u?l+=o.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function aze(){return"["}function RO(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 oze(e){const t=RO(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 lze(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 aW(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 cze(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?lze(n):RO(n);const o=e.ordered?a==="."?")":".":oze(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&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),aW(n)===a&&f){let u=-1;for(;++u<e.children.length;){const h=e.children[u];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),c}function uze(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 fze(e,t,n,r){const s=uze(n);let i=n.bulletCurrent||RO(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),f);return l(),c;function f(u,h,m){return h?(m?"":" ".repeat(a))+u:(m?i:i+" ".repeat(a-i.length))+u}}function dze(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const hze=c1(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mze(e,t,n,r){return(e.children.some(function(a){return hze(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function pze(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oW.peek=gze;function oW(e,t,n,r){const s=pze(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const c=l.charCodeAt(0),f=U0(r.before.charCodeAt(r.before.length-1),c,s);f.inside&&(l=Tg(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=U0(r.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Tg(u));const m=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},o+l+m}function gze(e,t,n){return n.options.strong||"*"}function yze(e,t,n,r){return n.safe(e.value,r)}function vze(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 bze(e,t,n){const r=(aW(n)+(n.options.ruleSpaces?" ":"")).repeat(vze(n));return n.options.ruleSpaces?r.slice(0,-1):r}const lW={blockquote:B$e,break:pz,code:Y$e,definition:J$e,emphasis:QY,hardBreak:pz,heading:eze,html:ZY,image:eW,imageReference:tW,inlineCode:nW,link:sW,linkReference:iW,list:cze,listItem:fze,paragraph:dze,root:mze,strong:oW,text:yze,thematicBreak:bze};function xze(){return{enter:{table:Sze,tableData:gz,tableHeader:gz,tableRow:_ze},exit:{codeText:kze,table:wze,tableData:xk,tableHeader:xk,tableRow:xk}}}function Sze(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 wze(e){this.exit(e),this.data.inTable=void 0}function _ze(e){this.enter({type:"tableRow",children:[]},e)}function xk(e){this.exit(e)}function gz(e){this.enter({type:"tableCell",children:[]},e)}function kze(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Eze));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Eze(e,t){return t==="|"?t:e}function Cze(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
453
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(m,p,v,S){return c(f(m,v,S),m.align)}function o(m,p,v,S){const y=u(m,v,S),b=c([y]);return b.slice(0,b.indexOf(`
454
+ `))}function l(m,p,v,S){const y=v.enter("tableCell"),b=v.enter("phrasing"),x=v.containerPhrasing(m,{...S,before:i,after:i});return b(),y(),x}function c(m,p){return F$e(m,{align:p,alignDelimiters:r,padding:n,stringLength:s})}function f(m,p,v){const S=m.children;let y=-1;const b=[],x=p.enter("table");for(;++y<S.length;)b[y]=u(S[y],p,v);return x(),b}function u(m,p,v){const S=m.children;let y=-1;const b=[],x=p.enter("tableRow");for(;++y<S.length;)b[y]=l(S[y],m,p,v);return x(),b}function h(m,p,v){let S=lW.inlineCode(m,p,v);return v.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Rze(){return{exit:{taskListCheckValueChecked:yz,taskListCheckValueUnchecked:yz,paragraph:Tze}}}function Nze(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Aze}}}function yz(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Tze(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 s=t.children;let i=-1,a;for(;++i<s.length;){const o=s[i];if(o.type==="paragraph"){a=o;break}}a===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 Aze(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(a);let l=lW.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+a}}function Oze(){return[c$e(),A$e(),D$e(),xze(),Rze()]}function Mze(e){return{extensions:[u$e(),O$e(e),I$e(),Cze(e),Nze()]}}const jze={tokenize:Lze,partial:!0},cW={tokenize:Fze,partial:!0},uW={tokenize:Uze,partial:!0},fW={tokenize:Bze,partial:!0},Dze={tokenize:Hze,partial:!0},dW={name:"wwwAutolink",tokenize:$ze,previous:mW},hW={name:"protocolAutolink",tokenize:zze,previous:pW},Yo={name:"emailAutolink",tokenize:Pze,previous:gW},Fa={};function Ize(){return{text:Fa}}let Dc=48;for(;Dc<123;)Fa[Dc]=Yo,Dc++,Dc===58?Dc=65:Dc===91&&(Dc=97);Fa[43]=Yo;Fa[45]=Yo;Fa[46]=Yo;Fa[95]=Yo;Fa[72]=[Yo,hW];Fa[104]=[Yo,hW];Fa[87]=[Yo,dW];Fa[119]=[Yo,dW];function Pze(e,t,n){const r=this;let s,i;return a;function a(u){return!IR(u)||!gW.call(r,r.previous)||NO(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(u))}function o(u){return IR(u)?(e.consume(u),o):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(Dze,f,c)(u):u===45||u===95||Ar(u)?(i=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),s=!0,l}function f(u){return i&&s&&Br(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function $ze(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!mW.call(r,r.previous)||NO(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jze,e.attempt(cW,e.attempt(uW,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function zze(e,t,n){const r=this;let s="",i=!1;return a;function a(u){return(u===72||u===104)&&pW.call(r,r.previous)&&!NO(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(u),e.consume(u),o):n(u)}function o(u){if(Br(u)&&s.length<5)return s+=String.fromCodePoint(u),e.consume(u),o;if(u===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),i?c:(i=!0,l)):n(u)}function c(u){return u===null||L0(u)||Ht(u)||Du(u)||a1(u)?n(u):e.attempt(cW,e.attempt(uW,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function Lze(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function Fze(e,t,n){let r,s,i;return a;function a(c){return c===46||c===95?e.check(fW,l,o)(c):c===null||Ht(c)||Du(c)||c!==45&&a1(c)?l(c):(i=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(s=r,r=void 0),e.consume(c),a}function l(c){return s||r||!i?n(c):t(c)}}function Uze(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(fW,t,i)(a):a===null||Ht(a)||Du(a)?t(a):(e.consume(a),s)}function i(a){return a===41&&r++,e.consume(a),s}}function Bze(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),i):o===93?(e.consume(o),s):o===60||o===null||Ht(o)||Du(o)?t(o):n(o)}function s(o){return o===null||o===40||o===91||Ht(o)||Du(o)?t(o):r(o)}function i(o){return Br(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Br(o)?(e.consume(o),a):n(o)}}function Hze(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return Ar(i)?n(i):t(i)}}function mW(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ht(e)}function pW(e){return!Br(e)}function gW(e){return!(e===47||IR(e))}function IR(e){return e===43||e===45||e===46||e===95||Ar(e)}function NO(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 qze={tokenize:Qze,partial:!0};function Vze(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Wze,continuation:{tokenize:Jze},exit:Xze}},text:{91:{name:"gfmFootnoteCall",tokenize:Yze},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Kze,resolveTo:Gze}}}}function Kze(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=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(!a||!a._balanced)return n(l);const c=Fi(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Gze(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Yze(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;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(i>999||u===93&&!a||u===null||u===91||Ht(u))return n(u);if(u===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(Fi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return Ht(u)||(a=!0),i++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),i++,c):c(u)}}function Wze(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=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(a>999||p===93&&!o||p===null||p===91||Ht(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return i=Fi(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ht(p)||(o=!0),a++,e.consume(p),p===92?u:f}function u(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s.includes(i)||s.push(i),yt(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function Jze(e,t,n){return e.check(Vy,t,e.attempt(qze,t,n))}function Xze(e){e.exit("gfmFootnoteDefinition")}function Qze(e,t,n){const r=this;return yt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function Zze(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},u={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",f,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",u,o]],m=o.parser.constructs.insideSpan.null;m&&Ds(h,h.length,0,o1(m,a.slice(c+1,l),o)),Ds(h,h.length,0,[["exit",u,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",f,o]]),Ds(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,o,l){const c=this.previous,f=this.events;let u=0;return h;function h(p){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const v=dh(c);if(p===126)return u>1?l(p):(a.consume(p),u++,m);if(u<2&&!n)return l(p);const S=a.exit("strikethroughSequenceTemporary"),y=dh(p);return S._open=!y||y===2&&!!v,S._close=!v||v===2&&!!y,o(p)}}}class eLe{constructor(){this.map=[]}add(t,n,r){tLe(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[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 s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function tLe(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function nLe(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rLe(){return{flow:{null:{name:"table",tokenize:sLe,resolveAll:iLe}}}}function sLe(e,t,n){const r=this;let s=0,i=0,a;return o;function o(R){let $=r.events.length-1;for(;$>-1;){const W=r.events[$][1].type;if(W==="lineEnding"||W==="linePrefix")$--;else break}const U=$>-1?r.events[$][1].type:null,K=U==="tableHead"||U==="tableRow"?E:l;return K===E&&r.parser.lazy[r.now().line]?n(R):K(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(a=!0,i+=1),f(R)}function f(R){return R===null?n(R):$e(R)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),m):n(R):ut(R)?yt(e,f,"whitespace")(R):(i+=1,a&&(a=!1,s+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),u(R)))}function u(R){return R===null||R===124||Ht(R)?(e.exit("data"),f(R)):(e.consume(R),R===92?h:u)}function h(R){return R===92||R===124?(e.consume(R),u):u(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),a=!1,ut(R)?yt(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):p(R))}function p(R){return R===45||R===58?S(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),v):C(R)}function v(R){return ut(R)?yt(e,S,"whitespace")(R):S(R)}function S(R){return R===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),y):R===45?(i+=1,y(R)):R===null||$e(R)?_(R):C(R)}function y(R){return R===45?(e.enter("tableDelimiterFiller"),b(R)):C(R)}function b(R){return R===45?(e.consume(R),b):R===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(R))}function x(R){return ut(R)?yt(e,_,"whitespace")(R):_(R)}function _(R){return R===124?p(R):R===null||$e(R)?!a||s!==i?C(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):C(R)}function C(R){return n(R)}function E(R){return e.enter("tableRow"),k(R)}function k(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),k):R===null||$e(R)?(e.exit("tableRow"),t(R)):ut(R)?yt(e,k,"whitespace")(R):(e.enter("data"),A(R))}function A(R){return R===null||R===124||Ht(R)?(e.exit("data"),k(R)):(e.consume(R),R===92?I:A)}function I(R){return R===92||R===124?(e.consume(R),A):A(R)}}function iLe(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,c,f,u;const h=new eLe;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(vz(h,t,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,u=void 0,i=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",f,t]])),s=p.type==="tableDelimiterRow"?2:f?3:1):s&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],u=Kv(h,t,i,s,void 0,u),i=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],u=Kv(h,t,i,s,void 0,u)),i=a,a=[i[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],u=Kv(h,t,i,s,n,u)):a[1]!==0&&(u=Kv(h,t,a,s,n,u)),s=0):s&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&vz(h,t,l,c,f),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=nLe(t.events,n))}return e}function Kv(e,t,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},If(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=If(t.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=If(t.events,n[2]),f=If(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 h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,v=n[3]-n[2]-1;e.add(p,v,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return s!==void 0&&(i.end=Object.assign({},If(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function vz(e,t,n,r,s){const i=[],a=If(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function If(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const aLe={name:"tasklistCheck",tokenize:lLe};function oLe(){return{text:{91:aLe}}}function lLe(e,t,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Ht(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return $e(l)?t(l):ut(l)?e.check({tokenize:cLe},t,n)(l):n(l)}}function cLe(e,t,n){return yt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function uLe(e){return SY([Ize(),Vze(),Zze(e),rLe(),oLe()])}const fLe={};function yW(e){const t=this,n=e||fLe,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(uLe(n)),i.push(Oze()),a.push(Mze(n))}function vW(e){const t=g.useMemo(()=>We.query("prs","comments",{urlParams:e,timeToLive:"60 seconds"}),[e.pullRequestId,e.repositoryName,e.profile,e.region]);return an(t)}function bz(e){const[t,n]=g.useState(!1),[r,s]=g.useState(!1),i=()=>localStorage.getItem(e)==="true",a=g.useCallback(()=>i()?!1:(n(!0),!0),[e]),o=g.useCallback(()=>{r&&localStorage.setItem(e,"true"),n(!1)},[r,e]);return{cancel:g.useCallback(()=>{n(!1)},[]),dismiss:o,dontRemind:r,isDismissed:i,setDontRemind:s,show:a,visible:t}}function dLe({items:e,onRefresh:t,permissionPrompt:n,stableKey:r}){const[s,i]=g.useState(null),[a,o]=g.useState(null),l=g.useRef(!1),c=g.useRef(null),f=g.useRef(t);f.current=t;const u=g.useCallback(()=>f.current(),[]);return g.useEffect(()=>{n?l.current=!0:l.current&&(l.current=!1,u())},[n,u]),g.useEffect(()=>{if((s||a)&&!n){let h=500;const m=Date.now(),p=()=>{if(Date.now()-m>3e4){i(null),o(null);return}u(),h=Math.min(h*1.5,3e3),c.current=setTimeout(p,h)};return c.current=setTimeout(p,h),()=>{c.current&&clearTimeout(c.current)}}},[s,a,n,u]),g.useEffect(()=>{i(null),o(null),c.current&&(clearTimeout(c.current),c.current=null)},[r]),{pendingAdd:s,pendingRemove:a,add:h=>i(h),remove:h=>o(h)}}function zs({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:at("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function _c({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:at("@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 kc({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:at("leading-none font-semibold",e),...t})}function Ls({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:at("px-6",e),...t})}const bW=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",hLe=e=>e==="green"?"border-green-500/30":e==="yellow"?"border-yellow-500/30":"border-red-500/30",mLe=e=>e==="positive"?"outline":e==="neutral"?"secondary":"destructive",pLe=e=>e==="positive"?"border-green-500/30 text-green-600 dark:text-green-400":"",gLe=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(),s=Math.floor(r/6e4);if(s<1)return`${n} · just now`;if(s<60)return`${n} · ${s}m ago`;const i=Math.floor(s/60);if(i<24)return`${n} · ${i}h ago`;const a=Math.floor(i/24);return`${n} · ${a}d ago`},xz=e=>e.comments.length===0?0:Math.min(...e.comments.map(t=>new Date(t.root.creationDate).getTime())),xW=e=>1+e.replies.reduce((t,n)=>t+xW(n),0);function yLe({score:e}){if(!e)return null;const t=cO(e.total);return d.jsx(qe,{variant:"outline",className:`${hLe(t)} ${bW(t)} tabular-nums font-semibold`,children:e.total.toFixed(1)})}function vLe({score:e}){if(!e)return d.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"Waiting for comment count..."});const t=cO(e.total);return d.jsxs("div",{className:"space-y-3 pt-2",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:`text-lg font-bold tabular-nums ${bW(t)}`,children:e.total.toFixed(1)}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"/ 10"}),d.jsx("div",{className:"ml-2 h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:d.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}%`}})})]}),d.jsx("div",{className:"space-y-2",children:e.categories.map(n=>d.jsxs("div",{className:"flex items-start gap-3 rounded border px-3 py-2",children:[d.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}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium",children:n.label}),d.jsx(qe,{variant:mLe(n.status),className:`text-[10px] px-1.5 py-0 ${pLe(n.status)}`,children:n.statusLabel})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.description})]})]},n.label))})]})}function SW({depth:e,thread:t}){return t.root.deleted?null:d.jsxs("div",{className:e>0?"ml-4 border-l-2 border-muted pl-3":"",children:[d.jsxs("div",{className:"space-y-1 py-2",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-medium",children:t.root.author}),d.jsx("span",{children:"·"}),d.jsx("span",{children:gLe(t.root.creationDate)})]}),d.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:d.jsx(HY,{remarkPlugins:[yW],rehypePlugins:[GY],children:t.root.content})})]}),t.replies.map(n=>d.jsx(SW,{thread:n,depth:e+1},n.root.id))]})}function bLe({pr:e}){const t=vW({pullRequestId:e.id,repositoryName:e.repositoryName,profile:e.account.profile,region:e.account.region});return Co(t).onInitialOrWaiting(()=>d.jsx("div",{className:"pt-2",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading comments..."})})).onError(()=>d.jsx("div",{className:"pt-2",children:d.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onDefect(()=>d.jsx("div",{className:"pt-2",children:d.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onSuccess(n=>{const r=n.reduce((s,i)=>s+i.comments.reduce((a,o)=>a+xW(o),0),0);return d.jsxs("div",{className:"pt-2",children:[n.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"No comments"}),r>0&&d.jsx("div",{className:"space-y-1",children:[...n].sort((s,i)=>xz(i)-xz(s)).map((s,i)=>d.jsxs("div",{children:[s.filePath&&d.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s.filePath}),s.comments.map(a=>d.jsx(SW,{thread:a,depth:0},a.root.id)),i<n.length-1&&d.jsx(tr,{className:"my-2"})]},i))})]})}).render()}function xLe({pr:e}){const t=vW({pullRequestId:e.id,repositoryName:e.repositoryName,profile:e.account.profile,region:e.account.region}),n=e.status==="MERGED"?e.lastModifiedDate.getTime()-e.creationDate.getTime():null,{timeToAddressFeedback:r,timeToFirstReview:s}=g.useMemo(()=>{if(!fs(t))return{timeToFirstReview:null,timeToAddressFeedback:null};const a=[];for(const p of t.value){const v=S=>{for(const y of S)a.push({author:y.root.author,date:new Date(y.root.creationDate)}),v(y.replies)};v(p.comments)}a.sort((p,v)=>p.date.getTime()-v.date.getTime());const o=a.find(p=>p.author!==e.author),l=o?o.date.getTime()-e.creationDate.getTime():null,f=e.isApproved&&e.approvedBy.some(p=>p!==e.author)?e.lastModifiedDate.getTime()-e.creationDate.getTime():null,u=l!=null&&f!=null?Math.min(l,f):l??f,h=[];for(let p=0;p<a.length;p++)if(a[p].author!==e.author){const v=a.slice(p+1).find(S=>S.author===e.author);v&&h.push(v.date.getTime()-a[p].date.getTime())}const m=h.length>0?h.reduce((p,v)=>p+v,0)/h.length:null;return{timeToFirstReview:u,timeToAddressFeedback:m}},[t,e.author,e.creationDate]);return n!=null||s!=null||r!=null?d.jsxs(d.Fragment,{children:[n!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Time to Merge"}),d.jsx("span",{className:"text-xs font-medium tabular-nums",children:Lb(n)})]}),s!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Time to First Review"}),d.jsx("span",{className:"text-xs font-medium tabular-nums",children:Lb(s)})]}),r!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Time to Address Feedback"}),d.jsx("span",{className:"text-xs font-medium tabular-nums",children:Lb(r)})]})]}):null}function Sz({children:e,count:t,title:n}){const[r,s]=g.useState(!1);return d.jsxs("div",{className:"rounded-lg border bg-card",children:[d.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:()=>s(!r),children:[d.jsx(jy,{className:`size-4 text-muted-foreground transition-transform ${r?"":"-rotate-90"}`}),n,t!==void 0&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t,")"]})]}),r&&d.jsx("div",{className:"border-t px-4 pb-3",children:e})]})}const SLe="Required approvers",wLe="Optional approvers",wz=(e,t)=>{const n=/^arn:aws:sts::[^:]*:assumed-role\/[^/]+\/(.+)$/.exec(e);return n?`CodeCommitApprovers:${t}:${n[1]}`:e};function _Le({approvalRules:e,approvedBy:t,currentUser:n,knownUserArns:r,onRefresh:s,onSetApprovers:i,permissionPrompt:a,required:o,ruleName:l,title:c}){const[f,u]=g.useState(!1),[h,m]=g.useState(""),p=e.flatMap(R=>R.poolMembers).join(","),v=dLe({items:e.flatMap(R=>R.poolMembers),stableKey:p,permissionPrompt:a,onRefresh:s}),{pendingAdd:S,pendingRemove:y}=v,b=g.useMemo(()=>{const R=new Set;for(const $ of e)if($.fromTemplate||$.ruleName===l)for(const U of $.poolMembers)R.add(U);return[...R]},[e,l]),x=e.find(R=>R.ruleName===l&&!R.fromTemplate),_=(x==null?void 0:x.poolMemberArns)??[],C=(x==null?void 0:x.poolMembers)??[],E=g.useMemo(()=>[...r.entries()].filter(([R])=>!b.includes(R)&&R!==S),[r,b,S]),k=R=>{const $=/^CodeCommitApprovers:[^:]*:(.+)$/.exec(R);if($)v.add($[1]);else{const U=/assumed-role\/[^/]+\/(.+)$/.exec(R);v.add(U?U[1]:R)}i([..._,R]),u(!1)},A=R=>{v.remove(R);const $=C.indexOf(R);$>=0&&i(_.filter((U,K)=>K!==$))},I=e.length>0&&e.every(R=>R.satisfied);return d.jsxs(zs,{children:[d.jsxs(_c,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kc,{className:"text-sm",children:c}),o&&e.length>0&&(I?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Satisfied"}):d.jsx(qe,{variant:"secondary",children:"Pending"}))]}),d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:()=>u(!f),children:d.jsx(vo,{className:"size-4"})})]}),d.jsxs(Ls,{className:"space-y-2",children:[f&&d.jsxs("div",{className:"flex flex-col gap-2 rounded-md border p-2 bg-muted/30",children:[E.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:E.map(([R,$])=>d.jsx(he,{variant:"outline",size:"sm",className:"h-6 text-xs gap-1",onClick:()=>m($),children:R},R))}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx("input",{placeholder:"CodeCommitApprovers:REPO_ACCOUNT_ID:USERNAME",className:"flex-1 rounded-md border bg-background px-2 py-1 text-xs font-mono",value:h,onChange:R=>m(R.target.value),onKeyDown:R=>{R.key==="Enter"&&h.trim()&&(k(h.trim()),m(""))}}),d.jsx(he,{size:"sm",className:"h-7 text-xs",disabled:!h.trim(),onClick:()=>{k(h.trim()),m("")},children:"Add"})]})]}),!f&&E.length>0&&d.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[d.jsx("span",{className:"text-[10px] text-muted-foreground/60 uppercase tracking-wider",children:"Suggested"}),E.slice(0,5).map(([R,$])=>d.jsxs("button",{className:"inline-flex items-center gap-0.5 rounded-md border border-dashed border-muted-foreground/30 px-1.5 py-0.5 text-[11px] text-muted-foreground/60 hover:border-primary/50 hover:text-foreground transition-colors",onClick:()=>k($),children:[d.jsx(vo,{className:"size-2.5"}),R]},R))]}),(b.length>0||S)&&d.jsxs("div",{className:"flex flex-wrap gap-1",children:[b.map(R=>{const $=t.includes(R),U=C.includes(R),K=R===y;return d.jsxs(qe,{variant:R===n?"default":$?"outline":"secondary",className:`text-xs gap-1 ${$?"border-green-500/30 text-green-600 dark:text-green-400":""} ${K?"opacity-50":""}`,children:[K&&d.jsx(Ra,{className:"size-3 animate-spin"}),!K&&$&&d.jsx(Jh,{className:"size-3"}),R,U&&!K&&d.jsx("button",{className:"ml-0.5 hover:text-destructive",onClick:()=>A(R),children:d.jsx(Db,{className:"size-3"})})]},R)}),S&&!b.includes(S)&&d.jsxs(qe,{variant:"secondary",className:"text-xs gap-1 opacity-70",children:[d.jsx(Ra,{className:"size-3 animate-spin"}),S]})]})]})]})}function kLe(){var ae;const{accountId:e,prId:t}=KN(),n=an(gi),r=ft(D_e),s=ft(I_e),i=ft(P_e),a=g.useRef(null),o=g.useMemo(()=>t?n.pullRequests.find(te=>te.id===t&&(te.account.awsAccountId===e||te.account.profile===e))??null:null,[e,t,n.pullRequests]),l=((ae=o==null?void 0:o.account)==null?void 0:ae.repoAccountId)||"",c=g.useMemo(()=>{const te=new Map;for(const fe of n.pullRequests){for(const Ce of fe.approvalRules)for(let ye=0;ye<Ce.poolMembers.length;ye++){const xt=Ce.poolMembers[ye],rn=ye<Ce.poolMemberArns.length?Ce.poolMemberArns[ye]:void 0;xt&&rn&&rn!=="*"&&te.set(xt,wz(rn,l))}for(let Ce=0;Ce<fe.approvedBy.length;Ce++){const ye=fe.approvedBy[Ce],xt=Ce<fe.approvedByArns.length?fe.approvedByArns[Ce]:void 0;ye&&xt&&xt!=="*"&&te.set(ye,wz(xt,l))}}return te},[n.pullRequests,l]);g.useEffect(()=>{if(o||!e||!t)return;const te=`${e}:${t}`;a.current!==te&&(a.current=te,r({path:{awsAccountId:e,prId:Ro.make(t)}}))},[o,e,t,r]);const f=g.useMemo(()=>o?Zs(iY(o,new Date)):void 0,[o]),u=hs(),h=ft(x_e),m=bz(ss.grantedDismissed),p=bz(ss.dockerDismissed),v=an(E_e),S=ft(C_e),y=ft(R_e),b=(o==null?void 0:o.account.awsAccountId)??(o==null?void 0:o.account.profile),x=g.useMemo(()=>fs(v)&&b?v.value.some(te=>te.awsAccountId===b&&te.pullRequestId===t):!1,[v,b,t]),[_,C]=tMe(x),E=g.useCallback(()=>{if(!b||!o)return;const te={awsAccountId:b,pullRequestId:o.id};C(!_),_?y({payload:te}):S({payload:te})},[b,_,o,S,y]),[k,A]=g.useState(!1),I=g.useRef(o==null?void 0:o.fetchedAt);g.useEffect(()=>{k&&(o!=null&&o.fetchedAt)&&o.fetchedAt!==I.current&&A(!1),I.current=o==null?void 0:o.fetchedAt},[k,o==null?void 0:o.fetchedAt]);const R=g.useCallback(()=>{!b||!t||k||(A(!0),r({path:{awsAccountId:b,prId:Ro.make(t)}}))},[b,k,t,r]),$=o?o.link||`https://${o.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${o.repositoryName}/pull-requests/${o.id}?region=${o.account.region}`:"",[U,K]=g.useState(!1),W=g.useCallback(()=>{$&&navigator.clipboard.writeText($).then(()=>{K(!0),setTimeout(()=>K(!1),2e3)},()=>{})},[$]),B=ft(M_e),j=g.useMemo(()=>{var te;return(te=n.sandboxes)==null?void 0:te.find(fe=>fe.pullRequestId===t&&fe.awsAccountId===e&&fe.status!=="stopped"&&fe.status!=="error")},[n.sandboxes,t,e]),[F,z]=g.useState(!1);g.useEffect(()=>{F&&j&&(z(!1),u(`/sandbox/${j.id}`))},[F,j,u]);const V=g.useCallback(()=>{if(!o)return;const te=o.account.awsAccountId??o.account.profile;B({payload:{pullRequestId:o.id,awsAccountId:te,repositoryName:o.repositoryName,sourceBranch:o.sourceBranch,profile:o.account.profile,region:o.account.region}}),z(!0)},[o,B]),O=g.useCallback(()=>{if(o){if(j){u(`/sandbox/${j.id}`);return}p.show()||V()}},[o,j,p,V,u]),me=()=>{p.dismiss(),V()},q=g.useCallback(()=>{!o||!$||h({payload:{profile:o.account.profile,link:$}})},[$,h,o]),N=g.useCallback(()=>{o&&(m.show()||q())},[m,o,q]),J=()=>{m.dismiss(),q()};if(g.useEffect(()=>{const te=fe=>{fe.target instanceof HTMLInputElement||fe.target instanceof HTMLTextAreaElement||(fe.key==="Escape"?(fe.preventDefault(),u("/")):(fe.key==="Enter"||fe.key==="o")&&(o!=null&&o.link)?N():fe.key==="."&&o&&(fe.preventDefault(),O()))};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[N,O,u,o]),!o)return d.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[d.jsx(Ra,{className:"size-6 animate-spin opacity-40"}),d.jsx("p",{className:"text-sm",children:"Loading pull request..."})]});const Y=o.status==="OPEN",le=Y?o.isMergeable?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):d.jsx(qe,{variant:"destructive",children:"Conflict"}):null,Q=Y?o.isApproved?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):d.jsx(qe,{variant:"secondary",children:"Pending"}):null;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(he,{variant:"ghost",size:"sm",onClick:()=>u("/"),children:[d.jsx(Oy,{className:"size-4"}),"Back"]}),d.jsxs(n1,{className:"ml-auto",children:[d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:R,disabled:k,children:[d.jsx(Qu,{className:`size-3.5 ${k?"animate-spin":""}`}),"Refresh"]}),d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:E,children:[_?d.jsx(uke,{className:"size-3.5"}):d.jsx(My,{className:"size-3.5"}),_?"Unsubscribe":"Subscribe"]}),d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:O,children:[d.jsx(zq,{className:"size-3.5"}),j?"Open Sandbox":"Sandbox"]}),d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:W,children:[U?d.jsx(Jh,{className:"size-3.5"}):d.jsx(Lq,{className:"size-3.5"}),U?"Copied":"Copy Link"]}),d.jsxs(he,{variant:"default",size:"sm",className:"h-7 text-xs",onClick:N,children:[d.jsx(Ike,{className:"size-3.5"}),"Open in Console"]})]})]}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:o.title}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[le,Q,d.jsx(qe,{variant:"outline",children:o.status}),d.jsx(yLe,{score:f}),d.jsx(Gs,{to:`/?f=author:${encodeURIComponent(o.author)}`,className:"text-sm text-muted-foreground hover:underline",children:o.author}),d.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),d.jsx("span",{className:"text-sm text-muted-foreground",children:r1(o.creationDate)}),o.fetchedAt&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:s1(o.fetchedAt,new Date,"Fetched")})]})]})]}),d.jsx(tr,{}),d.jsx(zs,{children:d.jsxs(Ls,{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 py-4 text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:"Account"}),d.jsx(Gs,{to:`/?f=account:${encodeURIComponent(o.account.profile)}`,className:"font-mono text-xs hover:underline",children:o.account.profile}),d.jsx("span",{className:"text-muted-foreground",children:"Repository"}),d.jsx(Gs,{to:`/?f=repo:${encodeURIComponent(o.repositoryName)}`,className:"font-mono text-xs hover:underline",children:o.repositoryName}),d.jsx("span",{className:"text-muted-foreground",children:"Branch"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(qe,{variant:"outline",className:"font-mono text-xs",children:o.sourceBranch}),d.jsx(Pq,{className:"size-3 text-muted-foreground"}),d.jsx(qe,{variant:"outline",className:"font-mono text-xs",children:o.destinationBranch})]}),d.jsx("span",{className:"text-muted-foreground",children:"Author"}),d.jsx(Gs,{to:`/?f=author:${encodeURIComponent(o.author)}`,className:"text-xs hover:underline",children:o.author}),Ed(o.title)&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Scope"}),d.jsx(Gs,{to:`/?f=scope:${encodeURIComponent(Ed(o.title))}`,className:"text-xs hover:underline",children:Ed(o.title)})]}),d.jsx("span",{className:"text-muted-foreground",children:"Status"}),d.jsx("div",{className:"flex items-center gap-2",children:o.status==="MERGED"?d.jsx(Gs,{to:"/?f=status:merged",className:"hover:underline",children:d.jsx(qe,{variant:"outline",className:"border-purple-500/30 text-purple-600 dark:text-purple-400",children:"Merged"})}):o.status==="CLOSED"?d.jsx(Gs,{to:"/?f=status:closed",className:"hover:underline",children:d.jsx(qe,{variant:"outline",className:"border-red-500/30 text-red-600 dark:text-red-400",children:"Closed"})}):d.jsxs(d.Fragment,{children:[d.jsx(Gs,{to:`/?f=status:${o.isApproved?"approved":"pending"}`,className:"hover:underline",children:o.isApproved?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):d.jsx(qe,{variant:"secondary",children:"Pending"})}),d.jsx(Gs,{to:`/?f=status:${o.isMergeable?"mergeable":"conflicts"}`,className:"hover:underline",children:o.isMergeable?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):d.jsx(qe,{variant:"destructive",children:"Conflict"})})]})}),d.jsx("span",{className:"text-muted-foreground",children:"ID"}),d.jsx("span",{className:"font-mono text-xs",children:o.id}),d.jsx(xLe,{pr:o})]})}),[{title:"Required Approvers",ruleName:SLe,required:!0},{title:"Optional Approvers",ruleName:wLe,required:!1}].map(te=>d.jsx(_Le,{title:te.title,ruleName:te.ruleName,required:te.required,approvalRules:o.approvalRules,approvedBy:o.approvedBy,knownUserArns:c,currentUser:n.currentUser,permissionPrompt:!!n.permissionPrompt,onSetApprovers:fe=>{const Ce=o.approvalRules.find(ye=>ye.ruleName===te.ruleName&&!ye.fromTemplate);Ce?i({payload:{pullRequestId:o.id,approvalRuleName:Ce.ruleName,requiredApprovals:te.required&&fe.length>0?fe.length:0,poolMembers:fe.length>0?fe:["*"],account:o.account}}):fe.length>0&&s({payload:{pullRequestId:o.id,approvalRuleName:te.ruleName,requiredApprovals:te.required?fe.length:0,poolMembers:fe,account:o.account}})},onRefresh:()=>r({path:{awsAccountId:e,prId:Ro.make(o.id)}})},te.ruleName)),d.jsx(Sz,{title:"Health Score Breakdown",children:d.jsx(vLe,{score:f})}),o.description&&d.jsxs(zs,{children:[d.jsx(_c,{children:d.jsx(kc,{className:"text-sm",children:"Description"})}),d.jsx(Ls,{children:d.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:d.jsx(HY,{remarkPlugins:[yW],rehypePlugins:[GY],children:o.description})})})]}),d.jsx(Sz,{title:"Comments",...o.commentCount!==void 0?{count:o.commentCount}:{},children:d.jsx(bLe,{pr:o},o.id)}),d.jsx(D0,{open:m.visible,onOpenChange:m.cancel,children:d.jsxs(I0,{children:[d.jsxs(P0,{children:[d.jsx($0,{children:"Granted CLI Required"}),d.jsxs(z0,{children:['"Open in Console" uses'," ",d.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"," ",d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",children:"assume"})," CLI is installed and configured before continuing."]})]}),d.jsxs(_R,{children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground mr-auto",children:[d.jsx("input",{type:"checkbox",checked:m.dontRemind,onChange:te=>m.setDontRemind(te.target.checked),className:"accent-primary"}),"Don't remind again"]}),d.jsx(he,{variant:"ghost",onClick:m.cancel,children:"Cancel"}),d.jsx(he,{onClick:J,children:"Continue"})]})]})}),d.jsx(D0,{open:p.visible,onOpenChange:p.cancel,children:d.jsxs(I0,{children:[d.jsxs(P0,{children:[d.jsx($0,{children:"Docker Required"}),d.jsx(z0,{children:"Sandbox uses Docker to run a code-server container. Make sure Docker is started before continuing."})]}),d.jsxs(_R,{children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground mr-auto",children:[d.jsx("input",{type:"checkbox",checked:p.dontRemind,onChange:te=>p.setDontRemind(te.target.checked),className:"accent-primary"}),"Don't show again"]}),d.jsx(he,{onClick:me,children:"OK"})]})]})})]})}const PR=new Set,Kr=new WeakMap,Iu=new WeakMap,Fo=new WeakMap,Ag=new WeakMap,Sk=new WeakMap,$R=new WeakMap,lu=new WeakMap,hh=new WeakMap,Pf=new WeakSet;let oc,TO=0,AO=0;const bo="__aa_tgt",Og="__aa_del",B0="__aa_new",wW=e=>{const t=TLe(e);t&&t.forEach(n=>ALe(n))},ELe=e=>{e.forEach(t=>{t.target===oc&&RLe(),Kr.has(t.target)&&rf(t.target)})};function CLe(e){const t=Ag.get(e);t==null||t.disconnect();let n=Kr.get(e),r=0;const s=5;n||(n=mh(e),Kr.set(e,n));const{offsetWidth:i,offsetHeight:a}=oc,l=[n.top-s,i-(n.left+s+n.width),a-(n.top+s+n.height),n.left-s].map(f=>`${-1*Math.floor(f)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&rf(e)},{root:oc,threshold:1,rootMargin:l});c.observe(e),Ag.set(e,c)}function rf(e){clearTimeout(hh.get(e));const t=f1(e),n=Mg(t)?500:t.duration;hh.set(e,setTimeout(async()=>{const r=Fo.get(e);try{await(r==null?void 0:r.finished),Kr.set(e,mh(e)),CLe(e)}catch{}},n))}function RLe(){clearTimeout(hh.get(oc)),hh.set(oc,setTimeout(()=>{PR.forEach(e=>zR(e,t=>_W(()=>rf(t))))},100))}function NLe(e){setTimeout(()=>{$R.set(e,setInterval(()=>_W(rf.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function _W(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let no;const kW=typeof window<"u"&&"ResizeObserver"in window;kW&&(oc=document.documentElement,new MutationObserver(wW),no=new ResizeObserver(ELe),window.addEventListener("scroll",()=>{AO=window.scrollY,TO=window.scrollX}),no.observe(oc));function TLe(e){return e.reduce((r,s)=>[...r,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,s)=>{if(r===!1)return!1;if(s.target instanceof Element){if(wk(s.target),!r.has(s.target)){r.add(s.target);for(let i=0;i<s.target.children.length;i++){const a=s.target.children.item(i);if(a){if(Og in a)return!1;wk(s.target,a),r.add(a)}}}if(s.removedNodes.length)for(let i=0;i<s.removedNodes.length;i++){const a=s.removedNodes[i];if(Og in a)return!1;a instanceof Element&&(r.add(a),wk(s.target,a),Iu.set(a,[s.previousSibling,s.nextSibling]))}}return r},new Set)}function wk(e,t){!t&&!(bo in e)?Object.defineProperty(e,bo,{value:e}):t&&!(bo in t)&&Object.defineProperty(t,bo,{value:e})}function ALe(e){var t;const n=e.isConnected,r=Kr.has(e);n&&Iu.has(e)&&Iu.delete(e),Fo.has(e)&&((t=Fo.get(e))===null||t===void 0||t.cancel()),B0 in e?_z(e):r&&n?MLe(e):r&&!n?jLe(e):_z(e)}function aa(e){return Number(e.replace(/[^0-9.\-]/g,""))}function OLe(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 mh(e){const t=e.getBoundingClientRect(),{x:n,y:r}=OLe(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function EW(e,t,n){let r=t.width,s=t.height,i=n.width,a=n.height;const o=getComputedStyle(e);if(o.getPropertyValue("box-sizing")==="content-box"){const c=aa(o.paddingTop)+aa(o.paddingBottom)+aa(o.borderTopWidth)+aa(o.borderBottomWidth),f=aa(o.paddingLeft)+aa(o.paddingRight)+aa(o.borderRightWidth)+aa(o.borderLeftWidth);r-=f,i-=f,s-=c,a-=c}return[r,i,s,a].map(Math.round)}function f1(e){return bo in e&&lu.has(e[bo])?lu.get(e[bo]):{duration:250,easing:"ease-in-out"}}function CW(e){if(bo in e)return e[bo]}function OO(e){const t=CW(e);return t?Pf.has(t):!1}function zR(e,...t){t.forEach(n=>n(e,lu.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(s=>s(r,lu.has(r)))}}function MO(e){return Array.isArray(e)?e:[e]}function Mg(e){return typeof e=="function"}function MLe(e){const t=Kr.get(e),n=mh(e);if(!OO(e))return Kr.set(e,n);let r;if(!t)return;const s=f1(e);if(typeof s!="function"){const i=t.left-n.left,a=t.top-n.top,[o,l,c,f]=EW(e,t,n),u={transform:`translate(${i}px, ${a}px)`},h={transform:"translate(0, 0)"};o!==l&&(u.width=`${o}px`,h.width=`${l}px`),c!==f&&(u.height=`${c}px`,h.height=`${f}px`),r=e.animate([u,h],{duration:s.duration,easing:s.easing})}else{const[i]=MO(s(e,"remain",t,n));r=new Animation(i),r.play()}Fo.set(e,r),Kr.set(e,n),r.addEventListener("finish",()=>rf(e),{once:!0})}function _z(e){B0 in e&&delete e[B0];const t=mh(e);Kr.set(e,t);const n=f1(e);if(!OO(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[s]=MO(n(e,"add",t));r=new Animation(s),r.play()}Fo.set(e,r),r.addEventListener("finish",()=>rf(e),{once:!0})}function kz(e,t){var n;e.remove(),Kr.delete(e),Iu.delete(e),Fo.delete(e),(n=Ag.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Og in e&&delete e[Og],Object.defineProperty(e,B0,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function jLe(e){var t;if(!Iu.has(e)||!Kr.has(e))return;const[n,r]=Iu.get(e);Object.defineProperty(e,Og,{value:!0,configurable:!0});const s=window.scrollX,i=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=CW(e))===null||t===void 0||t.appendChild(e),!OO(e))return kz(e);const[a,o,l,c]=ILe(e),f=f1(e),u=Kr.get(e);(s!==TO||i!==AO)&&DLe(e,s,i,f);let h,m={position:"absolute",top:`${a}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,m),h=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:f.duration,easing:"ease-out"});else{const[p,v]=MO(f(e,"remove",u));(v==null?void 0:v.styleReset)!==!1&&(m=(v==null?void 0:v.styleReset)||m,Object.assign(e.style,m)),h=new Animation(p),h.play()}Fo.set(e,h),h.addEventListener("finish",()=>kz(e,m),{once:!0})}function DLe(e,t,n,r){const s=TO-t,i=AO-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(oc).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+i),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,f=l.clientWidth;const u=performance.now();function h(){requestAnimationFrame(()=>{if(!Mg(r)){const m=c-l.clientHeight,p=f-l.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-m}),c=l.clientHeight,f=l.clientWidth,h()):document.documentElement.style.scrollBehavior=a}})}h()}function ILe(e){const t=Kr.get(e),[n,,r]=EW(e,t,mh(e));let s=e.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const i=getComputedStyle(s),a=Kr.get(s)||mh(s),o=Math.round(t.top-a.top)-aa(i.borderTopWidth),l=Math.round(t.left-a.left)-aa(i.borderLeftWidth);return[o,l,n,r]}function PLe(e,t={}){if(kW&&no&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Mg(t)&&!t.disrespectUserMotionPreference)){Pf.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),zR(e,rf,NLe,a=>no==null?void 0:no.observe(a)),Mg(t)?lu.set(e,t):lu.set(e,{duration:250,easing:"ease-in-out",...t});const i=new MutationObserver(wW);i.observe(e,{childList:!0}),Sk.set(e,i),PR.add(e)}return Object.freeze({parent:e,enable:()=>{Pf.add(e)},disable:()=>{Pf.delete(e)},isEnabled:()=>Pf.has(e),destroy:()=>{Pf.delete(e),PR.delete(e),lu.delete(e);const r=Sk.get(e);r==null||r.disconnect(),Sk.delete(e),zR(e,s=>{no==null||no.unobserve(s);const i=Fo.get(s);try{i==null||i.cancel()}catch{}Fo.delete(s);const a=Ag.get(s);a==null||a.disconnect(),Ag.delete(s);const o=$R.get(s);o&&clearInterval(o),$R.delete(s);const l=hh.get(s);l&&clearTimeout(l),hh.delete(s),Kr.delete(s),Iu.delete(s)})}})}function $Le(e){const[t,n]=g.useState(),r=g.useMemo(()=>e,[]),s=g.useCallback(a=>{a instanceof HTMLElement?n(PLe(a,r)):n(void 0)},[r]),i=g.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return g.useEffect(()=>()=>{var a;(a=t==null?void 0:t.destroy)===null||a===void 0||a.call(t)},[t]),[s,i]}function Ez({currentUser:e,pr:t,showUpdated:n,to:r}){const s=Cq(t,e),i=g.useMemo(()=>Zs(iY(t,new Date)),[t]),a=i?cO(i.total):void 0,o=a==="green"?"text-green-600 dark:text-green-400":a==="yellow"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",l=t.status==="MERGED"?d.jsx(qe,{variant:"outline",className:"border-purple-500/30 text-purple-600 dark:text-purple-400",children:"Merged"}):t.status==="CLOSED"?d.jsx(qe,{variant:"outline",className:"border-red-500/30 text-red-600 dark:text-red-400",children:"Closed"}):t.isMergeable?t.isApproved?d.jsx(qe,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):d.jsx(qe,{variant:"secondary",children:"Pending"}):d.jsx(qe,{variant:"destructive",children:"Conflict"});return d.jsxs(Gs,{to:r,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:[d.jsxs("div",{className:"flex items-center gap-2",children:[l,s&&d.jsxs(qe,{variant:"outline",className:"border-yellow-500/30 text-yellow-600 dark:text-yellow-400 gap-0.5",children:[d.jsx(j2,{className:"size-3"}),"Review"]}),i&&d.jsx("span",{className:`text-xs font-semibold tabular-nums ${o}`,children:i.total.toFixed(1)}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.author," ·"," ",n?s1(t.lastModifiedDate,new Date):r1(t.creationDate)]}),t.commentCount!==void 0&&t.commentCount>0&&d.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[d.jsx(Hq,{className:"size-3"}),t.commentCount]})]}),d.jsxs("div",{className:"flex items-baseline gap-1.5",children:[d.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:t.repositoryName}),d.jsx("span",{className:"text-muted-foreground/50",children:"›"}),d.jsx("span",{className:"text-sm font-medium",children:t.title})]}),t.description&&d.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.description.split(`
455
+ `).slice(0,2).join(" ")})]})}const zLe=(e,t)=>{var n;switch(t.key){case"account":return((n=e.account)==null?void 0:n.profile)===t.value;case"author":return e.author===t.value;case"scope":return Ed(e.title)===t.value;case"repo":return e.repositoryName===t.value;case"approver":return e.approvedBy.some(r=>r===t.value);case"commenter":return e.commentedBy.some(r=>r===t.value);case"size":{const r=e.filesChanged;if(r==null)return!1;switch(t.value){case"small":return r<5;case"medium":return r>=5&&r<=15;case"large":return r>=16&&r<=30;case"xlarge":return r>30;default:return!0}}case"status":switch(t.value){case"approved":return e.status==="OPEN"&&e.isApproved;case"pending":return e.status==="OPEN"&&!e.isApproved;case"mergeable":return e.status==="OPEN"&&e.isMergeable;case"conflicts":return e.status==="OPEN"&&!e.isMergeable;case"merged":return e.status==="MERGED";case"closed":return e.status==="CLOSED";case"open":return e.status==="OPEN";default:return!0}default:return!0}};function LLe(){const e=an(gi),t=ft(O2),{state:n,toggleFilter:r}=tY(),[s,i]=$Le(),a=e.status==="loading",o=e.pullRequests;g.useEffect(()=>{i(n.hot)},[n.hot,i]);const{flat:l,grouped:c}=g.useMemo(()=>{var B;if(o.length===0)return{flat:[],grouped:[]};const{filters:h,from:m,hot:p,q:v,review:S,to:y}=n,b=v.toLowerCase(),x=j=>{var F;return v?j.repositoryName.toLowerCase().includes(b)||j.title.toLowerCase().includes(b)||j.author.toLowerCase().includes(b)||j.sourceBranch.toLowerCase().includes(b)||(((F=j.description)==null?void 0:F.toLowerCase().includes(b))??!1):!0},_={open:"lifecycle",merged:"lifecycle",closed:"lifecycle",approved:"approval",pending:"approval",mergeable:"merge",conflicts:"merge"},C=new Map;for(const j of h){const F=j.key==="status"?`status:${_[j.value]??j.value}`:j.key,z=C.get(F);z?z.push(j):C.set(F,[j])}const E=j=>[...C.values()].every(F=>F.some(z=>zLe(j,z))),k=m?new Date(m).getTime():void 0,A=y?new Date(y).getTime():void 0,I=h.find(j=>j.key==="status"),R=j=>{if(!k||!A)return!0;const F=(I==null?void 0:I.value)==="merged"||(I==null?void 0:I.value)==="closed"?j.lastModifiedDate.getTime():j.creationDate.getTime();return F>=k&&F<A},$=j=>!S||Cq(j,e.currentUser),U=o.filter(j=>x(j)&&E(j)&&R(j)&&$(j));if(p)return{flat:[...U].sort((F,z)=>z.lastModifiedDate.getTime()-F.lastModifiedDate.getTime()),grouped:[]};const K=new Map;for(const j of U){const F=((B=j.account)==null?void 0:B.profile)??"unknown";K.has(F)||K.set(F,[]),K.get(F).push(j)}const W=[];for(const[j,F]of K)F.length>0&&W.push([j,F]);return{flat:[],grouped:W}},[o,n]),f=h=>{const m=h.account.awsAccountId??h.account.profile;return`/accounts/${encodeURIComponent(m)}/prs/${h.id}`};if(l.length===0&&c.length===0){if(a)return d.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[d.jsx(Ra,{className:"size-8 animate-spin opacity-40"}),d.jsx("p",{className:"text-sm font-medium",children:"Loading pull requests..."}),o.length>0&&d.jsxs("p",{className:"text-xs opacity-50",children:[o.length," PRs fetched (filter hides all)"]})]});const h=[...new Set(e.accounts.filter(p=>p.enabled).map(p=>p.profile))],m=o.length===0&&h.length>0;return d.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[d.jsxs("svg",{className:"size-16 opacity-30",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"8",y:"12",width:"48",height:"40",rx:"4",stroke:"currentColor",strokeWidth:"2"}),d.jsx("path",{d:"M8 24h48",stroke:"currentColor",strokeWidth:"2"}),d.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"currentColor"}),d.jsx("circle",{cx:"22",cy:"18",r:"2",fill:"currentColor"}),d.jsx("circle",{cx:"28",cy:"18",r:"2",fill:"currentColor"}),d.jsx("path",{d:"M24 36h16M28 42h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),d.jsx("p",{className:"text-sm",children:"No open pull requests"}),o.length>0&&d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsxs("p",{className:"text-xs opacity-50",children:[o.length," PRs in cache (all merged or closed)"]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(he,{variant:"outline",size:"sm",onClick:()=>r("status","merged"),children:"Show merged"}),d.jsx(he,{variant:"outline",size:"sm",onClick:()=>r("status","closed"),children:"Show closed"})]})]}),m&&d.jsxs(zs,{className:"mt-4 w-full max-w-sm",children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm",children:"SSO Login"})}),d.jsxs(Ls,{className:"flex flex-col gap-2",children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Session may have expired. Log in to fetch PRs."}),h.map(p=>d.jsxs(he,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:()=>t({payload:{profile:p}}),children:[d.jsx(Uq,{className:"size-3.5"}),p]},p))]})]})]})}return n.hot?d.jsx("div",{ref:s,className:"divide-y rounded-lg border bg-card",children:l.map(h=>d.jsx(Ez,{pr:h,to:f(h),showUpdated:!0,currentUser:e.currentUser},h.id))},"hot"):d.jsx("div",{className:"space-y-6",children:c.map(([h,m])=>d.jsxs("section",{children:[d.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:h}),d.jsx(qe,{variant:"secondary",children:m.length})]}),d.jsx("div",{className:"divide-y rounded-lg border bg-card",children:m.map(p=>d.jsx(Ez,{pr:p,to:f(p),currentUser:e.currentUser},p.id))})]},h))},"grouped")}const FLe=e=>{switch(e){case"running":return"default";case"creating":case"cloning":case"starting":return"secondary";case"error":return"destructive";default:return"outline"}};function ULe({logs:e}){const t=g.useRef(null);g.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]);const n=e.trimEnd().split(`
456
+ `);return d.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,s)=>{const i=r.match(/^\[([^\]]+)\]\s*(.*)$/);if(!i)return d.jsx("div",{className:"text-muted-foreground",children:r},s);const[,a,o]=i;return d.jsxs("div",{className:"flex gap-3",children:[d.jsx("span",{className:"text-muted-foreground/50 shrink-0 select-none",children:a}),d.jsx("span",{className:"text-muted-foreground",children:o})]},s)})})}function BLe(){const{sandboxId:e}=KN(),[t,n]=hS(),r=an(gi),s=ft(Mq),i=ft(jq),a=ft(Dq),o=hs(),l=t.get("view"),[c,f]=g.useState(l==="logs"),u=g.useCallback(()=>{f(y=>{const b=!y;return n(b?{view:"logs"}:{},{replace:!0}),b})},[n]),h=g.useMemo(()=>{var y;return((y=r.sandboxes)==null?void 0:y.find(b=>b.id===e))??null},[r.sandboxes,e]),m=g.useCallback(()=>{e&&s({path:{sandboxId:Hl.make(e)}})},[e,s]),p=h?`/accounts/${h.awsAccountId}/prs/${h.pullRequestId}`:"/";if(!h)return d.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[d.jsx(Ra,{className:"size-6 animate-spin opacity-40"}),d.jsx("p",{className:"text-sm",children:"Loading sandbox..."})]});const v=h.status==="running",S=["creating","cloning","starting"].includes(h.status);return d.jsxs("div",{className:"flex flex-col h-[calc(100vh-4rem)]",children:[d.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b shrink-0",children:[d.jsxs(he,{variant:"ghost",size:"sm",onClick:()=>o(p),children:[d.jsx(Oy,{className:"size-4"}),"Back to PR"]}),d.jsx(qe,{variant:"outline",className:"font-mono text-xs",children:h.repositoryName}),d.jsx(qe,{variant:"secondary",className:"font-mono text-xs",children:h.sourceBranch}),d.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[S&&d.jsx(Ra,{className:"size-3.5 animate-spin text-muted-foreground"}),d.jsx(qe,{variant:FLe(h.status),className:"mr-1",children:h.status}),h.logs&&d.jsx(he,{variant:c?"secondary":"outline",size:"sm",onClick:u,children:c?d.jsxs(d.Fragment,{children:[d.jsx(zq,{className:"size-3.5"})," Editor"]}):d.jsxs(d.Fragment,{children:[d.jsx(Dw,{className:"size-3.5"})," Logs"]})}),(h.status==="stopped"||h.status==="error")&&h.containerId&&d.jsxs(he,{variant:"outline",size:"sm",onClick:()=>e&&i({path:{sandboxId:Hl.make(e)}}),children:[d.jsx(Vq,{className:"size-3"}),"Restart"]}),(h.status==="stopped"||h.status==="error")&&d.jsxs(he,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>{e&&(a({path:{sandboxId:Hl.make(e)}}),o("/sandboxes"))},children:[d.jsx(Wq,{className:"size-3"}),"Delete"]}),(S||v)&&d.jsxs(he,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:m,children:[d.jsx(Gq,{className:"size-3"}),"Stop"]})]})]}),c||!v?d.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-3 p-4",children:[h.statusDetail&&d.jsx("p",{className:"text-sm text-muted-foreground shrink-0",children:h.statusDetail}),h.error&&d.jsx("p",{className:"rounded bg-destructive/10 px-3 py-2 text-xs text-destructive font-mono break-all shrink-0",children:h.error}),h.logs?d.jsx(ULe,{logs:h.logs}):d.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"No logs available"})]}):d.jsx("iframe",{src:`http://localhost:${h.port}/`,className:"flex-1 w-full border-0",title:"Code Sandbox"})]})}const HLe=e=>{switch(e){case"running":return"default";case"creating":case"cloning":case"starting":return"secondary";case"error":return"destructive";default:return"outline"}},_k=e=>["creating","cloning","starting","running"].includes(e),qLe=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 VLe(){const e=an(gi),t=ft(Mq),n=ft(jq),r=ft(Dq),s=hs(),i=e.sandboxes??[];return i.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[d.jsx(_g,{className:"size-8 opacity-30"}),d.jsx("p",{className:"text-sm",children:"No sandboxes"}),d.jsx("p",{className:"text-xs",children:'Open a PR and press "." or click "Sandbox" to create one'})]}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Sandboxes"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[i.length," total"]})]}),d.jsx("div",{className:"space-y-2",children:i.map(a=>d.jsxs("div",{className:"rounded-lg border bg-card px-4 py-3 hover:bg-accent/50 cursor-pointer",onClick:()=>s(`/sandbox/${a.id}`),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[_k(a.status)&&a.status!=="running"?d.jsx(Ra,{className:"size-4 animate-spin text-muted-foreground shrink-0"}):d.jsx(_g,{className:"size-4 text-muted-foreground shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-sm truncate",children:a.repositoryName}),d.jsx(qe,{variant:"outline",className:"font-mono text-[10px] shrink-0",children:a.sourceBranch})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-0.5",children:[d.jsxs("span",{children:["PR #",a.pullRequestId]}),d.jsx("span",{children:"·"}),d.jsx("span",{children:qLe(a.createdAt)}),a.port&&a.status==="running"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"·"}),d.jsxs("span",{children:["port ",a.port]})]}),a.statusDetail&&_k(a.status)&&a.status!=="running"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"·"}),d.jsx("span",{className:"truncate",children:a.statusDetail})]})]})]}),d.jsx(qe,{variant:HLe(a.status),className:"shrink-0",children:a.status}),a.logs&&d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),s(`/sandbox/${a.id}?view=logs`)},children:d.jsx(Dw,{className:"size-3.5"})}),(a.status==="running"||_k(a.status))&&d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),t({path:{sandboxId:Hl.make(a.id)}})},children:d.jsx(Gq,{className:"size-3"})}),(a.status==="stopped"||a.status==="error")&&a.containerId&&d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),n({path:{sandboxId:Hl.make(a.id)}})},children:d.jsx(Vq,{className:"size-3.5"})}),(a.status==="stopped"||a.status==="error")&&d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:o=>{o.stopPropagation(),r({path:{sandboxId:Hl.make(a.id)}})},children:d.jsx(Wq,{className:"size-3.5"})})]}),a.error&&d.jsx("p",{className:"mt-2 rounded bg-destructive/10 px-3 py-1.5 text-xs text-destructive font-mono break-all",children:a.error})]},a.id))})]})}const KLe=[{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 GLe(){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"About"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Keyboard shortcuts and info"})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Keyboard Shortcuts"}),KLe.map(e=>d.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:e.desc}),d.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 font-mono text-xs",children:e.key})]},e.key))]})]})}function YLe(){const e=an(T2),t=an(gi),n=ft(A2),r=ft(O2),s=ft(M2),[i,a]=g.useState(""),[o,l]=g.useState("all"),[c,f]=g.useState({}),u=g.useRef(null);g.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const h=g.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{n({payload:p})},500)},[n]),m=g.useCallback((p,v)=>{var x;const y=!(c[p]??((x=v.accounts.find(_=>_.profile===p))==null?void 0:x.enabled)??!0),b={...c,[p]:y};f(b),h({accounts:v.accounts.map(_=>({profile:_.profile,regions:[..._.regions],enabled:_.profile===p?y:b[_.profile]??_.enabled})),autoDetect:v.autoDetect,autoRefresh:v.autoRefresh,refreshIntervalSeconds:v.refreshIntervalSeconds})},[h,c]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Accounts"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"AWS profiles configured for CodeCommit"})]}),d.jsx(tr,{}),Co(e).onInitialOrWaiting(()=>d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(p=>d.jsx(WLe,{currentUser:t.currentUser,data:p,overrides:c,search:i,setSearch:a,statusFilter:o,setStatusFilter:l,toggleAccount:m,onSsoLogin:v=>{try{r({payload:{profile:g7(Wh)(v)}})}catch{}},onSsoLogout:()=>s({})})).render()]})}function WLe({currentUser:e,data:t,onSsoLogin:n,onSsoLogout:r,overrides:s,search:i,setSearch:a,setStatusFilter:o,statusFilter:l,toggleAccount:c}){const f=g.useMemo(()=>t.accounts.map(p=>({...p,enabled:s[p.profile]??p.enabled})),[t.accounts,s]),u=g.useMemo(()=>{const p=i.toLowerCase();return f.filter(v=>!(l==="on"&&!v.enabled||l==="off"&&v.enabled||p&&!v.profile.toLowerCase().includes(p)&&!v.regions.some(S=>S.toLowerCase().includes(p))))},[f,i,l]),h=f.filter(p=>p.enabled),m=h.length;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(Pw,{className:"size-4 text-muted-foreground"}),e?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Current user:"}),d.jsx("span",{className:"font-medium",children:e}),d.jsx(he,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Logout",onClick:()=>r(),children:d.jsx(Bq,{className:"size-3"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-muted-foreground",children:"Not logged in"}),h[0]&&(()=>{const p=h[0].profile;return d.jsx(he,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Login",onClick:()=>n(p),children:d.jsx(Uq,{className:"size-3"})})})()]})]}),f.length===0?d.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No accounts configured. Edit the config file to add AWS profiles."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(Iw,{className:"absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),d.jsx(to,{placeholder:"Search profiles...",value:i,onChange:p=>a(p.target.value),className:"h-8 pl-8 text-sm"})]}),d.jsx(n1,{children:["all","on","off"].map(p=>d.jsx(he,{variant:l===p?"default":"outline",size:"sm",className:"h-8 px-2.5 text-xs capitalize",onClick:()=>o(p),children:p},p))})]}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[m,"/",f.length," enabled",u.length!==f.length&&` · ${u.length} shown`]}),d.jsxs("div",{className:"divide-y rounded-md border",children:[u.map(p=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(uEe,{className:"size-3.5 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-sm font-medium truncate",children:p.profile}),d.jsx("span",{className:"text-xs text-muted-foreground truncate",children:p.regions.join(", ")||"default"})]}),d.jsx(he,{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&&d.jsx("p",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No matching accounts"})]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx(D2,{className:"size-3"}),"Auto-detect: ",t.autoDetect?"enabled":"disabled"]})]})}function JLe(){const e=hs(),t=an(U_e),n=ft(B_e),r=ft(V_e),[s,i]=g.useState(!0),[a,o]=g.useState(30),[l,c]=g.useState(!1);g.useEffect(()=>{fs(t)&&(i(t.value.enabled),o(t.value.retentionDays),c(!1))},[t]);const[f,u]=g.useState(!1),h=()=>{n({payload:{enabled:s,retentionDays:a}}),u(!0)};return g.useEffect(()=>{f&&fs(t)&&(u(!1),c(!1))},[f,t]),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold",children:"Audit Log"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Record every AWS API call made by the app"})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:"Enable audit logging"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Log all API calls with permission state and duration"})]}),d.jsx("button",{role:"switch","aria-checked":s,onClick:()=>{i(!s),c(!0)},className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${s?"bg-primary":"bg-muted"}`,children:d.jsx("span",{className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg transition-transform ${s?"translate-x-4":"translate-x-0"}`})})]}),d.jsxs("div",{className:"rounded-md border px-3 py-3 space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Retention period (days)"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Entries older than this are pruned on server start"}),d.jsxs(lh,{value:String(a),onValueChange:m=>{o(Number(m)),c(!0)},children:[d.jsx(uh,{className:"w-36",children:d.jsx(ch,{})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"7",children:"7 days"}),d.jsx(Dt,{value:"14",children:"14 days"}),d.jsx(Dt,{value:"30",children:"30 days"}),d.jsx(Dt,{value:"60",children:"60 days"}),d.jsx(Dt,{value:"90",children:"90 days"}),d.jsx(Dt,{value:"180",children:"180 days"}),d.jsx(Dt,{value:"365",children:"365 days"})]})]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-0 rounded-md border w-fit",children:[d.jsx(he,{size:"sm",disabled:!l,onClick:h,className:"rounded-r-none border-0",children:"Save"}),d.jsx(he,{variant:"outline",size:"sm",onClick:()=>e("/audit"),className:"rounded-l-none border-0 border-l",children:"View Audit Log"})]}),d.jsx(he,{variant:"destructive",size:"sm",onClick:()=>r({}),children:"Clear All Logs"})]})]})}const XLe=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;function Cz({copyKey:e,copied:t,label:n,onCopy:r,path:s,detail:i}){return d.jsxs("div",{className:"flex items-baseline gap-3 py-1.5",children:[d.jsx("span",{className:"shrink-0 text-xs text-muted-foreground w-24",children:n}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("code",{className:"truncate text-xs font-mono",children:s}),d.jsx("button",{onClick:()=>r(s,e),className:"shrink-0 rounded p-0.5 hover:bg-muted",children:t===e?d.jsx($q,{className:"size-3 text-green-500"}):d.jsx(Lq,{className:"size-3 text-muted-foreground"})})]}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:i})]})]})}function QLe(){const e=an(S_e),t=an(__e),n=an(w_e),r=ft(k_e),[s,i]=g.useState(null),[a,o]=g.useState(!1),l=g.useCallback((u,h)=>{navigator.clipboard.writeText(u).then(()=>{i(h),setTimeout(()=>i(null),2e3)},()=>{})},[]),c=g.useCallback(async()=>{o(!0);try{await r({})}finally{o(!1)}},[r]),f=u=>u?`Modified ${s1(new Date(u),new Date,"").trim()}`:"";return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Configuration"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"File locations, validation, and storage"})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-1",children:[Co(e).onInitialOrWaiting(()=>d.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading config path..."})).onError(()=>d.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onDefect(()=>d.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onSuccess(u=>{const h=fs(t)?` · ${t.value.status}`:"",m=u.exists?`${f(u.modifiedAt)}${h}`:`Not created yet${h}`;return d.jsx(Cz,{label:"Config file",path:u.path,detail:m,copyKey:"config",copied:s,onCopy:l})}).render(),Co(t).onInitialOrWaiting(()=>null).onError(()=>null).onDefect(()=>null).onSuccess(u=>u.errors.length>0?d.jsx("div",{className:"ml-27 rounded bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:u.errors.map((h,m)=>d.jsx("p",{children:h},m))}):null).render(),d.jsx(tr,{}),Co(n).onInitialOrWaiting(()=>d.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading database info..."})).onError(()=>d.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onDefect(()=>d.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onSuccess(u=>{const h=u.exists?`${XLe(u.sizeBytes)} · ${f(u.modifiedAt)}`:"Not created yet";return d.jsx(Cz,{label:"Cache database",path:u.path,detail:h,copyKey:"db",copied:s,onCopy:l})}).render()]}),d.jsx(tr,{}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:"text-sm font-medium",children:"Reset to Defaults"}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Backs up current config, then re-detects AWS profiles"})]}),d.jsxs(he,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"shrink-0 gap-2",children:[d.jsx(aEe,{className:at("size-3.5",a&&"animate-spin")}),a?"Resetting...":"Reset"]})]})]})}const Rz=(e,t)=>{try{const n=localStorage.getItem(e);return n===null?t:n==="true"}catch{return t}},ZLe=(e,t)=>{try{const n=localStorage.getItem(e);return n===null?t:Number(n)||t}catch{return t}},e3e=[{label:"30 min",ms:30*60*1e3},{label:"1 hour",ms:60*60*1e3},{label:"2 hours",ms:2*60*60*1e3},{label:"4 hours",ms:4*60*60*1e3}];function t3e(){const[e,t]=g.useState(()=>Rz(ss.desktopNotifications,!1)),[n,r]=g.useState(()=>Rz(ss.reminders,!0)),[s,i]=g.useState(()=>ZLe(ss.reminderInterval,60*60*1e3)),[a,o]=g.useState(typeof Notification<"u"?Notification.permission:"unsupported"),l=g.useCallback(async()=>{if(!e&&a==="default"){const h=await Notification.requestPermission();if(o(h),h!=="granted")return}const u=!e;t(u);try{localStorage.setItem(ss.desktopNotifications,String(u))}catch{}},[e,a]),c=g.useCallback(()=>{const u=!n;r(u);try{localStorage.setItem(ss.reminders,String(u))}catch{}},[n]),f=g.useCallback(u=>{i(u);try{localStorage.setItem(ss.reminderInterval,String(u))}catch{}},[]);return g.useEffect(()=>{const u=()=>{typeof Notification<"u"&&o(Notification.permission)};return window.addEventListener("focus",u),()=>window.removeEventListener("focus",u)},[]),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Notifications"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Desktop notifications and review reminders"})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(My,{className:"size-5 text-muted-foreground"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:"Desktop Notifications"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:a==="unsupported"?"Not available in this browser":a==="denied"?"Blocked by browser — enable in site settings":"Show browser notifications for approval requests and PR updates"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[a==="granted"&&d.jsx(qe,{variant:"outline",className:"text-xs",children:"Granted"}),d.jsx("button",{role:"switch","aria-checked":e,onClick:l,disabled:a==="unsupported"||a==="denied",className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e?"bg-primary":"bg-muted"} ${a==="unsupported"||a==="denied"?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:d.jsx("span",{className:`inline-block size-4 rounded-full bg-white transition-transform ${e?"translate-x-6":"translate-x-1"}`})})]})]}),d.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Tke,{className:"size-5 text-muted-foreground"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:"Review Reminders"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Periodic reminders for PRs awaiting your review"})]})]}),d.jsx("button",{role:"switch","aria-checked":n,onClick:c,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors cursor-pointer ${n?"bg-primary":"bg-muted"}`,children:d.jsx("span",{className:`inline-block size-4 rounded-full bg-white transition-transform ${n?"translate-x-6":"translate-x-1"}`})})]}),n&&d.jsxs("div",{className:"rounded-lg border p-4",children:[d.jsx("p",{className:"text-sm font-medium mb-2",children:"Reminder Interval"}),d.jsx("div",{className:"flex gap-2",children:e3e.map(u=>d.jsx("button",{"aria-pressed":s===u.ms,onClick:()=>f(u.ms),className:`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${s===u.ms?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:u.label},u.ms))})]})]})]})}function n3e(){const e=an($_e),t=ft(L_e),n=ft(F_e),r=fs(e)?e.value:[],s=r.filter(l=>l.category==="read"),i=r.filter(l=>l.category==="write"),a=()=>{for(const l of r)l.state!=="always_allow"&&t({payload:{operation:l.operation,state:"always_allow"}})},o=(l,c)=>d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:l}),c.map(f=>d.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(qe,{variant:f.category==="write"?"destructive":"secondary",className:"text-xs shrink-0",children:f.category}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("code",{className:"text-xs font-mono",children:f.operation}),d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.description})]})]}),d.jsxs(lh,{value:f.state,onValueChange:u=>t({payload:{operation:f.operation,state:u}}),children:[d.jsx(uh,{className:"w-36 shrink-0",children:d.jsx(ch,{})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"always_allow",children:"Always Allow"}),d.jsx(Dt,{value:"allow",children:"Ask Each Time"}),d.jsx(Dt,{value:"deny",children:"Deny"})]})]})]},f.operation))]});return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold",children:"API Permissions"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Control which AWS API calls the app can make"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(he,{variant:"outline",size:"sm",onClick:a,children:"Always Allow All"}),d.jsx(he,{variant:"outline",size:"sm",onClick:()=>n({}),children:"Reset (Clear All)"})]}),KC(e)?d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):d.jsxs("div",{className:"space-y-6",children:[o("Read Operations",s),o("Write Operations",i)]})]})}const r3e=[{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 s3e(){const e=an(T2),t=ft(A2),n=g.useRef(null),r=g.useRef(null),[s,i]=g.useState({});g.useEffect(()=>{fs(e)&&(r.current=e.value)},[e]),g.useEffect(()=>{const o=new BroadcastChannel("codecommit-config");return n.current=o,o.onmessage=l=>{i(c=>({...c,...l.data}))},()=>o.close()},[]);const a=g.useCallback(o=>{var c;const l=r.current;l&&(i(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 d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Auto-refresh"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Periodically fetch PR updates from AWS"})]}),d.jsx(tr,{}),Co(e).onInitialOrWaiting(()=>d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(o=>{const l=s.autoRefresh??o.autoRefresh,c=s.refreshIntervalSeconds??o.refreshIntervalSeconds;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.jsx(Qu,{className:"size-4 text-muted-foreground"}),d.jsx("span",{children:"Auto-refresh"})]}),d.jsx(he,{variant:l?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>a({autoRefresh:!l}),children:l?"On":"Off"})]}),l&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:"Refresh interval"}),d.jsx(n1,{children:r3e.map(f=>d.jsx(he,{variant:c===f.value?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>a({refreshIntervalSeconds:f.value}),children:f.label},f.value))})]})]})}).render()]})}const i3e={image:"codercom/code-server:latest",extensions:[],setupCommands:[],env:{},enableClaudeCode:!0,volumeMounts:[],cloneDepth:0};function a3e(){const e=an(T2),t=ft(A2),n=g.useRef(null),[r,s]=g.useState(null),[i,a]=g.useState(null),[o,l]=g.useState(!1);g.useEffect(()=>{if(fs(e)&&(n.current=e.value,!r)){const h=e.value.sandbox??i3e;s(h),a(h)}},[e,r]);const c=g.useMemo(()=>r!==null&&i!==null&&JSON.stringify(r)!==JSON.stringify(i),[r,i]),f=g.useCallback(h=>{s(m=>m&&{...m,...h})},[]),u=g.useCallback(()=>{const h=n.current;!h||!r||(l(!0),t({payload:{accounts:h.accounts.map(m=>({profile:m.profile,regions:[...m.regions],enabled:m.enabled})),autoDetect:h.autoDetect,autoRefresh:h.autoRefresh,refreshIntervalSeconds:h.refreshIntervalSeconds,sandbox:r}}),a(r),setTimeout(()=>l(!1),600))},[t,r]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Sandbox"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Docker sandbox defaults for code review environments"})]}),r&&d.jsx(he,{size:"sm",className:"h-8 gap-1.5 px-3",disabled:!c&&!o,onClick:u,children:o?d.jsxs(d.Fragment,{children:[d.jsx(Jh,{className:"size-3.5"})," Saved"]}):"Save"})]}),d.jsx(tr,{}),Co(e).onInitialOrWaiting(()=>d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>d.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(()=>r&&d.jsx(o3e,{settings:r,onChange:f})).render()]})}function o3e({settings:e,onChange:t}){const[n,r]=g.useState(""),[s,i]=g.useState(""),[a,o]=g.useState(""),[l,c]=g.useState(""),[f,u]=g.useState(""),[h,m]=g.useState(""),[p,v]=g.useState(!1);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Docker Image"}),d.jsx(to,{value:e.image,placeholder:"codercom/code-server:latest",onChange:S=>t({image:S.target.value}),className:"h-8 text-sm"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Base image for sandboxes. Must have code-server or install via setup commands."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Clone Depth"}),d.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(S=>d.jsx(he,{variant:e.cloneDepth===S.value?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>t({cloneDepth:S.value}),children:S.label},S.value))}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = full history. Higher values speed up clone but limit git log."})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"VS Code Extensions"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Installed via code-server --install-extension"}),d.jsx(c3e,{settings:e,onChange:t}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.extensions.map(S=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs",children:[d.jsx(_g,{className:"size-3 text-muted-foreground"}),S,d.jsx("button",{className:"ml-0.5 text-muted-foreground hover:text-foreground",onClick:()=>t({extensions:e.extensions.filter(y=>y!==S)}),children:d.jsx(Mp,{className:"size-3"})})]},S))}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(to,{value:n,placeholder:"publisher.extension-id",onChange:S=>r(S.target.value),onKeyDown:S=>{S.key==="Enter"&&n.trim()&&(t({extensions:[...e.extensions,n.trim()]}),r(""))},className:"h-8 text-sm flex-1"}),d.jsx(he,{variant:"outline",size:"sm",className:"h-8",disabled:!n.trim(),onClick:()=>{t({extensions:[...e.extensions,n.trim()]}),r("")},children:d.jsx(vo,{className:"size-3.5"})})]})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Setup Commands"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Shell commands run in container after ready"}),d.jsx(d3e,{settings:e,onChange:t}),d.jsx("div",{className:"space-y-1.5",children:e.setupCommands.map((S,y)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:S}),d.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>t({setupCommands:e.setupCommands.filter((b,x)=>x!==y)}),children:d.jsx(Db,{className:"size-3.5"})})]},y))}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(to,{value:s,placeholder:"npm i -g tsx",onChange:S=>i(S.target.value),onKeyDown:S=>{S.key==="Enter"&&s.trim()&&(t({setupCommands:[...e.setupCommands,s.trim()]}),i(""))},className:"h-8 text-sm font-mono flex-1"}),d.jsx(he,{variant:"outline",size:"sm",className:"h-8",disabled:!s.trim(),onClick:()=>{t({setupCommands:[...e.setupCommands,s.trim()]}),i("")},children:d.jsx(vo,{className:"size-3.5"})})]})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Environment Variables"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Extra env vars injected into sandbox container"}),d.jsx("div",{className:"space-y-1.5",children:Object.entries(e.env).map(([S,y])=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs font-mono",children:S}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"="}),d.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:y}),d.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>{const b={...e.env};delete b[S],t({env:b})},children:d.jsx(Db,{className:"size-3.5"})})]},S))}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(to,{value:a,placeholder:"KEY",onChange:S=>o(S.target.value),className:"h-8 text-sm font-mono w-32"}),d.jsx("span",{className:"flex items-center text-xs text-muted-foreground",children:"="}),d.jsx(to,{value:l,placeholder:"value",onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&a.trim()&&(t({env:{...e.env,[a.trim()]:l}}),o(""),c(""))},className:"h-8 text-sm font-mono flex-1"}),d.jsx(he,{variant:"outline",size:"sm",className:"h-8",disabled:!a.trim(),onClick:()=>{t({env:{...e.env,[a.trim()]:l}}),o(""),c("")},children:d.jsx(vo,{className:"size-3.5"})})]})]}),d.jsx(tr,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium",children:"Volume Mounts"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Map host paths into the container"}),d.jsx(h3e,{settings:e,onChange:t}),d.jsx("div",{className:"space-y-1.5",children:e.volumeMounts.map((S,y)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:S.hostPath}),d.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:":"}),d.jsx("code",{className:"flex-1 rounded-md bg-muted px-2 py-1 text-xs font-mono truncate",children:S.containerPath}),S.readonly&&d.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"(ro)"}),d.jsx("button",{className:"text-muted-foreground hover:text-destructive shrink-0",onClick:()=>t({volumeMounts:e.volumeMounts.filter((b,x)=>x!==y)}),children:d.jsx(Db,{className:"size-3.5"})})]},y))}),d.jsxs("div",{className:"flex gap-1.5 items-center",children:[d.jsx(to,{value:f,placeholder:"/host/path",onChange:S=>u(S.target.value),className:"h-8 text-sm font-mono flex-1"}),d.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:":"}),d.jsx(to,{value:h,placeholder:"/container/path",onChange:S=>m(S.target.value),onKeyDown:S=>{S.key==="Enter"&&f.trim()&&h.trim()&&(t({volumeMounts:[...e.volumeMounts,{hostPath:f.trim(),containerPath:h.trim(),readonly:p}]}),u(""),m(""),v(!1))},className:"h-8 text-sm font-mono flex-1"}),d.jsx(he,{variant:p?"default":"outline",size:"sm",className:"h-8 px-2 text-xs shrink-0",onClick:()=>v(!p),title:"Read-only",children:"RO"}),d.jsx(he,{variant:"outline",size:"sm",className:"h-8",disabled:!f.trim()||!h.trim(),onClick:()=>{t({volumeMounts:[...e.volumeMounts,{hostPath:f.trim(),containerPath:h.trim(),readonly:p}]}),u(""),m(""),v(!1)},children:d.jsx(vo,{className:"size-3.5"})})]})]})]})}const l3e=[{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 c3e({settings:e,onChange:t}){const n=g.useMemo(()=>l3e.filter(r=>!e.extensions.includes(r.id)),[e.extensions]);return n.length===0?null:d.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({extensions:[...e.extensions,r.id]}),children:[d.jsx(vo,{className:"size-3"}),r.label]},r.id))})}const u3e=[{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`}],f3e=[{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 d3e({settings:e,onChange:t}){const n=g.useMemo(()=>u3e.filter(r=>!e.setupCommands.some(s=>s===r.cmd)),[e.setupCommands]);return n.length===0?null:d.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({setupCommands:[...e.setupCommands,r.cmd]}),children:[d.jsx(vo,{className:"size-3"}),r.label]},r.label))})}function h3e({settings:e,onChange:t}){const n=g.useMemo(()=>f3e.filter(r=>!e.volumeMounts.some(s=>s.hostPath===r.mount.hostPath)),[e.volumeMounts]);return n.length===0?null:d.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>d.jsxs(he,{variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>t({volumeMounts:[...e.volumeMounts,r.mount]}),children:[d.jsx(vo,{className:"size-3"}),r.label]},r.label))})}function m3e(){const{setTheme:e,theme:t}=D5(),n=[{id:"light",label:"Light",icon:d.jsx(Yq,{className:"size-5"})},{id:"dark",label:"Dark",icon:d.jsx(qq,{className:"size-5"})},{id:"system",label:"System",icon:d.jsx(Qke,{className:"size-5"})}];return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold",children:"Theme"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred appearance"})]}),d.jsx(tr,{}),d.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(r=>d.jsxs("button",{onClick:()=>e(r.id),className:at("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,d.jsx("span",{className:"text-sm font-medium",children:r.label})]},r.id))})]})}const p3e={accounts:d.jsx(Pw,{className:"size-4"}),refresh:d.jsx(Qu,{className:"size-4"}),sandbox:d.jsx(_g,{className:"size-4"}),notifications:d.jsx(My,{className:"size-4"}),permissions:d.jsx(Kq,{className:"size-4"}),audit:d.jsx(Dw,{className:"size-4"}),theme:d.jsx(tEe,{className:"size-4"}),config:d.jsx(zke,{className:"size-4"}),about:d.jsx(D2,{className:"size-4"})},g3e={accounts:"Accounts",refresh:"Refresh",sandbox:"Sandbox",notifications:"Notifications",permissions:"Permissions",audit:"Audit",theme:"Theme",config:"Config",about:"About"},y3e=e=>Xq.includes(e);function v3e(){const{tab:e}=KN(),t=y3e(e)?e:"accounts",n=hs();return d.jsxs("div",{className:"flex gap-6",children:[d.jsxs("nav",{className:"w-48 shrink-0",children:[d.jsxs(he,{variant:"ghost",size:"sm",className:"mb-4 gap-2",onClick:()=>n("/"),children:[d.jsx(Oy,{className:"size-4"}),"Back to PRs"]}),d.jsx("div",{className:"flex flex-col gap-1",role:"tablist",children:Xq.map(r=>d.jsxs("button",{role:"tab","aria-selected":t===r,onClick:()=>n(`/settings/${r}`,{replace:!0}),className:at("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:[p3e[r],g3e[r]]},r))})]}),d.jsxs("div",{className:"flex-1 min-w-0",children:[t==="accounts"&&d.jsx(YLe,{}),t==="refresh"&&d.jsx(s3e,{}),t==="sandbox"&&d.jsx(a3e,{}),t==="notifications"&&d.jsx(t3e,{}),t==="permissions"&&d.jsx(n3e,{}),t==="audit"&&d.jsx(JLe,{}),t==="theme"&&d.jsx(m3e,{}),t==="config"&&d.jsx(QLe,{}),t==="about"&&d.jsx(GLe,{})]})]})}const b3e=(e,t)=>We.query("stats","get",{urlParams:{week:e,...t},timeToLive:"30 seconds"});function x3e(e,t){const n=g.useMemo(()=>b3e(e,t),[e,t.repo,t.author,t.account]);return an(n)}function RW(e){return e==null?"—":Lb(e)}function kk({icon:e,label:t,onClick:n,value:r}){return d.jsx(zs,{className:n?"cursor-pointer transition-colors hover:bg-accent/50":void 0,onClick:n,children:d.jsxs(Ls,{className:"flex items-center gap-3 p-4",children:[d.jsx("div",{className:"rounded-md bg-muted p-2",children:d.jsx(e,{className:"size-4 text-muted-foreground"})}),d.jsxs("div",{children:[d.jsx("div",{className:"text-2xl font-bold tabular-nums",children:r}),d.jsx("div",{className:"text-xs text-muted-foreground",children:t})]})]})})}function S3e({highlight:e,label:t,onClick:n,pct:r,value:s}){return d.jsxs("div",{className:`group relative flex items-center gap-2 rounded-md px-2 py-1.5${n?" cursor-pointer":""}`,onClick:n,children:[d.jsx("div",{className:`absolute inset-0 rounded-md transition-colors ${e?"bg-amber-400/[0.08] group-hover:bg-amber-400/[0.14]":"bg-foreground/[0.06] dark:bg-foreground/[0.08] group-hover:bg-foreground/[0.10] dark:group-hover:bg-foreground/[0.14]"}`,style:{width:`${r}%`}}),e&&d.jsx(pEe,{"aria-hidden":"true",className:"relative z-10 size-3 shrink-0 text-amber-400 fill-amber-400",style:{animation:"star-in 400ms ease-out"}},t),d.jsx("span",{className:`relative z-10 flex-1 truncate text-xs${e?" text-amber-400 font-medium":""}`,children:t}),d.jsx("span",{className:`relative z-10 shrink-0 text-xs tabular-nums ${e?"text-amber-400/60":"text-muted-foreground"}`,children:s})]})}function Ek({data:e,labelKey:t,onItemClick:n,title:r,valueKey:s}){const i=e.reduce((a,o)=>Math.max(a,Number(o[s])||0),0);return d.jsxs(zs,{children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm",children:r})}),d.jsx(Ls,{children:e.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No data"}):d.jsx("div",{className:"space-y-1.5",children:e.map((a,o)=>{const l=String(a[t]),c=Number(a[s])||0,f=i>0?c/i*100:0;return d.jsx(S3e,{label:l,value:c,pct:f,highlight:o===0,onClick:n?()=>n(l):void 0},l)})})})]})}function w3e({dist:e,onBarClick:t}){const n=[{key:"small",label:"S",sub:"<5 files",count:e.small},{key:"medium",label:"M",sub:"5–15",count:e.medium},{key:"large",label:"L",sub:"15–30",count:e.large},{key:"xlarge",label:"XL",sub:"30+",count:e.extraLarge}],r=n.reduce((i,a)=>i+a.count,0),s=Math.max(...n.map(i=>i.count),1);return d.jsxs(zs,{children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm",children:"PR Size Distribution"})}),d.jsx(Ls,{children:r===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No diff data"}):d.jsx("div",{className:"flex items-end gap-2 h-[120px]",children:n.map(i=>d.jsxs("div",{className:`flex flex-1 flex-col items-center gap-1${t&&i.count>0?" cursor-pointer":""}`,onClick:t&&i.count>0?()=>t(i.key):void 0,children:[d.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:i.count}),d.jsx("div",{className:"w-full flex items-end",style:{height:80},children:d.jsx("div",{className:"w-full rounded-t bg-foreground/[0.12] dark:bg-foreground/[0.16] transition-all hover:bg-foreground/[0.18] dark:hover:bg-foreground/[0.22]",style:{height:`${i.count/s*100}%`,minHeight:i.count>0?4:0}})}),d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-xs font-medium",children:i.label}),d.jsx("div",{className:"text-[10px] text-muted-foreground",children:i.sub})]})]},i.key))})})]})}function _3e({onPRClick:e,prs:t}){return t.length===0?null:d.jsxs(zs,{children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm",children:"Most Active PRs"})}),d.jsx(Ls,{children:d.jsx("div",{className:"space-y-2",children:t.map(n=>d.jsxs("div",{className:"flex items-center gap-2 text-sm cursor-pointer hover:bg-accent rounded px-2 py-1",onClick:()=>e(n.awsAccountId,n.id),children:[d.jsxs("span",{className:"text-muted-foreground font-mono",children:["#",n.id]}),d.jsx("span",{className:"truncate flex-1",children:n.title}),d.jsx("span",{className:"text-muted-foreground text-xs",children:n.author}),d.jsx(qe,{variant:"secondary",className:"text-xs",children:n.repositoryName}),d.jsxs("span",{className:"text-xs tabular-nums",children:[n.commentCount," comments"]})]},`${n.awsAccountId}:${n.id}`))})})]})}function k3e({onPRClick:e,prs:t}){return t.length===0?null:d.jsxs(zs,{children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm flex items-center gap-1",children:"Stale PRs"})}),d.jsx(Ls,{children:d.jsx("div",{className:"space-y-1",children:t.map(n=>d.jsxs("div",{className:"flex items-center gap-2 text-sm cursor-pointer hover:bg-accent rounded px-2 py-1",onClick:()=>e(n.awsAccountId,n.id),children:[d.jsxs("span",{className:"text-muted-foreground font-mono",children:["#",n.id]}),d.jsx("span",{className:"truncate flex-1",children:n.title}),d.jsx("span",{className:"text-muted-foreground text-xs",children:n.author}),d.jsxs(qe,{variant:"destructive",className:"text-xs",children:[n.daysSinceActivity,"d idle"]})]},`${n.awsAccountId}:${n.id}`))})})]})}function E3e({data:e}){return d.jsxs(zs,{children:[d.jsx(_c,{className:"pb-2",children:d.jsx(kc,{className:"text-sm",children:"Health"})}),d.jsx(Ls,{children:d.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-xs text-muted-foreground",children:"Review Coverage"}),d.jsx("div",{className:"text-lg font-bold tabular-nums",children:e.reviewCoverage!=null?`${(e.reviewCoverage*100).toFixed(0)}%`:"—"})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs text-muted-foreground",children:"Approval Rate"}),d.jsx("div",{className:"text-lg font-bold tabular-nums",children:e.approvalRate!=null?`${(e.approvalRate*100).toFixed(0)}%`:"—"})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs text-muted-foreground",children:"Stale PRs"}),d.jsx("div",{className:"text-lg font-bold tabular-nums",children:e.stalePRs.length})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs text-muted-foreground",children:"Bus Factor"}),d.jsx("div",{className:"text-lg font-bold tabular-nums",children:e.busFactor?`${e.busFactor.uniqueContributors} (${(e.busFactor.topContributorShare*100).toFixed(0)}%)`:"—"})]})]})})]})}function C3e({author:e,data:t,repo:n,setFilter:r}){return d.jsxs(d.Fragment,{children:[t.availableRepos.length>0&&d.jsxs(lh,{value:n||"__all__",onValueChange:s=>r("repo",s==="__all__"?void 0:s),children:[d.jsx(uh,{className:"w-[140px] h-8 text-xs",children:d.jsx(ch,{placeholder:"All repos"})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"__all__",children:"All repos"}),t.availableRepos.map(s=>d.jsx(Dt,{value:s,children:s},s))]})]}),t.availableAuthors.length>0&&d.jsxs(lh,{value:e||"__all__",onValueChange:s=>r("author",s==="__all__"?void 0:s),children:[d.jsx(uh,{className:"w-[140px] h-8 text-xs",children:d.jsx(ch,{placeholder:"All authors"})}),d.jsxs(fh,{children:[d.jsx(Dt,{value:"__all__",children:"All authors"}),t.availableAuthors.map(s=>d.jsx(Dt,{value:s,children:s},s))]})]})]})}function R3e({details:e,goToPR:t}){return e.length===0?d.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"No data points"}):d.jsx("div",{className:"space-y-1 mt-2",children:e.map((n,r)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs cursor-pointer hover:bg-accent rounded px-2 py-1",onClick:()=>t(n.awsAccountId,n.prId),children:[d.jsxs("span",{className:"text-muted-foreground font-mono shrink-0",children:["#",n.prId]}),d.jsx("span",{className:"truncate flex-1",children:n.prTitle}),d.jsx("span",{className:"text-muted-foreground shrink-0",children:n.author}),d.jsx(qe,{variant:"secondary",className:"text-[10px] shrink-0",children:n.repositoryName}),d.jsx("span",{className:"font-mono tabular-nums shrink-0",children:RW(n.durationMs)}),d.jsxs("span",{className:"text-muted-foreground shrink-0 text-[10px]",children:[n.fromLabel," → ",n.toLabel]})]},`${n.awsAccountId}:${n.prId}:${r}`))})}function N3e({data:e,goToPR:t}){var a,o;const[n,r]=g.useState(null),s=l=>r(c=>c===l?null:l),i=[{key:"merge",label:"Median Time to Merge",value:e.medianTimeToMerge,details:e.mergeTimeDetails},{key:"review",label:"Median Time to First Review",value:e.medianTimeToFirstReview,details:e.firstReviewDetails},{key:"feedback",label:"Median Time to Address Feedback",value:e.medianTimeToAddressFeedback,details:e.feedbackDetails}];return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"grid grid-cols-3 gap-3",children:i.map(l=>d.jsx(zs,{className:`cursor-pointer transition-colors hover:bg-accent/50 ${n===l.key?"ring-1 ring-ring":""}`,onClick:()=>s(l.key),children:d.jsxs(Ls,{className:"p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"text-xs text-muted-foreground",children:l.label}),d.jsx(jy,{className:`size-3 text-muted-foreground transition-transform ${n===l.key?"rotate-180":""}`})]}),d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("div",{className:"text-xl font-bold tabular-nums",children:RW(l.value)}),l.details.length>0&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[l.details.length," PRs"]})]})]})},l.key))}),n&&d.jsx(zs,{children:d.jsxs(Ls,{className:"p-3",children:[d.jsxs("div",{className:"text-xs font-medium mb-1",children:[(a=i.find(l=>l.key===n))==null?void 0:a.label," — Detail"]}),d.jsx(R3e,{details:((o=i.find(l=>l.key===n))==null?void 0:o.details)??[],goToPR:t})]})})]})}function T3e({data:e,goToPR:t,handleSync:n,navigate:r,syncing:s}){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsx(kk,{label:"PRs Created",value:e.prsCreated,icon:NP,onClick:()=>r(`/?from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)}),d.jsx(kk,{label:"PRs Merged",value:e.prsMerged,icon:NP,onClick:()=>r(`/?f=status:merged&from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)}),d.jsx(kk,{label:"Comments",value:e.totalComments,icon:Hq})]}),d.jsx(N3e,{data:e,goToPR:t}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsx(Ek,{data:e.topContributors,labelKey:"author",valueKey:"prCount",title:"Top Contributors",onItemClick:i=>r(`/?f=author:${encodeURIComponent(i)}&from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)}),d.jsx(Ek,{data:e.topReviewers,labelKey:"author",valueKey:"commentCount",title:"Top Commenters",onItemClick:i=>r(`/?f=commenter:${encodeURIComponent(i)}&from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)}),d.jsx(Ek,{data:e.topApprovers,labelKey:"author",valueKey:"approvalCount",title:"Top Approvers",onItemClick:i=>r(`/?f=approver:${encodeURIComponent(i)}&from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx(w3e,{dist:e.prSizeDistribution,onBarClick:i=>r(`/?f=size:${i}&from=${e.weekStart.slice(0,10)}&to=${e.weekEnd.slice(0,10)}`)}),e.avgDiffSize&&d.jsx(zs,{children:d.jsxs(Ls,{className:"space-y-2 p-4",children:[d.jsx("div",{className:"text-sm font-medium",children:"Average Diff Size"}),d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:"Files added"}),d.jsx("span",{className:"font-mono",children:e.avgDiffSize.filesAdded.toFixed(1)})]}),d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:"Files modified"}),d.jsx("span",{className:"font-mono",children:e.avgDiffSize.filesModified.toFixed(1)})]}),d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:"Files deleted"}),d.jsx("span",{className:"font-mono",children:e.avgDiffSize.filesDeleted.toFixed(1)})]})]})})]}),d.jsx(_3e,{prs:e.mostActivePRs,onPRClick:t}),d.jsx(E3e,{data:e}),d.jsx(k3e,{prs:e.stalePRs,onPRClick:t}),e.dataAvailableSince&&d.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["Data available since ",r1(new Date(e.dataAvailableSince))]}),e.prsCreated===0&&e.prsMerged===0&&e.totalComments===0&&d.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[d.jsx("p",{className:"text-sm",children:"No activity for this week."}),d.jsxs(he,{variant:"outline",size:"sm",className:"mt-2",onClick:n,disabled:s,children:[d.jsx(Qu,{className:`size-3 mr-1 ${s?"animate-spin":""}`}),"Sync this week"]})]})]})}function A3e(){const e=hs(),[t,n]=hS(),r=ft(j_e),s=g.useMemo(()=>v$(new Date),[]),i=t.get("week")||s,a=t.get("repo")||void 0,o=t.get("author")||void 0,l=t.get("account")||void 0,c=x3e(i,{repo:a,author:o,account:l}),f=an(gi),u=f.status==="loading",h=g.useRef(u);g.useEffect(()=>{h.current&&!u&&n(x=>(x.set("_t",Date.now().toString()),x)),h.current=u},[u,n]);const m=g.useMemo(()=>LOe(i),[i]),p=g.useMemo(()=>m._tag==="None"?i:FOe(m.value),[i,m]),v=g.useCallback(x=>{if(m._tag==="None")return;const _=new Date(m.value.start.getTime()+x*7*864e5),C=v$(_);C>s||n(E=>(E.set("week",C),E))},[m,s,n]),S=g.useCallback((x,_)=>{n(C=>(_?C.set(x,_):C.delete(x),C))},[n]),y=g.useCallback(()=>{r({payload:{week:i}})},[i,r]),b=g.useCallback((x,_)=>e(`/accounts/${x}/prs/${_}`),[e]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:()=>e("/"),children:d.jsx(xke,{className:"size-4"})}),d.jsx("h1",{className:"text-lg font-semibold",children:"Statistics"}),d.jsx(qe,{variant:"secondary",className:"text-[10px] tracking-wide uppercase font-normal text-muted-foreground/60",children:"🚧 Experimental"})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:()=>v(-1),children:d.jsx(Oy,{className:"size-4"})}),d.jsx("span",{className:"text-sm font-medium min-w-[220px] text-center",children:p}),d.jsx(he,{variant:"ghost",size:"icon-sm",onClick:()=>v(1),disabled:i>=s,children:d.jsx(Pq,{className:"size-4"})}),d.jsxs(he,{variant:"outline",size:"sm",onClick:()=>n(x=>(x.set("week",s),x)),disabled:i===s,children:[d.jsx(mke,{className:"size-3 mr-1"})," Today"]}),d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[Co(c).onSuccess(x=>d.jsx(C3e,{data:x,repo:a,author:o,setFilter:S})).render(),d.jsxs(he,{variant:"outline",size:"sm",onClick:y,disabled:u,children:[d.jsx(Qu,{className:`size-3 mr-1 ${u?"animate-spin":""}`}),"Sync"]})]})]}),u&&f.statusDetail&&d.jsx("div",{className:"text-xs text-muted-foreground truncate",children:f.statusDetail}),(a||o||l)&&d.jsxs("div",{className:"flex gap-1 flex-wrap",children:[a&&d.jsxs(qe,{variant:"secondary",className:"cursor-pointer",onClick:()=>S("repo",void 0),children:["repo: ",a," ×"]}),o&&d.jsxs(qe,{variant:"secondary",className:"cursor-pointer",onClick:()=>S("author",void 0),children:["author: ",o," ×"]}),l&&d.jsxs(qe,{variant:"secondary",className:"cursor-pointer",onClick:()=>S("account",void 0),children:["account: ",l," ×"]})]}),d.jsx(tr,{}),Co(c).onInitialOrWaiting(()=>d.jsx("div",{className:"flex items-center justify-center py-12",children:d.jsx(Ra,{className:"size-5 animate-spin text-muted-foreground"})})).onError(()=>d.jsx("div",{className:"text-sm text-destructive py-4",children:"Failed to load stats"})).onDefect(()=>d.jsx("div",{className:"text-sm text-destructive py-4",children:"Failed to load stats"})).onSuccess(x=>d.jsx(T3e,{data:x,navigate:e,goToPR:b,handleSync:y,syncing:u})).render()]})}const O3e=e=>e!=null&&typeof e=="object"&&"fullWidth"in e,M3e=e=>O3e(e.handle)&&e.handle.fullWidth===!0,j3e=()=>ree().some(M3e),D3e=Bee([{element:d.jsx(YOe,{}),children:[{index:!0,element:d.jsx(LLe,{})},{path:"accounts/:accountId/prs/:prId",element:d.jsx(kLe,{})},{path:"sandboxes",element:d.jsx(VLe,{})},{path:"sandbox/:sandboxId",element:d.jsx(BLe,{}),handle:{fullWidth:!0}},{path:"settings/:tab?",element:d.jsx(v3e,{})},{path:"notifications",element:d.jsx(fMe,{})},{path:"stats",element:d.jsx(A3e,{})},{path:"audit",element:d.jsx(QOe,{})},{path:"*",element:d.jsx(pee,{to:"/",replace:!0})}]}]);class I3e extends ee.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?d.jsxs("div",{style:{padding:"2rem",textAlign:"center"},children:[d.jsx("h1",{children:"Something went wrong"}),d.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem"},children:"Reload"})]}):this.props.children}}const Nz=document.getElementById("root");Nz&&RQ.createRoot(Nz).render(d.jsx(ee.StrictMode,{children:d.jsx(I3e,{children:d.jsx(tte,{children:d.jsx(dee,{router:D3e})})})}));